--- openjade-1.4devel1.orig/INSTALL +++ openjade-1.4devel1/INSTALL @@ -1,3 +1,9 @@ +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software +Foundation, Inc. + + This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + Basic Installation ================== @@ -8,20 +14,27 @@ those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, a file -`config.cache' that saves the results of its tests to speed up -reconfiguring, and a file `config.log' containing compiler output -(useful mainly for debugging `configure'). +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. (Caching is +disabled by default to prevent problems with accidental use of stale +cache files.) If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can -be considered for the next release. If at some point `config.cache' -contains results you don't want to keep, you may remove or edit it. - - The file `configure.in' is used to create `configure' by a program -called `autoconf'. You only need `configure.in' if you want to change -it or regenerate `configure' using a newer version of `autoconf'. +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You only need +`configure.ac' if you want to change it or regenerate `configure' using +a newer version of `autoconf'. The simplest way to compile this package is: @@ -55,14 +68,16 @@ ===================== Some systems require unusual options for compilation or linking that -the `configure' script does not know about. You can give `configure' -initial values for variables by setting them in the environment. Using -a Bourne-compatible shell, you can do that on the command line like -this: - CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. -Or on systems that have the `env' program, you can do it like this: - env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix + + *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== @@ -75,11 +90,11 @@ the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. - If you have to use a `make' that does not supports the `VPATH' -variable, you have to compile the package for one architecture at a time -in the source code directory. After you have installed the package for -one architecture, use `make distclean' before reconfiguring for another -architecture. + If you have to use a `make' that does not support the `VPATH' +variable, you have to compile the package for one architecture at a +time in the source code directory. After you have installed the +package for one architecture, use `make distclean' before reconfiguring +for another architecture. Installation Names ================== @@ -122,22 +137,32 @@ Specifying the System Type ========================== - There may be some features `configure' can not figure out -automatically, but needs to determine by the type of host the package -will run on. Usually `configure' can figure that out, but if it prints -a message saying it can not guess the host type, give it the -`--host=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name with three fields: + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + CPU-COMPANY-SYSTEM -See the file `config.sub' for the possible values of each field. If +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't -need to know the host type. +need to know the machine type. - If you are building compiler tools for cross-compiling, you can also + If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will -produce code for and the `--build=TYPE' option to select the type of -system on which you are compiling the package. +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. Sharing Defaults ================ @@ -150,20 +175,44 @@ `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. -Operation Controls +Defining Variables ================== + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +will cause the specified gcc to be used as the C compiler (unless it is +overridden in the site shell script). + +`configure' Invocation +====================== + `configure' recognizes the following options to control how it operates. -`--cache-file=FILE' - Use and save the results of the tests in FILE instead of - `./config.cache'. Set FILE to `/dev/null' to disable caching, for - debugging `configure'. - `--help' +`-h' Print a summary of the options to `configure', and exit. +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + `--quiet' `--silent' `-q' @@ -175,8 +224,6 @@ Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. -`--version' - Print the version of Autoconf used to generate the `configure' - script, and exit. +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. -`configure' also accepts some other, not widely useful, options. --- openjade-1.4devel1.orig/Makefile.am +++ openjade-1.4devel1/Makefile.am @@ -3,17 +3,21 @@ AUTOMAKE_OPTIONS = check-news ## FIXME groveoa is missing, since an .am with only EXTRA_DIST doesn't work. -SUBDIRS = jadedoc dsssl grove spgrove style jade intl po +SUBDIRS = jadedoc dsssl grove spgrove style jade intl po contrib unicode pkginclude_HEADERS = config.h -docdir = $(prefix)/doc +docdir = $(datadir)/doc pkgdocdir = $(docdir)/@PACKAGE@ pkgdoc_DATA = README ABOUT-NLS NEWS COPYING AUTHORS ChangeLog BUILT_SOURCES = config.h msggen.pl +# these are not in CVS and get generated by 'automake --add-missing' +MAINTAINERCLEANFILES = config.h.in Makefile.in aclocal.m4 \ + configure stamp-h.in + ## Note that we include the windows-only aux files. ## We include msggen.pl, since it won't be generated on Windows. EXTRA_DIST = instmac.pl msggen.pl jade.dsw jade.mak \ @@ -26,7 +30,7 @@ cp $(top_srcdir)/ChangeLog $(top_distdir); \ fi -dist-zip: dist-dir +dist-zip: distdir -chmod -R a+r $(distdir) zip -rql $(distdir).zip $(distdir) -rm -rf $(distdir) --- openjade-1.4devel1.orig/NEWS +++ openjade-1.4devel1/NEWS @@ -31,6 +31,40 @@ * (test => recipient) cond clauses are supported. +* RTF output had extra spaces that were detrimental to display; + patch from Andrey Taranov. + +* Better time string support; it is possible to compare time, date and + datetime (not only datetime). Also partial formats (like YY-MM-DD, + YYYY-MM or HH:MM) are now supported. Patch from Francis J. Lacoste. + +* Optimize sosofo-append to reduce its memory and stack usage when + using it to build long list of sosofos. Patch from Francis + J. Lacoste. + +* For the TeX backend, turn on the twoside LaTeX feature by default. + Patch from Francis J. Lacoste. + +* Improve table support in the JadeTeX backend: + - Support for nested tables. cell-after-column-margin: and + cell-before-column-margin: wasn't really working. + - Row spanning was broken. This patch only supports 'start row + alignment though. + - Paragraphs in cell spanning multiple column are now working. + - Support for the row-alignment: characteristic. + - Support for cell-background? and background-color properties. + Patch from Francis J. Lacoste. To see benefits of this, requires + JadeTeX 3.2 or better. + +* Add support for the 'asis and 'asis-wrap values for the paragraph's + 'lines:' characteristic. Patch from Francis J. Lacoste. + +* Allow JadeTeX to resolve references to subdocs or to content + produced through a "sgml-parse" by hacking on the NodeIndex + instruction. Patch from Jean-Marie Kubek. + +* remove contrib/jadetex, get it from upstream if you want it + Changes in OpenJade 1.3 * The SGML backend will no emit linebreaks when used as -t sgml-raw. --- openjade-1.4devel1.orig/acinclude.m4 +++ openjade-1.4devel1/acinclude.m4 @@ -1,5 +1,5 @@ dnl OJ_CHECK_SIZEOF(TYPE, HEADER [, CROSS-SIZE]) -AC_DEFUN(OJ_CHECK_SIZEOF, +AC_DEFUN([OJ_CHECK_SIZEOF], [changequote(<<, >>)dnl dnl The name to #define. define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl @@ -18,7 +18,7 @@ exit(0); }], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$3] , , AC_CV_NAME=$3))])dnl AC_MSG_RESULT($AC_CV_NAME) -AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) +AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [Size of the $1 type]) undefine([AC_TYPE_NAME])dnl undefine([AC_CV_NAME])dnl ]) @@ -31,7 +31,7 @@ dnl dnl @author Matthias Clasen dnl -AC_DEFUN(AC_CXX_PLACEMENT_OPERATOR_DELETE, +AC_DEFUN([AC_CXX_PLACEMENT_OPERATOR_DELETE], [AC_CACHE_CHECK(whether the compiler supports placement operator delete, ac_cv_cxx_placement_operator_delete, [AC_LANG_SAVE @@ -61,7 +61,7 @@ dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl -AC_DEFUN(AC_CXX_TYPENAME, +AC_DEFUN([AC_CXX_TYPENAME], [AC_CACHE_CHECK(whether the compiler recognizes typename, ac_cv_cxx_typename, [AC_LANG_SAVE @@ -85,7 +85,7 @@ dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl -AC_DEFUN(AC_CXX_NEW_FOR_SCOPING, +AC_DEFUN([AC_CXX_NEW_FOR_SCOPING], [AC_CACHE_CHECK(whether the compiler accepts the new for scoping rules, ac_cv_cxx_new_for_scoping, [AC_LANG_SAVE @@ -112,7 +112,7 @@ dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl -AC_DEFUN(AC_CXX_EXPLICIT_INSTANTIATIONS, +AC_DEFUN([AC_CXX_EXPLICIT_INSTANTIATIONS], [AC_CACHE_CHECK(whether the compiler supports explicit instantiations, ac_cv_cxx_explinst, [AC_LANG_SAVE @@ -133,7 +133,7 @@ dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl -AC_DEFUN(AC_CXX_DYNAMIC_CAST, +AC_DEFUN([AC_CXX_DYNAMIC_CAST], [AC_CACHE_CHECK(whether the compiler supports dynamic_cast<>, ac_cv_cxx_dynamic_cast, [AC_LANG_SAVE @@ -158,7 +158,7 @@ dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl -AC_DEFUN(AC_CXX_NAMESPACES, +AC_DEFUN([AC_CXX_NAMESPACES], [AC_CACHE_CHECK(whether the compiler implements namespaces, ac_cv_cxx_namespaces, [AC_LANG_SAVE @@ -182,7 +182,7 @@ dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl -AC_DEFUN(AC_CXX_BOOL, +AC_DEFUN([AC_CXX_BOOL], [AC_CACHE_CHECK(whether the compiler recognizes bool as a built-in type, ac_cv_cxx_bool, [AC_LANG_SAVE @@ -200,14 +200,14 @@ fi ]) -AC_DEFUN(AC_DEFINE_DIR, [ +AC_DEFUN([AC_DEFINE_DIR], [ ac_expanded=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix" test "x$exec_prefix" = xNONE && exec_prefix="${prefix}" eval echo \""[$]$2"\" )` ifelse($3, , - AC_DEFINE_UNQUOTED($1, "$ac_expanded"), +dnl AC_DEFINE_UNQUOTED($1, "$ac_expanded"), AC_DEFINE_UNQUOTED($1, "$ac_expanded", $3)) ]) @@ -220,7 +220,7 @@ dnl @version $Id: acinclude.m4,v 1.6 2000/01/13 20:31:46 clasen Exp $ dnl @author Luc Maisonobe dnl -AC_DEFUN(AC_CXX_MUTABLE, +AC_DEFUN([AC_CXX_MUTABLE], [AC_CACHE_CHECK(whether the compiler supports the mutable keyword, ac_cv_cxx_mutable, [AC_LANG_SAVE @@ -238,3 +238,16 @@ AC_DEFINE(HAVE_MUTABLE,,[define if the compiler supports the mutable keyword]) fi ]) + +dnl In the intl/Makefile.in we have a special dependency which makes +dnl sense only for gettext. We comment this out for non-gettext +dnl packages. +if test "$PACKAGE" = "gettext"; then + GT_NO="#NO#" + GT_YES= +else + GT_NO= + GT_YES="#YES#" +fi +AC_SUBST(GT_NO) +AC_SUBST(GT_YES) --- openjade-1.4devel1.orig/configure.in +++ openjade-1.4devel1/configure.in @@ -1,4 +1,4 @@ -AC_REVISION([$Id: configure.in,v 1.21 2000/03/28 16:10:47 clasen Exp $]) +AC_REVISION([$Id: configure.in,v 1.25 2001/07/20 06:19:24 adicarlo Exp $]) dnl dnl Process this file with autoconf to produce a configure script. dnl @@ -11,10 +11,13 @@ dnl dnl Initialization -AC_INIT(dsssl) -AM_INIT_AUTOMAKE(OpenJade, 1.4devel, no-define) -AM_CONFIG_HEADER(config.h) +AC_INIT([OpenJade], [1.4devel], [], [OpenJade]) +AC_CONFIG_SRCDIR(dsssl) +AM_INIT_AUTOMAKE([foreign]) +AM_CONFIG_HEADER([config.h]) AM_SANITY_CHECK +AM_MAINTAINER_MODE +AC_USE_SYSTEM_EXTENSIONS dnl Use different names than usually to avoid conflicts. AC_DEFINE_UNQUOTED(OPENJADE_PACKAGE, "$PACKAGE", [Package name]) @@ -27,30 +30,31 @@ AC_PROG_CXXCPP AC_PROG_INSTALL AC_PROG_LN_S -AC_PROG_RANLIB +dnl AC_PROG_RANLIB AC_PROG_MAKE_SET AC_PATH_PROGS(PERL, perl, perl) AM_PROG_LIBTOOL dnl Checks for libraries. AC_CHECK_LIB(pthread,pthread_create,,AC_CHECK_LIB(threads,cthread_fork)) -ALL_LINGUAS="de sv" AM_GNU_GETTEXT -AC_CHECK_HEADERS(locale.h) +AM_GNU_GETTEXT_VERSION([0.19.2]) +AC_CHECK_HEADERS([locale.h]) AC_DEFINE_DIR(OPENJADE_LOCALE_DIR, datadir/locale, [location of message catalogs]) OPENJADE_MESSAGE_DOMAIN=jade AC_DEFINE_UNQUOTED(OPENJADE_MESSAGE_DOMAIN, "$OPENJADE_MESSAGE_DOMAIN", [message domain]) AC_SUBST(OPENJADE_MESSAGE_DOMAIN) +AC_CHECK_LIB(w,wcscoll) dnl Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS(limits.h) -AC_LANG_CPLUSPLUS +AC_CHECK_HEADERS([limits.h]) +AC_LANG([C++]) AC_CHECK_HEADERS(new cassert) dnl Checks for typedefs, structures and compiler characteristics. AC_TYPE_SIZE_T -AC_STRUCT_ST_BLKSIZE +AC_CHECK_MEMBERS([struct stat.st_blksize]) AC_CACHE_CHECK(for sig_atomic_t in signal.h, ac_cv_have_sig_atomic_t, AC_TRY_LINK([#include ],sig_atomic_t x;, @@ -149,7 +153,7 @@ [define this if your system misses new.h]) AC_CACHE_CHECK(whether to declare set_new_handler extern "C", ac_cv_cxx_new_handler_extern_c, - [AC_TRY_COMPILE([ + [AC_TRY_LINK([ typedef void (*new_handler)(); new_handler set_new_handler(new_handler);],[ set_new_handler(0);], @@ -183,8 +187,8 @@ dnl Checks for system services. dnl Package options. -AC_ARG_PROGRAM -AC_DEFINE_UNQUOTED(DEFAULT_SCHEME_BUILTINS,"$prefix/share/$PACKAGE/builtins.dsl", +dnl AC_ARG_PROGRAM dnl complains about multiple invocations, though this is only explicit one +AC_DEFINE_UNQUOTED(DEFAULT_SCHEME_BUILTINS,"$prefix/share/sgml/$PACKAGE/builtins.dsl", [set this to the location of builtins.dsl]) AC_DEFINE(SP_MULTI_BYTE,1, [define this to build a multi-byte version]) @@ -232,9 +236,8 @@ [define this to build the html backend]) AC_MSG_RESULT(yes)) -AC_SUBST(LIBOBJS) -AC_OUTPUT([${PACKAGE}-${VERSION}.spec:spec.in Makefile msggen.pl style/Makefile grove/Makefile spgrove/Makefile - jade/Makefile dsssl/Makefile jadedoc/Makefile - jadedoc/images/Makefile intl/Makefile po/Makefile.in], - [echo creating po/Makefile - sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile]) +dnl AC_SUBST(LIBOBJS) +AC_OUTPUT([${PACKAGE}-${VERSION}.spec:spec.in Makefile msggen.pl style/Makefile + grove/Makefile spgrove/Makefile jade/Makefile dsssl/Makefile + jadedoc/Makefile jadedoc/images/Makefile intl/Makefile contrib/Makefile + unicode/Makefile po/Makefile.in]) --- openjade-1.4devel1.orig/contrib/Makefile.am +++ openjade-1.4devel1/contrib/Makefile.am @@ -0,0 +1,9 @@ +## Process this file with automake to produce Makefile.in + +pkgdatadir = $(datadir)/@PACKAGE@/contrib + +pkgdata_DATA = transform.dsl + +EXTRA_DIST = transform.dsl + +MAINTAINERCLEANFILES = Makefile.in --- openjade-1.4devel1.orig/contrib/README +++ openjade-1.4devel1/contrib/README @@ -0,0 +1,33 @@ +README for the OpenJade contrib directory +----------------------------------------- + +This directory contains software and documentation that are not an +integral part of OpenJade -- that is, they are not part of a DSSSL +implementation. They may or may not be useful. Your pointage may +vary. + +Here's a list of what's in this directory: + +rtf2doc.pl - a Perl script which will take .rtf files generated by + Jade and convert them to Word .doc format. In the process, + referenced graphic files will be embedded into the documents, + and page numbers references will be resolved. Requires MS Word + 97.d + +psgml-jade.el - an addition to psgml (a powerful SGML mode for Emacs) + which makes it easy to apply a DSSSL style sheet to an SGML document + from within the editor. It also contains a framework to enable + menu-driven customization of DSSSL style sheets. Requires + psgml-dsssl.el and customize.dtd. + +psgml-dsssl.el - creates a skeleton DSSSL style sheet for an SGML document. + +customize.dtd - a dtd derived from the DSSSL architecture which includes + information about user-settable variables and characteristics. This + allows menu-driven customization. + +jadetex - the JadeTeX macros needed to process the output of the TeX + backend used to be included here. However, they were removed; + just get them from upstream: + + --- openjade-1.4devel1.orig/contrib/catalog +++ openjade-1.4devel1/contrib/catalog @@ -0,0 +1,3 @@ +-- Copyright (C) 1999 Avi Kivity -- +CATALOG "../dsssl/catalog" +-- ENTITY "transform.dsl" "transform.dsl" -- --- openjade-1.4devel1.orig/contrib/customize.dtd +++ openjade-1.4devel1/contrib/customize.dtd @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + +s. + If a particular
, or + doesn't have a in the preferred + language, the tool should display a description + without an explicit language, if there is one. + Otherwise the tool might choose to use another + language or provide a default description. It is + not acceptible to simply omit the
, + or in question. --> + + + + + + + + + + + + element or + a whole type of elements can be included using the element. + The set of all allowed values is the union of the sets of allowed + values of all and subelements. Typical constellations + are: 1) only subelements + 2) a single element --> + + + + + + + +, a or a . It always has a part, which + should contain a short descriptive string, suitable as a menu entry. The + optional long part can contain a longer description, suitable a a help text + explaining the
, or in question. --> + + + + + + + + + + + + + --- openjade-1.4devel1.orig/contrib/psgml-dsssl.el +++ openjade-1.4devel1/contrib/psgml-dsssl.el @@ -0,0 +1,139 @@ +;; psgml-dsssl.el --- create a skeleton DSSSL spec for an SGML document. +;; $Id: psgml-dsssl.el,v 1.1 1999/08/28 20:01:31 clasen Exp $ +;; Copyright (C) 1996 David Megginson. Free redistribution permitted. +;; USE AT YOUR OWN RISK! +;; +;; Author: David Megginson (dmeggins@microstar.com) + + +;;; Commentary: + +;; Installation: +;; +;; This file requires Gnu Emacs 19.* or XEmacs, together with Lennart +;; Staflin's PSGML mode (tested with version 1a12). +;; +;; Install this file somewhere on your load path, byte-compile it, and +;; include the following in your .emacs or site-start.el file: +;; +;; (autoload 'sgml-dsssl-make-spec "psgml-dsssl" nil t) +;; +;; Now, whenever you are editing an SGML document with PSGML, you can +;; type +;; +;; M-x sgml-dsssl-make-spec +;; +;; to create a skeleton DSSSL style spec in a temporary buffer +;; "**DSSSL**" (overwriting any existing spec). You may save the +;; buffer to a file and edit it as you wish. +;; +;; +;; Operation: +;; +;; This package will generate an element construction rule for every +;; element type which could appear in the SGML document, whether it +;; actually appears or not -- it does so by starting with the element +;; type of the document's root element, then performing a depth-first +;; traversal of the DTD tree. Any element types which are not +;; reachable from the root will be excluded. +;; +;; The first instance of each element class in the DTD tree will +;; determine its context, and thus, its default flow-object class. +;; The contexts are as follow: +;; +;; 1) The root element of the document (default: simple-page-sequence). +;; 2) The element appears in mixed content or contains PCDATA content +;; (default: sequence). +;; 3) The element contains mixed content and appears in element content +;; (default: paragraph). +;; 4) The element contains only element content +;; (default: display-group). +;; 5) The element is EMPTY (default: sequence). +;; +;; These will work well with some DTDs, but the assumptions will fall +;; apart quickly for others, especially HTML (which allows mixed +;; content almost everywhere). You can change the default flow-object +;; classes for each of these using configuration variables, as you can +;; change the default document-type declaration at the top of the +;; specification. +;; + + +;;; Code: + +(require 'psgml-parse) +(autoload 'sgml-map-element-types "psgml-info" nil t) +(autoload 'sgml-eltype-refrenced-elements "psgml-info" nil t) + +;; +;; Global configuration variables -- change as appropriate. +;; + + ; Default to the style-sheet + ; DTD from the jade distribution. +(defvar sgml-dsssl-prolog + "\n\n" + "Prolog for generated DSSSL scripts.") + +(defvar sgml-dsssl-root-foc "simple-page-sequence" + "The default flow-object class for the root element type.") + +(defvar sgml-dsssl-mixed-foc "paragraph" + "The default flow-object class for an element type with mixed content.") + +(defvar sgml-dsssl-element-foc "display-group" + "The default flow-object class for an element type with element content.") + +(defvar sgml-dsssl-data-foc "sequence" + "The default flow-object class for an element type with data content.") + +(defvar sgml-dsssl-empty-foc "sequence" + "The default flow-object class for an element type with EMPTY content.") + +;;; +;;; Generate a skeleton DSSSL spec. +;;; +(defun sgml-dsssl-make-spec () + "Generate a skeleton DSSSL style spec for the SGML document in a buffer. +The output will always go into a buffer named \"**DSSSL**\"." + + (interactive) + (sgml-need-dtd) + (let ((root (symbol-name (sgml-element-name (sgml-top-element)))) + (max-lisp-eval-depth 10000) + (elements-seen ())) + (with-output-to-temp-buffer "**DSSSL**" + (princ sgml-dsssl-prolog) + (sgml-dsssl-make-rule (sgml-lookup-eltype root))))) + +(defun sgml-dsssl-make-rule (eltype &optional parent-mixed) + "Generate an element-construction rule, then recurse to any children." + + (let ((name (sgml-eltype-name eltype)) + (foc + (cond ((equal elements-seen ()) + sgml-dsssl-root-foc) + ((or (equal (sgml-eltype-refrenced-elements eltype) + (list (intern "#PCDATA"))) + parent-mixed) + sgml-dsssl-data-foc) +; ((sgml-eltype-mixed eltype) +; sgml-dsssl-mixed-foc) + ((equal (sgml-eltype-refrenced-elements eltype) ()) + sgml-dsssl-empty-foc) + (t sgml-dsssl-element-foc)))) + + (push name elements-seen) + +; (princ ";; Contents: ") +; (mapc (function (lambda (child) (princ child) (princ " "))) +; (sgml-eltype-refrenced-elements eltype)) +; (princ "\n") + (princ (format "(element %s\n (make %s\n (process-children)))\n\n" + (upcase name) foc))) + (mapcar (function + (lambda (el) + (if (and (not (memq (sgml-eltype-name el) elements-seen)) + (not (string= (sgml-eltype-name el) "#PCDATA"))) + (sgml-dsssl-make-rule el (sgml-eltype-mixed eltype))))) + (sgml-eltype-refrenced-elements eltype))) --- openjade-1.4devel1.orig/contrib/psgml-jade.el +++ openjade-1.4devel1/contrib/psgml-jade.el @@ -0,0 +1,1103 @@ +; $Id: psgml-jade.el,v 1.2 2001/01/31 23:37:56 adicarlo Exp $ +;; psgml-jade.el --- add jade, jadetex and customize support to psgml. +;; Copyright (C) 1997 Matthias Clasen. Free redistribution permitted. +;; USE AT YOUR OWN RISK! +;; +;; Author: Matthias Clasen (mclasen@sun2.mathematik.uni-freiburg.de) + + +;;; Commentary: + +;; Thanks: +;; +;; The code is heavily borrowed from AUCTeX 9.5. +;; +;; +;; Installation: +;; +;; This file requires Gnu Emacs 19.* or XEmacs, together with Lennart +;; Staflin's PSGML mode (tested with version 1.0.1) and David Megginson's +;; DSSSL extensions (psgml-dsssl.el). +;; +;; Install this file somewhere on your load path, byte-compile it, and +;; include the following in your .emacs or site-start.ed file: +;; +;; (add-hook 'sgml-mode-hook '(lambda () (require 'psgml-jade))) +;; +;; Make the file `customize.dtd' accessible to jade and psgml. This +;; typically means adding a catalog entry for this file. +;; +;; Now, whenever you are editing an SGML document with PSGML, you will +;; see an additional menu with title `DSSSL'. It contains entries + +;; `Jade' calls jade with sensible command line parameters +;; `JadeTeX' calls jadetex with sensible command line parameters +;; `View dvi' calls `xdvi' by default +;; `Kill Job' kills a job started with one of the above entries +;; `Recenter Output Buffer' displays the output of a job started +;; with one of the above entries. +;; `File Options >' opens a submenu that allows you to select the +;; DSSSL style sheet and the backend to use with jade. +;; `Make new style sheet' executes David Megginson's `sgml-dsssl-make-spec' +;; for this you need the file `psgml-dsssl.el'. +;; `Edit style sheet' brings up a buffer with the selected style sheet. +;; `Customize style sheet' If the style sheet is following the DTD +;; `customize.dtd' distributed with this file, this contains +;; a submenu for changing variable settings in the style sheet. +;; `Save customizations' Asks you for the name of a file to save the +;; customized values to. The generated file is a fully valid +;; DSSSL style sheet. You may reload your customizations from +;; this file by selecting it as style sheet. +;; +;; The menu entries (except `File Options >') are also reachable by commands: +;; `M-x sgml-command' prompts you for the command to execute. You can use +;; completion to select one of the menu entries for the external commands. +;; `M-x sgml-recenter-output-buffer' +;; `M-x sgml-kill-job' +;; `M-x sgml-dsssl-make-spec' +;; `M-x sgml-dsssl-edit-spec' +;; +;; For details how to add commands to the menu, see the documentation of +;; the variables below. + + +;;; Code: + +;;;; Variables to be customized. + +(defvar + sgml-command-list + (list +; this is how `Validate' could be done here; note that this is better than +; the solution in the `SGML' menu, since it automatically includes the catalogs. +; (list "Validate" +; "cd %dir; nsgmls -s -m%catalogs %file" 'sgml-run-command t +; '((":\\(.+\\):\\([0-9]+\\):\\([0-9]+\\):[EX]: " 1 2 3) +; ("\\(error\\|warning\\) at \\([^,]+\\), line \\([0-9]+\\)" 2 3) +; ("\n[a-zA-Z]?:?[^0-9 \n\t:]+:[ \t]*\\([^ \n\t:]+\\):\ +;\\([0-9]+\\):\\(\\([0-9]+\\)[: \t]\\)?" 1 2 4))) + (list "Jade" "cd %dir; openjade -c%catalogs -t%backend -d%stylesheet %file" + 'sgml-run-command nil + '(("openjade:\\(.*\\):\\(.*\\):\\(.*\\):E:" 1 2 3))) + (list "JadeTeX" "cd %dir; jadetex '\\nonstopmode\\input %tex'" + 'sgml-run-command nil) + (list "View dvi" "cd %dir; xdvi %dvi" + 'sgml-run-background t)) + "*List of commands. + +The first entry is the string appearing in the `DSSSL' menu. +The second entry is the command to run after expansion with `sgml-command-expand'. +The third one is the hook used to run the command. A hook should be a function of +four arguments: the name (first entry), the command to run (the expanded second +entry), the file name and an error regexp (the fifth entry). +The fourth entry is set to t to enforce confirmation in the minibuffer. +The (optional) fifth entry is an error regexp to be used by `compile-internal'.") + +(defvar sgml-sgml-file-extension "sgml" + "*Extension used for the expansion of %sgml in `sgml-command-expand'.") + +(defvar sgml-dsssl-file-extension "dsl" + "*Extension used for the expansion of %dsssl in `sgml-command-expand' +and for the default file name when saving the `**DSSSL**' buffer.") + + +(defvar sgml-expand-list + (list + (list "%file" 'file nil) ; the current file as is + (list "%sgml" 'file sgml-sgml-file-extension) ; with given extension + (list "%tex" 'file "tex") ; dito + (list "%dvi" 'file "dvi") ; dito + (list "%dsssl" 'file sgml-dsssl-file-extension) ; dito + (list "%dir" 'file nil t) ; the directory part + (list "%stylesheet" 'sgml-dsssl-spec) ; the specified style sheet + (list "%backend" 'sgml-jade-backend) ; the selected backend + (list "%catalogs" 'sgml-dsssl-catalogs 'sgml-catalog-files 'sgml-local-catalogs) + ; the catalogs listed in sgml-catalog-files and sgml-local-catalogs. + ) + "*List of matched patterns in commands. + +The first entry is the placeholder in the command string. +The second entry is a function which is evaluated to produce a string +replacing the placeholder. + +The function should accept all remaining list entries as arguments plus a +first argument which is a string holding a possible flag preceding the +placeholder in the command string or the empty string if there is no flag. + +If the replacement is more than one item (like for catalogs), the function +would normally repeat the flag for each item.") + +(defvar sgml-jade-backends + '(("TeX" . tex) + ("RTF" . rtf) + ("FOT" . fot) + ("SGML" . sgml) + ("XML" . xml)) + "*List of supported backends for jade. + +Each backend is specified as a cons cell containing a string to appear in the +`Jade backend' menu and a symbol whose name is used as replacement for %backend." +) + +(defvar sgml-show-compilation nil + "*If non-nil, show output of compilation in other window.") + +;;;; Internal variables. + +;; This variable is shared with `compile.el'. +(defvar compilation-in-progress nil + "List of compilation processes now running.") + +(or (assq 'compilation-in-progress minor-mode-alist) + (setq minor-mode-alist (cons '(compilation-in-progress " Compiling") + minor-mode-alist))) + +(defvar sgml-jade-backend 'tex + "*Symbol whose name is used as replacement for %backend in `sgml-command-expand'. + +Possible values are given in `sgml-jade-backends'.") +(make-variable-buffer-local 'sgml-jade-backend) +(put 'sgml-jade-backend 'sgml-type sgml-jade-backends) +(put 'sgml-jade-backend 'sgml-desc "Jade backend") + +(defvar sgml-dsssl-spec nil + "*String used as file name part in the replacement for %stylesheet +in `sgml-command-expand'. + +The value should be a file name or nil.") +(make-variable-buffer-local 'sgml-dsssl-spec) +(put 'sgml-dsssl-spec 'sgml-type 'file-or-nil) +(put 'sgml-dsssl-spec 'sgml-desc "DSSSL style sheet") + +(defvar sgml-dsssl-subspec nil + "*String used as style-specification part in the replacement for +%stylesheet in `sgml-command-expand'. + +The value should be the ID of a style-specification in +`sgml-dsssl-spec' or nil.") +(make-variable-buffer-local 'sgml-dsssl-subspec) +(put 'sgml-dsssl-subspec 'sgml-type 'string-or-nil) +(put 'sgml-dsssl-subspec 'sgml-desc "DSSSL style specification") + +(defvar sgml-dsssl-customize-spec nil + "*String used as file name when saving customizations. + +The value should be a file name or nil.") +(make-variable-buffer-local 'sgml-dsssl-customize-spec) +(put 'sgml-dsssl-customize-spec 'sgml-type 'file-or-nil) +(put 'sgml-dsssl-customize-spec 'sgml-desc "Customizations go to") + +(defvar sgml-dsssl-language "DE" + "*String identifying the language preferred for customization info.") +(put 'sgml-dsssl-language 'sgml-type 'string-or-nil) +(put 'sgml-dsssl-language 'sgml-desc "Language") + +(defvar sgml-dsssl-customize nil + "*An alist holding customized values of style sheet variables +and characteristics.") +(make-variable-buffer-local 'sgml-dsssl-customize) +(put 'sgml-dsssl-customize 'sgml-type 'list) +(put 'sgml-dsssl-customize 'sgml-desc "Customize value alist") + +(defvar sgml-dsssl-customize-info nil + "*An alist holding customization info about style sheet variables +and characteristics.") +(make-variable-buffer-local 'sgml-dsssl-customize-info) +(put 'sgml-dsssl-customize-info 'sgml-type 'list) +(put 'sgml-dsssl-customize-info 'sgml-desc "Customize info alist") + +(defvar sgml-dsssl-added-characteristics nil + "*The name of a customizable style sheet containing a description +of DSSSL characteristics which should be offered for customization.") +(put 'sgml-dsssl-added-characteristics 'sgml-type 'file-or-nil) +(put 'sgml-dsssl-added-characteristics 'sgml-desc "Additional characteristics") + +(defconst sgml-dsssl-customize-identifier + "" +"A string inserted at the beginning of customization files.") + +(defconst sgml-dsssl-file-options + '( + sgml-jade-backend + sgml-dsssl-spec + sgml-dsssl-subspec + sgml-dsssl-language + ) + "Options for the current file, can be saved or set from menu." + ) + +(defvar sgml-confirm-command-history nil + "The minibuffer history list for `sgml-command-execute''s COMMAND argument.") + +(defvar sgml-read-command-history nil + "The minibuffer history list for `sgml-read-command-name'.") + +;;;; Command expansion + +(defun sgml-jade-backend (flag) + "Used in `sgml-command-expand' to produce the replacement text for %backend." + (concat (when sgml-jade-backend flag) (symbol-name sgml-jade-backend))) + +(defun sgml-dsssl-spec (flag) + "Used in `sgml-command-expand' to produce the replacement text for %stylesheet. + +If the style sheet has customization info, this has the side effect of creating +a temporary style sheet." + (cond + ((null sgml-dsssl-spec) "") ; no style sheet + ((null sgml-dsssl-customize) ; a style sheet without customize info + (concat flag + sgml-dsssl-spec + (when sgml-dsssl-subspec "#") sgml-dsssl-subspec)) ; might have subspec + (t (let ( (the-spec (make-temp-name (concat "/tmp/" "psgml"))) ) + (sgml-dsssl-write-customize the-spec) + (concat flag the-spec))))) + +(defun sgml-dsssl-write-customize (&optional filename) + (interactive + (list (setq sgml-dsssl-customize-spec + (read-from-minibuffer "Filename: " sgml-dsssl-customize-spec)))) + (let ( (the-spec sgml-dsssl-spec) + (the-subspec sgml-dsssl-subspec) + (the-cust sgml-dsssl-customize) + (the-info sgml-dsssl-customize-info) ) + (when (and the-spec the-cust filename) + (save-excursion + (set-buffer (find-file-noselect filename)) + (erase-buffer) + (insert sgml-dsssl-customize-identifier "\n") + (insert "\n") + (insert "]>\n") + (insert "\n") + (let ( (val nil) + (info nil) ) + (while the-cust + (setq desc (car the-cust)) + (setq info (cdr (assoc (car desc) the-info))) + (when (cdr desc) ; write out only customized values + (cond + ((equal 'characteristic (aref info 4)) + (insert "(declare-initial-value " (car desc) " " (cdr desc) ")\n")) + ((equal 'variable (aref info 4)) + (insert "(define " (car desc) " " (cdr desc) ")\n")))) + (setq the-cust (cdr the-cust)))) + (insert "\n") + (insert "\n") + (save-buffer))))) + +(defun sgml-dsssl-catalogs (flag &rest lists) + "Used in `sgml-command-expand' to produce the replacement text for %catalogs." + (mapconcat + (lambda (cats) + (mapconcat (lambda (cat) (concat flag cat)) (eval cats) " ")) + lists " ") +) + +; should this somehow deal with `sgml-parent-document' ? +(defun sgml-file (&optional extension dir) + "If DIR is non-nil, return the directory part of the current file, +else the current file without directory part. Replace the extension +by EXTENSION, if non-nil." + (if dir + (file-name-directory (buffer-file-name)) + (if extension + (concat (sgml-strip-extension + (file-name-nondirectory (buffer-file-name))) "." extension) + (file-name-nondirectory (buffer-file-name)) + ) + ) + ) + +(defun sgml-command-expand (command file) + "Expand COMMAND for FILE as described by `sgml-expand-list'." + (let ( (list sgml-expand-list) ) + (while list + (let ( (case-fold-search nil) ; Do not ignore case. + (string (car (car list))) ; First element + (expansion (car (cdr (car list)))) ; Second element + (arguments (cdr (cdr (car list)))) ) ; Remaining elements + (while (string-match (concat " \\(-.*\\|\\)" string) command) + (let ( (prefix (substring command 0 (match-beginning 1))) + (flag (substring command (match-beginning 1) (match-end 1))) + (postfix (substring command (match-end 0))) ) + (setq command + (concat prefix + (cond ((sgml-function-p expansion) + (apply expansion flag arguments)) + ((boundp expansion) + (concat flag (apply (eval expansion) arguments))) + (t + (error "Nonexpansion %s" expansion))) + postfix))))) + (setq list (cdr list))) + command)) + +;;;; Hooks for `sgml-command-list' + +(defun sgml-run-background (name command file error-regexp) + "Start process with second argument, show output when and if it arrives." + (save-excursion + (set-buffer (get-buffer-create "*SGML background*")) + (erase-buffer) + (let ((process (start-process (concat name " background") + nil "/bin/sh" "-c" command))) + (process-kill-without-query process)))) + +(defun sgml-run-command (name command file error-regexp) + "Hook for `sgml-command-list'." + (let ( (buffer (sgml-process-buffer-name file)) + (fname (file-name-nondirectory file)) + (dir (file-name-directory file)) ) + (sgml-process-check file) + (get-buffer-create buffer) + (set-buffer buffer) + (erase-buffer) + (insert "Running `" name "' on `" file "' with ``" command "''\n") + (compilation-minor-mode) + (setq compilation-error-regexp-alist error-regexp) + (setq compilation-error-message "No more errors") + (setq mode-name name) + (if sgml-show-compilation + (display-buffer buffer) + (message "Type `%s' to display results of compilation." + (substitute-command-keys "\\[sgml-recenter-output-buffer]"))) + (let ((process (start-process name buffer "/bin/sh" "-c" command))) + (set-marker (process-mark process) (point-max)) + (setq compilation-in-progress (cons process compilation-in-progress)) + process) + ) + ) + +(defun sgml-recenter-output-buffer (line) + "Redisplay buffer of job output so that most recent output can be seen. +The last line of the buffer is displayed on line LINE of the window, or +at bottom if LINE is nil." + (interactive "P") + (let ( (buffer (sgml-process-buffer (sgml-file))) ) + (if buffer + (let ((old-buffer (current-buffer))) + (pop-to-buffer buffer t) + (bury-buffer buffer) + (goto-char (point-max)) + (recenter (if line + (prefix-numeric-value line) + (/ (window-height) 2))) + (pop-to-buffer old-buffer)) + (message "No process for this document.")))) + +;;;; Command execution + +(defun sgml-command-execute (name file) + "Run the command NAME from `sgml-command-list' on FILE. + +This function relies on NAME being a valid element of `sgml-command-list' +and on FILE being function returning a file name. For interactive calls, +use `sgml-command'." + (let* ( (entry (assoc name sgml-command-list)) + (command (sgml-command-expand (nth 1 entry) file)) + (hook (nth 2 entry)) + (confirm (nth 3 entry)) + (error-regexp (nth 4 entry)) ) + (if confirm + (setq command + (read-from-minibuffer (concat name " command: ") command + nil nil 'sgml-confirm-command-history))) + (if sgml-offer-save + (save-some-buffers nil nil)) + (apply hook name command (apply file nil) error-regexp nil))) + +(defun sgml-command (name) + "Execute command NAME from `sgml-command-list' from a menu or interactively." + (interactive (list + (completing-read "Run command: " sgml-command-list nil t nil + 'sgml-read-command-history))) + (setq name (car-safe (sgml-assoc name sgml-command-list))) + (when name (sgml-command-execute name 'sgml-file)) + ) + +(defun sgml-kill-job () + (interactive) + (let ( (process (sgml-process (sgml-file))) ) + (if process + (kill-process process) + (error "No process to kill")))) + +;;;; Process handling + +(defun sgml-process-buffer-name (name) + (concat "*" (abbreviate-file-name (expand-file-name name)) " output*")) + +(defun sgml-process-buffer (name) + (get-buffer (sgml-process-buffer-name name))) + +(defun sgml-process (name) + (get-buffer-process (sgml-process-buffer name))) + +(defun sgml-process-check (name) + "Check if a process for the document NAME already exists. If so, +give the user the choice of aborting the process or the current command." + (let ((process (sgml-process name))) + (cond ((null process)) + ((not (eq (process-status process) 'run))) + ((yes-or-no-p (concat "Process `" + (process-name process) + "' for document `" + name + "' running, kill it? ")) + (delete-process process)) + (t + (error "Cannot have two processes for the same document"))))) + +;;;; The menu + +(defun sgml-command-menu-entry (entry) + "Return `sgml-command-list' entry ENTRY as a menu item." + (let ( (name (car entry)) ) + (vector name (list 'sgml-command name) t))) + +(defun sgml-dsssl-file-options-menu (&optional event) + "If `sgml-dsssl-spec' is changed, update `sgml-dsssl-customize' and the + customize menu." + (interactive "e") + (let ( (old-spec sgml-dsssl-spec) + (old-subspec sgml-dsssl-subspec) + (old-lang sgml-dsssl-language) ) + (sgml-options-menu event sgml-dsssl-file-options) + (unless (equal old-spec sgml-dsssl-spec) + (setq sgml-dsssl-subspec nil)) + (unless (and (equal old-spec sgml-dsssl-spec) + (equal old-subspec sgml-dsssl-subspec) + (equal old-lang sgml-dsssl-language)) + (sgml-dsssl-check-customize)))) + +(easy-menu-define sgml-command-menu sgml-mode-map "DSSSL menu" + (append '("DSSSL") + (let ( (file 'buffer-file-name) ) + (mapcar 'sgml-command-menu-entry sgml-command-list)) + '("--" + ["Kill job" sgml-kill-job (sgml-process (sgml-file))] + ["Recenter output buffer" sgml-recenter-output-buffer + (sgml-process-buffer (sgml-file))] + "--" + ["File Options >" sgml-dsssl-file-options-menu 't] + ["Create new style sheet" sgml-dsssl-new-spec 't] + ["Edit style sheet" sgml-dsssl-edit-spec sgml-dsssl-spec] + ["Customize style sheet" t 'nil] + ["Save customizations" sgml-dsssl-write-customize sgml-dsssl-customize]))) + + +;;;; Auxiliary functions + +; You might want to find David Love's new scheme.el which implements dsssl-mode. +(if (not (fboundp 'dsssl-mode)) (fset 'dsssl-mode 'scheme-mode)) + +(defun sgml-function-p (arg) + "Return non-nil if ARG is callable as a function." + (or (and (fboundp 'byte-code-function-p) + (byte-code-function-p arg)) + (and (listp arg) + (eq (car arg) 'lambda)) + (and (symbolp arg) + (fboundp arg)))) + +(defun sgml-member (elt list how) + "Returns the member ELT in LIST. Comparison done with HOW. + +Return nil if ELT is not a member of LIST." + (while (and list (not (funcall how elt (car list)))) + (setq list (cdr list))) + (car-safe list)) + +(defun sgml-assoc (elem list) + "Like assoc, except case incentive." + (let ((case-fold-search t)) + (sgml-member elem list + (function (lambda (a b) + (string-match (concat "^" (regexp-quote a) "$") + (car b))))))) + +(defun sgml-strip-extension (name) + "Return NAME with final `.*' stripped." + (string-match "^\\(.*\\)[.][^.]*$" name) + (substring name (match-beginning 1) (match-end 1)) + ) + + +;;; Integration of psgml-dsssl.el with psgml-jade.el + +(defun sgml-dsssl-ask-for-spec () + (let ( (dsssl (buffer-file-name)) ) + (save-excursion + (set-buffer sgml-current-sgml-buffer) + (when (and + (not (equal sgml-dsssl-spec dsssl)) + (y-or-n-p "Select style sheet ") + (setq sgml-dsssl-spec dsssl) + (sgml-dsssl-check-customize)))))) + +(defun sgml-dsssl-write () + (if (equal (buffer-name) "**DSSSL**") + (progn + (setq buffer-file-name + (expand-file-name (read-file-name + "File to save in: " (file-name-directory buffer-file-name) + buffer-file-name nil (file-name-nondirectory buffer-file-name)))) + (rename-buffer (file-name-nondirectory buffer-file-name)))) + nil) + +(defun sgml-dsssl-edit-spec () + (interactive) + (when (or (null sgml-dsssl-customize) + (y-or-n-p "Editing the style sheet will destroy +your customizations. Continue? ")) + (display-buffer (find-file-noselect sgml-dsssl-spec)) + (setq sgml-current-sgml-buffer (current-buffer)) + (select-window (get-buffer-window (get-file-buffer sgml-dsssl-spec))) + (dsssl-mode) + (font-lock-mode) + (goto-char (point-min)) + (setq buffer-offer-save t) + (add-hook 'after-save-hook 'sgml-dsssl-check-customize))) + +(defun sgml-dsssl-new-spec () + (interactive) + (sgml-dsssl-make-spec) + (setq sgml-current-sgml-buffer (current-buffer)) + (let* ( (name (sgml-file sgml-dsssl-file-extension)) + (buffer (get-buffer "**DSSSL**")) ) + (select-window (get-buffer-window buffer)) + (dsssl-mode) + (font-lock-mode) + (goto-char (point-min)) + (setq buffer-offer-save t) + (setq buffer-file-name name) + (make-local-variable 'after-save-hook) + (add-hook 'after-save-hook 'sgml-dsssl-ask-for-spec) + (add-hook 'local-write-file-hooks 'sgml-dsssl-write))) + +;;; Customization of style sheets + +(defun sgml-dsssl-read-desc (elt) + (let ( (sub-elt (sgml-element-content elt)) + (retval nil) ) + (while sub-elt + (setq retval (cons (buffer-substring-no-properties + (sgml-element-stag-end sub-elt) + (sgml-element-etag-start sub-elt)) retval)) + (setq sub-elt (sgml-element-next sub-elt))) + (reverse retval))) + +(defun sgml-dsssl-read-var-or-char (elt) + (let* ( (sub-elt (sgml-element-content elt)) + (desc nil) + (default-desc (list (sgml-element-attval elt "name"))) + (values nil) + (types nil) ) + (while sub-elt + (let ( (elname (symbol-name (sgml-element-name sub-elt))) ) + (cond + ((equal "description" elname) + (let ( (lang (sgml-element-attval sub-elt "language")) ) + (cond + ((equal lang sgml-dsssl-language) + (setq desc (sgml-dsssl-read-desc sub-elt))) + ((null lang) + (setq default-desc (sgml-dsssl-read-desc sub-elt)))))) + ((equal "value" elname) + (let ( (value-desc nil) + (sub-sub-elt (sgml-element-content sub-elt)) ) + (while sub-sub-elt + (let ( (sub-elname (symbol-name (sgml-element-name sub-sub-elt))) ) + (cond + ((equal "type" sub-elname) + (setq newval (sgml-element-attval sub-sub-elt "class")) + (when (null value-desc) + (setq value-desc (list newval ""))) + (setq types (cons (cons (nth 0 value-desc) (list newval)) types)) + (setq sub-sub-elt nil)) + ((equal "content" sub-elname) + (setq newval (buffer-substring-no-properties + (sgml-element-stag-end sub-sub-elt) + (sgml-element-etag-start sub-sub-elt))) + (when (null value-desc) + (setq value-desc (list newval ""))) + (setq values (cons (cons (nth 0 value-desc) newval) values)) + (setq sub-sub-elt nil)) + ((equal "description" sub-elname) + (let ( (lang (sgml-element-attval sub-sub-elt "language")) ) + (cond + ((equal lang sgml-dsssl-language) + (setq value-desc (sgml-dsssl-read-desc sub-sub-elt))) + ((and (null lang) (null value-desc)) + (setq value-desc (sgml-dsssl-read-desc sub-sub-elt))))) + (setq sub-sub-elt (sgml-element-next sub-sub-elt))) + ((setq sub-sub-elt (sgml-element-next sub-sub-elt))))))))) + (setq sub-elt (sgml-element-next sub-elt)))) + (let* ( (is-variable (equal "variable" (symbol-name (sgml-element-name elt)))) + (name (sgml-element-attval elt "name")) + (default (if is-variable + (sgml-element-attval elt "default") + (sgml-element-attval elt "initial"))) ) + (when (null desc) (setq desc default-desc)) + (setq types (reverse types)) + (setq values (reverse values)) + + ; build up the alists of per-variable information. + (setq new-cust (cons (cons name default) new-cust)) + (setq new-cust-info + (cons (cons name + (vector desc default types values + (if is-variable 'variable 'characteristic))) + new-cust-info)) + + (vector (nth 0 desc) + `(sgml-dsssl-var-menu (quote ,name) 't) + 't)))) + +(defun sgml-dsssl-read-section (elt &optional start) + (let* ( (sub-elt (sgml-element-content elt)) + (desc nil) + (default-desc (list (cond (start) ("???")))) + (retval (list nil)) ) + (while sub-elt + (let ( (elname (symbol-name (sgml-element-name sub-elt))) ) + (cond + ((equal "description" elname) + (let ( (lang (sgml-element-attval sub-elt "language")) ) + (cond + ((equal lang sgml-dsssl-language) + (setq desc (sgml-dsssl-read-desc sub-elt))) + ((null lang) + (setq default-desc (sgml-dsssl-read-desc sub-elt)))))) + ((equal "section" elname) + (setq retval (append retval (list (sgml-dsssl-read-section sub-elt))))) + ((equal "variable" elname) + (unless (assoc (sgml-element-attval sub-elt "name") new-cust) + (setq retval + (append retval (list (sgml-dsssl-read-var-or-char sub-elt)))))) + ((equal "characteristic" elname) + (when (equal "ignored" (sgml-element-attval sub-elt "ignored")) + (setq ignored-chars + (cons (sgml-element-attval sub-elt "name") ignored-chars))) + (unless (or (member (sgml-element-attval sub-elt "name") ignored-chars) + (assoc (sgml-element-attval sub-elt "name") new-cust)) + (setq retval + (append retval (list (sgml-dsssl-read-var-or-char sub-elt)))))) + (t (error "Confusion in `read-section'"))) + (setq sub-elt (sgml-element-next sub-elt)))) + (when (null desc) (setq desc default-desc)) + (if (equal (length retval) 1) + '() ; empty section; do not add to menu + (cons (nth 0 desc) (cdr retval))))) + +(defun sgml-dsssl-check-customize () + (interactive) + (easy-menu-change + nil "DSSSL" + (append (let ( (file 'buffer-file-name) ) + (mapcar 'sgml-command-menu-entry sgml-command-list)) + (list "--" + ["Kill job" sgml-kill-job (sgml-process (sgml-file))] + ["Recenter output buffer" sgml-recenter-output-buffer + (sgml-process-buffer (sgml-file))] + "--" + ["File Options >" sgml-dsssl-file-options-menu 't] + ["Create new style sheet" sgml-dsssl-new-spec 't] + ["Edit style sheet" sgml-dsssl-edit-spec sgml-dsssl-spec]) + (list (sgml-dsssl-analyze-spec) + ["Save customizations" sgml-dsssl-write-customize + sgml-dsssl-customize])))) + +(defun sgml-dsssl-check-auto-generated () + (let* ( (true-spec nil) + (true-subspec nil) ) + (save-excursion + (set-buffer (find-file-noselect sgml-dsssl-spec)) + + ; check for psgml-generated customization file + (goto-char (point-min)) + (when (and + (search-forward-regexp "" (save-excursion + (goto-line 2) (point)) t) + (equal (buffer-substring-no-properties + (match-beginning 0) (match-end 0)) + sgml-dsssl-customize-identifier)) + ; (message "Its my baby!") + + ; find the style sheet which is customized here + (search-forward-regexp "" + nil t) + (setq true-spec (buffer-substring-no-properties + (match-beginning 1) (match-end 1))) + + ; find a possible style-specification + (when (search-forward-regexp + "" + nil t) + (setq true-subspec (buffer-substring-no-properties + (match-beginning 1) (match-end 1)))) + + ; find the customized values. + (goto-char (point-min)) + ; we match to the end of line, since the value might + ; be an arbitrary DSSSL expression containing parens + (while (search-forward-regexp + "^[ ]*(declare-initial-value \\([^ ]*\\) \\(.*\\))[ ]*$" nil t) + (setq saved-variables + (cons (cons (buffer-substring-no-properties + (match-beginning 1) (match-end 1)) + (buffer-substring-no-properties + (match-beginning 2) (match-end 2))) + saved-variables))) + ; find the customized values. + (goto-char (point-min)) + ; we match to the end of line, since the value might + ; be an arbitrary DSSSL expression containing parens + (while (search-forward-regexp + "^[ ]*(define \\([^ ]*\\) \\(.*\\))[ ]*$" nil t) + (setq saved-variables + (cons (cons (buffer-substring-no-properties + (match-beginning 1) (match-end 1)) + (buffer-substring-no-properties + (match-beginning 2) (match-end 2))) + saved-variables))))) ; end of excursion + (when true-spec + (setq sgml-dsssl-customize-spec sgml-dsssl-spec) + (setq sgml-dsssl-spec true-spec) + (setq sgml-dsssl-subspec true-subspec)))) + +; cut string into a list of strings at whitespace +(defun explode-string (s) + (let ( (i 0) + (retval nil) ) + (while (< i (length s)) + (string-match "[ ]*\\([^ ]+\\)[ ]*" s i) + (setq retval (cons (substring s (match-beginning 1) (match-end 1)) retval)) + (setq i (match-end 0))) + (reverse retval))) + +(defun sgml-dsssl-analyze-spec () + "Return menu tree from spec, also setting `sgml-dsssl-customize'." + ; reset stuff depending on sgml-dsssl-spec. + (setq sgml-dsssl-customize nil) + (setq sgml-dsssl-customize-info nil) + (put 'sgml-dsssl-language 'sgml-type 'string-or-nil) + (put 'sgml-dsssl-subspec 'sgml-type 'string-or-nil) + + ; analyze sgml-dsssl-spec, rebuilding all dependent stuff. + (if (null sgml-dsssl-spec) + ["Customize style sheet" 't 'nil] + (let ( (new-cust nil) + (new-cust-info nil) + (ignored-chars nil) + (lang-list (list nil)) + (id-list (list nil)) + (use-list nil) + (menu-so-far (list "Customize style sheet")) + (local-catalogs sgml-local-catalogs) + (saved-variables nil) ) + (sgml-dsssl-check-auto-generated) + (setq use-list (list sgml-dsssl-subspec)) + + ; if we had a psgml-generated file, we now switch to the style sheet. + (save-excursion + (set-buffer (find-file-noselect sgml-dsssl-spec)) + + ; treat an non-psgml-generated style sheet + (sgml-mode) + (setq sgml-local-catalogs local-catalogs) + (sgml-need-dtd) + (sgml-parse-to (point-max)) + + ; find all available style-specifications + (when (sgml-top-element) + (let* ( (style-spec (sgml-element-content (sgml-top-element))) + (id nil) + (i 0) ) + (while style-spec + ; might need to check for partial attribute here + (when (equal "style-specification" + (symbol-name (sgml-element-name style-spec))) + (setq i (+ 1 i)) + (setq id (sgml-element-attval style-spec "id")) + (when id (setq id-list (append id-list (list id))))) + (setq style-spec (sgml-element-next style-spec))) + (message (format "%d style-specification(s) found." i))) + + ; analyze the customize + (let* ( (style-spec (sgml-element-content (sgml-top-element))) + (count 0) ) + (while (and style-spec use-list (< count 1000)) + (when (or (null (car use-list)) ; special case for first spec + (equal (sgml-element-attval style-spec "id") + (car use-list))) + + ; update use-list + (setq use-list + (append use-list + (explode-string + (sgml-element-attval style-spec "use")))) + (setq use-list (remove-duplicates (cdr use-list))) + + (let ( (cust (sgml-element-content style-spec)) ) + ; this silently drops external-specification's + (when (and cust + (equal "customize" + (symbol-name (sgml-element-name cust)))) + + ; append languages + (setq lang-list + (append lang-list + (explode-string + (sgml-element-attval cust "languages")))) + + ; append the customize info + (setq menu-so-far + (append menu-so-far (list "---") + (cdr (sgml-dsssl-read-section cust))))))) + + ; continue loop over style-spec + (setq count (+ 1 count)) + (setq style-spec (sgml-element-next style-spec)) + (when (null style-spec) ; loop from the beginning + (setq style-spec (sgml-element-content (sgml-top-element)))))))) + ; end of excursion + + (when sgml-dsssl-added-characteristics + (save-excursion + (set-buffer (find-file-noselect sgml-dsssl-added-characteristics)) + + (sgml-mode) + (setq sgml-local-catalogs local-catalogs) + (sgml-need-dtd) + (sgml-parse-to (point-max)) + + (when (sgml-top-element) + (let* ( (cust (sgml-element-content + (sgml-element-content + (sgml-top-element)))) ) + (when (and cust + (equal "customize" + (symbol-name (sgml-element-name cust)))) + + ; append the customize info + (setq menu-so-far + (append menu-so-far (list "---") + (cdr (sgml-dsssl-read-section cust))))))))) + + ; check if we found any customize info + (when (equal 1 (length menu-so-far)) + (setq menu-so-far [ "Customize style sheet" 't 'nil])) + + ; set the buffer-local variables to their new values + (put 'sgml-dsssl-language 'sgml-type + (or (remove-duplicates (cdr lang-list)) 'string-or-nil)) + (put 'sgml-dsssl-subspec 'sgml-type + (or (remove-duplicates (cdr id-list)) 'string-or-nil)) + + ; if we had a psgml-generated file, we use the values from + ; there instead of the default ones + ;(setq sgml-dsssl-customize (or saved-variables new-cust)) + (while saved-variables + (setcdr (assoc (car (car saved-variables)) new-cust) + (cdr (car saved-variables))) + (setq saved-variables (cdr saved-variables))) + (setq sgml-dsssl-customize new-cust) + (setq sgml-dsssl-customize-info new-cust-info) + menu-so-far))) + +(defun sgml-dsssl-var-menu (var event) + (let* ( (info (cdr (assoc var sgml-dsssl-customize-info))) + (desc (aref info 0)) + (types (copy-alist (aref info 2))) + (values (copy-alist (aref info 3))) ) + ; treat boolean variables as having two explicit values + (let ( (bool (rassoc '("boolean") types)) ) + (when bool + (setq types (delete bool types)) + (setq values (append (list (cons "#t" "#t") (cons "#f" "#f")) values)))) + + (let* ( (pair (assoc var sgml-dsssl-customize)) + (current (cdr pair)) + (choice nil) ) + + ; treat variables with just one type without popup-menu + (if (and (null values) (equal 1 (length types))) + (setq choice (cdr (nth 0 types))) + + ; create a popup-menu + (progn + ; mark the current value + (when current + (let ( (curval (rassoc current values)) ) + (if curval + (setcar curval (concat (car curval) " *")) + (setq values + (append values + (list (cons (concat current " *") current))))))) + (setq choice (sgml-popup-menu event (nth 0 desc) (append values types))))) + + ; now choice is the value we have to analyze + (cond + ((stringp choice) + (sgml-dsssl-set-variable var choice)) + ((and choice (listp choice)) + (sgml-dsssl-set-variable var nil (car choice))))))) + +(defun sgml-dsssl-set-variable (&optional var val type) + (interactive) + (unless var + (setq var (completing-read "Variable/Characteristic: " + sgml-dsssl-customize nil t))) + (let ( (pair (assoc var sgml-dsssl-customize)) ) + (unless val + (let* ( (info (cdr (assoc var sgml-dsssl-customize-info))) + (desc (aref info 0)) + (current (cdr pair)) + (types (aref info 2)) + (values (aref info 3)) + (l nil) ) + (when (and (null type) + (equal 1 (length types))) + (setq type (nth 0 (cdr (nth 0 types))))) + (with-output-to-temp-buffer "*Help*" + (cond + (type (princ (concat "Please enter a new value of type " type + "\n(or a DSSSL expression of that type) "))) + ; in this case we know that types is of length > 1. + (types (princ "Please enter a new value of type ") + (setq l types) + (while l + (princ (nth 0 (cdr (car l)))) + (setq l (cdr l)) + (when l (princ " or "))) + (princ "\n(or a DSSSL expression of one of that types) ")) + (t (princ "Please choose a new value among ") + (setq l values) + (while l + (princ (cdr (nth 0 l))) + (setq l (cdr l)) + (when l (princ ", "))))) + (if (equal 'variable (aref info 4)) + (princ (concat "\nfor the variable `" var "' (" (nth 0 desc) ").\n")) + (princ (concat "\nfor the characteristic `" var "' (" + (nth 0 desc) ").\n"))) + (princ (concat "The current value of `" var "' is " + (or current "unspecified") ".\n\n")) + (when (nth 1 desc) (princ (nth 1 desc)))) + (setq val (completing-read "Value: " (unless type values) + nil (null types) current)))) + (setcdr pair val))) + +;;; my ideas for additions to psgml-edit.el + +(defun sgml-entity-under-point () + "Return the entity found whose name is under point or nil. If there is an +entity, leave point after ERO, else don't move point." + (sgml-with-parser-syntax + (let ( (pnt (point)) + (entity) ) + (when (or (sgml-parse-delim "ERO") + (progn (search-backward-regexp "[&>;]") + (sgml-parse-delim "ERO"))) + (setq pnt (point)) + (setq sgml-markup-start (- (point) (length "&"))) + (setq entity (sgml-lookup-entity + (sgml-parse-name t) + (sgml-dtd-entities (sgml-pstate-dtd + sgml-buffer-parse-state))))) + + (goto-char pnt) + entity + ) + ) + ) + +(defun sgml-edit-external-entity () + "Open a new window and display the external entity at the point." + (interactive) + (sgml-need-dtd) + (save-excursion + (sgml-with-parser-syntax + (setq sgml-markup-start (point)) + (unless (sgml-parse-delim "ERO") + (search-backward-regexp "[&>;]") + (setq sgml-markup-start (point)) + (sgml-check-delim "ERO")) + (sgml-parse-to-here) ; get an up-to-date parse tree + (let* ( (parent (buffer-file-name)) ; used to be (sgml-file) + (ename (sgml-check-name t)) + (entity (sgml-lookup-entity ename + (sgml-dtd-entities + (sgml-pstate-dtd + sgml-buffer-parse-state)))) + (buffer nil) + (ppos nil)) + (unless entity + (error "Undefined entity %s" ename)) + (unless (and (eq (sgml-entity-type entity) 'text) + (not (stringp (sgml-entity-text entity)))) + (error "The entity %s is not an external text entity" ename)) + + ;; here I try to construct a useful value for + ;; `sgml-parent-element'. + + ;; find sensible values for the HAS-SEEN-ELEMENT part + (let ((seen nil) + (child (sgml-tree-content sgml-current-tree))) + (while (and child + (sgml-tree-etag-epos child) + (<= (sgml-tree-end child) (point))) + (push (sgml-element-gi child) seen) + (setq child (sgml-tree-next child))) + (push (nreverse seen) ppos)) + + ;; find ancestors + (let ((rover sgml-current-tree)) + (while (not (eq rover sgml-top-tree)) + (push (sgml-element-gi rover) ppos) + (setq rover (sgml-tree-parent rover)))) + + (find-file-other-window + (sgml-external-file (sgml-entity-text entity) + (sgml-entity-type entity) + (sgml-entity-name entity))) + (goto-char (point-min)) + (sgml-mode) + (setq sgml-parent-document (cons parent ppos)) + ;; update the live element indicator of the new window + (sgml-parse-to-here))))) + +(defun sgml-edit-external-entity-mouse (event) + (interactive "e") + (mouse-set-point event) + (sgml-edit-external-entity) +) + +(defun sgml-expand-entity-reference-mouse (event) + (interactive "e") + (mouse-set-point event) + (sgml-expand-entity-reference) +) + +(define-key sgml-mode-map [S-mouse-1] 'sgml-edit-external-entity-mouse) +(define-key sgml-mode-map [S-double-mouse-1] 'sgml-expand-entity-reference-mouse) + +;;;; Autoload + +(autoload 'sgml-dsssl-make-spec "psgml-dsssl" nil t) +(autoload 'sgml-options-menu "psgml-edit" nil t) +(autoload 'sgml-with-parser-syntax "psgml-parse" nil t) + +;;;; Provide + +(provide 'psgml-jade) + +;;; psgml-jade.el ends here + --- openjade-1.4devel1.orig/contrib/rtf2doc.pl +++ openjade-1.4devel1/contrib/rtf2doc.pl @@ -0,0 +1,49 @@ +#! /usr/bin/perl -w +# Copyright (C) 1999 Avi Kivity + +sub usage +{ + print <<__USAGE__; +Usage: rtf2doc.pl FILE... + Converts one or more MS .rtf FILEs to MS Word .doc files. + Requires MS Word 97 or above, plus correct phase of moon. +__USAGE__ +} + +usage(), exit 0 + if ($#ARGV < 0) || ($ARGV[0] =~ /^((-h)|(--help))$/); + +use Cwd; +use Win32::OLE; +use Win32::OLE::Const 'Microsoft Word'; + +$cwd = cwd(); + +@storytypes = ( 4, 3, 8, 6, 11, 10, 2, 1, 9, 7, 5 ); +my $Word = Win32::OLE->new('Word.Application', 'Quit'); +die "Cannot open MS Word\n" unless $Word; + +foreach (@ARGV) { + my $src = $_; + $src = "$cwd\\$src" + unless $src =~ /^(.:\\)/; + my $tgt = "$src.doc"; + my $Doc = $Word->Documents->Open($src); + die "Cannot open $src\n" unless $Doc; + $Doc->Repaginate(); + $Stories = $Doc->StoryRanges; + for $s (@storytypes) { + eval { + local $SIG{__WARN__} = {}; + $Story = $Stories->Item($s); + if ($Story) { + $Story->Fields->Update(); + $Story->Fields->Unlink(); + } + }; + } + $Doc->SaveAs($tgt, 0); + $Doc->Close(); +} + +$Word->Quit(); --- openjade-1.4devel1.orig/contrib/transform.dsl +++ openjade-1.4devel1/contrib/transform.dsl @@ -0,0 +1,73 @@ + + + + + + + + +(declare-flow-object-class element + "UNREGISTERED::James Clark//Flow Object Class::element") +(declare-flow-object-class empty-element + "UNREGISTERED::James Clark//Flow Object Class::empty-element") +(declare-flow-object-class document-type + "UNREGISTERED::James Clark//Flow Object Class::document-type") +(declare-flow-object-class entity + "UNREGISTERED::James Clark//Flow Object Class::entity") +(declare-flow-object-class entity-ref + "UNREGISTERED::James Clark//Flow Object Class::entity-ref") +(declare-flow-object-class formatting-instruction + "UNREGISTERED::James Clark//Flow Object Class::formatting-instruction") +(declare-characteristic preserve-sdata? + "UNREGISTERED::James Clark//Characteristic::preserve-sdata?" #f) + +(define (empty-element? #!optional (nd (current-node))) + (node-property 'must-omit-end-tag? nd) +) + +(define (element-attributes #!optional (nd (current-node))) + (let loop ((atts (named-node-list-names (attributes nd)))) + (if (null? atts) + '() + (let* + ( + (name (car atts)) + (value (attribute-string name nd)) + ) + (if value + (cons (list name value) (loop (cdr atts))) + (loop (cdr atts)) + ) + ) + ) + ) +) + +(define (copy-element #!optional (node (current-node))) + (if (empty-element? node) + (make empty-element attributes: (element-attributes node)) + (make element attributes: (element-attributes node)) + ) +) + +(mode identity-transform + (default (copy-element)) +) --- openjade-1.4devel1.orig/debian/README.Debian +++ openjade-1.4devel1/debian/README.Debian @@ -0,0 +1,23 @@ +openjade for Debian +------------------------------ + +This document covers the Debian version of OpenJade. + +For information on using these packages, see the included HTML +documentation. It also includes links to other sites, for more +information about SGML or DSSSL. Also see: + + Jade home page (OpenJade's parent) + Robin Cover's SGML/XML/DSSSL pages + Mulberry DSSSL docs and cookbook + + An auto-FAQ for Jade and DSSSL + W3O, a standards body + Discussion of the HTML backend + + +See the task-sgml and task-sgml-dev packages for other useful Debian +SGML packages. + +.....Adam Di Carlo....adam@onShore.com..... + --- openjade-1.4devel1.orig/debian/changelog +++ openjade-1.4devel1/debian/changelog @@ -0,0 +1,298 @@ +openjade (1.4devel1-21.3) unstable; urgency=low + + * Non-maintainer upload. + * Pass -fno-lifetime-dse to GCC to work around invalid assumptions about + object lifetimes (closes: #823419). Thanks to Daniel Schepler for the bug + report. + + -- Jakub Wilk Sat, 01 Oct 2016 17:01:25 +0200 + +openjade (1.4devel1-21.2) unstable; urgency=medium + + * Non-maintainer upload. + * Move to debhelper compat level 9. (Closes: #817606) + - Don't use brace expansion in debian/libostyle-dev.install. + + -- Chris Lamb Sun, 25 Sep 2016 14:09:33 +0200 + +openjade (1.4devel1-21.1) unstable; urgency=medium + + [ Wookey ] + * Add acinclude.m4 macro to find correct intlh header whether or + not gettext is present (Closes: #748626, #759100) + * Update rules file to use dh-autoreconf rather than manual commands + and update configure.in enough for autoreconf to work + + [ Andreas Barth ] + * Non-maintainer upload. + * Update configure.in to set PACKAGE_TARNAME to mixed case. + * Create po/Makevars with copyright hint to individual pot files + and DOMAIN=jade. + + -- Andreas Barth Sun, 24 Aug 2014 12:47:55 +0000 + +openjade (1.4devel1-21) unstable; urgency=low + + * Added dependency on libperl4-corelibs-perl for getopts.pl. (Closes: + #724728). + * Added explicit dependency on libostyle1c2 to libostyle-dev to ensure + there are no broken symlinks when installed. (Closes: #715098). + * Added man page to update-alternatives. (Closes: #662887). + + -- Neil Roeth Sat, 12 Oct 2013 21:09:50 -0400 + +openjade (1.4devel1-20.1) unstable; urgency=low + + * Non-maintainer upload. + * Fix "FTBFS: make[1]: *** No targets specified and no makefile found. + Stop.": fix target dependencies in debian/rules. + (Closes: #666346) + + -- gregor herrmann Tue, 01 May 2012 17:27:19 +0200 + +openjade (1.4devel1-20) unstable; urgency=low + + * Resolved lintian warnings: + - about shlibs + - added debian/source/format + - added build-arch and build-indep target to debian/rules + * Updated to policy 3.9.2.0: + - Removed obsolete -D_REENTRANT option. + * Removed unnecessary lintian override. + + -- Neil Roeth Sat, 06 Aug 2011 10:43:48 -0400 + +openjade (1.4devel1-19.1) unstable; urgency=low + + * Non-maintainer upload. + * Build with -fpermissive to fix build failure with GCC 4.6 + (Closes: #624872). + * Don't ship .la files. + + -- Luk Claes Fri, 01 Jul 2011 19:39:11 +0200 + + +openjade (1.4devel1-19) unstable; urgency=low + + * Ensure it builds with g++ 4.3 + + -- Neil Roeth Thu, 24 Jul 2008 07:46:05 -0400 + +openjade (1.4devel1-18) unstable; urgency=low + + * debian/rules: COPYING inadvertently was changed to GPL, which applies + to debian/ dir, not whole package. Reverted back to COPYING from + upstream, which appears to be BSD-derived. Does away with cmp that + caused FTBFS in prior Debian version. + + -- Neil Roeth Thu, 31 Aug 2006 21:33:06 -0400 + +openjade (1.4devel1-17) unstable; urgency=low + + * debian/rules: Fix FTBFS, thanks to Julien Danjou (closes: #383772) + + -- Neil Roeth Sat, 19 Aug 2006 13:18:11 -0400 + +openjade (1.4devel1-16) unstable; urgency=low + + * Fixed "openjade: FTBFS: bashisms in debian/rules", thanks to Julien + Danjou (closes: #376481) + + -- Neil Roeth Mon, 3 Jul 2006 22:20:33 -0400 + +openjade (1.4devel1-15) unstable; urgency=low + + * Compiled against new libosp5. + + -- Neil Roeth Sun, 8 Jan 2006 07:59:04 -0500 + +openjade (1.4devel1-14) unstable; urgency=low + + * Added dh-buildinfo. + * Updated FSF location in COPYING. (closes: #314414) + * Update for g++ 4.0 transition - depend on libosp4c2. (closes: #321543) + * debian/rules: Backed optimization down from -O3 to -O2 to avoid ICE in + g++ while compiling GroveBuilder. + * Change "it's" to "its" in Description. (closes: #268534, #277258) + + -- Neil Roeth Mon, 8 Aug 2005 21:57:08 -0400 + +openjade (1.4devel1-13) unstable; urgency=low + + * Compiled against new libosp4. + * Moved debhelper compatibility level from debian/rules to debian/compat. + * Revamped debian/rules - used debhelper to simplify it greatly. + * Moved include files from openjade package to libostyle-dev package. + Added Conflicts: openjade (<< 1.4devel1-13) to libostyle-dev. + * Updated to Standards-Version: 3.6.1 (no changes). + * Depend on debhelper >= 4.1.75 to pick up bug fixes for dh_installcatalogs. + + -- Neil Roeth Thu, 23 Oct 2003 22:50:37 -0400 + +openjade (1.4devel1-12) unstable; urgency=low + + * Cleaned up debian/rules: + - Set DH_COMPAT=4, debhelper version to (>=4). + - Used libtool 1.5 for autotools generated files, so C++ gets used for + linking, ensuring that libs get linked with libstdc++, and removed + gruesome sed hacks that were necessary to do this with libtool 1.4. + - Fixed copyright file: was a copy of GPL plus some text that referenced + /usr/share/common-licenses/GPL, now it is the actual copyright notice, + the reference, and the Debian copyright info. + - Let debhelper tools do shlibs and substvars generation instead of + explicitly doing it in rules. + - Added openjade-1.4devel1 man page (closes: #191738) + * Updated to Standards-Version: 3.6.0. + * Removed libtool from Build-Depends. + + -- Neil Roeth Thu, 7 Aug 2003 08:23:59 -0400 + +openjade (1.4devel1-11) unstable; urgency=low + + * Recognize 'noopt' instead of 'debug' in DEB_BUILD_OPTIONS. + * Changed section of libostyle-dev to libdevel. + * Remove use of autotools from regular package build. + * Added unicode/Makefile.am to replace Debian specific rules. + * Added contrib/Makefile.am in order to get transform.dsl into openjade + package. I find it useful, I suppose others might, too. + * Added *.gmo to files removed in clean target of makefile in subdir po. + They get built if not there, and were causing a binary file difference + error when building the package. + * Fixed improperly defined 'attribute' function in builtins.dsl; changed + parameter name from 'string' to 'name'. (closes: #145242) + * Incorporated patch to fix quoting of '&' in XML backend. Will push + upstream. (closes: #147073) + * Thanks to Toby Speight for the patches that closed the two bugs. + + -- Neil Roeth Sun, 27 Jul 2003 21:51:16 -0400 + +openjade (1.4devel1-10) unstable; urgency=low + + * Make new maintainer effective by actually changing Maintainer field in + control file. (closes: #171072) + + -- Neil Roeth Sun, 25 May 2003 12:20:13 -0400 + +openjade (1.4devel1-9) unstable; urgency=low + + * New maintainer (closes: #171072) + * Add/remove central catalog to/from super catalog. (closes: #191060) + * Removed unnecessary token pasting operator in Node.cxx so that it + compiles with g++ 3.3. (closes: #193219) + * Removed install-docs calls from postinst and prerm; they are already + handled by dh_installdocs. + + -- Neil Roeth Sun, 25 May 2003 10:02:51 -0400 + +openjade (1.4devel1-8.3) unstable; urgency=low + + * NMU + * Fix libostyle1.shlibs. Closes: #187543. + * Fix libostyle-dev dependencies. + + -- Daniel Schepler Fri, 4 Apr 2003 16:32:11 -0800 + +openjade (1.4devel1-8.2) unstable; urgency=low + + * NMU + * Remove manpage slave from openjade alternative, since it was now + creating a dangling symlink. + + -- Daniel Schepler Wed, 19 Mar 2003 04:31:57 -0800 + +openjade (1.4devel1-8.1) unstable; urgency=low + + * NMU + * Use updated msggen.pl from upstream CVS to allow compilation with + newer opensp versions. Closes: #159140. + (Upstream also changed the soname version with this patch, so I'm + doing the same.) + * Remove obsolete po/Makefile code from configure.in. + * g++-3.2 transition. Closes: #179709. + + -- Daniel Schepler Sun, 16 Mar 2003 18:34:24 -0800 + +openjade (1.4devel1-8) unstable; urgency=low + + * Added build-flag for hppa. Thanks to Lamont Jones. (closes: Bug#126852) + * Added patch (closes: Bug#108414) to fix some aspect of table creation. + + -- Chad Miller Thu, 21 Feb 2002 16:19:45 +0000 + +openjade (1.4devel1-7) unstable; urgency=low + + * Made openjade binary use alternatives system. + * Corrected registration of unicode catalog. Clobber any other version + at preinst. + + -- Chad Miller Mon, 17 Dec 2001 02:53:27 +0000 + +openjade (1.4devel1-6) unstable; urgency=low + + * Maintainer change. (closes: Bug#110802) + * Register and deregister catalog using update-catalog. (closes: Bug#108360) + * Changed to debhelper v3. + * Fixed control file var-subst on nonexistent package version. + * Named openjade's postinst and prerm to names that get included in the package. + (the real source of Bug#108360) + + -- Chad Miller Sun, 16 Dec 2001 16:41:00 +0000 + +openjade (1.4devel1-5) unstable; urgency=low + + * debian/control: fix override disparities in libostyle0 and + libostyle-dev + * debian/control: build-depends on gettext + closes: #105181 + * problem fixed a while ago where we weren't shipping the HTML + documentation + closes: #71093 + * Japanese translation added upstream + * debian/rules: make maintainer-clean upstream is incredibly fragile, + so tolerate errors there until that gets fixed + * debian/rules: during build, run libtoolize --force to replace this + libtoolize stuff, which is needed for arches which diverge from the + libtool stuff OpenSP ships with + * debian/rules, control: use dh_shlibdeps, remove some hand-rolled stuff + here which was unnecessary and in fact adding two libosp deps on the + opensp package, not to mention that it stopped working + + -- Adam Di Carlo Fri, 20 Jul 2001 11:08:45 -0400 + +openjade (1.4devel1-4) unstable; urgency=low + + * upstream changes from CVS, see NEWS + * debian/rules: compile with -O3 instead of -O2 to try to get this thing + faster; CXXFLAGS propogates to the library stuff properly now; remove + an extra licensing file (thanks, lintian); some improvements in clean + and cvs-build (snapshot building); run aclocal and autoheader, I think + this is proper -- it certainly inhibits some warnings + * debian/control: update standards to 3.5.0 (no changes required) + + -- Adam Di Carlo Fri, 2 Feb 2001 21:44:24 -0500 + +openjade (1.4devel1-3) unstable; urgency=low + + * upstream changes from CVS, see NEWS + * debian/rules: cope with DEB_BUILD_OPTIONS; stop building with -g by + default; fix setting of pkgdocdir when doing 'make install' + * debian/control: Policy compliant with 3.2.1 + + -- Adam Di Carlo Sat, 27 Jan 2001 15:03:29 -0500 + +openjade (1.4devel1-2) unstable; urgency=low + + * some upstream changes from cvs since the last release + * debian/rules: stop renaming unicode.sd to unicode.decl, based on a + related problem in jade; build with -g + + -- Adam Di Carlo Wed, 18 Oct 2000 00:13:25 -0400 + +openjade (1.4devel1-1) unstable; urgency=low + + * new package; upstream fork from James Clark's Jade package + (closes: Bug#41697) + + -- Adam Di Carlo Sat, 20 May 2000 12:55:44 -0400 + + --- openjade-1.4devel1.orig/debian/compat +++ openjade-1.4devel1/debian/compat @@ -0,0 +1 @@ +9 --- openjade-1.4devel1.orig/debian/control +++ openjade-1.4devel1/debian/control @@ -0,0 +1,49 @@ +Source: openjade +Section: text +Priority: optional +Maintainer: Neil Roeth +Homepage: http://openjade.sourceforge.net/ +Standards-Version: 3.9.2.0 +Build-Depends: libosp-dev (>= 1.5.1.0-2.1), debhelper (>= 9), dh-autoreconf, gettext, dh-buildinfo, libperl4-corelibs-perl + +Package: openjade +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Conflicts: libostyle-dev (<< 1.4devel1-14) +Suggests: doc-base, sgml-data +Description: Implementation of the DSSSL language + OpenJade is an implementation of the ISO/IEC 10179:1996 standard + DSSSL language. It is based on James Clark's Jade software. + . + The OpenJade processor, in conjunction with a DSSSL style sheet, is + capable of translating SGML documents into other formats. Output + formats currently supported are RTF, HTML, MIF, JadeTeX, or an XML + representation of the flow object tree. Using its own non-standard + system, it is also capable of transforming one SGML or XML DTD to + another. + . + Author: The OpenJade Team + +Package: libostyle1c2 +Architecture: any +Section: libs +Depends: ${shlibs:Depends}, ${misc:Depends} +Replaces: libostyle1 +Conflicts: libostyle1 +Description: Runtime libraries for OpenJade + OpenJade's shared libraries, runtime support. Includes libogrove, + providing an abstract interface to groves; libospgrove, an interface + to groves on top of the OpenSP suite; and libostyle, the actual DSSSL + style engine. + . + This shared library is used by the openjade package. + +Package: libostyle-dev +Architecture: any +Section: libdevel +Depends: libostyle1c2(= ${binary:Version}), ${misc:Depends} +Conflicts: openjade (<< 1.4devel1-14) +Description: OpenJade libraries, developer support + Contains include files and the static library for libogrove, + libospgrove, and libostyle. This is useful for those developing on + top of the OpenJade grove or DSSSL engine. --- openjade-1.4devel1.orig/debian/copyright.Debian +++ openjade-1.4devel1/debian/copyright.Debian @@ -0,0 +1,22 @@ + +----- + +The distribution license for OpenJade is the GNU General Public License (GPL) +version 2. You can find a copy of the GPL version 2 in +/usr/share/common-licenses/GPL-2. + +----- + +This package has borrowed heavily from the 'jade' package. It was originally +made into a Debian package by Adam Di Carlo and is now +maintained by Neil Roeth . + +The original source was downloaded from + and/or the CVS area at +cvs.openjade.sourceforge.net:/cvsroot/openjade . + +All materials under the 'debian' subdirectory are licensed under the GNU +General Public License (GPL) version 2 or later. You can find a copy of the +GPL in /usr/share/common-licenses/GPL on Debian systems. Any changes made +*not* under the 'debian' subdirectory are under the same license as the +software itself. --- openjade-1.4devel1.orig/debian/libostyle-dev.dirs +++ openjade-1.4devel1/debian/libostyle-dev.dirs @@ -0,0 +1,3 @@ +usr/lib +usr/include/OpenJade +usr/share/doc/libostyle-dev --- openjade-1.4devel1.orig/debian/libostyle-dev.install +++ openjade-1.4devel1/debian/libostyle-dev.install @@ -0,0 +1,3 @@ +debian/tmp/usr/include/OpenJade usr/include +debian/tmp/usr/lib/lib*.a usr/lib +debian/tmp/usr/lib/lib*.so usr/lib --- openjade-1.4devel1.orig/debian/libostyle1c2.dirs +++ openjade-1.4devel1/debian/libostyle1c2.dirs @@ -0,0 +1,2 @@ +usr/lib +usr/share/doc/libostyle1c2 --- openjade-1.4devel1.orig/debian/libostyle1c2.install +++ openjade-1.4devel1/debian/libostyle1c2.install @@ -0,0 +1,2 @@ +debian/tmp/usr/lib/lib*.so.[0-9].[0-9].[0-0] usr/lib +debian/tmp/usr/lib/lib*.so.[0-9] usr/lib --- openjade-1.4devel1.orig/debian/libostyle1c2.postinst +++ openjade-1.4devel1/debian/libostyle1c2.postinst @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e + +if [ "$1" = "configure" ]; then + ldconfig +fi + +#DEBHELPER# + +exit 0 --- openjade-1.4devel1.orig/debian/license.Debian +++ openjade-1.4devel1/debian/license.Debian @@ -0,0 +1,7 @@ + +----- + +The distribution license for OpenJade is the GNU General Public License (GPL) +version 2. You can find a copy of the GPL version 2 in +/usr/share/common-licenses/GPL-2. + --- openjade-1.4devel1.orig/debian/openjade.1 +++ openjade-1.4devel1/debian/openjade.1 @@ -0,0 +1,399 @@ +.\"Generated by db2man.xsl. Don't modify this, modify the source. +.de Sh \" Subsection +.br +.if t .Sp +.ne 5 +.PP +\fB\\$1\fR +.PP +.. +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Ip \" List item +.br +.ie \\n(.$>=3 .ne \\$3 +.el .ne 3 +.IP "\\$1" \\$2 +.. +.TH "OPENJADE" 1 "January 2002" "OpenJade" "" +.SH NAME +openjade \- apply a DSSSL stylesheet to an SGML or XML document +.SH "SYNOPSIS" +.ad l +.hy 0 +.HP 9 +\fBopenjade\fR [\fB\-vCegG2s\fR] [\fB\-b\ \fIencoding\fR\fR] [\fB\-f\ \fIerror_file\fR\fR] [\fB\-c\ \fIcatalog_sysid\fR\fR] [\fB\-D\ \fIdir\fR\fR] [\fB\-a\ \fIlink_type\fR\fR] [\fB\-A\ \fIarch\fR\fR] [\fB\-E\ \fImax_errors\fR\fR] [\fB\-i\ \fIentity\fR\fR] [\fB\-w\ \fIwarning_type\fR\fR] [\fB\-d\ \fIdsssl_spec\fR\fR] [\fB\-V\ \fIvariable[=\fIvalue\fR]\fR\fR] [\fB\-t\ \fIoutput_type\fR\fR] [\fB\-o\ \fIoutput_file\fR\fR] [\fB\fIsysid\fR\fR...] +.ad +.hy + +.SH "DESCRIPTION" + +.PP + \fBopenjade\fR is an implementation of the ISO/IEC 10179:1996 standard DSSSL language. The DSSSL engine receives as input an SGML or XML document and transforms it into formats like: + +.PP +* XML representation of the flow object tree. + +.PP +* RTF format that can be rendered and printed with Microsoft's free Word Viewer 97 + +.PP +* TeX format + +.PP +* MIF format that can be rendered and printed with Framemaker + +.PP +* SGML or XML format. This is used in conjunction with non\-standard flow object classes to generate SGML, thus allowing \fBopenjade\fR to be used for SGML/XML transformations. + +.PP +The system identifier of the document to be processed is specified as an argument to \fBopenjade\fR. If this is omitted, standard input will be read. + +.PP +\fBopenjade\fR determines the system identifier for the DSSSL specification as follows: + +.PP +1. If the \-d option is specified, it will use the argument as the system identifier. + +.PP +2. Otherwise, it will look for processing instructions in the prolog of the document. Two kinds of processing instruction are recognized: + +.PP + + +.PP +The system data of the processing instruction is parsed like an SGML start\-tag. It will be parsed using the reference concrete syntax whatever the actual concrete syntax of the document. The name that starts the processing instruction can be either stylesheet, xml\-stylesheet or xml:stylesheet. The processing instruction will be ignored unless the value of the type attribute is one of text/dsssl, text/x\-dsssl, application/dsssl, or application/x\-dsssl. The value of href attribute is the system identifier of the DSSSL specification. + +.PP + + +.PP +The system identifier is the portion of the system data of the processing instruction following the initial name and any whitespace. + +.PP +Although the processing instruction is only recognized in the prolog, it need not occur in the document entity. For example, it could occur in a DTD. The system identifier will be interpreted relative to where the the processing instruction occurs. + +.PP +3. Otherwise, it will use the system identifier of the document with any extension changed to .dsl. + +.PP +A DSSSL specification document can contain more than one style\-specification. If the system identifier of the DSSSL specification is followed by #id, then \fBopenjade\fR will use the style\-specification whose unique identifier is id. This is allowed both with the \fB\-d\fR option and with the processing instructions. + +.PP +The DSSSL specification must be an SGML document conforming to the DSSSL architecture. For an example, see \fIdsssl/demo.dsl\fR. + +.PP +\fBopenjade\fR supports the following options in addition to the normal OpenSP (see \fBonsgmls(1)\fR) options (note that all options are case\-sensitive, ie \fB\-g\fR and \fB\-G\fR are different options): + +.TP +\fB\-d \fIdsssl_spec\fR\fR +This specifies that dsssl_spec is the system identifier of the DSSSL specification to be used. + +.TP +\fB\-G\fR +Debug mode. When an error occurs in the evaluation of an expression, \fBopenjade\fR will display a stack trace. Note that this disables tail\-call optimization. + +.TP +\fB\-c \fIfilename\fR\fR +The filename arguments specify catalog files rather than the document entity. The document entity is specified by the first DOCUMENT entry in the catalog files. + +.TP +\fB\-s\fR +Strict compliance mode. Currently the only effect is that jade doesn't use any predefined character names, sdata\-entity mappings or name\-characters. This is useful for checking that your stylesheet is portable to other DSSSL implementations and that it is strictly compliant to the DSSSL specifications. + +.TP +\fB\-t \fIoutput_type\fR\fR +\fIoutput_type\fR specifies the type of output as follows: + +\fBfot \fR An XML representation of the flow object tree + +\fBrtf\fR \fBrtf\-95 \fR RTF (used for SGML/XML to RTF transformations) Microsoft's Rich Text Format. rtf\-95 produces output optimized for Word 95 rather than Word 97. + +\fBtex\fR TeX (used for SGML/XML to TeX transformations) + +\fBsgml\fR \fBsgml\-raw\fR SGML (used for SGML/XML to SGML transformations). sgml\-raw doesn't emit linebreaks in tags. + +\fBxml\fR \fBxml\-raw\fR XML (used for SGML/XML to XML transformations). xml\-raw doesn't emit linebreaks in tags. + +\fBhtml \fR HTML (used for SGML/XML to HTML transformations) + +\fBmif\fR MIF (used for SGML/XML to MIF transformations) + +.TP +\fB\-o \fIoutput_file\fR\fR +Write output to \fIoutput_file\fR instead of the default. The default filename is the name of the last input file with its extension replaced by the name of the type of output. If there is no input filename, then the extension is added onto jade\-out. + +.TP +\fB\-V \fIvariable\fR\fR +This is equivalent to doing (define variable #t) except that this definition will take priority over any definition of variable in a style\-sheet. + +.TP +\fB\-V \fIvariable=value\fR\fR +This is equivalent to doing (define \fIvariable\fR "\fIvalue\fR") except that this definition will take priority over any definition of variable in a style\-sheet. + +.TP +\fB\-V (define \fIvariable\fR \fIvalue\fR)\fR +This is equivalent to doing (define variable value) except that this definition will take priority over any definition of variable in a style\-sheet. Note that you will probably have to use some escaping mechanism for the spaces to get the entire scheme expression parsed as one cmdline argument. + +.TP +\fB\-w\fItype\fR\fR +Control warnings and errors. Multiple \fB\-w\fR options are allowed. The following values of type enable warnings: + +\fBxml\fR Warn about constructs that are not allowed by XML. + +\fBmixed\fR Warn about mixed content models that do not allow #pcdata anywhere. + +\fBsgmldecl\fR Warn about various dubious constructions in the SGML declaration. + +\fBshould\fR Warn about various recommendations made in ISO 8879 that the document does not comply with. (Recommendations are expressed with ``should'', as distinct from requirements which are usually expressed with ``shall''.) + +\fBdefault\fR Warn about defaulted references. + +\fBduplicate\fR Warn about duplicate entity declarations. + +\fBundefined\fR Warn about undefined elements: elements used in the DTD but not defined. + +\fBunclosed\fR Warn about unclosed start and end\-tags. + +\fBempty\fR Warn about empty start and end\-tags. + +\fBnet\fR Warn about net\-enabling start\-tags and null end\-tags. + +\fBmin\-tag\fR Warn about minimized start and end\-tags. Equivalent to combination of unclosed, empty and net warnings. + +\fBunused\-map\fR Warn about unused short reference maps: maps that are declared with a short reference mapping declaration but never used in a short reference use declaration in the DTD. + +\fBunused\-param\fR Warn about parameter entities that are defined but not used in a DTD. Unused internal parameter entities whose text is INCLUDE or IGNORE won't get the warning. + +\fBnotation\-sysid\fR Warn about notations for which no system identifier could be generated. + +\fBall\fR Warn about conditions that should usually be avoided (in the opinion of the author). Equivalent to: mixed, should, default, undefined, sgmldecl, unused\-map, unused\-param, empty and unclosed. + +A warning can be disabled by using its name prefixed with no\-. Thus \fB\-wall\fR \fB\-wno\-duplicate\fR will enable all warnings except those about duplicate entity declarations. + +The following values for \fIwarning_type\fR disable errors: + +\fBno\-idref\fR Do not give an error for an ID reference value which no element has as its ID. The effect will be as if each attribute declared as an ID reference value had been declared as a name. + +\fBno\-significant\fR Do not give an error when a character that is not a significant character in the reference concrete syntax occurs in a literal in the SGML declaration. This may be useful in conjunction with certain buggy test suites. + +\fBno\-valid\fR Do not require the document to be type\-valid. This has the effect of changing the SGML declaration to specify VALIDITY NOASSERT and IMPLYDEF ATTLIST YES ELEMENT YES. An option of \fB\-wvalid\fR has the effect of changing the SGML declaration to specify VALIDITY TYPE and IMPLYDEF ATTLIST NO ELEMENT NO. If neither \fB\-wvalid\fR nor \fB\-wno\-valid\fR are specified, then the VALIDITY and IMPLYDEF specified in the SGML declaration will be used. + +.SH "ENVIRONMENT" + +.PP +OpenJade ignores the SP_CHARSET_FIXED and SP_SYSTEM_CHARSET environment variables and always uses Unicode as its internal character set, as if SP_CHARSET_FIXED was 1 and SP_SYSTEM_CHARSET was unset. Thus only the SP_ENCODING environment variable is relevant to OpenJade's handling of character sets. + +.SH "OPENJADE EXTENSIONS" + +.PP +The following external procedures are available. These external procedures are defined by a prototype in the same manner as in the standard. To use one of these external procedures, you must make use of the standard external\-procedure procedure, using a public identifier of "UNREGISTERED::James Clark//Procedure::name" where name is the name given here, typically by including the following in the DSSSL specification: + +.PP +(define name (external\-procedure "UNREGISTERED::James Clark//Procedure::name")) + +.PP +Note that external\-procedure returns #f if it doesn't know about the specified public identifier. You can use this to enable your DSSSL specifications to work gracefully with other implementations which do not support these extensions. + +.PP +For external procedures added by the OpenJade team, use a public identifier of the form "UNREGISTERED::OpenJade//Procedure::name". + +.PP +An easy way to get access to all external procedures is to use the style specification dsssl/extensions.dsl#procedures. The file dsssl/extensions.dsl also contains style specifications which make the nonstandard flow object classes and inherited characteristics supported by the backends available in a convenient way. + +.PP +\fBDebugging\fR + +.PP +(debug obj) + +.PP +Generates a message including the value of obj and then returns obj. + +.PP +\fBSimple\-page\-sequence header/footer control\fR + +.PP +(if\-first\-page sosofo1 sosofo2) + +.PP +This can be used only in the specification of the value of one of the header/footer characteristics of simple\-page\-sequence. It returns a sosofo that will display as sosofo1 if the page is the first page of the simple\-page\-sequence and as sosofo2 otherwise. + +.PP +(if\-front\-page sosofo1 sosofo2) + +.PP +This can be used only in the specification of the value of one of the header/footer characteristics of simple\-page\-sequence. It returns a sosofo that will display as sosofo1 if the page is a front (ie recto, odd\-numbered) page and as sosofo2 if it is a back (ie verso, even\-numbered) page. + +.PP +\fBNumbering\fR + +.PP +(all\-element\-number) + +.PP +(all\-element\-number osnl) + +.PP +This is the same as element\-number except it counts elements with any generic identifier. If osnl is not an element returns #f, otherwise returns 1 plus the number of elements that started before osnl. This provides an efficient way of creating a unique identifier for any element in a document. + +.PP +\fBExternal entity access\fR + +.PP +(read\-entity string) + +.PP +This returns a string containing the contents of the external entity with system identifier string. This should be used only for textual entities (CDATA and SDATA), and not for binary entities (NDATA). + +.PP +\fBPOSIX locale access\fR + +.PP +(language lang country) + +.PP +This procedure returns an object of type language, if the system supports the specified language. lang is a string or symbol giving the two letter language code. country is a string or symbol giving the two letter country code. + +.PP +This procedure uses POSIX locales. It is an OpenJade addition. It is not supported on all operating systems. + +.PP +\fBExtended standard procedures\fR + +.PP +(sgml\-parse sysid #!key active: parent: architecture:) + +.PP +This allows you to specify an SGML architecture with respect to which the document should be parsed. It is an OpenJade addition. + +.PP +(expt q k) + +.PP +This allows you to raise a quantity to an integral power. It is an OpenJade addition. + +.SH "LIMITATIONS" + +.PP +This section describes the limitations of the front\-end (the general\-purpose DSSSL engine); each backend also has its own limitations. + +.PP +\fBopenjade\fR doesn't allow internal definitions at the beginning of bodies and the (test => recipient) variant of cond clauses. + +.PP +\fBopenjade\fR supports only a single, fixed grove plan which comprises the following modules: + +.PP +* baseabs + +.PP +* prlgabs0 + +.PP +* prlgabs1 + +.PP +* instabs + +.PP +* basesds0 + +.PP +* instsds0 + +.PP +* subdcabs + +.PP +It doesn't implement the following parts of SDQL: HyTime support, auxiliary parsing, node regular expressions. + +.PP +Query rules, sosofo synchronization, indirect sosofos, reference values, decoration areas and font properties are not supported. + +.PP +Note that only inherited characteristics that are applicable to some supported flow object can be specified. + +.PP +\fBCharacter/glyph handling\fR + +.PP +It only supports a single pre\-defined character repertoire. A character name of the form U\-XXXX where XXXX are four upper\-case hexadecimal digits, is recognized as referring to the Unicode character with that code. For many characters, it is also possible to use the ISO/IEC 10646 name in lower\-case with words separated by hyphens. + +.PP +Some common SDATA entity names from the ISO entity sets are recognized and mapped to characters. In addition an SDATA entity name of the form U\-XXXX, where XXXX are four upper\-case hexadecimal digits, is mapped to the Unicode character with that code. + +.PP +OpenJade now supports the standard\-chars, map\-sdata\-entity, add\-name\-chars, add\-separator\-chars and char\-repertoire declaration element forms, allowing a style\-sheet to define additional character names, sdata entity mappings, name characters (i.e. characters allowed in identifiers) and separator characters. Currently the only recognized character repertoire is the built\-in repertoire. It has the public identifier "UNREGISTERED::OpenJade//Character Repertoire::OpenJade". + +.PP +\fBValidation\fR + +.PP +Several things that it would be desirable to have checked aren't checked: + +.PP +* When the allowed value of an inherited characteristic is a symbol, OpenJade checks only that the value is a symbol that is allowed as the value of some characteristic; #t and #f are treated as a special kind of symbol in this case. + +.PP +* OpenJade doesn't check whether a flow object is occurring in a context where it is allowed. + +.PP +* OpenJade does not prevent flow objects being attached to the principal port of a flow object when the flow object shouldn't have a principal port. + +.PP +* Most type\-checking is done at run\-time not compile\-time. + +.PP +* OpenJade does not check for non\-inherited characteristics that are required to be specified. + +.PP +* It doesn't check that optional features that have been used were declared in the features form. + +.PP +\fBOther limitations\fR + +.PP +The following primitives are just stubs: + +.PP +\fBchar\-script\-case\fR Always returns last argument. + +.PP +\fBaddress\-visited?\fR Always returns #f. + +.SH "EXAMPLES" + +.PP +Given an SGML file \fBfile.sgml\fR, use the stylesheet \fBfile.dsl\fR and publish as an rtf file. + +.PP +openjade \-t rtf file.sgml + +.PP +Using a different stylesheet: + +.PP +openjade \-t rtf \-d docbook.dsl file.sgml + +.PP +Using the \fBprint\fR style specification contained within the stylesheet + +.PP +openjade \-t rtf \-d docbook.dsl#print file.sgml + +.PP +And use the html specification within the style sheet to convert to html + +.PP +openjade \-t sgml \-i html \-d docbook.dsl#html file.sgml + +.SH "SEE ALSO" + +.PP +\fBonsgmls(1)\fR + +.SH AUTHORS +James Clark, Ian Castle . --- openjade-1.4devel1.orig/debian/openjade.dirs +++ openjade-1.4devel1/debian/openjade.dirs @@ -0,0 +1,11 @@ +usr/bin +usr/share/man/man1 +usr/share/doc/openjade +usr/share/doc/openjade/images +usr/share/sgml/OpenJade +usr/share/sgml/OpenJade/contrib +usr/share/sgml/OpenJade/unicode +usr/share/locale/de/LC_MESSAGES +usr/share/locale/ja/LC_MESSAGES +usr/share/locale/sv/LC_MESSAGES +usr/share/doc-base --- openjade-1.4devel1.orig/debian/openjade.doc-base +++ openjade-1.4devel1/debian/openjade.doc-base @@ -0,0 +1,13 @@ +Document: openjade +Title: OpenJade Users Manual +Author: James Clark , Open Jade Development Group +Abstract: Users manual and documentation for OpenJade. + OpenJade is an implementation of the DSSSL style language. + This allows you to flexibly format SGML and XML data to + media-specific back-ends, including TeX, RTF, MIF, HTML, + and other XML or SGML files. +Section: Text + +Format: HTML +Index: /usr/share/doc/openjade/index.htm +Files: /usr/share/doc/openjade/*.htm --- openjade-1.4devel1.orig/debian/openjade.docs +++ openjade-1.4devel1/debian/openjade.docs @@ -0,0 +1,7 @@ +debian/README.Debian +debian/tmp/usr/share/doc/OpenJade/AUTHORS +debian/tmp/usr/share/doc/OpenJade/README +debian/tmp/usr/share/doc/OpenJade/NEWS +debian/tmp/usr/share/doc/OpenJade/images +debian/tmp/usr/share/doc/OpenJade/doc/*.htm +debian/tmp/usr/share/doc/OpenJade/demo.* --- openjade-1.4devel1.orig/debian/openjade.install +++ openjade-1.4devel1/debian/openjade.install @@ -0,0 +1,3 @@ +debian/tmp/usr/bin/openjade-1.4devel usr/bin +debian/tmp/usr/share/OpenJade usr/share/sgml +debian/tmp/usr/share/locale usr/share --- openjade-1.4devel1.orig/debian/openjade.manpages +++ openjade-1.4devel1/debian/openjade.manpages @@ -0,0 +1 @@ +debian/tmp/usr/share/man/man1/openjade-1.4devel.1 --- openjade-1.4devel1.orig/debian/openjade.postinst +++ openjade-1.4devel1/debian/openjade.postinst @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +case "$1" in + configure) + ## alternatives + update-alternatives --quiet --install \ + /usr/bin/openjade openjade /usr/bin/openjade-1.4devel 20 \ + --slave /usr/share/man/man1/openjade.1.gz openjade.1.gz /usr/share/man/man1/openjade-1.4devel.1.gz + ;; +esac + +#DEBHELPER# + +exit 0 --- openjade-1.4devel1.orig/debian/openjade.prerm +++ openjade-1.4devel1/debian/openjade.prerm @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +case "$1" in + remove|deconfigure|upgrade) + ## alternatives system + update-alternatives --quiet --remove \ + openjade /usr/bin/openjade-1.4devel + ;; + +esac + +#DEBHELPER# + +exit 0 --- openjade-1.4devel1.orig/debian/openjade.sgmlcatalogs +++ openjade-1.4devel1/debian/openjade.sgmlcatalogs @@ -0,0 +1 @@ +debian/tmp/usr/share/OpenJade/catalog /usr/share/sgml/OpenJade/catalog --- openjade-1.4devel1.orig/debian/rules +++ openjade-1.4devel1/debian/rules @@ -0,0 +1,180 @@ +#!/usr/bin/make -f + +export DH_VERBOSE=1 + +pkg := openjade +pkg-openjade := $(pkg) +pkg-libostyle := libostyle1c2 +pkg-libostyle-dev := libostyle-dev + +# build tool abstraction +install_ := install -o root -g root -p +install_file := install -o root -g root -m 644 -p +install_script := install -o root -g root -m 755 -p +install_program := install -o root -g root -m 755 -p +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + install_program += --strip +endif +make_directory := install -d -o root -g root -m 755 +compress := gzip -9f + +CFLAGS := -g --pipe +CXXFLAGS := -g --pipe -fpermissive +ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O2 + CXXFLAGS += -O2 +else + CFLAGS += -O0 + CXXFLAGS += -O0 +endif +ifneq (,$(findstring hppa,$(DEB_BUILD_ARCH))) + CFLAGS += -ffunction-sections + CXXFLAGS += -ffunction-sections +endif +CXXFLAGS += -fno-lifetime-dse # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69534 +export CFLAGS +export CXXFLAGS + +# flags to get automake to use the above +inst_flags := INSTALL='$(install_)' +inst_flags += INSTALL_PROGRAM='$(install_program)' +inst_flags += INSTALL_SCRIPT='$(install_script)' +inst_flags += INSTALL_DATA='$(install_file)' + +# first version of package providing the right shlibs +SHLIBS_PKGVER := 1.4devel1-11 + +# # extra docs we don't want +# DOCS_TOO_MUCH := ABOUT-NLS COPYING copying.txt ChangeLog + +# determine our version numbers +SRC_VERSION := $(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | sed 's/^Version: *//') +UPSTREAM_VERSION:= $(shell echo $(SRC_VERSION) | sed -e 's/^\(.*\)-[^-]*$$/\1/') +# stuff for snapshot/cvs building +root_cmd := sudo +deb_build := dpkg-buildpackage -pgpg -r$(root_cmd) -b +cvs_build_dir := $(HOME)/debian/$(pkg-openjade) +cvs_ver_build_dir := $(cvs_build_dir)/$(pkg-openjade)-$(UPSTREAM_VERSION) +cvs_pure_src_dir := .. +cvs_pure_src := $(pkg-openjade) + +# cvs snapshot building +cvs-build: clean + [ -d $(cvs_pure_src_dir)/$(cvs_pure_src)/CVS ] || exit 1 + $(root_cmd) rm -rf $(cvs_ver_build_dir) +# rm -f $(cvs_build_dir)/$(pkg-openjade)_$(UPSTREAM_VERSION).orig.tar.gz +# don't do cvs up or make the changelog + install -d -m 755 $(cvs_ver_build_dir) +# GZIP=-9 tar czf $(cvs_build_dir)/$(pkg-openjade)_$(UPSTREAM_VERSION).orig.tar.gz -C $(cvs_pure_src_dir) --exclude CVS $(cvs_pure_src) + tar cf - --exclude CVS . | tar xf - -C $(cvs_ver_build_dir) + [ -f ChangeLog ] || cvs2cl -r -t -b + cp ChangeLog $(cvs_ver_build_dir)/ + cd $(cvs_ver_build_dir) && $(deb_build) + +ChangeLog: + [ ! -e OpenJade-$(UPSTREAM_VERSION) ] + [ -f $(cvs_pure_src_dir)/$(pkg-openjade)_$(UPSTREAM_VERSION).orig.tar.gz ] + tar -xzvf $(cvs_pure_src_dir)/$(pkg-openjade)_$(UPSTREAM_VERSION).orig.tar.gz OpenJade-1.4devel/ChangeLog + mv OpenJade-1.4devel/ChangeLog . + rm -r OpenJade-1.4devel + +clean: + dh_testdir + rm -f debian/buildinfo + [ ! -f Makefile ] || $(MAKE) distclean || true + rm -f po/*.gmo + find . -type l | xargs rm -f + dh_clean configure-stamp build-stamp install-stamp debian/copyright + # The build process doesn't handle this properly, force a rebuild + -rm -f style/InterpreterMessages.cxx style/InterpreterMessages.h \ + style/DssslAppMessages.h jade/JadeMessages.h \ + jade/RtfMessages.h jade/HtmlMessages.h jade/TeXMessages.h \ + jade/MifMessages.h + dh_autoreconf_clean + rm -f debian/*.debhelper.log + +configure: configure-stamp +configure-stamp: + dh_autoreconf + dh_buildinfo generate cat + ./configure --prefix=/usr --enable-http --enable-shared --enable-static + touch $@ + + +build: build-arch build-indep +build-arch: build-stamp +build-indep: build-stamp +build-stamp: configure-stamp + dh_testdir jade + $(MAKE) SUBDIRS="grove spgrove style" + $(MAKE) + touch $@ + + +# Upstream copyright notice only appears in README; for Debian, it must be in +# copyright file. COPYING is the license, which appears to be BSD derived +# (similar wording, with "Regents" changed to "James Clark"). Create +# debian/copyright with all the right information. +debian/copyright: README debian/license.Debian debian/copyright.Debian + cat $^ > $@ + +# Install into DESTDIR, then move everything later. CURDIR is set by make. +DESTDIR = $(CURDIR)/debian/tmp +export DESTDIR +install: build install-stamp +install-stamp: + dh_testdir + dh_testroot + dh_clean -k + $(MAKE) install $(inst_flags) + touch $@ + +clean-install: + rm -fr debian/tmp + rm install-stamp + +binary-indep: install +# There are no architecture-independent binary packages generated from this +# source package. + +binary-arch: install debian/copyright debian/README.Debian + dh_testdir + dh_testroot + rm -f debian/*.debhelper + dh_clean -X tmp -d + + dh_installdirs + dh_installdocs + dh_installchangelogs -A ChangeLog + + mkdir -p $(DESTDIR)/usr/share/man/man1 && \ + cp -p debian/openjade.1 \ + $(DESTDIR)/usr/share/man/man1/openjade-1.4devel.1 + dh_installman -p openjade + + cp -p $(DESTDIR)/usr/bin/openjade $(DESTDIR)/usr/bin/openjade-1.4devel + dh_install + + dh_installcatalogs + + dh_strip -a + dh_compress -a + dh_fixperms -a + dh_makeshlibs + dh_shlibdeps -L $(pkg-libostyle) -l debian/$(pkg-libostyle)/usr/lib + + dh_buildinfo install + + dh_installdeb + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch + +.PHONY: clean build install binary-indep binary-arch binary + +# vim: set syntax=makefile: +# Local variables: +# compile-command: "cd .. && fakeroot dpkg-buildpackage -uc -us" +# End: --- openjade-1.4devel1.orig/debian/source/format +++ openjade-1.4devel1/debian/source/format @@ -0,0 +1 @@ +1.0 --- openjade-1.4devel1.orig/develdoc/DEVELOPERS +++ openjade-1.4devel1/develdoc/DEVELOPERS @@ -0,0 +1,158 @@ + Notes for Developers -*-text-*- + -------------------- + +Note: these notes apply only if you are working on some flavor of Unix. + +You will need to install several GNU tools to be able to use the cvs +sources. If you do not have these tools available, build from the tar +file distribution instead, available from peano.mathematik.uni-freiburg.de + +To build from the CVS sources, you will need: + * GNU gcc (version >= 2.95) + * GNU make + * autoconf (version >= 2.13) + * automake (version >= 1.4) + + +After the *initial* checkout of the sources, (see cvs.html) you will +need to execute the following commands from the top of the source +tree. + + automake --add-missing + autoreconf + ^^ +Be careful! The second command is autoREconf, not simply autoconf. + +There will be some warnings, which are ignorable as long as you get a +working configure script: the configure script will fix all those +problems. + +Now, configure and build as per INSTALL. If configure fails, please +look through `config.log' for clues. + + +Development Rules of the Road +----------------------------- + + 1) _Every_ change must be properly ChangeLogged. Since we create the + ChangeLog automatically from the cvs commit logs, you can do this + by giving meaningful logs when cvs commits asks for them. + + 2) If you make a user-visible change please add a blurb about it to the + NEWS file. A couple sentences is fine; don't repeat the + documentation but give folks enough of an idea so they can decide if + they want to learn more. Bug fixes (unless they're _really_ user + visible) shouldn't be noted in the NEWS file. + + 3) If you add a new user-visible feature, don't forget to update the + appropriate documentation at the same time! + + 4) Bug fixes may be committed at any time (unless we're in code freeze + for a release), usually without much review (unless you want someone + else to look at it). All our code freeze, etc. is merely + procedural, not enforced, so it's important you read jade-devel + and keep up-to-date with the current state of the tree. + + 5) New features should be discussed on the list to ensure everyone + thinks they're "appropriate". + + 6) If the new feature is large enough, unstable enough, or not + targeted at the next release, it should go on a private branch. + Otherwise, consensus will probably have it installed on the main + branch. + + + ** Of course, compile and test before committing! ** + + +Dealing with CVS +---------------- + +I will fill in some details sometime. + + +Changing a Makefile +------------------- + +First of all, NEVER edit anything named Makefile or Makefile.in. These +are both derived from the corresponding Makefile.am. The most common +reason for editing is to change the list of sources. + +Steps: 1. edit foo/blah/Makefile.am + 2. re-run "make" from the top of the build directory + +Step 2 will take care of rebuilding the Makefile.in and Makefile from your +changed Makefile.am. + +Makefile.am has a simple format, basically: + + bin_PROGRAMS = openjade + + fvmw2_SOURCES = blah.cxx blah.h foo.cxx foo.h ... + +Notice that you have to add all files, C++-code *and* headers, to the +_SOURCES line. This is vital, because this is the list of files that are +packed into the distribution. If you leave one out, nobody will be able +to build the distributed tar file! + + +Changing configure.in +--------------------- + +The most common reason to do this is to change the version string. If +you're editing it for any other reason, I will assume you know what you're +doing. + +Steps: 1. edit configure.in, and find the line containing + AM_INIT_AUTOMAKE(OpenJade, x.y.z) at the top of the file + 2. change x.y.z to the new version string + 3. re-run "make" from the top of the build directory + +Step 3 will take care of rebuilding the configure script, and usually all +the other Makefiles. + + +Building a distribution +----------------------- + +By this, I mean the file "OpenJade-x.y.z.tar.gz". + +Steps: 1. ./configure + 2. make clean + 3. double check that you get no warnings during the build (the + options for compilers other than gcc may be different): + make CFLAGS="-g -O2 -Wall -Werror" + 4. make distcheck + 5. ensure that you see the message + "OpenJade-x.y.z.tar.gz ready for distribution" + +Note that you need to have actually build everything before packing +the distribution, thus if we ever have files which are compiled only +conditionally, you'll have to add the necessary options 1. to make +sure everything is built. Among other things, this generates +the proper dependency information for insertion into Makefile.in's +generated in step 4. + +Step 4 will create the tar file, then unpack it and attempt a build & +install (to a scratch directory, not /usr/local). This makes sure +that you really DID include all the files necessary to build the +package into the tar file. It may be hard to appreciate how useful +this is, until it has reminded you that you forgot file "foo.h" in +some _SOURCES line. But trust me, it will save your bacon in this way +some day! + + +If this is to be an "official", labeled release, then do also the +following: + + 6. tag the CVS tree: + cvs tag openjade_x_y_z + 7. increase the version number in configure.in (see above) + and `cvs commit' this change + 8. put the file up for ftp somewhere + 9. add a link to the download.html page, which is in the + cvs module named www. Committing the new version to the + repository will bring it online shortly after. + +Be sure to do steps 6 and 7 in that order, so you get the label on the +right version of configure.in. --- openjade-1.4devel1.orig/develdoc/NOTES +++ openjade-1.4devel1/develdoc/NOTES @@ -0,0 +1,195 @@ +Some temporary notes: + +============================================================================== + +For reference, here is how some of this can be hacked in jadetex using +sgml-parse: + +cat >>jadetex.cfg <^^J +^^J +^^J +^^J +^^J% +]>^^J% +} +\endgroup +\typeout{Writing DSSSL page number information to \jobname.index.} + +\newcounter{elno} +\let\@@Node\Node +\def\Node#1{% + \@@Node{#1}% + \DEBUG{Label \Label}% + \DEBUG{Element \Element}% + \def\pgid{}% + \ifx\Label\@empty + \ifx\Element\@empty\else + \setcounter{elno}{\Element}% + \addtocounter{elno}{1}% + \edef\pgid{ELNO\arabic{elno}}% + \fi + \else + \let\pgid\Label + \fi + \immediate\write\@dssslindexfile + {^^J + }} +\let\@@endNode\endNode +\def\endNode#1{% + \DEBUG{endNode: \Label, \Element}% + \immediate\write\@dssslindexfile + { ^^J}% + \@@endNode{#1}} +\let\@@endFOT\endFOT +\def\endFOT{% + \immediate\write\@dssslindexfile{}% + \immediate\closeout\@dssslindexfile + \@@endFOT} + +EOF + +Explanation for the TeXagnostics: What this does is write an SGML file +xyz.index (assuming you started with xyz.sgml from which jade -ttex produced +xyz.tex) with the following DTD + + + + + + + +jadetex emits a node element for each node in the FOT (in reality there +are no nodes in the FOT, but the TeXFOTBuilder emits enough information +for jadetex to know which node was current when a FO was created). + +The page and category attributes of the firstarea and lastarea elements +contain the values we want to get via + +(page-number first-area-of-node: nd) +(page-number last-area-of-node: nd) +(category-page-number first-area-of-node: nd) +(category-page-number last-area-of-node: nd) + +if nd is the node in question. + +Here is how to define page-number and category-page-number using sgml-parse. +The ugly thing is that the name of the index file is hardcoded. This +could be improved using the -V extensions of OpenJade. + +cat >>page-numbers.dsl <number + (or (attribute-string + "PAGE" (select-elements + (children (element-with-id tid index-page-grove)) + area)) + "0")) + (error "page-number currently works only on elements +and nodes with id")))))) + +(define (category-page-number #!key first-area-of-node last-area-of-node) + (wrap-generated-object + (if (and first-area-of-node last-area-of-node) + (error "category-page-number accepts at most one key argument") + (let* ((snl (or first-area-of-node last-area-of-node (current-node))) + (area (if last-area-of-node "LASTAREA" "FIRSTAREA")) + (tid (or (id snl) (string-append "ELNO" + (format-number + (all-element-number snl) "1"))))) + (if tid + (string->number + (or (attribute-string + "CATEGORY" (select-elements + (children (element-with-id tid index-page-grove)) + area)) + "0")) + (error "category-page-number currently works only on elements +and nodes with id")))))) + + +;; I used wrap-generated-object to fake a new type for generated objects. + +(define (wrap-generated-object x) (cons 'generated-object x)) + +(define (generated-object? x) + (and (pair? x) (equal? (car x) 'generated-object))) + +(define (unwrap-generated-object x) + (if (generated-object? x) + (cdr x) + (error "generated object required"))) + + +;; Of course we also need some of the DSSSL functions dealing with +;; generated objects. + +; This is a *very* partial implementation of general-indirect-sosofo. +(define (general-indirect-sosofo fun #!rest li) + (fun (map unwrap-generated-object li))) + +(define (number-indirect-sosofo x #!key (format "1") (add 0) (multiple 1)) + (let ((y (unwrap-generated-object x))) + (if (not (number? y)) + (error "number-indirect-sosofo: kernel of generated object +not a number") + (let ((n (+ add y))) + (if (= 0 (remainder n multiple)) + (literal (format-number n format)) + (literal "")))))) + +(define (asis-indirect-sosofo x) + (let ((y (unwrap-generated-object x))) + (if (not (sosofo? y)) + (error "asis-indirect-sosofo: kernel of generated object +not a sosofo") + y))) + +EOF + +============================================================================== --- openjade-1.4devel1.orig/develdoc/TODO +++ openjade-1.4devel1/develdoc/TODO @@ -0,0 +1,197 @@ +* Add some optimizations to the query stuff: add query rules to the per-gi + rule lists only if they actually contain at least on element node with that + gi, add a seperate list of char rules and a findCharRule function to use + for char nodes (or combine the various find...Rule functions into one + which gets the list to look in as a parameter). Then hasCharRules_ can + be replaced by charRules_[0].size() > 0 || charRules_[1].size() > 0. +x +* Redo the modules stuff. Move it from Interpreter to grove/. Ideally, the + style engine shouldn't need any hardwired knowledge about the limitations + of the grove implementation, but should query it. + +* Redo the features stuff to make it cleaner. + +* Remove the SdataMapper hack from the grove interface. Rename SdataMapper + to something like GroveConstructionParameters and pass it to the grove + construction process. Eventually we want to add the standard-chars, + combine-char and other stuff to the GroveConstructionParameters. + +* Make the in-memory representation for char chunks more compact. Right + now we store a flat array of 32bit chars, which is wasteful. If we use + a different representation, DataNode::charChunk will involve a making + a copy and thus be much more expensive than currently. Thus we should + make sure it is not called unnecessarily often (eg its called twice + in ProcessContext::processNode). + +* Add more error messages to the SchemeParser. Currently, many parser + functions just return 0 to the caller; they should also issue a message. + Add sth like AllowedTokensMessageArg and use that in + SchemeParser::tokenRecover to give information about the expected tokens. + +* Free Expressions when they are no longer needed. Later, maybe replace the + allocation mechanism with a simpler one that does not actually free + individual objects. + +* Wrap lines in help message. (Add wrapping OutputCharStream.) + Then fold the info messages into a single message + +* The empty delimEnd message has been removed from ParserMessages.msg. + If translators need to do something different than just put a string + before the actual delimiter, we should support simple insertions in + message fragments and use + +delim++delimiter % + instead. + +Things which are missing and need a lot of work +=============================================== + +* Redesign the App class hierarchy to prepare for breaking OpenJade in + exchangeable components. + +* Check the win32 port of OpenJade (OpenSP works). + +* Support i18n on win32. As a first step, write a perl script to translate + the .rc files using the translations from the .po files. Be careful, + the quoting in .rc seems to be different from the quoting in .po. + This will give us compile-time language-choice on win32, ie one could + decide to run this script for de.po before the compilation to get the + German translations compiled in. I still have no idea how install-time + language-selection would be handled. + +* SGML backend: Change the document-type FO to be non-atomic, to allow an + internal DTD subset. ADD FOs for DTD declarations. + +* query: leads to current-node not being an element node. + +* char-script-case: this should be handled by the backends. + +* baseset-encoding, literal-described-char, other-chars: + must abandon SP_CHARSET_FIXED to do this, since otherwise + SP does unwanted conversions on numeric char refs. On the + other hand, we do want SP_CHARSET_FIXED, if we are using + jades builtin repertoire (ie Unicode). This could be done + by scanning the cmdline args for "-s"/"--strict" before + constructing the JadeApp instance. + + We have to map other-chars in the Unicode/UCS private area somewhere and + tell the user/backend about it. + +* combine-char: If we do this, we can't do character translation + as a map char --> char any longer, but instead have to deal + with string --> string. + +* Annex K #ALL/#IMLICIT content tokens. Implementation idea: At the + begin of the instance and after seeing a new implicit element type + in the instance, go over all definitions and recompile the model + groups. Also adjust the inclusions/exclusions. Optimization: recompile + only those which actually use #ALL/#IMPLICIT. + +<<<<<<< TODO +* Annex K #IMPLIED doctype name. + +======= +* Annex K DTD data entities: add a DTD notation framework. Applications + should have a way to register DTD notation handlers which would then + be called for DTD data entities with the corresponding notation. They + would get a pointer to the entity and to the current Dtd and would + add the element and entity declarations they extract from the entity + to the Dtd. + +>>>>>>> 1.12.2.6 +* check table-auto-width and multi-process features. + +* A caching mechanism for DTDs, dsssl specs, ... + This is complicated, since the result of parsing a DTD does depend not + only on the sysid, but also on cmdline options which could define parameter + entities and on the catalogs used to search for entities. + +* An XSLFO backend ? Would try to approximate the DSSSL FOT into an XSLFO + document. Then we could take advantage of existing XSL formatters. We could + also drop JadeTeX in favor of PassiveTeX (when it gets ready) then. + +* TeXFOTBuilder: Only output Start/EndNode pairs for nodes actually referred to + (see RtfFOTBuilder). + +* Do page feature in the front-end. + +* TeX backend: Implement general indirect FOs by outputting relevant info from + a TeX run and reading that info in the next OJ run. + + + +Simple things +============= + +* install ports, ICs, etc only in SL Interpreters. + +* Perhaps split InterpreterMessages into InterpreterMessages and + SchemeParserMessages (and more...). + +<<<<<<< TODO +* Remove FOTBuilder::characters(const Vector &) and instead add + a procedure that lets the backend query character properties for a Char + array. Makes storing parts of the FOT more efficient (otherwise, + SaveFOTBuilder will have to store the NIC Vectors, for example.) + Should be done before next release. + +* A way for backends to declare/access extension character properties. + (Not needed until we have a backend that actually would do this.) + +* Validation of extension flow objects. (Not very important, since the backends + can handle these special cases without major effort.) Instead we could add a + FOTBuilder::FOMessage() non-virtual, so that backends may produce consistent + error messages without knowing about ProcessContext internals. +======= +* Set up framework for I18N: generating .po from .msg, po/OpenXYZ.pot from ../*.po, + generate and install .mo files. This has been done for OpenSP, + still to do for OpenJade. + + If you add a new .msg file, you now have to remember to add it + to po/POTFILES.in. + + Adding support for a new language is done by: + 1) cp po/OpenSP.pot .po + 2) Add translations in po/.po + 3) cvs add po/.po + 4) Add to ALL_LINGUAS in configure.in + 5) cvs commit configure.in po/.po + Here stands for the proper 2-letter language code + (is that ISO 639 ?) + + Still to do: figure out how to create translated .rc files from + the translations in .po. This will need some perl magic + to read in .po, then go over the .rc file and for each string, + look up the translation. Then write out a translated .rc file + containing the proper language identification (ask Didier about this). +>>>>>>> 1.12.2.6 + +* Support uri-ref addresses in more backends. + +Things which have to be added to the jade internals documentation +================================================================= + +* writing backends. + +* scheme primitives: special meaning of partIndex == unsigned(-1), + (define internal: ...), (define feature: foo ...). + +* language stuff. + +* feature checking. + +* grove plan checking. + +* color spaces. + +* char repertoire stuff. + +* messages: module stuff, message numbers + I18n handling. + +Reorganization +============== + +* clean up the mess of SP_ defines + +* replace many SP_ defines by their more `standard' automake + names (see the bottom of acconfig.h) --- openjade-1.4devel1.orig/develdoc/jadedoc.sgml +++ openjade-1.4devel1/develdoc/jadedoc.sgml @@ -0,0 +1,1243 @@ + +
+ + OpenJade and OpenSP internals + + Matthias + Clasen + +
+ clasen@mathematik.uni-freiburg.de +
+
+
+ 19.11.99 +
+ + This document describes the OpenJade DSSSL engine + and the OpenSP SGML system upon which it is based + from the programmers point of view. It was written to + help people who want to extend OpenJade or OpenSP. + + + OpenSP Package organization + + Directory contents + The follwing directories contain files needed during the + build: + + + all/ + Visual C++ build process + + + The following directories contain documentation: + + + doc/ + OpenSP documentation + + + The following directories contain + SGML text files: + + + pubtext/ + various DTDs and catalogs + + + unicode/ + SGML declaration and catalog for + dealing with Unicode + + + The following directories contain the sources of the + library: + + + include/ + generic + the headers defining the API of the OpenSP + library + + + lib/ + the source of the OpenSP library + + + Applications: + + + nsgmls/ + an SGML parser + + + sgmlnorm/ + an SGML normalizer + + + + spam/ + a markup stream editor + + + spent/ + a frontend to the OpenSP entity manager + + + + sx/ + a simple SGML to + XML converter + + + spcat/ + a frontend to the OpenSP catalog + manager + + + + + The build system + OpenSP uses the GNU build system based on autoconf, automake + and libtool. If you are working from a .tar.gz + snapshot or release of OpenSP, all you need to do is +./configure; make. If you are working from CVS, you have to + run autoconf --add-missing; autoheader; aclocal; autoconf + initially. + + + + OpenJade Package organization + + Directory contents + The follwing directories contain files needed during the + build: + + + jadedist/ + creating a distribution + + + testsuite/ + a collection of DSSSL tests + + + debian/ + files necessary to build a Debian package + + + The following directories contain documentation: + + + jadedoc/ + OpenJade documentation + + + develdoc/ + documentation for developers + + + The following directories contain + DSSSL text files: + + + dsssl/ + DTDs for style sheets and FOT output; jadetex; + examples + + + The following directories contain the sources of the various + libraries: + + + style/ + the DSSSL style + engine + + + grove/ + an abstract interface to groves + + + spgrove/ + an implementation of the grove + interface on top of OpenSP + + + groveoa/ + an OLE-enabled version of the + grove builder, Windows-only + + + Applications: + + + jade/ + the source of the OpenJade application and its + various backends + + + + + The build system + OpenJade also uses the GNU build system. Look at the + description of the OpenSP build system for more details. + + + + Coding conventions + + Formatting + The following list gives some hints on the coding conventions + used throughout the source. + + + Whitespace. + + + Statement keywords have one space after them, and no space + between the parentheses and the enclosed expression: + +if (foo) /* good */ +if( foo ) /* bad */ + + + + In general there is never a space after an open + parenthesis or before a close parenthesis: + +foo(arg) /* good */ +foo( arg ) /* bad */ + + + + The * or & in pointer or reference declarations stick to + the identifier, not to the type: + +void foo(int *p, int &r) /* good */ +void foo(int* p, int& r) /* bad */ + + + + Put whitespace on either side of operators: + +x = y + z; /* good */ +x=y+z; /* bad */ + + + + Indent by 2 characters. + + + Tabs are set every 8 characters. + + + + + Line breaks. + + + Expressions broken over more than one line are aligned + LISP style: + +if ((a + && b) + || (c + && d)) + + + + else is on a separate line from the preceding brace: + +if (foo) { +} +else if (bar) { +} +else { +} + + + + Long function headers should not be broken before the + parenthesis that starts the argument list. + + + + + Identifiers. + + + Use camelCase. Class names and type names start + with an upper-case letter. Function names start with a + lower-case letter. + + + Names of private date members end with an + underscore. + + + + + Declarations. + + + Use public: before private: in class declarations. + + + Use const wherever applicable. Declare member functions + const if they don't alter the object. Declare reference + arguments const if the function doesn't change them + etc. + + + Don't declare inline member functions in the body; declare + them separately in the header file. + + + Never have public data members in a class. + However is OK to have a struct which is just a bundle of + data. In this case use struct not class. All members are + public and names don't end with an underscore. There are no + member functions (the only exception is that there may be a + constructor). + + + + + Other rules. + + + case clauses without a break always have a + "fall through" comment where the break would occur: + +switch (foo) +case x: +/* do something here */ +// fall through +case y: +} + + + + A statement governed by if or else that is longer than a + single line always is surrounded by {}. The following is + unacceptable: + +else +if (foo) + ; +else + ; + + + + On the other hand, never use braces around single + statements: + +if (foo) /* good */ + bar(); +if (foo) { /* bad */ + bar(); +} + + + + Avoid global functions. All functions should be members + of some class. + + + Try to avoid calling delete except in low-level library + classes. For example, don't do: + +void foo() { + Obj *p = new Obj; + + ... + delete p; +} + + Instead do: + +void foo() { + Owner<Obj> p(new Obj); + ... +} + + + + + If a the default copy constructor and assignment operator + will not work for a class, you must do one of two things: + Either provide a copy constructor and assigment operator that + will work or declare but do not implement a private copy + constructor and assignment operator. + + + Avoid C++ exceptions. + + + You can assume new will never return NULL (either it will + throw an exception on systems where that works or it will + print a fatal error and exit). + + + + + + + Headers + Every header file should be surrounded by an #ifndef. + Here is a skeleton for a header file named + filename.h: + +/* copyright notice goes here */ + +#ifndef filename_INCLUDED +#define filename_INCLUDED 1 + +/* contents go here */ + +#endif /* not filename_INCLUDED */ + + The first header included by a source file must be + splib.h for files in + lib/, config.h + for files in grove/, spgrove/ + or an application directory, stylelib.h + for files in style/. + + + Namespaces + Every file should be surrounded by a namespace. Namespaces are + never used directly in order to support compilers which don't + understand namespaces. The general skeleton for a + .cxx file in the namespace NAMESPACE is: + +/* includes go here */ + +#ifdef NAMESPACE +namespace NAMESPACE { +#endif + +/* content goes here */ + +#ifdef NAMESPACE +} +#endif + + Files in the lib/, + nsgmls/, sgmlnorm/, + spam/, spent/, + spgrove/ and sx/ + directories use the namespace SP_NAMESPACE. Files in + grove/ use the namespace GROVE_NAMESPACE. + Files in style/ and + jade/ use DSSSL_NAMESPACE. + + DSSSL_NAMESPACE imports everything from SP_NAMESPACE and + GROVE_NAMESPACE (see style/dsssl_ns.h). + + VC 5 and 6 have bugs in the namespace management, which mean that + all these 3 need to be defined to be the same. + + The conditional stuff is to deal with compilers that don't support + namespaces. + + + Templates + To cope with different compilers capabilities with respect to + templates, all template instantiations are collected in files with names + ending in _inst.cxx. These are generated from + _inst.m4 files. + + To add a new template instantiation, add a macro call of the + form + +__instantiate(/* your template instatiation */) + + to the appropriate .m4 file. + + + API definitions + + When building DLLs on Windows, every class or + function which should be exported by the DLL + has to be prefixed with + +__declspec(dllexport) + + when building the DLL and with + +__declspec(dllimport) + + when using it outside the DLL. + + This is hidden behind the _API macros which get defined + appropriately. Every declaration of a class of function which is part of + the public interface of its library should be prefixed with the proper + _API macro. Files in include/ use SP_API, + files in grove/ use GROVE_API, + files in spgrove/ use SPGROVE_API, + files in style/ use STYLE_API. + + + + Messages + Messages for the main classes are collected in separate classes. + Eg there is a class InterpreterMessages for all + messages of the class Interpreter. + + The sources (.h and .cxx + files and, on Windows, .rc files) for the + <class>Messages + classes are generated from .msg files by + the msggen.pl Perl script. + + + Adding a new message amounts to adding one line to the correct + .msg file. The lines in these files have the + following format: + + <message type><args>+<identifier>+<relevant clauses>+<message text> + + <message type> must be one of the + I, W, Q, X or E. These stand for info, warning, quantity error, idref + error and error, respectively. + + <args> is the number of placeholders + of the form %n in the <message + text>. + + <identifier> is the C++-identifier + used to refer to the message. + + <relevant clauses> may be used to + give an exact reference to the relevant ISO standard for + each error message. In OpenJade error messages, this field is + usually left empty. The information in this field is currently + ignored by all OpenSP and OpenJade applications. + The format for this field is a space-separated + list of clauses, where each clause is a dot-separated list of + numbers. A clause may optionally contain a paragraph specification, + which is a suffix of the form `p<number>'. + + <message text> is the text of the + message. It can contain placeholders of the form %n where n is a number + between 0 and <args> - 1. These placeholders + will be replaced by suitable arguments if the message is issued. + + Besides normal message lines, .msg files + may contain a few other lines: a line starting with `!cxx' causes + the generation of a .cxx file (this is necessary + if the generated header file is included in multiple source files, + a line of the form `= <number>' can be used to set the number + for the following message, a line starting with `-' is a deleted + message (ie it is ignored, but still increases the message number), + a line with `#' or `$' as the first non-whitespace character is + a comment (ie it is ignored). Finally, if a message line omits + the <message type> and <args> fields and starts with the `+' + before the <identifier> field, it specifies a message fragment. + Message fragments are used in building up messages. + + Message numbers should be unique across all + .msg files in a single library or + application. + + Message arguments come from classes derived from + MessageArg. + StringMessageArg is a string, + NumberMessageArg is an unsigned long. + + There is a special form of message which also gives a location for + the error which can be defined by adding one more field of the form + +<aux text> at the end of message + definition. <aux text> will usually be + an explanation of the location like "first definition was here" (for a + duplicate definition error). This form of message is only implemented + for <args>≤1. + + Issuing a message is done by a call of the form + message(<class>Messages::<identifier>, ...) + + where <class> is the class to which the + message belongs and <identifier> is the + identifier used in the message definition. The remaining arguments to + the message() call must match the %n placeholders + in the message. For messages which give location information, the last + argument must be an object of type + Location. + + + + General overview + + Program structure + + Most of OpenSP and OpenJade is user-interface independent: + it doesn't know + whether it's being run from the command line or from a GUI. The + code is organized in several layers. + + The lowest layer is a general purpose class library (mostly + template based), which is independent of + SGML/XML. + + The next layer is a general concept of an entity + manager, which is basically an interface to set of services to an + SGML parser; basically it's everything that the + SGML standard leaves undefined or makes + system-dependent for an SGML parser. This layer + includes the message reporting API + (MessageReporter, + Message), catalog API + (EntityCatalog), + character set API (CharsetInfo), and the + entity manager proper + (EntityManager). Template instantations for + this are in entmgr_inst.m4. + + Dependent on the first two layers is the core + SGML parser. This only implements the behaviour + defined in the SGML standard. Main public + classes are SgmlParser and + Event. Template instantations for this are in + parser_inst.m4. + + + The architectural forms engine. It depends on the + SGML parser. Main class is + ArcEngine. + Template instantiations are in + arc_inst.m4. + + An implementation of the entity manager interface. This + doesn't depend on the SGML parser or achitectural + forms engine. Main class is + ExtendEntityManager. This for example + determines what the syntax of a system identifier is. Template + instantiations for this are in + xentmgr_inst.m4. + + A generic interface to groves; in + grove/Node.h. This doesn't depend + on any of the previous layers. + + An implementation of the grove interface using OpenSP; + this is in the spgrove/ directory. Main class + is GroveBuilder. This doesn't depend on the + implementation of the entity manager interface. + + An implementation of the DSSSL style + language (the tree construction part, not the formatting part). + This is in the style/ directory. There + are really two sub parts: + + Packaging of the DSSSL + stylesheet as an SGML document using + architectural forms. Main classes are + DssslSpecEventHandler and + StyleEngine. This doesn't depend on + the implemenation of the entity manager and grove + interfaces. + + Processing of the contents of the elements in + the DSSSL stylesheet; this depends only + on the entity manager and grove interfaces. + The main interface here is FOTBuilder + which is the interface between the tree construction process + and the formatter. + + + + Multiple implementations of the + FOTBuilder interface (the backends). + + + Parallel to the hierarchy of layers is a hierarchy of convenience + classes that collect together various pieces in a convenient way for + command line apps. + + CmdLineApp is the lowest level + and depends only on the general purpose class library. + EntityApp additionally depends on + the entity manager interface and implementation; it's a convenience + class for accessing the functionality of the entity manager with a + command line program. + ParserApp additionally depends on the + SGML parser; it packages the parser together with + the entity manager for use in a command line program. + GroveApp additionally depends on the + grove interface and implementation; this packages the functionality + of the grove builder in a convenient way for command line + apps. + DssslApp additionally depends on + DSSSL style language implementation, tieing it to + the grove implementation; it is packaging up the functionality of + the DSSSL tree construction in a way suitable for + command line apps. + JadeApp additionally depends on the + backends. + + + + Other important classes + Short descriptions of several central classes in the + DSSSL style language implementation, some of which + have not yet been mentioned. + + + StyleEngine + + main class of the style + library. DssslApp + uses an instance of this class to process the grove. + + + + Interpreter + + contains all the stylesheet-related state: + there are no global + variables. StyleEngine owns an instance + of this class. + + + + SchemeParser + + parses a part of a DSSSL spec, creating + expression language objects and binding variables using a given + Interpreter. + StyleEngine uses instances of this class + to parse the parts of its spec. + + + + ProcessContext + + holds the current state of the processing of a grove. + + + + VM + + represents the state of the virtual machine that + implements the expression language. + + + + Expression + + Expressions are the result of parsing + expression language constructs. They are compiled to + Insns. + + + + Insn + + an instruction for the virtual machine. + When an instruction is executed it modifies the state of the + virtual machine (usually) and then returns the next instruction + to be executed. Returning a null Insn + terminates execution. Thus the inner loop of the expression + evaluator is in a member function of VM + and looks like: + + +while (insn) + insn = insn->execute(*this); + + + + + ELObj + + the abstract base class for all expression language + types. + + + + + + Garbage collection + + + For further information on the garbage collection technique used in + Jade, look at ftp://ftp.cs.utexas.edu/pub/garbage/bigsurv.ps and + ftp://ftp.netcom.com/pub/hb/hbaker/NoMotionGC.html. + + Basically it works like a copying collector, but the copying is + logical rather than physical. There are two doubly-linked lists one + for each of the two spaces of a copying collector. Every object is + one of these two lists. There's also a bit (the "color") which says + which space it is in. To "copy" an object from one space to another, + it is unlinked from one list, linked into the other, and its color is + flipped. A key point is that unlike normal copying collectors, this + collector never changes the address of a GC object. + + This is a simplification. It is optimized so that there is one big + circular list of all objects. A pointer into the list separates the + allocated from the free list. Allocating just moves the pointer along + the list. + + Garbage collection starts with a set of root objects (more on this + later). It finds all objects reachable from this set of root objects. + All objects not reachable are considered garbage and are put on the + free list where they can be reused. If garbage collection doesn't + free up enough objects, then more memory is allocated from the system. + + There are a couple of twists beyond what's described in the Wilson + paper: + + + It supports finalization (the ability to call an GC object's + destructor when the object is GCed). All finalizable objects occur + before non-finalizable objects in the allocated list. The garbage + collection arranges so that immediately after completing the copy + part of a garbage collection, the objects needing finalization are + at the head of the free list, thus allowing the collector to + efficiently perform finalization. + + Objects which are created during the parsing of the + stylesheet, which can never become garbage during the processing of + the source document, are separated off into a separate area (these + are called "permanent"). All objects reachable from a permanent + object must themselves be permanent. + + It has the concept of an object being read-only: it can mark + an object and all objects reachable from that object as being + read-only (needed for OpenJade extensions which allow limited mutation + of objects). + + It always allocates a fixed amount of space for a GC object; + so the sizeof() any object derived from + ELObj must be ≤ this space. How big + is it? On a 32-bit machine there is space for 16 bytes (eg 4 + pointers, or a double+int+pointer) beyond what is used by the + ELObj itself. On a 64-bit machine it will be + about twice that; maxObjSize() in + style/Interpreter.cxx figures it out at + runtime, so to be safe add any new types of + ELObj to the table in + maxObjSize(). But make + sure you don't use more than 16 bytes on a 32-bit machine, otherwise + you will significantly increase Jade's memory consumption. If you + need more space than this, then the ELObj + should have a pointer to dynamically allocated memory; in this case + you must deallocate the memory in the destructor. In this case and + any other case where an ELObj has a + destructor that must be called, you must declare an operator + new(): + +void *operator new(size_t, Collector &c) +{ + return c.allocateObject(1); +} + +This tells the garbage collector that the object has a destructor that +must be called when the object becomes garbage. + + + + A key aspect of correct use of the garbage collector is to ensure + that the collector always has a sufficient set of roots. Any time + that C++ code does anything that may allocate a GC object, any GC + object that is not reachable from a root object may get recycled by + the system. The way to create a root is to use an auto variable of + type ELObjDynamicRoot. An + ELObjDynamicRoot adds a single + ELObj as a root for the + Collector for as long as the + ELObjDynamicRoot is in scope. The first + argument of the ELObjDynamicRoot constructor + specifies the collector. The second argument specifies the + ELObj that is to be made a root. The + ELObj that the + ELObjDynamicRoot causes to be a + root can be changed by assiging an ELObj to the + ELObjDynamicRoot. There's also a + conversion from ELObjDynamicRoot to + ELObj *. + + The <function>reverse()</function> function + +DEFPRIMITIVE(Reverse, argc, argv, context, interp, loc) +{ + ELObjDynamicRoot protect(interp, interp.makeNil()); + ELObj *p = argv[0]; + while (!p->isNil()) { + PairObj *tem = p->asPair(); + if (!tem) + return argError(interp, loc, + InterpreterMessages::notAList, 0, argv[0]); + protect = new (interp) PairObj(tem->car(), protect); + p = tem->cdr(); + } + return protect; +} + + protect is a dynamic root that contains the currently created + part of the reversed node list. Making this a root ensures that all + the newly created PairObjs are reachable from + a root. + + + The <function>NodeListRef()</function> function + The NodeListRef() function gives an example of + the sort of bug that can creep in if you're not very careful. This + used to end like this: + +return new (interp) + NodePtrNodeListObj(nl->nodeListRef(k, context, interp)); + + The nodeListRef() function sometimes + allocatesthat it takes an Interpreter argument + is a good clue). So what could happen is: + + operator new() gets called to + allocate a new object + nodeListRef() gets called in a + way that causes an allocation + the free list happens to be empty, so the garbage + collector gets run; the newly allocated object is not reachable + from a root, so it gets GCed and recycled + the constructor gets called with a GC object that + the garbage collector thinks is free + + + The fix was to rewrite it as: + +NodePtr nd(nl->nodeListRef(k, context, interp)); +return new (interp) NodePtrNodeListObj(nd); + + + + Another key aspect of correct use of the garbage collector is to + ensure that objects with garbage-collected subobjects inform the + collector of the references to the subobjects they hold. To do so, + they must override + Collector::Object::traceSubObjects(Collector &) + to call Collector::trace(const Object *) for each + subobject. + + + + How to add a new application + Create a subclass of one of the App classes; + use the macro SP_DEFINE_APP. + TODO: This needs more detail. Perhaps + use spcat as example. + + + Extending OpenJade + + Utility classes + TODO: Explain Char, String, Vector, StringC, Ptr, Owner + TODO: Maybe move this to the "General overview". + + + Primitives + Primitives of the expression language, the SDQL and the style + language are implemented as subclasses of + PrimitiveObj + (style/Insn.h, + style/Insn.cxx). All primitives are defined in the + files style/primitive.h and + style/primitive.cxx. Adding a new primitive is done + by adding a macro call of the form + +PRIMITIVE(<class name prefix>, + "<primitive name>", + <req. args>, <opt. args>, <rest arg>, + <feature>) + + to style/primitive.h and a macro call of the form + +DEFPRIMITIVE(<class name prefix>, argc, argv, + context, interp, loc) + + to style/primitive.cxx, followed by the body of + the function + PrimitiveObj::primitiveCall() as needed for the + function you want to add. + + For procedures that are specific to the style language, + use SPRIMITIVE instead of PRIMITIVE. Likewise, procedures that + are specific to the experimental so-called DSSSL-2 option, are + declared with the PRIMITIVE2 macro. + + External procedures found in Jade 1.2.1 use XPRIMITIVE instead of PRIMITIVE. + These procedures are accessed using a public identifier of the form: + "UNREGISTERED::James Clark//Procedure::<primitive name>". + External procedures added to OpenJade should be declared + using XXPRIMITIVE and are accessed using a public identifier + of the form: + "UNREGISTERED::OpenJade//Procedure::<primitive name>" + + The <function>sin</function> function + We can add the sin defined in clause + 8.5.7.18 of the DSSSL standard by appending + +PRIMITIVE(Sin, "sin", 1, 0, 0) + + to style/primitive.h and + +DEFPRIMITIVE(Sin, argc, argv, context, interp, loc) +{ + double d; + if (!argv[0]->realValue(d)) + return argError(interp, loc, + InterpreterMessages::notANumber, 0, argv[0]); + return new (interp) RealObj(sin(d)); +} + + to style/primitive.cxx. + + + + Expression language types + Relevant classes: + + + ELObj + + Adding a new expression language type + is done by adding a new subclass of + ELObj. Make sure to follow the advise + in the section on garbage collection with respect to the size of + the subclass. + + + + SchemeParser + + You will have to add a method for generating + objects of the new type. This will generally involve a line like + +result = new (*interp_) <your class>(...) + + The *interp_ argument to new is important to make + the newly generated object properly garbage collected. + + + + TODO: is this all ? add an example! + + + Backends + In order to create a completely new backend, you first + need to create a new subclass of + FOTBuilder or + SerialFOTBuilder implementing the output + format you are interested in. It is probably a good idea to + take an existing backend as a skeleton. + TODO: More detail needed. + + To make the new backend available to OpenJade, you have to + add new values for your backend to + JadeApp::OutputType and + JadeApp::outputTypeNames and add a new + case to the switch statement in + JadeApp::makeFOTBuilder() + returning an instance of your FOTBuilder + subclass. + + + Flow objects + For a standard flow object, you must create + a new subclass of FlowObj (atomic) + or CompoundFlowObj (nonatomic). + Do not forget to add a FLOW_OBJ macro call for the new class + in the Interpreter::installFlowObjs() function + in style/FlowObj.cxx. + + The FlowObj class has two members: one pointer and one + Owner (which takes up the same space as + a pointer). So, on a 32-bit machine for example, there is 8 + bytes (two pointers) left for data members. The + CompoundFlowObj class adds one more data + member (a pointer), so you may have at most one pointer in a + subclass of that class. (See for more + information.) + + + The processInner() of the new class + is responsible for calling the FOTBuilder + function (or pair of functions for nonatomic flow objects) associated + with the flow object in question. You may have to add these + functions to the interface of the FOTBuilder + class and provide default definitions there. These have to + be overridden by the backends (FOTBuilder + subclass) in order to implement the flow object in question. + + For a compound flow object, this function also has to tell the + ProcessContext what ports this flow + object has and what content these prots accept. This is done + by calling + ProcessContext>::pushPorts() + and + ProcessContext::popPorts() + if the flow object has any named ports, or + ProcessContext::pushPrincipalPort() + and + ProcessContext::popPrincipalPort() + if the flow object has a single principal port. You also have + to provide subclasses of + ProcessContext::Validator for each port. + + The acceptFlags() + FlowObj member function should return + flags describing the flow object (i.e. if it is inline or + display, for example). This information is used by the + validation mechanism. + + TODO: explain extension flow objects + + + Command line switches + If you are adding a new OpenJade-specific option, add it to + JadeApp. If the option you are adding + influences the behaviour of the style engine, add it to + DssslApp. + + Adding an option amount to registering it in the constructor + with registerOption() and handling it in + processOption(). + + + The CmdLineApp supports only single-letter options. You should + make sure that you don't choose a letter that is already taken: + + + + b, f, v + registered by + CmdLineApp + + + c, C, D + registered by + EntityApp + + + a, A, e, E, g, i, w + registered by + ParserApp + + + G, 2, d, V, s + registered by + DssslApp + + + t, o + registered by + JadeApp + + + + A -s flag for <classname>DssslApp</classname> + Lets assume you have changed the + StyleEngine constructor to accept one + more bool parameter strict_, which you want to be set depending + on the -s command line flag. + + We add a new private member strict_ to + DssslApp to hold the value until we pass + it to the StyleEngine constructor. Thus we + insert + +bool strict_; + + at the very end of the DssslApp class + declaration in style/DssslApp.h. + Now we change the constructor to + +DssslApp::DssslApp(int unitsPerInch) +: GroveApp("unicode"), unitsPerInch_(unitsPerInch), + dssslSpecOption_(0), debugMode_(0), dsssl2_(0), + strict_(0) // this line is new +{ + registerOption('G'); + registerOption('2'); + registerOption('d', SP_T("dsssl_spec")); + registerOption('V', SP_T("variable")); + registerOption('s'); // this line is new +} + + and the function processOption() to + +void DssslApp::processOption(AppChar opt, const AppChar *arg) +{ + switch (opt) { + case 's': // new case + strict_ = 1; + break; + /* other cases stay the same */ + } +} + + Finally, we change the call of the + StyleEngine constructor in + processGrove() to + +StyleEngine se(*this, *this, unitsPerInch_, debugMode_, + dsssl2_, strict_, extensions); + + + + + + Supporting a larger grove plan + TODO: how is this done ? + + + Translating messages + I can explain this only for the gettext() + support. + + Make sure gettext() is supported on + your system. + + Modify msggen.pl by changing the + line + +$gen_po = 0; + +to + +$gen_po = 1; + + + + Build everything. + + + Collect the various .po files in one big + one: + +for i in */*.po; do cat $i >> messages.po; done + + + + Make a copy of messages.po for + the language you are interested in and add the translations. + + + Compile the translated file and install the resulting + .mo file under the name + sp.mo in the appropriate directory: + +msgfmt -o de.mo de.po +cp de.mo /usr/local/share/locale/de/LC_MESSAGES/sp.mo + + + + + +
+ + --- openjade-1.4devel1.orig/develdoc/missing +++ openjade-1.4devel1/develdoc/missing @@ -0,0 +1,240 @@ +This collects stuff from the DSSSL standard which is +not implemented (yet) in OpenJade. A '+' at the end of +a line indicates that there is a patch implementing it. +A '*' indicates it is already in CVS. + + +missing DSSSL architectural element forms +========================================= + +7.1.1 features * +7.1.2 sgml-grove-plan * +7.1.3 char-repertoire * +7.1.5 other-chars + +7.1.6 baseset-encoding + (the patch is only semi-functional) +7.1.7 literal-described-char + (the patch is only semi-functional) +7.1.9 add-separator-chars * +7.1.10 add-name-chars * +7.1.11 combine-char + (the patch is only semi-functional) + + +missing expression language primitives +====================================== + +8.5.8.1 declare-char-property * + add-char-properties * +8.5.8.2 language? * + current-language * + with-language * +8.5.8.2.1 define-language * +8.5.8.4 char? * + char<=? * + char>=? * +8.5.8.5 char-ci? * + char-ci<=? * + char-ci>=? * +8.5.8.6 char-upcase * + char-downcase * +8.5.8.7 char-property * +8.5.9.5 string-ci=? * + string-equiv? * +8.5.9.6 string? * + string<=? * + string>=? * + string-ci? * + string-ci<=? * + string-ci>=? * + + +missing property set modules +============================ + +basesds1 +sdclabs +sdclsds +prlgabs1 * +prlgsds +instsds1 +dtgabs +rankabs * +srabs +srsds +linkabs +linksds +subdcsds +fpiabs * + + +missing SDQL primitives +======================= + +10.1.1 current-root * +10.2.1 value-proploc + list-proploc + node-list-proploc + listloc + nameloc + groveloc + treeloc + pathloc + relloc-any + relloc-esib + relloc-ysib + relloc-des + datatok + make-grove + literal-match + hylex-match + compare + ordered-may-overlap? + ordered-no-overlap? + span +10.2.2 node-list-reduce * + node-list-contains? * + node-list-remove-duplicates * + node-list-union * + node-list-intersection * + node-list-difference * + node-list-symmetric-difference * + node-list-map * + node-list-union-map * + node-list-some? * + node-list-every? * + node-list-filter * + node-list->list * + node-list-tail * + node-list-head * + node-list-sublist * + node-list-count * + node-list-last * + there-exist? * + for-all? * + select-each * + union-for-each * +10.2.3 node-list-property * + origin * + origin-to-subnode-rel * + tree-root * + grove-root * + source * + subtree * + subgrove * + ancestors * + grove-root-path * + rsiblings * + ipreced * + ifollow * + grove-before? * + sort-in-tree-order * + tree-before? * + tree-before * + property-lookup * + select-by-property * + select-by-null-property * + select-by-missing-property * +10.2.5 attribute * + referent * + q-element * + q-class * + q-sdata * +10.3.1 word-parse + select-tokens +10.3.2 regexp? +10.3.3 regexp-node + regexp-seq + regexp-or + regexp-and + regexp-rep + regexp-plus + regexp-opt + regexp-range + string->regexp +10.3.4 regexp-search + regexp-search-disjoint + + +Transformation language +======================= + + +Style language +============== + +12.4.1 query * +12.4.6 char-script-case + declare-char-characteristic+property * +12.4.7 sync + side-sync +12.5.1 generated-object? +12.5.1.1 general-indirect-sosofo + asis-indirect-sosofo + number-indirect-sosofo +12.5.1.2 page-number + category-page-number + page-number-in-node + total-node-page-numbers + column-number + footnote-number + line-number +12.5.1.3 declare-reference-value-type + first-area-reference-value + last-area-reference-value + last-preceding-area-reference-value + all-area-reference-value +12.5.3 decoration-area + decorated-area-width + decorated-area-height +12.5.7 font-property + + +Missing color spaces +==================== + +ISO/IEC 10179:1996//Color-Space Family::Device Gray * +ISO/IEC 10179:1996//Color-Space Family::Device CMYK * +ISO/IEC 10179:1996//Color-Space Family::Device KX * +ISO/IEC 10179:1996//Color-Space Family::CIE LAB * +ISO/IEC 10179:1996//Color-Space Family::CIE LUV * +ISO/IEC 10179:1996//Color-Space Family::CIE Based ABC * +ISO/IEC 10179:1996//Color-Space Family::CIE Based A * + + +Missing flow object classes +=========================== + +page-sequence (and related expression language primitives and types) +column-set-sequence (and related expression language primitives and types) +anchor +embedded-text +included-container-area +side-by-side * (only some backends) +side-by-side-item * (only some backends) +glyph-annotation +aligned-column +multi-line-inline-note +emphasizing-mark + + +Ignored inherited characteristics +================================= + +force!c * +inline-space-space * +line-miter-limit +alignment-point-offset +hyphenation-char +asis-truncate-char +asis-wrap-char +first-line-align +hyphenation-exceptions +box-corner-rounded +table-corner-rounded +line-dash +allowed-ligatures +line-number +line-spacing-priority +char-map * --- openjade-1.4devel1.orig/dsssl/Makefile.am +++ openjade-1.4devel1/dsssl/Makefile.am @@ -3,10 +3,12 @@ pkgdata_DATA = builtins.dsl catalog dsssl.dtd \ style-sheet.dtd spec.dtd fot.dtd extensions.dsl -docdir = $(prefix)/doc +docdir = $(datadir)/doc pkgdocdir = $(docdir)/@PACKAGE@ pkgdoc_DATA = demo.dsl demo.sgm EXTRA_DIST = builtins.dsl catalog demo.dsl demo.sgm dsssl.dtd \ extensions.dsl fot.dtd spec.dtd style-sheet.dtd + +MAINTAINERCLEANFILES = Makefile.in --- openjade-1.4devel1.orig/dsssl/builtins.dsl +++ openjade-1.4devel1/dsssl/builtins.dsl @@ -342,7 +342,7 @@ nl)) ;; clause 10.2.5 -(define (attribute string nl) +(define (attribute name nl) (node-list-map (lambda (snl) (named-node name (attributes snl))) nl)) --- openjade-1.4devel1.orig/dsssl/extensions.dsl +++ openjade-1.4devel1/dsssl/extensions.dsl @@ -135,6 +135,10 @@ "UNREGISTERED::James Clark//Characteristic::page-balance-columns?" #f) +(declare-characteristic page-two-side? + "UNREGISTERED::OpenJade//Characteristic::page-two-side?" + #f) + (declare-characteristic superscript-height "UNREGISTERED::James Clark//Characteristic::superscript-height" 0pt) --- openjade-1.4devel1.orig/grove/Makefile.am +++ openjade-1.4devel1/grove/Makefile.am @@ -2,7 +2,7 @@ lib_LTLIBRARIES = libogrove.la -libogrove_la_LDFLAGS = -version-info 0:0:0 +libogrove_la_LDFLAGS = -version-info 1:0:0 libogrove_la_SOURCES = Node.h Node.cxx LocNode.h LocNode.cxx @@ -10,3 +10,5 @@ pkginclude_HEADERS = Node.h EXTRA_DIST = grove.dsp + +MAINTAINERCLEANFILES = Makefile.in --- openjade-1.4devel1.orig/grove/Node.cxx +++ openjade-1.4devel1/grove/Node.cxx @@ -547,7 +547,7 @@ ret = getEntityType(type); if (ret == accessOK) { switch (type) { -#define ENUM(e, E) case EntityType::##e: value.set(ComponentName::id##E); break; +#define ENUM(e, E) case EntityType::e: value.set(ComponentName::id##E); break; ENUM(text, Text) ENUM(cdata, Cdata) ENUM(sdata, Sdata) @@ -567,7 +567,7 @@ ret = getDeclValueType(type); if (ret == accessOK) { switch (type) { -#define ENUM(e, E) case DeclValueType::##e: value.set(ComponentName::id##E); break; +#define ENUM(e, E) case DeclValueType::e: value.set(ComponentName::id##E); break; ENUM(cdata, Cdata) ENUM(entity, Entity) ENUM(entities, Entities) @@ -597,7 +597,7 @@ ret = getDefaultValueType(type); if (ret == accessOK) { switch (type) { -#define ENUM(e, E) case DefaultValueType::##e: value.set(ComponentName::id##E); break; +#define ENUM(e, E) case DefaultValueType::e: value.set(ComponentName::id##E); break; ENUM(value, Value) ENUM(fixed, Fixed) ENUM(required, Required) @@ -617,7 +617,7 @@ ret = getContentType(type); if (ret == accessOK) { switch (type) { -#define ENUM(e, E) case ContentType::##e: value.set(ComponentName::id##E); break; +#define ENUM(e, E) case ContentType::e: value.set(ComponentName::id##E); break; ENUM(cdata, Cdata) ENUM(rcdata, Rcdata) ENUM(empty, Empty) @@ -636,7 +636,7 @@ ret = getConnector(type); if (ret == accessOK) { switch (type) { -#define ENUM(e, E) case Connector::##e: value.set(ComponentName::id##E); break; +#define ENUM(e, E) case Connector::e: value.set(ComponentName::id##E); break; ENUM(and_, And) ENUM(or_, Or) ENUM(seq, Seq) @@ -653,7 +653,7 @@ ret = getOwnerType(type); if (ret == accessOK) { switch (type) { -#define ENUM(e, E) case OwnerType::##e: value.set(ComponentName::id##E); break; +#define ENUM(e, E) case OwnerType::e: value.set(ComponentName::id##E); break; ENUM(iso, Iso) ENUM(registered, Registered) ENUM(unregistered, Unregistered) @@ -670,7 +670,7 @@ ret = getTextClass(tclass); if (ret == accessOK) { switch (tclass) { -#define ENUM(e, E) case TextClass::##e: value.set(ComponentName::id##E); break; +#define ENUM(e, E) case TextClass::e: value.set(ComponentName::id##E); break; ENUM(capacity, Capacity) ENUM(charset, Charset) ENUM(document, Document) --- openjade-1.4devel1.orig/groveoa/CGroveBuilder.cxx +++ openjade-1.4devel1/groveoa/CGroveBuilder.cxx @@ -0,0 +1,377 @@ +// CGroveBuilder.cpp : Implementation of CGroveBuilder + +#include "stdafx.h" +#include "groveoa.h" +#include "CGroveBuilder.h" +#include "GroveBuilder.h" +#include "ErrorCountEventHandler.h" +#include "GroveNode.h" +#include "MessageTable.h" +#include "ArcEngine.h" +#include +#include +#include +#define STRICT +#include + +using SP_NAMESPACE::StringC; + +#ifdef SP_NO_STD_NAMESPACE +#define std /* as nothing */ +#endif + +#define TRY try { +#define CATCH } catch (std::bad_alloc) { return E_OUTOFMEMORY; } + +/* We need to keep a reference to the entity manager, because +StoragePos can use storage managers that are owned by the entity +manager. */ + +class SpParserThread : + public ParserThread, + public SP_NAMESPACE::Messenger, + public SP_NAMESPACE::MessageFormatter { +public: + SpParserThread() : cancel_(0) { } + ~SpParserThread(); + void run(); + void dispatchMessage(const SP_NAMESPACE::Message &); + SP_NAMESPACE::Boolean getMessageText(const SP_NAMESPACE::MessageFragment &, SP_NAMESPACE::StringC &); + + SP_NAMESPACE::Owner eh; + SP_NAMESPACE::SgmlParser parser; + SP_NAMESPACE::Ptr em; + SP_NAMESPACE::Vector archNames; + static unsigned __stdcall start(void *p); +private: + sig_atomic_t cancel_; + HANDLE thread_; +}; + +void convertBSTR(BSTR str, StringC &result) +{ + if (str) + result.assign(str, ::SysStringLen(str)); + else + result.resize(0); +} + +STDMETHODIMP CGroveBuilder::parse(BSTR sysid, SgmlDocumentNode **retval) +{ + return archParse( sysid, 0, retval ); +} + +STDMETHODIMP CGroveBuilder::archParse + (BSTR sysid, BSTR archNames, SgmlDocumentNode **retval) +{ + TRY + SpParserThread *parserThread = new SpParserThread; + SP_NAMESPACE::Owner tem(parserThread); + + if( archNames != 0 ) { + StringC archNames_; + convertBSTR(archNames, archNames_); + StringC archName; + for( short i = 0; i < archNames_.size(); i++ ) + if( archNames_[i] != ' ' ) + archName += archNames_[i]; + else if( archName.size() != 0 ) { + parserThread->archNames.push_back( archName ); + archName.resize( 0 ); + } + if( archName.size() != 0 ) + parserThread->archNames.push_back( archName ); + } + + GROVE_NAMESPACE::NodePtr root; + parserThread->eh + = SP_NAMESPACE::GroveBuilder::make(0, parserThread, parserThread, validateOnly_ != 0, root); + StringC str(sysid, sysid ? ::SysStringLen(sysid) : 0); + app_.initParser(str, parserThread->parser, parserThread->em); + parserThread->run(); + return makeRootNode(root, tem, retval); + CATCH +} + +static +HRESULT makeBSTR(const StringC &str, BSTR *retval) +{ + if (str.size() == 0) + *retval = 0; + else { + *retval = ::SysAllocStringLen(str.data(), str.size()); + if (!*retval) + return E_OUTOFMEMORY; + } + return NOERROR; +} + +STDMETHODIMP CGroveBuilder::get_ExtraCatalogs(BSTR *retval) +{ + return makeBSTR(app_.extraCatalogs(), retval); +} + +STDMETHODIMP CGroveBuilder::put_ExtraCatalogs(BSTR str) +{ + TRY + StringC tem; + convertBSTR(str, tem); + app_.setExtraCatalogs(tem); + return NOERROR; + CATCH +} + +STDMETHODIMP CGroveBuilder::get_DefaultCatalogs(BSTR *retval) +{ + return makeBSTR(app_.defaultCatalogs(), retval); +} + +STDMETHODIMP CGroveBuilder::put_DefaultCatalogs(BSTR str) +{ + TRY + StringC tem; + convertBSTR(str, tem); + app_.setDefaultCatalogs(tem); + return NOERROR; + CATCH +} + +STDMETHODIMP CGroveBuilder::get_ExtraDirectories(BSTR *retval) +{ + return makeBSTR(app_.extraDirectories(), retval); +} + +STDMETHODIMP CGroveBuilder::put_ExtraDirectories(BSTR str) +{ + TRY + StringC tem; + convertBSTR(str, tem); + app_.setExtraDirectories(tem); + return NOERROR; + CATCH +} + +STDMETHODIMP CGroveBuilder::get_DefaultDirectories(BSTR *retval) +{ + return makeBSTR(app_.defaultDirectories(), retval); +} + +STDMETHODIMP CGroveBuilder::put_DefaultDirectories(BSTR str) +{ + TRY + StringC tem; + convertBSTR(str, tem); + app_.setDefaultDirectories(tem); + return NOERROR; + CATCH +} + +STDMETHODIMP CGroveBuilder::get_Encoding(BSTR *retval) +{ + return makeBSTR(app_.encoding(), retval); +} + +STDMETHODIMP CGroveBuilder::put_Encoding(BSTR str) +{ + TRY + StringC tem; + convertBSTR(str, tem); + app_.setEncoding(tem); + // FIXME give an error for a illegal encoding + return NOERROR; + CATCH +} + +STDMETHODIMP CGroveBuilder::get_DefaultEncoding(BSTR *retval) +{ + return makeBSTR(app_.defaultEncoding(), retval); +} + +STDMETHODIMP CGroveBuilder::put_DefaultEncoding(BSTR str) +{ + TRY + StringC tem; + convertBSTR(str, tem); + app_.setDefaultEncoding(tem); + return NOERROR; + CATCH +} + +STDMETHODIMP CGroveBuilder::get_Includes(BSTR *retval) +{ + TRY + SP_NAMESPACE::StringC tem; + for (size_t i = 0; i < app_.options.includes.size(); i++) { + if (i) + tem += ','; + tem += app_.options.includes[i]; + } + return makeBSTR(tem, retval); + CATCH +} + +STDMETHODIMP CGroveBuilder::put_Includes(BSTR str) +{ + TRY + SP_NAMESPACE::Vector &v = app_.options.includes; + v.resize(0); + if (str) { + SP_NAMESPACE::Boolean started = 0; + for (; *str; str++) { + if (*str == ',') + started = 0; + else { + if (!started) { + v.resize(v.size() + 1); + started = 1; + } + v.back() += *str; + } + } + } + return NOERROR; + CATCH +} + +STDMETHODIMP CGroveBuilder::get_Warning(WarningType type, VARIANT_BOOL *retval) +{ + *retval = 0; + SP_NAMESPACE::PackedBoolean *p = lookupWarningType(type); + if (!p) + return E_INVALIDARG; + *retval = *p ? -1 : 0; + return NOERROR; +} + +STDMETHODIMP CGroveBuilder::put_Warning(WarningType type, VARIANT_BOOL b) +{ + SP_NAMESPACE::PackedBoolean *p = lookupWarningType(type); + if (!p) + return E_INVALIDARG; + *p = b ? 1 : 0; + return NOERROR; +} + +SP_NAMESPACE::PackedBoolean *CGroveBuilder::lookupWarningType(WarningType type) +{ + switch (type) { +#define ENTRY(w) case warning##w: return &app_.options.warn##w; + ENTRY(SgmlDecl) + ENTRY(DuplicateEntity) + ENTRY(Should) + ENTRY(UndefinedElement) + ENTRY(DefaultEntityReference) + ENTRY(MixedContent) + ENTRY(EmptyTag) + ENTRY(UnusedMap) + ENTRY(UnusedParam) + ENTRY(NotationSystemId) +#undef ENTRY + case warningUnclosedTag: + return &app_.options.noUnclosedTag; + case warningNet: + return &app_.options.noNet; + } + return 0; +} + +STDMETHODIMP CGroveBuilder::get_Error(ErrorType type, VARIANT_BOOL *retval) +{ + *retval = 0; + if (type == errorValid) { + *retval = (app_.options.typeValid == 0 ? 0 : -1); + return NOERROR; + } + SP_NAMESPACE::PackedBoolean *p = lookupErrorType(type); + if (!p) + return E_INVALIDARG; + *retval = *p ? -1 : 0; + return NOERROR; +} + +STDMETHODIMP CGroveBuilder::put_Error(ErrorType type, VARIANT_BOOL b) +{ + if (type == errorValid) { + app_.options.typeValid = (b ? SP_NAMESPACE::ParserOptions::sgmlDeclTypeValid : 0); + return NOERROR; + } + SP_NAMESPACE::PackedBoolean *p = lookupErrorType(type); + if (!p) + return E_INVALIDARG; + *p = b ? 1 : 0; + return NOERROR; +} + +SP_NAMESPACE::PackedBoolean *CGroveBuilder::lookupErrorType(ErrorType type) +{ + switch (type) { +#define ENTRY(e) case error##e: return &app_.options.error##e; + ENTRY(Idref) + ENTRY(Significant) + ENTRY(Afdr) +#undef ENTRY + case errorLpdNotation: + return &errorLpdNotation_; + } + return 0; +} + +STDMETHODIMP CGroveBuilder::get_ValidateOnly(VARIANT_BOOL *retval) +{ + *retval = validateOnly_; + return NOERROR; +} + +STDMETHODIMP CGroveBuilder::put_ValidateOnly(VARIANT_BOOL b) +{ + validateOnly_ = b; + return NOERROR; +} + +SpParserThread::~SpParserThread() +{ + cancel_ = 1; + ::WaitForSingleObject(thread_, INFINITE); + ::CloseHandle(thread_); +} + +unsigned __stdcall SpParserThread::start(void *p) +{ + SpParserThread *arg = (SpParserThread *)p; + try { + if (arg->archNames.size() > 0) { + SP_NAMESPACE::SelectOneArcDirector director(arg->archNames, *arg->eh); + SP_NAMESPACE::ArcEngine::parseAll(arg->parser, director, director, &arg->cancel_); + } else + arg->parser.parseAll(*arg->eh, &arg->cancel_); + } + catch (std::bad_alloc) { + // FIXME how to report this? + } + arg->eh.clear(); + // Release the parser + SP_NAMESPACE::SgmlParser tem; + tem.swap(arg->parser); + return 0; +} + +void SpParserThread::run() +{ + unsigned id; + thread_ = HANDLE(_beginthreadex(NULL, 0, start, this, 0, &id)); +} + +void SpParserThread::dispatchMessage(const SP_NAMESPACE::Message &) +{ +} + +SP_NAMESPACE::Boolean +SpParserThread::getMessageText(const SP_NAMESPACE::MessageFragment &frag, + StringC &text) +{ + SP_NAMESPACE::String str; + if (!SP_NAMESPACE::MessageTable::instance()->getText(frag, str)) + return 0; + text.assign((const SP_NAMESPACE::Char *)str.data(), str.size()); + return 1; +} --- openjade-1.4devel1.orig/groveoa/CGroveBuilder.h +++ openjade-1.4devel1/groveoa/CGroveBuilder.h @@ -0,0 +1,61 @@ +// CGroveBuilder.h : Declaration of the CGroveBuilder + +#ifndef __GROVEBUILDER_H_ +#define __GROVEBUILDER_H_ + +#include "resource.h" // main symbols +#include "config.h" +#include "WinApp.h" +#include "Message.h" +#include "MessageFormatter.h" + +///////////////////////////////////////////////////////////////////////////// +// CGroveBuilder +class ATL_NO_VTABLE CGroveBuilder : + public CComObjectRoot, + public CComCoClass, + public IDispatchImpl<_GroveBuilder, &IID__GroveBuilder, &LIBID_GROVE> +{ +public: + CGroveBuilder() : validateOnly_(0), errorLpdNotation_(0) { } + +DECLARE_REGISTRY_RESOURCEID(IDR_GROVEBUILDER) + +BEGIN_COM_MAP(CGroveBuilder) + COM_INTERFACE_ENTRY(_GroveBuilder) + COM_INTERFACE_ENTRY(IDispatch) +END_COM_MAP() +// IGroveBuilder +public: + STDMETHOD(parse)(BSTR sysid, SgmlDocumentNode **root); + STDMETHOD(archParse)(BSTR sysid, BSTR archNames, SgmlDocumentNode **root); + STDMETHOD(get_ExtraCatalogs)(BSTR *); + STDMETHOD(put_ExtraCatalogs)(BSTR); + STDMETHOD(get_DefaultCatalogs)(BSTR *); + STDMETHOD(put_DefaultCatalogs)(BSTR); + STDMETHOD(get_ExtraDirectories)(BSTR *); + STDMETHOD(put_ExtraDirectories)(BSTR); + STDMETHOD(get_DefaultDirectories)(BSTR *); + STDMETHOD(put_DefaultDirectories)(BSTR); + STDMETHOD(get_Encoding)(BSTR *); + STDMETHOD(put_Encoding)(BSTR); + STDMETHOD(get_DefaultEncoding)(BSTR *); + STDMETHOD(put_DefaultEncoding)(BSTR); + STDMETHOD(get_Includes)(BSTR *); + STDMETHOD(put_Includes)(BSTR); + STDMETHOD(get_Warning)(WarningType, VARIANT_BOOL *); + STDMETHOD(put_Warning)(WarningType, VARIANT_BOOL); + STDMETHOD(get_Error)(ErrorType, VARIANT_BOOL *); + STDMETHOD(put_Error)(ErrorType, VARIANT_BOOL); + STDMETHOD(get_ValidateOnly)(VARIANT_BOOL *); + STDMETHOD(put_ValidateOnly)(VARIANT_BOOL); +private: + SP_NAMESPACE::PackedBoolean *lookupWarningType(WarningType type); + SP_NAMESPACE::PackedBoolean *lookupErrorType(ErrorType type); + SP_NAMESPACE::WinApp app_; + VARIANT_BOOL validateOnly_; + // This is just for binary compatibility. + SP_NAMESPACE::PackedBoolean errorLpdNotation_; +}; + +#endif //__GROVEBUILDER_H_ --- openjade-1.4devel1.orig/groveoa/GroveBuilder.rgs +++ openjade-1.4devel1/groveoa/GroveBuilder.rgs @@ -0,0 +1,25 @@ +HKCR +{ + SP.GroveBuilder.1 = s 'GroveBuilder Class' + { + CLSID = s '{557CE382-9EBD-11D0-9083-0020AF41CFC2}' + } + SP.GroveBuilder = s 'GroveBuilder Class' + { + CLSID = s '{557CE382-9EBD-11D0-9083-0020AF41CFC2}' + CurVer = s 'SP.GroveBuilder.1' + } + NoRemove CLSID + { + ForceRemove {557CE382-9EBD-11D0-9083-0020AF41CFC2} = s 'GroveBuilder Class' + { + ProgID = s 'SP.GroveBuilder.1' + VersionIndependentProgID = s 'SP.GroveBuilder' + ForceRemove 'Programmable' + InprocServer32 = s '%MODULE%' + { + val ThreadingModel = s 'Apartment' + } + } + } +} --- openjade-1.4devel1.orig/groveoa/GroveNode.cxx +++ openjade-1.4devel1/groveoa/GroveNode.cxx @@ -0,0 +1,1483 @@ +// GroveNode.cxx + +#include "stdafx.h" +#include "groveoa.h" +#include "config.h" +#include "GroveNode.h" +#include "Boolean.h" +#include "Node.h" +#include "LocNode.h" +#include "PointerTable.h" +#include "NamedResource.h" +#include "Ptr.h" +#include "Owner.h" +#include "ExtendEntityManager.h" +#include "StorageManager.h" +#include +#include +#include +#include + +#ifdef SP_NO_STD_NAMESPACE +#define std /* as nothing */ +#endif + +#define TRY try { +#define CATCH } catch (std::bad_alloc) { return E_OUTOFMEMORY; } + +// A NULL BSTR is supposed to be equivalent to an empty BSTR +// but not everybody gets this right (perl build 306, for example) + +inline +BSTR makeEmptyBSTR() +{ + return ::SysAllocStringLen(0, 0); +} + +using GROVE_NAMESPACE::NodePtr; +using GROVE_NAMESPACE::NodeListPtr; +using GROVE_NAMESPACE::NamedNodeListPtr; +using GROVE_NAMESPACE::GroveString; +using GROVE_NAMESPACE::GroveStringList; +using GROVE_NAMESPACE::GroveStringListPtr; +using GROVE_NAMESPACE::ConstGroveStringListIter; +using GROVE_NAMESPACE::GroveChar; +using GROVE_NAMESPACE::accessOK; +using GROVE_NAMESPACE::accessNull; +using GROVE_NAMESPACE::accessNotInClass; +using GROVE_NAMESPACE::SdataMapper; + +class NodeTable; +typedef SP_NAMESPACE::Ptr NodeTablePtr; + +class ATL_NO_VTABLE CStringList : + public CComObjectRoot, + public IDispatchImpl { +public: + CStringList() { } +BEGIN_COM_MAP(CStringList) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(StringList) +END_COM_MAP() + STDMETHOD(get_Count)(long *); + STDMETHOD(get_Item)(long, BSTR *retval); + STDMETHOD(First)(BSTR *retval); + STDMETHOD(Rest)(StringList **); + static HRESULT make(const GroveStringListPtr &, StringList **); +private: + GroveStringListPtr sl_; +}; + +class CNodeBase { +public: + virtual ~CNodeBase(); + void init(const NodePtr &nd, const NodeTablePtr &); + static HRESULT make(const NodePtr &, const NodeTablePtr &, Node **); + static BSTR makeBSTR(const GroveString &); + static const GROVE_NAMESPACE::Node &key(const CNodeBase &obj) { + return *obj.nd_; + } + static unsigned long hash(const GROVE_NAMESPACE::Node &nd) { + return nd.hash(); + } + virtual Node *asNode() = 0; + HRESULT internalGetStoragePos(StoragePos **); +protected: + CNodeBase() { } + NodePtr nd_; + NodeTablePtr table_; +}; + +class NodeTable +: public SP_NAMESPACE::Resource, + public SP_NAMESPACE::PointerTable { +public: + NodeTable(SP_NAMESPACE::Owner &thd) { + thd.swap(thread_); + } +private: + SP_NAMESPACE::Owner thread_; +}; + +class ATL_NO_VTABLE CNodeList : + public CComObjectRoot, + public IDispatchImpl { +public: + CNodeList() { } +BEGIN_COM_MAP(CNodeList) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(NodeList) +END_COM_MAP() + STDMETHOD(get_Count)(long *); + STDMETHOD(get_Item)(long, Node **); + STDMETHOD(get__NewEnum)(IUnknown **); + STDMETHOD(First)(Node **); + STDMETHOD(Rest)(NodeList **); + static HRESULT make(const NodeListPtr &, const NodeTablePtr &, NodeList **); +private: + NodeListPtr nl_; + NodeTablePtr table_; +}; + +class ATL_NO_VTABLE CChunkNodeList : + public CComObjectRoot, + public IDispatchImpl { +public: + CChunkNodeList() { } +BEGIN_COM_MAP(CChunkNodeList) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(NodeList) +END_COM_MAP() + STDMETHOD(get_Count)(long *); + STDMETHOD(get_Item)(long, Node **); + STDMETHOD(get__NewEnum)(IUnknown **); + STDMETHOD(First)(Node **); + STDMETHOD(Rest)(NodeList **); + static HRESULT make(const NodeListPtr &, const NodeTablePtr &, NodeList **); +private: + NodeListPtr nl_; + NodeTablePtr table_; +}; + +class ATL_NO_VTABLE CNamedNodeList : + public CComObjectRoot, + public IDispatchImpl { +public: + CNamedNodeList() { } +BEGIN_COM_MAP(CNamedNodeList) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(NamedNodeList) +END_COM_MAP() + STDMETHOD(get_Count)(long *); + STDMETHOD(get_Item)(BSTR, Node **); + STDMETHOD(get__NewEnum)(IUnknown **); + STDMETHOD(get_NodeList)(NodeList **); + STDMETHOD(Normalize)(BSTR, BSTR *); + STDMETHOD(NodeName)(Node *, BSTR *); + static HRESULT make(const NamedNodeListPtr &, const NodeTablePtr &, NamedNodeList **); +private: + NamedNodeListPtr nnl_; + NodeTablePtr table_; +}; + +class ATL_NO_VTABLE CStoragePos : + public CComObjectRoot, + public IDispatchImpl { +public: + CStoragePos() { } + BEGIN_COM_MAP(CStoragePos) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(StoragePos) + END_COM_MAP() + STDMETHOD(get_StorageManagerName)(BSTR *retval) { + const char *s = loc_.storageObjectSpec->storageManager->type(); + BSTR tem = ::SysAllocStringLen(0, strlen(s)); + *retval = tem; + if (!tem) + return E_OUTOFMEMORY; + while (*s) + *tem++ = *s++; + return NOERROR; + } + STDMETHOD(get_StorageObjectId)(BSTR *retval) { + const SP_NAMESPACE::StringC &id = loc_.actualStorageId; + CComBSTR tem(id.size(), id.data()); + *retval = tem.Detach(); + return *retval ? NOERROR : E_OUTOFMEMORY; + } + STDMETHOD(get_LineNumber)(long *retval) { + *retval = loc_.lineNumber; + if (*retval < 0) + *retval = 0; + return NOERROR; + } + STDMETHOD(get_ColumnNumber)(long *retval) { + *retval = loc_.columnNumber; + if (*retval < 0) + *retval = 0; + return NOERROR; + } + STDMETHOD(get_ByteIndex)(long *retval) { + *retval = loc_.byteIndex + 1; + return NOERROR; + } + STDMETHOD(get_CharacterIndex)(long *retval) { + *retval = loc_.storageObjectOffset + 1; + return NOERROR; + } + static HRESULT make(const SP_NAMESPACE::ExternalInfo *, + SP_NAMESPACE::Offset, + const NodePtr &, + StoragePos **); +private: + SP_NAMESPACE::StorageObjectLocation loc_; + NodePtr nd_; +}; + +#define NODE_PROP2(xfunc, ifunc) \ + STDMETHOD(xfunc)(Node **retval) { \ + TRY \ + *retval = 0; \ + NodePtr nd; \ + if (nd_->ifunc(nd) == accessOK) \ + return make(nd, table_, retval); \ + return NOERROR; \ + CATCH \ + } +#define NODE_PROP(Name) NODE_PROP2(get_##Name, get##Name) + +#define DERIVED_NODE_PROP2(xfunc, ifunc, cls) \ + STDMETHOD(xfunc)(cls##Node **retval) { \ + TRY \ + *retval = 0; \ + NodePtr nd; \ + if (nd_->ifunc(nd) == accessOK) { \ + Node *base; \ + HRESULT hres = make(nd, table_, &base); \ + *retval = (cls##Node *)base; \ + return hres; \ + } \ + return NOERROR; \ + CATCH \ + } +#define DERIVED_NODE_PROP(Name, cls) DERIVED_NODE_PROP2(get_##Name, get##Name, cls) + + +#define NODE_LIST_PROP2(xfunc, ifunc) \ + STDMETHOD(xfunc)(NodeList **retval) { \ + TRY \ + *retval = 0; \ + NodeListPtr nl; \ + if (nd_->ifunc(nl) == accessOK) \ + return CNodeList::make(nl, table_, retval); \ + return NOERROR; \ + CATCH \ + } +#define NODE_LIST_PROP(Name) NODE_LIST_PROP2(get_##Name, get##Name) + +#define STRING_LIST_PROP2(xfunc, ifunc) \ + STDMETHOD(xfunc)(StringList **retval) { \ + TRY \ + *retval = 0; \ + GroveStringListPtr sl; \ + if (nd_->ifunc(sl) == accessOK) \ + return CStringList::make(sl, retval); \ + return NOERROR; \ + CATCH \ + } +#define STRING_LIST_PROP(Name) STRING_LIST_PROP2(get_##Name, get##Name) + +#define CHUNK_NODE_LIST_PROP2(xfunc, ifunc) \ + STDMETHOD(xfunc)(NodeList **retval) { \ + TRY \ + *retval = 0; \ + NodeListPtr nl; \ + if (nd_->ifunc(nl) == accessOK) \ + return CChunkNodeList::make(nl, table_, retval); \ + return NOERROR; \ + CATCH \ + } + +#define NAMED_NODE_LIST_PROP2(xfunc, ifunc) \ + STDMETHOD(xfunc)(NamedNodeList **retval) { \ + TRY \ + *retval = 0; \ + NamedNodeListPtr nnl; \ + if (nd_->ifunc(nnl) == accessOK) \ + return CNamedNodeList::make(nnl, table_, retval); \ + return NOERROR; \ + CATCH \ + } +#define NAMED_NODE_LIST_PROP(Name) \ + NAMED_NODE_LIST_PROP2(get_##Name, get##Name) + +#define BOOL_PROP2(xfunc, ifunc) \ + STDMETHOD(xfunc)(VARIANT_BOOL *retval) { \ + TRY \ + bool b; \ + if (nd_->ifunc(b) == accessOK) \ + *retval = b ? -1 : 0; \ + else \ + *retval = 0; \ + return NOERROR; \ + CATCH \ + } +#define BOOL_PROP(Name) BOOL_PROP2(get_##Name, get##Name) + +#define INTEGER_PROP2(xfunc, ifunc) \ + STDMETHOD(xfunc)(long *retval) { \ + TRY \ + long l; \ + if (nd_->ifunc(l) == accessOK) \ + *retval = l; \ + else \ + *retval = 0; \ + return NOERROR; \ + CATCH \ + } +#define INTEGER_PROP(Name) INTEGER_PROP2(get_##Name, get##Name) + +#define STRING_PROP2(xfunc, ifunc) \ + STDMETHOD(xfunc)(BSTR *retval) { \ + TRY \ + *retval = 0; \ + GroveString str; \ + if (nd_->ifunc(str) == accessOK) \ + *retval = makeBSTR(str); \ + else \ + *retval = makeEmptyBSTR(); \ + return NOERROR; \ + CATCH \ + } +#define STRING_PROP(Name) STRING_PROP2(get_##Name, get##Name) + +#define ENUM_PROP2(enumClass, xfunc, ifunc) \ + STDMETHOD(xfunc)(enumClass *retval) { \ + GROVE_NAMESPACE::Node::##enumClass##::Enum type; \ + if (nd_->ifunc(type) == accessOK) \ + *retval = enumClass##(type); \ + return NOERROR; \ + } +#define ENUM_PROP(Name) ENUM_PROP2(Name, get_##Name, get##Name) + +#define NULL_STRING_PROP(Name) \ + STRING_PROP(Name) \ + STDMETHOD(get_##Name##Null)(VARIANT_BOOL *retval) { \ + TRY \ + *retval = 0; \ + GroveString str; \ + if (nd_->get##Name(str) == accessNull) \ + *retval = -1; \ + return NOERROR; \ + CATCH \ + } + + +template +class INodeImpl : public IDispatchImpl, public CNodeBase { +public: + NODE_PROP(Parent) + NODE_PROP(Origin) + NODE_PROP(GroveRoot) + NODE_PROP(TreeRoot) + NODE_LIST_PROP2(get_Children, children) + CHUNK_NODE_LIST_PROP2(get_ChunkChildren, children) + NODE_PROP2(FirstChild, firstChild) + NODE_PROP2(NextSibling, nextSibling) + NODE_PROP2(NextChunkSibling, nextChunkSibling) + STDMETHOD(get_Class)(NodeClass *retval) { + TRY + *retval = nodeClass; + return NOERROR; + CATCH + } + STDMETHOD(get_SiblingIndex)(long *retval) { + TRY + unsigned long n; + if (nd_->siblingsIndex(n) == accessOK) + *retval = n + 1; + else + *retval = 0; + return NOERROR; + CATCH + } + Node *asNode() { return this; } + STDMETHOD(get_StoragePos)(StoragePos **retval) { + return internalGetStoragePos(retval); + } +}; + +class ATL_NO_VTABLE CElementNode : + public CComObjectRoot, + public INodeImpl { +public: + CElementNode() { } +BEGIN_COM_MAP(CElementNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(ElementNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + STRING_PROP(Gi) + NAMED_NODE_LIST_PROP(Attributes) + STRING_PROP(Id) + NODE_LIST_PROP(Content) + CHUNK_NODE_LIST_PROP2(get_ChunkContent, getContent) + BOOL_PROP(Included) + BOOL_PROP(MustOmitEndTag) + DERIVED_NODE_PROP(ElementType, ElementType) +}; + +class ATL_NO_VTABLE CAttributeAssignmentNode : + public CComObjectRoot, + public INodeImpl { +public: + CAttributeAssignmentNode() { } +BEGIN_COM_MAP(CAttributeAssignmentNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(AttributeAssignmentNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + STRING_PROP(Name) + BOOL_PROP(Implied) + NODE_LIST_PROP(Value) + CHUNK_NODE_LIST_PROP2(get_ChunkValue, getValue) + STDMETHOD(get_TokenSep)(long *retval) { + TRY + GroveChar ch; + if (nd_->getTokenSep(ch) == accessOK) + *retval = ch; + else + *retval = -1; + return NOERROR; + CATCH + } + STDMETHOD(get_StringValue)(BSTR *retval) { + TRY + *retval = 0; + bool implied; + if (nd_->getImplied(implied) == accessOK && implied) { + *retval = makeEmptyBSTR(); + return NOERROR; + } + GroveString tokens; + if (nd_->tokens(tokens) == accessOK) { + *retval = makeBSTR(tokens); + return NOERROR; + } + NodePtr first; + if (nd_->firstChild(first) == accessOK) { + size_t len = 0; + NodePtr tem(first); + do { + GroveString chunk; + if (tem->charChunk(SdataMapper(), chunk) == accessOK) + len += chunk.size(); + } while (tem.assignNextChunkSibling() == accessOK); + GroveChar *p = ::SysAllocStringLen(0, len); + if (!p) + return E_OUTOFMEMORY; + *retval = p; + tem = first; + do { + GroveString chunk; + if (tem->charChunk(SdataMapper(), chunk) == accessOK) { + memcpy(p, chunk.data(), chunk.size()*sizeof(*p)); + p += chunk.size(); + } + } while (tem.assignNextChunkSibling() == accessOK); + } + return NOERROR; + CATCH + } + DERIVED_NODE_PROP(AttributeDef, AttributeDef) + }; + +class ATL_NO_VTABLE CAttributeValueTokenNode : + public CComObjectRoot, + public INodeImpl { +public: + CAttributeValueTokenNode() { } +BEGIN_COM_MAP(CAttributeValueTokenNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(AttributeValueTokenNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + STRING_PROP(Token) + DERIVED_NODE_PROP(Referent, Element) + DERIVED_NODE_PROP(Entity, Entity) + DERIVED_NODE_PROP(Notation, Notation) +}; + +class ATL_NO_VTABLE CSgmlDocumentNode : + public CComObjectRoot, + public INodeImpl { +public: + CSgmlDocumentNode() { } +BEGIN_COM_MAP(CSgmlDocumentNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(SgmlDocumentNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + DERIVED_NODE_PROP(DocumentElement, Element) + DERIVED_NODE_PROP(SgmlConstants, SgmlConstants) + NULL_STRING_PROP(ApplicationInfo) + NODE_LIST_PROP(Prolog) + NODE_LIST_PROP(Epilog) + NAMED_NODE_LIST_PROP(Elements) + NAMED_NODE_LIST_PROP(Entities) + NAMED_NODE_LIST_PROP(DefaultedEntities) + NAMED_NODE_LIST_PROP(DoctypesAndLinktypes) + DERIVED_NODE_PROP(GoverningDoctype, DocumentType) + NODE_LIST_PROP(Messages) +}; + +class ATL_NO_VTABLE CDataCharNode : + public CComObjectRoot, + public INodeImpl { +public: + CDataCharNode() { } +BEGIN_COM_MAP(CDataCharNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(DataCharNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + STDMETHOD(get_Char)(long *); + STDMETHOD(get_NonSgml)(long *); + STDMETHOD(get_CharChunk)(BSTR *); +}; + +class ATL_NO_VTABLE CSgmlConstantsNode : + public CComObjectRoot, + public INodeImpl { +public: + CSgmlConstantsNode() { } +BEGIN_COM_MAP(CSgmlConstantsNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(SgmlConstantsNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() +}; + +class ATL_NO_VTABLE CPiNode : + public CComObjectRoot, + public INodeImpl { +public: + CPiNode() { } +BEGIN_COM_MAP(CPiNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(PiNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + STRING_PROP(SystemData) + DERIVED_NODE_PROP(Entity, Entity) + STRING_PROP(EntityName) +}; + +class ATL_NO_VTABLE CSdataNode : + public CComObjectRoot, + public INodeImpl { +public: + CSdataNode() { } +BEGIN_COM_MAP(CSdataNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(SdataNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + STRING_PROP(SystemData) + DERIVED_NODE_PROP(Entity, Entity) + STRING_PROP(EntityName) +}; + +class ATL_NO_VTABLE CDocumentTypeNode : + public CComObjectRoot, + public INodeImpl { +public: + CDocumentTypeNode() { } +BEGIN_COM_MAP(CDocumentTypeNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(DocumentTypeNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + STRING_PROP(Name) + BOOL_PROP(Governing) + NAMED_NODE_LIST_PROP(GeneralEntities) + NAMED_NODE_LIST_PROP(Notations) + NAMED_NODE_LIST_PROP(ElementTypes) + NAMED_NODE_LIST_PROP(ParameterEntities) + DERIVED_NODE_PROP(DefaultEntity, DefaultEntity) +}; + +class ATL_NO_VTABLE CEntityNode : + public CComObjectRoot, + public INodeImpl { +public: + CEntityNode() { } +BEGIN_COM_MAP(CEntityNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(EntityNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + STRING_PROP(Name) + NULL_STRING_PROP(Text) + DERIVED_NODE_PROP(Notation, Notation) + STRING_PROP(NotationName) + BOOL_PROP(Defaulted) + NAMED_NODE_LIST_PROP(Attributes) + DERIVED_NODE_PROP(ExternalId, ExternalId) + ENUM_PROP(EntityType) +}; + +class ATL_NO_VTABLE CDefaultEntityNode : + public CComObjectRoot, + public INodeImpl { +public: + CDefaultEntityNode() { } +BEGIN_COM_MAP(CDefaultEntityNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(DefaultEntityNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + STRING_PROP(Name) + NULL_STRING_PROP(Text) + DERIVED_NODE_PROP(Notation, Notation) + STRING_PROP(NotationName) + NAMED_NODE_LIST_PROP(Attributes) + DERIVED_NODE_PROP(ExternalId, ExternalId) + ENUM_PROP(EntityType) +}; + + +class ATL_NO_VTABLE CNotationNode : + public CComObjectRoot, + public INodeImpl { +public: + CNotationNode() { } +BEGIN_COM_MAP(CNotationNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(NotationNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + STRING_PROP(Name) + DERIVED_NODE_PROP(ExternalId, ExternalId) + NAMED_NODE_LIST_PROP(AttributeDefs) +}; + +class ATL_NO_VTABLE CExternalIdNode : + public CComObjectRoot, + public INodeImpl { +public: + CExternalIdNode() { } +BEGIN_COM_MAP(CExternalIdNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(ExternalIdNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + NULL_STRING_PROP(PublicId) + NULL_STRING_PROP(SystemId) + STRING_PROP(GeneratedSystemId) +}; + +class ATL_NO_VTABLE CExternalDataNode : + public CComObjectRoot, + public INodeImpl { +public: + CExternalDataNode() { } +BEGIN_COM_MAP(CExternalDataNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(ExternalDataNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + DERIVED_NODE_PROP(Entity, Entity) + STRING_PROP(EntityName) +}; + +class ATL_NO_VTABLE CSubdocNode : + public CComObjectRoot, + public INodeImpl { +public: + CSubdocNode() { } +BEGIN_COM_MAP(CSubdocNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(SubdocNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + DERIVED_NODE_PROP(Entity, Entity) + STRING_PROP(EntityName) +}; + +class ATL_NO_VTABLE CElementTypeNode : + public CComObjectRoot, + public INodeImpl { +public: + CElementTypeNode() { } +BEGIN_COM_MAP(CElementTypeNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(ElementTypeNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + STRING_PROP(Gi) + NAMED_NODE_LIST_PROP(AttributeDefs) + ENUM_PROP(ContentType) + STRING_LIST_PROP(Exclusions) + STRING_LIST_PROP(Inclusions) + DERIVED_NODE_PROP(ModelGroup, ModelGroup) + BOOL_PROP(OmitEndTag) + BOOL_PROP(OmitStartTag) +}; + +class ATL_NO_VTABLE CAttributeDefNode : + public CComObjectRoot, + public INodeImpl { +public: + CAttributeDefNode() { } +BEGIN_COM_MAP(CElementTypeNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(ElementTypeNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + STRING_PROP(Name) + ENUM_PROP(DeclValueType) + ENUM_PROP(DefaultValueType) + STRING_LIST_PROP(Tokens) + INTEGER_PROP(CurrentAttributeIndex) + NODE_LIST_PROP(CurrentGroup) + NODE_LIST_PROP(DefaultValue) +}; + +class ATL_NO_VTABLE CModelGroupNode : + public CComObjectRoot, + public INodeImpl { +public: + CModelGroupNode() { } +BEGIN_COM_MAP(CModelGroupNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(ModelGroupNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + ENUM_PROP(Connector) + ENUM_PROP(OccurIndicator) + NODE_LIST_PROP(ContentTokens) +}; + +class ATL_NO_VTABLE CElementTokenNode : + public CComObjectRoot, + public INodeImpl { +public: + CElementTokenNode() { } +BEGIN_COM_MAP(CElementTokenNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(ElementTokenNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + STRING_PROP(Gi) + ENUM_PROP(OccurIndicator) +}; + +class ATL_NO_VTABLE CPcdataTokenNode : + public CComObjectRoot, + public INodeImpl { +public: + CPcdataTokenNode() { } +BEGIN_COM_MAP(CPcdataTokenNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(PcdataTokenNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() +}; + +class ATL_NO_VTABLE CMessageNode : + public CComObjectRoot, + public INodeImpl { +public: + CMessageNode() { } +BEGIN_COM_MAP(CMessageNode) + COM_INTERFACE_ENTRY(IDispatch) + COM_INTERFACE_ENTRY(MessageNode) + COM_INTERFACE_ENTRY(Node) +END_COM_MAP() + STRING_PROP(Text) + STDMETHOD(get_Severity)(Severity *retval) { + TRY + GROVE_NAMESPACE::Node::Severity type; + if (nd_->getSeverity(type) == accessOK) + *retval = Severity(type); + return NOERROR; + CATCH + } +}; + +class ATL_NO_VTABLE CEnumNodeList : + public CComObjectRoot, + public IEnumVARIANT { +public: + CEnumNodeList() { } +BEGIN_COM_MAP(CEnumNodeList) + COM_INTERFACE_ENTRY(IEnumVARIANT) +END_COM_MAP() + // IEnumVARIANT + STDMETHOD(Next)(ULONG celt, VARIANT *rgVar, ULONG *pCeltFetched); + STDMETHOD(Skip)(ULONG celt); + STDMETHOD(Reset)(); + STDMETHOD(Clone)(IEnumVARIANT **ppEnum); + static HRESULT make(const NodeListPtr &, const NodeTablePtr &table, IUnknown **); +private: + NodeListPtr nl_; + NodeListPtr cur_; + NodeTablePtr table_; +}; + +class ATL_NO_VTABLE CEnumChunkNodeList : + public CComObjectRoot, + public IEnumVARIANT { +public: + CEnumChunkNodeList() { } +BEGIN_COM_MAP(CEnumChunkNodeList) + COM_INTERFACE_ENTRY(IEnumVARIANT) +END_COM_MAP() + // IEnumVARIANT + STDMETHOD(Next)(ULONG celt, VARIANT *rgVar, ULONG *pCeltFetched); + STDMETHOD(Skip)(ULONG celt); + STDMETHOD(Reset)(); + STDMETHOD(Clone)(IEnumVARIANT **ppEnum); + static HRESULT make(const NodeListPtr &, const NodeTablePtr &table, IUnknown **); +private: + NodeListPtr nl_; + NodeListPtr cur_; + NodeTablePtr table_; +}; + +struct BuildVisitor : public GROVE_NAMESPACE::NodeVisitor { +public: + BuildVisitor(const NodePtr &n, const NodeTablePtr &t) + : nd(n), table(t), retval(0), hRes(NOERROR) { } +#define BUILD(mem, Cls) \ + void mem(GROVE_NAMESPACE::Node &) { \ + CComObject *p; \ + hRes = CComObject::CreateInstance(&p); \ + if (!FAILED(hRes)) { \ + p->init(nd, table); \ + retval = p; \ + (retval)->AddRef(); \ + } \ + } + BUILD(element, CElementNode) + BUILD(attributeAssignment, CAttributeAssignmentNode) + BUILD(attributeValueToken, CAttributeValueTokenNode) + BUILD(sgmlDocument, CSgmlDocumentNode) + BUILD(dataChar, CDataCharNode) + BUILD(sgmlConstants, CSgmlConstantsNode) + BUILD(pi, CPiNode) + BUILD(sdata, CSdataNode) + BUILD(documentType, CDocumentTypeNode) + BUILD(entity, CEntityNode) + BUILD(notation, CNotationNode) + BUILD(externalId, CExternalIdNode) + BUILD(externalData, CExternalDataNode) + BUILD(subdocument, CSubdocNode) + BUILD(message, CMessageNode) + BUILD(elementType, CElementTypeNode) + BUILD(modelGroup, CModelGroupNode) + BUILD(elementToken, CElementTokenNode) + BUILD(pcdataToken, CPcdataTokenNode) + BUILD(defaultEntity, CDefaultEntityNode) + BUILD(attributeDef, CAttributeDefNode) +#undef BUILD + NodePtr nd; + HRESULT hRes; + Node *retval; + NodeTablePtr table; +}; + +HRESULT CNodeBase::make(const NodePtr &nd, const NodeTablePtr &table, Node **retval) +{ + CNodeBase *nb = table->lookup(*nd); + if (nb) { + *retval = nb->asNode(); + (*retval)->AddRef(); + return NOERROR; + } + else { + BuildVisitor visitor(nd, table); + nd->accept(visitor); + *retval = visitor.retval; + return visitor.hRes; + } +} + +CNodeBase::~CNodeBase() +{ + CNodeBase *tem = table_->remove(*nd_); + if (tem != this) + abort(); +} + +void CNodeBase::init(const NodePtr &nd, const NodeTablePtr &table) +{ + table_ = table; + nd_ = nd; + table_->insert(this); +} + +BSTR CNodeBase::makeBSTR(const GroveString &str) +{ + CComBSTR bstr(str.size(), str.data()); + return bstr.Detach(); +} + +HRESULT CNodeBase::internalGetStoragePos(StoragePos **retval) +{ + TRY + const SP_NAMESPACE::LocNode *lp = SP_NAMESPACE::LocNode::convert(nd_); + if (lp) { + SP_NAMESPACE::Location loc; + if (lp->getLocation(loc) == accessOK) { + const SP_NAMESPACE::Origin *origin = loc.origin().pointer(); + SP_NAMESPACE::Index index = loc.index(); + while (origin) { + const SP_NAMESPACE::ExternalInfo *info + = origin->externalInfo(); + if (info) + return CStoragePos::make(info, origin->startOffset(index), nd_, retval); + const SP_NAMESPACE::Location &loc = origin->parent(); + index = loc.index(); + origin = loc.origin().pointer(); + } + } + } + *retval = 0; + return NOERROR; + CATCH +} + +STDMETHODIMP CDataCharNode::get_CharChunk(BSTR *retval) +{ + TRY + *retval = 0; + GroveString str; + if (nd_->charChunk(SdataMapper(), str) == accessOK) + *retval = makeBSTR(str); + else + *retval = makeEmptyBSTR(); + return NOERROR; + CATCH +} + +STDMETHODIMP CDataCharNode::get_Char(long *retval) +{ + TRY + GroveChar ch; + if (nd_->getChar(SdataMapper(), ch) == accessOK) + *retval = ch; + else + *retval = -1; + return NOERROR; + CATCH +} + +STDMETHODIMP CDataCharNode::get_NonSgml(long *retval) +{ + TRY + unsigned long n; + if (nd_->getNonSgml(n) == accessOK) + *retval = n; + else + *retval = -1; + return NOERROR; + CATCH +} +// ---------- + +HRESULT CStringList::make(const GroveStringListPtr &sl, StringList **retval) +{ + CComObject *p; + HRESULT hRes = CComObject::CreateInstance(&p); + if (FAILED(hRes)) + return hRes; + CStringList *np = p; + np->sl_ = sl; + *retval = p; + (*retval)->AddRef(); + return NOERROR; +} + +STDMETHODIMP CStringList::First(BSTR *retval) +{ + TRY + *retval = 0; + GroveString str; + if (sl_->first(str) == accessOK) { + *retval = CNodeBase::makeBSTR(str); + } + return NOERROR; + CATCH +} + +STDMETHODIMP CStringList::Rest(StringList **retval) +{ + TRY + *retval = 0; + GroveStringListPtr sl; + if (sl_->rest(sl) == accessOK) + return CStringList::make(sl, retval); + return NOERROR; + CATCH +} + +STDMETHODIMP CStringList::get_Count(long *retval) +{ + TRY + long n = 0; + for (ConstGroveStringListIter iter(sl_->iter()); !iter.done(); iter.next()) + n++; + *retval = n; + return NOERROR; + CATCH +} + +STDMETHODIMP CStringList::get_Item(long i, BSTR *retval) +{ + TRY + *retval = 0; + if (i <= 0) + return E_INVALIDARG; + ConstGroveStringListIter iter(*sl_); + for (long n = 1; n < i && !iter.done(); n++) + iter.next(); + if (iter.done()) + return E_INVALIDARG; + GroveString str; + str = iter.cur(); + *retval = CNodeBase::makeBSTR(str); + return NOERROR; + CATCH +} +// ----------- + +HRESULT CNodeList::make(const NodeListPtr &nl, const NodeTablePtr &table, NodeList **retval) +{ + CComObject *p; + HRESULT hRes = CComObject::CreateInstance(&p); + if (FAILED(hRes)) + return hRes; + CNodeList *np = p; + np->nl_ = nl; + np->table_ = table; + *retval = p; + (*retval)->AddRef(); + return NOERROR; +} + +STDMETHODIMP CNodeList::First(Node **retval) +{ + TRY + *retval = 0; + NodePtr nd; + if (nl_->first(nd) == accessOK) + return CNodeBase::make(nd, table_, retval); + return NOERROR; + CATCH +} + +STDMETHODIMP CNodeList::Rest(NodeList **retval) +{ + TRY + *retval = 0; + NodeListPtr nl; + if (nl_->rest(nl) == accessOK) + return CNodeList::make(nl, table_, retval); + return NOERROR; + CATCH +} + +STDMETHODIMP CNodeList::get_Count(long *retval) +{ + TRY + long n = 0; + NodeListPtr nl; + if (nl_->rest(nl) == accessOK) { + n++; + while (nl.assignRest() == accessOK) + n++; + } + *retval = n; + return NOERROR; + CATCH +} + +STDMETHODIMP CNodeList::get_Item(long i, Node **retval) +{ + TRY + *retval = 0; + NodePtr nd; + if (i <= 0) + return E_INVALIDARG; + if (nl_->ref(i - 1, nd) != accessOK) + return E_INVALIDARG; + return CNodeBase::make(nd, table_, retval); + CATCH +} + +STDMETHODIMP CNodeList::get__NewEnum(IUnknown **retval) +{ + TRY + return CEnumNodeList::make(nl_, table_, retval); + CATCH +} + +HRESULT CChunkNodeList::make(const NodeListPtr &nl, const NodeTablePtr &table, NodeList **retval) +{ + CComObject *p; + HRESULT hRes = CComObject::CreateInstance(&p); + if (FAILED(hRes)) + return hRes; + CChunkNodeList *np = p; + np->nl_ = nl; + np->table_ = table; + *retval = p; + (*retval)->AddRef(); + return NOERROR; +} + +STDMETHODIMP CChunkNodeList::First(Node **retval) +{ + TRY + *retval = 0; + NodePtr nd; + if (nl_->first(nd) == accessOK) + return CNodeBase::make(nd, table_, retval); + return NOERROR; + CATCH +} + +STDMETHODIMP CChunkNodeList::Rest(NodeList **retval) +{ + TRY + *retval = 0; + NodeListPtr nl; + if (nl_->chunkRest(nl) == accessOK) + return CNodeList::make(nl, table_, retval); + return NOERROR; + CATCH +} + +STDMETHODIMP CChunkNodeList::get__NewEnum(IUnknown **retval) +{ + TRY + return CEnumChunkNodeList::make(nl_, table_, retval); + CATCH +} + +STDMETHODIMP CChunkNodeList::get_Count(long *retval) +{ + TRY + long n = 0; + NodeListPtr nl; + if (nl_->chunkRest(nl) == accessOK) { + n++; + while (nl.assignChunkRest() == accessOK) + n++; + } + *retval = n; + return NOERROR; + CATCH +} + +STDMETHODIMP CChunkNodeList::get_Item(long i, Node **retval) +{ + TRY + *retval = 0; + if (i <= 0) + return E_INVALIDARG; + if (i == 1) + return First(retval); + NodeListPtr nl(nl_); + do { + if (nl.assignChunkRest() != accessOK) + return E_INVALIDARG; + } while (--i > 1); + NodePtr nd; + if (nl->first(nd) != accessOK) + return E_INVALIDARG; + return CNodeBase::make(nd, table_, retval); + CATCH +} + +STDMETHODIMP CNamedNodeList::get_Count(long *retval) +{ + TRY + NodeListPtr nl(nnl_->nodeListNoOrder()); + long n = 0; + while (nl.assignRest() == accessOK) + n++; + *retval = n; + return NOERROR; + CATCH +} + +STDMETHODIMP CNamedNodeList::get_Item(BSTR name, Node **retval) +{ + TRY + *retval = 0; + if (!name) + return E_INVALIDARG; + GroveString tem(name, ::SysStringLen(name)); + NodePtr nd; + if (nnl_->namedNode(tem, nd) != accessOK) + return E_INVALIDARG; + return CNodeBase::make(nd, table_, retval); + CATCH +} + +STDMETHODIMP CNamedNodeList::get_NodeList(NodeList **retval) +{ + TRY + return CNodeList::make(nnl_->nodeList(), table_, retval); + CATCH +} + +STDMETHODIMP CNamedNodeList::get__NewEnum(IUnknown **retval) +{ + TRY + return CEnumNodeList::make(nnl_->nodeListNoOrder(), table_, retval); + CATCH +} + +STDMETHODIMP CNamedNodeList::Normalize(BSTR name, BSTR *retval) +{ + TRY + *retval = 0; + if (name) { + size_t len = ::SysStringLen(name); + BSTR tem = ::SysAllocStringLen(name, len); + size_t newLen = nnl_->normalize(tem, len); + if (newLen != len && !::SysReAllocStringLen(&tem, tem, newLen)) { + ::SysFreeString(tem); + return E_OUTOFMEMORY; + } + *retval = tem; + } + else + *retval = makeEmptyBSTR(); + return NOERROR; + CATCH +} + +STDMETHODIMP CNamedNodeList::NodeName(Node *nd, BSTR *retval) +{ + TRY + *retval = 0; + switch (nnl_->type()) { +#define CASE(T, I, P) \ + case GROVE_NAMESPACE::NamedNodeList::T: \ + { \ + I *tem; \ + if (SUCCEEDED(nd->QueryInterface(IID_##I, (void **)&tem))) { \ + HRESULT hRes = tem->get_##P(retval); \ + tem->Release(); \ + return hRes; \ + } \ + return NOERROR; \ + } + CASE(elements,ElementNode,Id) + CASE(entities,EntityNode,Name) + CASE(notations,NotationNode,Name) + CASE(attributes,AttributeAssignmentNode,Name) + CASE(doctypesAndLinktypes,DocumentTypeNode,Name) + CASE(elementTypes,ElementTypeNode,Gi) + CASE(attributeDefs,AttributeDefNode,Name) + } + return NOERROR; + CATCH +} + +HRESULT CNamedNodeList::make(const NamedNodeListPtr &nnl, + const NodeTablePtr &table, + NamedNodeList **retval) +{ + CComObject *p; + HRESULT hRes = CComObject::CreateInstance(&p); + if (FAILED(hRes)) + return hRes; + CNamedNodeList *np = p; + np->nnl_ = nnl; + np->table_ = table; + *retval = p; + (*retval)->AddRef(); + return NOERROR; +} + +HRESULT CEnumNodeList::make(const NodeListPtr &nl, const NodeTablePtr &table, + IUnknown **retval) +{ + CComObject *p; + HRESULT hRes = CComObject::CreateInstance(&p); + if (FAILED(hRes)) + return hRes; + CEnumNodeList *np = p; + np->nl_ = nl; + np->cur_ = nl; + np->table_ = table; + return p->QueryInterface(IID_IUnknown, (void **)retval); +} + +STDMETHODIMP CEnumNodeList::Next(ULONG celt, VARIANT *rgVar, ULONG *pCeltFetched) +{ + TRY + ULONG n = 0; + for (; celt > 0; celt--, rgVar++, n++) { + NodePtr nd; + if (cur_->first(nd) != accessOK) + break; + if (cur_.assignRest() != accessOK) + goto error; + Node *ip; + if (FAILED(CNodeBase::make(nd, table_, &ip))) + goto error; + rgVar->vt = VT_DISPATCH; + rgVar->pdispVal = ip; + } + if (pCeltFetched) + *pCeltFetched = n; + return celt ? S_FALSE : NOERROR; +error: + while (n > 0) { + --n ; + --rgVar; + VariantClear(rgVar); + } + if (pCeltFetched) + *pCeltFetched = 0; + return S_FALSE; + CATCH +} + +STDMETHODIMP CEnumNodeList::Skip(ULONG celt) +{ + TRY + for (; celt > 0; celt--) { + if (cur_.assignRest() != accessOK) + return S_FALSE; + } + return NOERROR; + CATCH +} + +STDMETHODIMP CEnumNodeList::Reset() +{ + TRY + cur_ = nl_; + return NOERROR; + CATCH +} + +STDMETHODIMP CEnumNodeList::Clone(IEnumVARIANT **ppEnum) +{ + TRY + CComObject *p; + HRESULT hRes = CComObject::CreateInstance(&p); + if (FAILED(hRes)) + return hRes; + CEnumNodeList *np = p; + np->nl_ = nl_; + np->cur_ = cur_; + np->table_ = table_; + *ppEnum = p; + (*ppEnum)->AddRef(); + return NOERROR; + CATCH +} + +HRESULT CEnumChunkNodeList::make(const NodeListPtr &nl, const NodeTablePtr &table, + IUnknown **retval) +{ + CComObject *p; + HRESULT hRes = CComObject::CreateInstance(&p); + if (FAILED(hRes)) + return hRes; + CEnumChunkNodeList *np = p; + np->nl_ = nl; + np->cur_ = nl; + np->table_ = table; + return p->QueryInterface(IID_IUnknown, (void **)retval); +} + +STDMETHODIMP CEnumChunkNodeList::Next(ULONG celt, VARIANT *rgVar, ULONG *pCeltFetched) +{ + TRY + ULONG n = 0; + for (; celt > 0; celt--, rgVar++, n++) { + NodePtr nd; + if (cur_->first(nd) != accessOK) + break; + if (cur_.assignChunkRest() != accessOK) + goto error; + Node *ip; + if (FAILED(CNodeBase::make(nd, table_, &ip))) + goto error; + rgVar->vt = VT_DISPATCH; + rgVar->pdispVal = ip; + } + if (pCeltFetched) + *pCeltFetched = n; + return celt ? S_FALSE : NOERROR; +error: + while (n > 0) { + --n ; + --rgVar; + VariantClear(rgVar); + } + if (pCeltFetched) + *pCeltFetched = 0; + return S_FALSE; + CATCH +} + +STDMETHODIMP CEnumChunkNodeList::Skip(ULONG celt) +{ + TRY + for (; celt > 0; celt--) { + if (cur_.assignChunkRest() != accessOK) + return S_FALSE; + } + return NOERROR; + CATCH +} + +STDMETHODIMP CEnumChunkNodeList::Reset() +{ + TRY + cur_ = nl_; + return NOERROR; + CATCH +} + +STDMETHODIMP CEnumChunkNodeList::Clone(IEnumVARIANT **ppEnum) +{ + TRY + CComObject *p; + HRESULT hRes = CComObject::CreateInstance(&p); + if (FAILED(hRes)) + return hRes; + CEnumChunkNodeList *np = p; + np->nl_ = nl_; + np->cur_ = cur_; + np->table_ = table_; + *ppEnum = p; + (*ppEnum)->AddRef(); + return NOERROR; + CATCH +} + +HRESULT CStoragePos::make(const SP_NAMESPACE::ExternalInfo *info, + SP_NAMESPACE::Offset offset, + const NodePtr &nd, + StoragePos **retval) +{ + *retval = 0; + CComObject *p; + HRESULT hRes = CComObject::CreateInstance(&p); + if (FAILED(hRes)) + return hRes; + CStoragePos *tem = p; + if (!SP_NAMESPACE::ExtendEntityManager::externalize(info, offset, tem->loc_)) { + delete p; + return NOERROR; + } + tem->nd_ = nd; + *retval = p; + (*retval)->AddRef(); + return NOERROR; +} + +HRESULT makeRootNode(const GROVE_NAMESPACE::NodePtr &root, + SP_NAMESPACE::Owner &parser, + SgmlDocumentNode **retval) +{ + TRY + NodeTablePtr table(new NodeTable(parser)); + Node *tem; + HRESULT hRes = CNodeBase::make(root, table, &tem); + *retval = (SgmlDocumentNode *)tem; + return hRes; + CATCH +} --- openjade-1.4devel1.orig/groveoa/GroveNode.h +++ openjade-1.4devel1/groveoa/GroveNode.h @@ -0,0 +1,16 @@ +#ifndef GroveNode_INCLUDED +#define GroveNode_INCLUDED 1 + +#include "Owner.h" +#include "Boolean.h" +#include "Node.h" + +struct ParserThread { + virtual ~ParserThread() { } +}; + +HRESULT makeRootNode(const GROVE_NAMESPACE::NodePtr &, + SP_NAMESPACE::Owner &, + SgmlDocumentNode **); + +#endif /* not GroveNode_INCLUDED */ --- openjade-1.4devel1.orig/groveoa/Makefile.am +++ openjade-1.4devel1/groveoa/Makefile.am @@ -0,0 +1,5 @@ +## Process this file with automake to produce Makefile.in + +EXTRA_DIST = CGroveBuilder.cxx CGroveBuilder.h GroveBuilder.rgs \ + GroveNode.cxx GroveNode.h StdAfx.cxx StdAfx.h groveoa.cxx \ + groveoa.def groveoa.dsp groveoa.idl groveoa.rc resource.h --- openjade-1.4devel1.orig/groveoa/StdAfx.cxx +++ openjade-1.4devel1/groveoa/StdAfx.cxx @@ -0,0 +1,12 @@ +// stdafx.cpp : source file that includes just the standard includes +// stdafx.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +#ifdef _ATL_STATIC_REGISTRY +#include +#include +#endif + +#include --- openjade-1.4devel1.orig/groveoa/StdAfx.h +++ openjade-1.4devel1/groveoa/StdAfx.h @@ -0,0 +1,14 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, +// but are changed infrequently + +#define STRICT + +// #define _WIN32_WINNT 0x0400 +#define _ATL_APARTMENT_THREADED + +#include +//You may derive a class from CComModule and use it if you want to override +//something, but do not change the name of _Module +extern CComModule _Module; +#include --- openjade-1.4devel1.orig/groveoa/groveoa.cxx +++ openjade-1.4devel1/groveoa/groveoa.cxx @@ -0,0 +1,92 @@ +// groveoa.cxx : Implementation of DLL Exports. + +// You will need VC 4.2 and the full 4.2b patch (http://msvc/vc42b/vc42b.htm) in +// order to build this project. This patch includes the final NT 4.0 SDK. +// You will also need MIDL 3.00.75, which is included with ATL 2.0. + +// Note: Proxy/Stub Information +// To merge the proxy/stub code into the object DLL, add the file +// dlldatax.c to the project. Make sure precompiled headers +// are turned off for this file, and add _MERGE_PROXYSTUB to the +// defines for the project. +// +// If you are not running MIDL with /Oicf (the default), you will need +// to remove the following defines from the top of dlldatax.c. +// #define _WIN32_WINNT 0x0400 +// #define USE_STUBLESS_PROXY +// +// Modify the custom build rule for groveoa.idl by adding the following +// files to the Outputs. +// groveoa_p.c +// dlldata.c +// To build a separate proxy/stub DLL, +// run nmake -f groveoaps.mk in the project directory. + +#include "stdafx.h" +#include "resource.h" +#include "groveoa.h" + +#include "groveoa_i.c" +#include "CGroveBuilder.h" + +CComModule _Module; + +BEGIN_OBJECT_MAP(ObjectMap) + OBJECT_ENTRY(CLSID_GroveBuilder, CGroveBuilder) +END_OBJECT_MAP() + +///////////////////////////////////////////////////////////////////////////// +// DLL Entry Point + +extern "C" +BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) +{ + lpReserved; + if (dwReason == DLL_PROCESS_ATTACH) + { + _Module.Init(ObjectMap, hInstance); + DisableThreadLibraryCalls(hInstance); + } + else if (dwReason == DLL_PROCESS_DETACH) + _Module.Term(); + return TRUE; // ok +} + +///////////////////////////////////////////////////////////////////////////// +// Used to determine whether the DLL can be unloaded by OLE + +STDAPI DllCanUnloadNow(void) +{ + return (_Module.GetLockCount()==0) ? S_OK : S_FALSE; +} + +///////////////////////////////////////////////////////////////////////////// +// Returns a class factory to create an object of the requested type + +STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv) +{ + return _Module.GetClassObject(rclsid, riid, ppv); +} + +///////////////////////////////////////////////////////////////////////////// +// DllRegisterServer - Adds entries to the system registry + +STDAPI DllRegisterServer(void) +{ + // registers object, typelib and all interfaces in typelib + return _Module.RegisterServer(TRUE); +} + +///////////////////////////////////////////////////////////////////////////// +// DllUnregisterServer - Removes entries from the system registry + +STDAPI DllUnregisterServer(void) +{ + _Module.UnregisterServer(); +#if _WIN32_WINNT >= 0x0400 + UnRegisterTypeLib(LIBID_GROVE, 1, 0, LOCALE_USER_DEFAULT, SYS_WIN32); +#endif + return S_OK; +} + + --- openjade-1.4devel1.orig/groveoa/groveoa.def +++ openjade-1.4devel1/groveoa/groveoa.def @@ -0,0 +1,9 @@ +; groveoa.def : Declares the module parameters. + +LIBRARY "ogroveoa.DLL" + +EXPORTS + DllCanUnloadNow @1 PRIVATE + DllGetClassObject @2 PRIVATE + DllRegisterServer @3 PRIVATE + DllUnregisterServer @4 PRIVATE --- openjade-1.4devel1.orig/groveoa/groveoa.dsp +++ openjade-1.4devel1/groveoa/groveoa.dsp @@ -0,0 +1,163 @@ +# Microsoft Developer Studio Project File - Name="groveoa" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=groveoa - Win32 Release +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "groveoa.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "groveoa.mak" CFG="groveoa - Win32 Release" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "groveoa - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "groveoa - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "groveoa - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir ".\Release" +# PROP BASE Intermediate_Dir ".\Release" +# PROP BASE Target_Dir "." +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir ".\Release" +# PROP Intermediate_Dir ".\Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "." +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\include" /I "..\grove" /I "..\spgrove" /D "_MBCS" /D "_ATL_STATIC_REGISTRY" /D "_WINDLL" /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D "SP_MULTI_BYTE" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /out:"..\bin\ogroveoa.dll" /base:0x25000000 +# Begin Special Build Tool +TargetPath=\users\Avi\jadetest\jade\bin\ogroveoa.dll +SOURCE="$(InputPath)" +PostBuild_Cmds=regsvr32 /s /c "$(TargetPath)" +# End Special Build Tool + +!ELSEIF "$(CFG)" == "groveoa - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir ".\Debug" +# PROP BASE Intermediate_Dir ".\Debug" +# PROP BASE Target_Dir "." +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir ".\Debug" +# PROP Intermediate_Dir ".\Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "." +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\grove" /I "..\spgrove" /D "_MBCS" /D "_ATL_STATIC_REGISTRY" /D "_WINDLL" /D "_DEBUG" /D "_WINDOWS" /D "WIN32" /D SP_NAMESPACE=James_Clark_SP /D GROVE_NAMESPACE=James_Clark_GROVE /D "SP_MULTI_BYTE" /YX /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" +# ADD RSC /l 0x809 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /out:"..\dbgbin\ogroveoa.dll" /base:0x25000000 +# SUBTRACT LINK32 /incremental:no + +!ENDIF + +# Begin Target + +# Name "groveoa - Win32 Release" +# Name "groveoa - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90" +# Begin Source File + +SOURCE=.\CGroveBuilder.cxx +# ADD CPP /Yu"stdafx.h" +# End Source File +# Begin Source File + +SOURCE=.\GroveNode.cxx +# ADD CPP /Yu"stdafx.h" +# End Source File +# Begin Source File + +SOURCE=.\groveoa.cxx +# ADD CPP /Yu"stdafx.h" +# End Source File +# Begin Source File + +SOURCE=.\groveoa.def +# End Source File +# Begin Source File + +SOURCE=.\groveoa.idl +# ADD MTL /tlb "groveoa.tlb" /h "groveoa.h" /iid "groveoa_i.c" /Oicf +# SUBTRACT MTL /mktyplib203 +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.cxx +# ADD CPP /Yc"stdafx.h" +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" +# Begin Source File + +SOURCE=.\CGroveBuilder.h +# End Source File +# Begin Source File + +SOURCE=.\GroveNode.h +# End Source File +# Begin Source File + +SOURCE=.\resource.h +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\groveoa.rc +# End Source File +# End Group +# Begin Source File + +SOURCE=.\GroveBuilder.rgs +# End Source File +# End Target +# End Project --- openjade-1.4devel1.orig/groveoa/groveoa.idl +++ openjade-1.4devel1/groveoa/groveoa.idl @@ -0,0 +1,773 @@ +// groveoa.idl : IDL source for groveoa.dll + +// This file will be processed by the MIDL tool to +// produce the type library (groveoa.tlb) and marshalling code. + +import "oaidl.idl"; + +interface Node; +interface NodeList; +interface NamedNodeList; +interface StringList; + +interface ElementNode; +interface AttributeAssignmentNode; +interface AttributeValueTokenNode; +interface DataCharNode; +interface SgmlDocumentNode; +interface SgmlConstantsNode; +interface PiNode; +interface SdataNode; +interface DocumentTypeNode; +interface EntityNode; +interface NotationNode; +interface ExternalIdNode; +interface ExternalDataNode; +interface SubdocNode; +interface MessageNode; +interface StoragePos; +interface ElementTypeNode; +interface AttributeDefNode; +interface ModelGroupNode; +interface ElementTokenNode; +interface PcdataTokenNode; +interface DefaultEntityNode; + +enum NodeClass { + nodeClassElement, + nodeClassAttributeAssignment, + nodeClassAttributeValueToken, + nodeClassDataChar, + nodeClassSgmlDocument, + nodeClassSgmlConstants, + nodeClassPi, + nodeClassSdata, + nodeClassDocumentType, + nodeClassEntity, + nodeClassNotation, + nodeClassExternalId, + nodeClassExternalData, + nodeClassSubdoc, + nodeClassMessage, + nodeClassElementType, + nodeClassAttributeDef, + nodeClassElementToken, + nodeClassPcdataToken, + nodeClassDefaultEntity, + nodeClassModelGroup +}; + +enum EntityType { + entityTypeText, + entityTypeCdata, + entityTypeSdata, + entityTypeNdata, + entityTypeSubdocument, + entityTypePi +}; + +enum ContentType { + contentTypeCdata, + contentTypeRcdata, + contentTypeEmpty, + contentTypeAny, + contentTypeModelGroup +}; + +enum DeclValueType { + declValueTypeCdata, + declValueTypeEntity, + declValueTypeEntities, + declValueTypeId, + declValueTypeIdref, + declValueTypeIdrefs, + declValueTypeName, + declValueTypeNames, + declValueTypeNmtoken, + declValueTypeNmtokens, + declValueTypeNumber, + declValueTypeNumbers, + declValueTypeNutoken, + declValueTypeNutokens, + declValueTypeNotation, + declValueTypeNmtkgrp +}; + +enum DefaultValueType { + defaultValueTypeValue, + defaultValueTypeFixed, + defaultValueTypeRequired, + defaultValueTypeCurrent, + defaultValueTypeConref, + defaultValueTypeImplied +}; + +enum Connector { + connectorAnd, + connectorOr, + connectorSeq +}; + +enum OccurIndicator { + occurIndicatorOpt, + occurIndicatorPlus, + occurIndicatorRep +}; + +enum Severity { + severityInfo, + severityWarning, + severityError +}; + +[ + object, + uuid(B3BE8C20-BA4A-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface Node : IDispatch +{ + [propget] + HRESULT Parent([out, retval] Node **); + [propget] + HRESULT Origin([out, retval] Node **); + /* Using SgmlDocumentNode as the return type doesn't work. */ + [propget] + HRESULT GroveRoot([out, retval] Node **); + [propget] + HRESULT TreeRoot([out, retval] Node **); + [propget] + HRESULT Children([out, retval] NodeList **); + [propget] + HRESULT ChunkChildren([out, retval] NodeList **); + [propget] + HRESULT Class([out, retval] enum NodeClass *); + [propget] + HRESULT StoragePos([out, retval] StoragePos **); + [propget] + HRESULT SiblingIndex([out, retval] long *); + + HRESULT FirstChild([out, retval] Node **); + HRESULT NextSibling([out, retval] Node **); + HRESULT NextChunkSibling([out, retval] Node **); +} + +[ + object, + uuid(D8334201-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface SgmlDocumentNode : Node +{ + [propget] + HRESULT DocumentElement([out, retval] ElementNode **); + [propget] + HRESULT SgmlConstants([out, retval] SgmlConstantsNode **); + [propget] + HRESULT ApplicationInfo([out, retval] BSTR *); + [propget] + HRESULT ApplicationInfoNull([out, retval] VARIANT_BOOL *); + [propget] + HRESULT Prolog([out, retval] NodeList **); + [propget] + HRESULT Epilog([out, retval] NodeList **); + [propget] + HRESULT Elements([out, retval] NamedNodeList **); + [propget] + HRESULT Entities([out, retval] NamedNodeList **); + [propget] + HRESULT DefaultedEntities([out, retval] NamedNodeList **); + [propget] + HRESULT GoverningDoctype([out, retval] DocumentTypeNode **); + [propget] + HRESULT DoctypesAndLinktypes([out, retval] NamedNodeList **); + [propget] + HRESULT Messages([out, retval] NodeList **); +} + +[ + object, + uuid(D8334202-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface ElementNode : Node +{ + [propget] + HRESULT Gi([out, retval] BSTR *); + [propget] + HRESULT Attributes([out, retval] NamedNodeList **); + [propget] + HRESULT Id([out, retval] BSTR *); + [propget] + HRESULT Content([out, retval] NodeList **); + [propget] + HRESULT ChunkContent([out, retval] NodeList **); + [propget] + HRESULT Included([out, retval] VARIANT_BOOL *); + [propget] + HRESULT MustOmitEndTag([out, retval] VARIANT_BOOL *); + [propget] + HRESULT ElementType([out, retval] ElementTypeNode **); +} + +[ + object, + uuid(D8334203-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface DataCharNode : Node +{ + [propget] + HRESULT Char([out, retval] long *); + [propget] + HRESULT NonSgml([out, retval] long *); + [propget] + HRESULT CharChunk([out, retval] BSTR *); +} + +[ + object, + uuid(D8334204-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface AttributeAssignmentNode : Node +{ + [propget] + HRESULT Name([out, retval] BSTR *); + [propget] + HRESULT Implied([out, retval] VARIANT_BOOL *); + [propget] + HRESULT Value([out, retval] NodeList **); + [propget] + HRESULT ChunkValue([out, retval] NodeList **); + [propget] + HRESULT TokenSep([out, retval] long *); + [propget, id(DISPID_VALUE)] + HRESULT StringValue([out, retval] BSTR *); + [propget] + HRESULT AttributeDef([out, retval] AttributeDefNode **); +} + +[ + object, + uuid(D8334205-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface AttributeValueTokenNode : Node +{ + [propget, id(DISPID_VALUE)] + HRESULT Token([out, retval] BSTR *); + [propget] + HRESULT Referent([out, retval] ElementNode **); + [propget] + HRESULT Entity([out, retval] EntityNode **); + [propget] + HRESULT Notation([out, retval] NotationNode **); +} + +[ + object, + uuid(D8334206-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface SgmlConstantsNode : Node +{ +} + +[ + object, + uuid(D8334207-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface PiNode : Node +{ + [propget] + HRESULT SystemData([out, retval] BSTR *); + [propget] + HRESULT Entity([out, retval] EntityNode **); + [propget] + HRESULT EntityName([out, retval] BSTR *); +} + +[ + object, + uuid(D8334208-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface SdataNode : Node +{ + [propget] + HRESULT SystemData([out, retval] BSTR *); + [propget] + HRESULT Entity([out, retval] EntityNode **); + [propget] + HRESULT EntityName([out, retval] BSTR *); +} + +[ + object, + uuid(D8334209-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface DocumentTypeNode : Node +{ + [propget] + HRESULT Name([out, retval] BSTR *); + [propget] + HRESULT Governing([out, retval] VARIANT_BOOL *); + [propget] + HRESULT GeneralEntities([out, retval] NamedNodeList **); + [propget] + HRESULT Notations([out, retval] NamedNodeList **); + [propget] + HRESULT ElementTypes([out, retval] NamedNodeList **); + [propget] + HRESULT ParameterEntities([out, retval] NamedNodeList **); + [propget] + HRESULT DefaultEntity([out, retval] DefaultEntityNode **); +} + +[ + object, + uuid(D833420A-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface EntityNode : Node +{ + [propget] + HRESULT Name([out, retval] BSTR *); + [propget] + HRESULT Text([out, retval] BSTR *); + [propget] + HRESULT TextNull([out, retval] VARIANT_BOOL *); + [propget] + HRESULT Notation([out, retval] NotationNode **); + [propget] + HRESULT NotationName([out, retval] BSTR *); + [propget] + HRESULT EntityType([out, retval] enum EntityType *); + [propget] + HRESULT Defaulted([out, retval] VARIANT_BOOL *); + [propget] + HRESULT Attributes([out, retval] NamedNodeList **); + [propget] + HRESULT ExternalId([out, retval] ExternalIdNode **); +} + +[ + object, + uuid(D833420B-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface NotationNode : Node +{ + [propget] + HRESULT Name([out, retval] BSTR *); + [propget] + HRESULT ExternalId([out, retval] ExternalIdNode **); + [propget] + HRESULT AttributeDefs([out, retval] NamedNodeList **); +} + +[ + object, + uuid(D833420C-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface ExternalIdNode : Node +{ + [propget] + HRESULT PublicId([out, retval] BSTR *); + [propget] + HRESULT PublicIdNull([out, retval] VARIANT_BOOL *); + [propget] + HRESULT SystemId([out, retval] BSTR *); + [propget] + HRESULT SystemIdNull([out, retval] VARIANT_BOOL *); + [propget] + HRESULT GeneratedSystemId([out, retval] BSTR *); +} + +[ + object, + uuid(D833420D-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface ExternalDataNode : Node +{ + [propget] + HRESULT Entity([out, retval] EntityNode **); + [propget] + HRESULT EntityName([out, retval] BSTR *); +} + +[ + object, + uuid(D833420E-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface SubdocNode : Node +{ + [propget] + HRESULT Entity([out, retval] EntityNode **); + [propget] + HRESULT EntityName([out, retval] BSTR *); +} + +[ + object, + uuid(D833420F-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface ElementTypeNode : Node +{ + [propget] + HRESULT Gi([out, retval] BSTR *); + [propget] + HRESULT AttributeDefs([out, retval] NamedNodeList **); + [propget] + HRESULT ContentType([out, retval] enum ContentType *); + [propget] + HRESULT Exclusions([out, retval] StringList **); + [propget] + HRESULT Inclusions([out, retval] StringList **); + [propget] + HRESULT ModelGroup([out, retval] ModelGroupNode **); + [propget] + HRESULT OmitEndTag([out, retval] VARIANT_BOOL *); + [propget] + HRESULT OmitStartTag([out, retval] VARIANT_BOOL *); +} + +[ + object, + uuid(D8334210-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface AttributeDefNode : Node +{ + [propget] + HRESULT Name([out, retval] BSTR *); + [propget] + HRESULT DeclValueType([out, retval] enum DeclValueType *); + [propget] + HRESULT DefaultValueType([out, retval] enum DefaultValueType *); + [propget] + HRESULT Tokens([out, retval] StringList **); + [propget] + HRESULT CurrentAttributeIndex([out, retval] long *); + [propget] + HRESULT CurrentGroup([out, retval] NodeList **); + [propget] + HRESULT DefaultValue([out, retval] NodeList **); +} + +[ + object, + uuid(D8334211-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface ModelGroupNode : Node +{ + [propget] + HRESULT Connector([out, retval] enum Connector *); + [propget] + HRESULT OccurIndicator([out, retval] enum OccurIndicator *); + [propget] + HRESULT ContentTokens([out, retval] NodeList **); +} + +[ + object, + uuid(D8334212-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface ElementTokenNode : Node +{ + [propget] + HRESULT Gi([out, retval] BSTR *); + [propget] + HRESULT OccurIndicator([out, retval] enum OccurIndicator *); +} + +[ + object, + uuid(D8334213-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface PcdataTokenNode : Node +{ +} + +[ + object, + uuid(D8334214-9FD6-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface DefaultEntityNode : Node +{ + [propget] + HRESULT Name([out, retval] BSTR *); + [propget] + HRESULT Text([out, retval] BSTR *); + [propget] + HRESULT TextNull([out, retval] VARIANT_BOOL *); + [propget] + HRESULT Notation([out, retval] NotationNode **); + [propget] + HRESULT NotationName([out, retval] BSTR *); + [propget] + HRESULT EntityType([out, retval] enum EntityType *); + [propget] + HRESULT Attributes([out, retval] NamedNodeList **); + [propget] + HRESULT ExternalId([out, retval] ExternalIdNode **); +} + +[ + object, + uuid(8E5A3821-A213-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface MessageNode : Node +{ + [propget] + HRESULT Text([out, retval] BSTR *); + [propget] + HRESULT Severity([out, retval] enum Severity *); +} + +[ + object, + uuid(BA7A21C0-9FA9-11d0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface NamedNodeList : IDispatch +{ + [propget, helpstring("Returns number of nodes.")] + HRESULT Count([out, retval] long *retval); + + [propget, id(DISPID_VALUE), helpstring("Given a name, return the node.")] + /* if you use "name" for the parameter name, MIDL outputs a TLB file + that uses "name" instead of "Name" for "Name" properties */ + HRESULT Item([in] BSTR nodeName, [out, retval] Node **retval); + [propget, restricted, id(DISPID_NEWENUM)] + HRESULT _NewEnum([out, retval] IUnknown **retval); + + [propget] + HRESULT NodeList([out, retval] NodeList **retval); + + HRESULT Normalize([in] BSTR nodeName, [out, retval] BSTR *); + HRESULT NodeName([in] Node *, [out, retval] BSTR *); +} + +[ + object, + uuid(BA7A21C1-9FA9-11d0-9083-0020AF41CFC2), + dual +] +interface NodeList : IDispatch +{ + HRESULT First([out, retval] Node **); + HRESULT Rest([out, retval] NodeList **); + + [propget, helpstring("Returns number of nodes.")] + HRESULT Count([out, retval] long *retval); + + [propget, id(DISPID_VALUE), + helpstring("Given an index, return the node. First node has index 1.")] + HRESULT Item([in] long index, [out, retval] Node **retval); + + [propget, restricted, id(DISPID_NEWENUM)] + HRESULT _NewEnum([out, retval] IUnknown **retval); +} + +[ + object, + uuid(BA7A21C2-9FA9-11d0-9083-0020AF41CFC2), + dual +] +interface StringList : IDispatch +{ + HRESULT First([out, retval] BSTR *); + HRESULT Rest([out, retval] StringList **); + + [propget, helpstring("Returns number of strings.")] + HRESULT Count([out, retval] long *retval); + + [propget, id(DISPID_VALUE), + helpstring("Given an index, return the string. First string has index 1.")] + HRESULT Item([in] long index, [out, retval] BSTR *retval); +} + +[ + object, + uuid(18E670A0-AE01-11D0-9083-0020AF41CFC2), + dual, + pointer_default(unique) +] +interface StoragePos : IDispatch +{ + [propget] + HRESULT StorageManagerName([out, retval] BSTR *); + [propget] + HRESULT StorageObjectId([out, retval] BSTR *); + [propget] + HRESULT LineNumber([out, retval] long *); + [propget] + HRESULT ColumnNumber([out, retval] long *); + [propget] + HRESULT ByteIndex([out, retval] long *); + [propget] + HRESULT CharacterIndex([out, retval] long *); +} + +enum ErrorType { + errorIdref, + errorSignificant, + errorAfdr, + errorLpdNotation, + errorValid +}; + +enum WarningType { + warningSgmlDecl, + warningDuplicateEntity, + warningShould, + warningUndefinedElement, + warningDefaultEntityReference, + warningMixedContent, + warningUnclosedTag, + warningNet, + warningEmptyTag, + warningUnusedMap, + warningUnusedParam, + warningNotationSystemId +}; + +[ + object, + uuid(557CE381-9EBD-11D0-9083-0020AF41CFC2), + dual, + hidden, + pointer_default(unique) +] +interface _GroveBuilder : IDispatch +{ + [propget] + HRESULT ExtraCatalogs([out, retval] BSTR *); + [propput] + HRESULT ExtraCatalogs([in] BSTR catalogs); + [propget] + HRESULT DefaultCatalogs([out, retval] BSTR *); + [propput] + HRESULT DefaultCatalogs([in] BSTR catalogs); + [propget] + HRESULT ExtraDirectories([out, retval] BSTR *); + [propput] + HRESULT ExtraDirectories([in] BSTR dirs); + [propget] + HRESULT DefaultDirectories([out, retval] BSTR *); + [propput] + HRESULT DefaultDirectories([in] BSTR dirs); + [propget] + HRESULT Encoding([out, retval] BSTR *); + [propput] + HRESULT Encoding([in] BSTR name); + [propget] + HRESULT DefaultEncoding([out, retval] BSTR *); + [propput] + HRESULT DefaultEncoding([in] BSTR name); + [propget] + HRESULT Includes([out, retval] BSTR *); + [propput] + HRESULT Includes([in] BSTR entityNames); + [propget] + HRESULT Warning([in] enum WarningType type, [out, retval] VARIANT_BOOL *); + [propput] + HRESULT Warning([in] enum WarningType type, [in] VARIANT_BOOL); + [propget] + HRESULT Error([in] enum ErrorType type, [out, retval] VARIANT_BOOL *); + [propput] + HRESULT Error([in] enum ErrorType type, [in] VARIANT_BOOL); + [propget] + HRESULT ValidateOnly([out, retval] VARIANT_BOOL *); + [propput] + HRESULT ValidateOnly([in] VARIANT_BOOL); + + HRESULT parse([in] BSTR systemId, [out, retval] SgmlDocumentNode **); + + HRESULT archParse([in] BSTR systemId, + [in] BSTR archNames, + [out, retval] SgmlDocumentNode **); +} + +[ + uuid(8E1C3D40-9EBC-11D0-9083-0020AF41CFC2), + version(1.0), + helpstring("SP Grove 1.0 Type Library") +] +library GROVE +{ + importlib("stdole32.tlb"); + importlib("stdole2.tlb"); + + interface Node; + interface NodeList; + interface NamedNodeList; + interface StringList; + + interface ElementNode; + interface AttributeAssignmentNode; + interface AttributeValueTokenNode; + interface DataCharNode; + interface SgmlDocumentNode; + interface SgmlConstantsNode; + interface PiNode; + interface SdataNode; + interface DocumentTypeNode; + interface EntityNode; + interface NotationNode; + interface ExternalIdNode; + interface ExternalDataNode; + interface SubdocNode; + interface MessageNode; + interface StoragePos; + interface ElementTypeNode; + interface AttributeDefNode; + interface ModelGroupNode; + interface ElementTokenNode; + interface PcdataTokenNode; + interface DefaultEntityNode; + + [ + uuid(557CE382-9EBD-11D0-9083-0020AF41CFC2) + ] + coclass GroveBuilder + { + [default] interface _GroveBuilder; + } +} --- openjade-1.4devel1.orig/groveoa/groveoa.rc +++ openjade-1.4devel1/groveoa/groveoa.rc @@ -0,0 +1,136 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""winres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "1 TYPELIB ""groveoa.tlb""\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 1,0,0,1 + PRODUCTVERSION 1,0,0,1 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904B0" + BEGIN + VALUE "CompanyName", "\0" + VALUE "FileDescription", "groveoa Module\0" + VALUE "FileVersion", "1, 0, 0, 1\0" + VALUE "InternalName", "GROVEOA\0" + VALUE "LegalCopyright", "Copyright © 1995\0" + VALUE "OriginalFilename", "GROVEOA.DLL\0" + VALUE "ProductName", "groveoa Module\0" + VALUE "ProductVersion", "1, 0, 0, 1\0" + VALUE "OLESelfRegister", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_PROJNAME "Groveoa" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (U.K.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// REGISTRY +// + +IDR_GROVEBUILDER REGISTRY DISCARDABLE "GroveBuilder.rgs" +#endif // English (U.K.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +1 TYPELIB "groveoa.tlb" + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + --- openjade-1.4devel1.orig/groveoa/resource.h +++ openjade-1.4devel1/groveoa/resource.h @@ -0,0 +1,17 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by groveoa.rc +// +#define IDS_PROJNAME 100 +#define IDR_GROVEBUILDER 101 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 201 +#define _APS_NEXT_COMMAND_VALUE 32768 +#define _APS_NEXT_CONTROL_VALUE 201 +#define _APS_NEXT_SYMED_VALUE 102 +#endif +#endif --- openjade-1.4devel1.orig/intl/ChangeLog +++ openjade-1.4devel1/intl/ChangeLog @@ -0,0 +1,1086 @@ +1998-04-29 Ulrich Drepper + + * intl/localealias.c (read_alias_file): Use unsigned char for + local variables. Remove unused variable tp. + * intl/l10nflist.c (_nl_normalize_codeset): Use unsigned char * + for type of codeset. For loosing Solaris systems. + * intl/loadinfo.h: Adapt prototype of _nl_normalize_codeset. + * intl/bindtextdom.c (BINDTEXTDOMAIN): Don't define local variable + len if not needed. + Patches by Jim Meyering. + +1998-04-28 Ulrich Drepper + + * loadmsgcat.c (_nl_load_domain): Don't assign the element use_mmap if + mmap is not supported. + + * hash-string.h: Don't include . + +1998-04-27 Ulrich Drepper + + * textdomain.c: Use strdup is available. + + * localealias.c: Define HAVE_MEMPCPY so that we can use this + function. Define and use semapahores to protect modfication of + global objects when compiling for glibc. Add code to allow + freeing alias table. + + * l10nflist.c: Don't assume stpcpy not being a macro. + + * gettextP.h: Define internal_function macri if not already done. + Use glibc byte-swap macros instead of defining SWAP when compiled + for glibc. + (struct loaded_domain): Add elements to allow unloading. + + * Makefile.in (distclean): Don't remove libintl.h here. + + * bindtextdomain.c: Carry over changes from glibc. Use strdup if + available. + + * dcgettext.c: Don't assume stpcpy not being a macro. Mark internal + functions. Add memory freeing code for glibc. + + * dgettext.c: Update copyright. + + * explodename.c: Include stdlib.h and string.h only if they exist. + Use strings.h eventually. + + * finddomain.c: Mark internal functions. Use strdup if available. + Add memory freeing code for glibc. + +1997-10-10 20:00 Ulrich Drepper + + * libgettext.h: Fix dummy textdomain and bindtextdomain macros. + They should return reasonable values. + Reported by Tom Tromey . + +1997-09-16 03:33 Ulrich Drepper + + * libgettext.h: Define PARAMS also to `args' if __cplusplus is defined. + * intlh.inst.in: Likewise. + Reported by Jean-Marc Lasgouttes . + + * libintl.glibc: Update from current glibc version. + +1997-09-06 02:10 Ulrich Drepper + + * intlh.inst.in: Reformat copyright. + +1997-08-19 15:22 Ulrich Drepper + + * dcgettext.c (DCGETTEXT): Remove wrong comment. + +1997-08-16 00:13 Ulrich Drepper + + * Makefile.in (install-data): Don't change directory to install. + +1997-08-01 14:30 Ulrich Drepper + + * cat-compat.c: Fix copyright. + + * localealias.c: Don't define strchr unless !HAVE_STRCHR. + + * loadmsgcat.c: Update copyright. Fix typos. + + * l10nflist.c: Don't define strchr unless !HAVE_STRCHR. + (_nl_make_l10nflist): Handle sponsor and revision correctly. + + * gettext.c: Update copyright. + * gettext.h: Likewise. + * hash-string.h: Likewise. + + * finddomain.c: Remoave dead code. Define strchr only if + !HAVE_STRCHR. + + * explodename.c: Include . + + * explodename.c: Reformat copyright text. + (_nl_explode_name): Fix typo. + + * dcgettext.c: Define and use __set_errno. + (guess_category_value): Don't use setlocale if HAVE_LC_MESSAGES is + not defined. + + * bindtextdom.c: Pretty printing. + +1997-05-01 02:25 Ulrich Drepper + + * dcgettext.c (guess_category_value): Don't depend on + HAVE_LC_MESSAGES. We don't need the macro here. + Patch by Bruno Haible . + + * cat-compat.c (textdomain): DoN't refer to HAVE_SETLOCALE_NULL + macro. Instead use HAVE_LOCALE_NULL and define it when using + glibc, as in dcgettext.c. + Patch by Bruno Haible . + + * Makefile.in (CPPFLAGS): New variable. Reported by Franc,ois + Pinard. + +Mon Mar 10 06:51:17 1997 Ulrich Drepper + + * Makefile.in: Implement handling of libtool. + + * gettextP.h: Change data structures for use of generic lowlevel + i18n file handling. + +Wed Dec 4 20:21:18 1996 Ulrich Drepper + + * textdomain.c: Put parentheses around arguments of memcpy macro + definition. + * localealias.c: Likewise. + * l10nflist.c: Likewise. + * finddomain.c: Likewise. + * bindtextdom.c: Likewise. + Reported by Thomas Esken. + +Mon Nov 25 22:57:51 1996 Ulrich Drepper + + * textdomain.c: Move definition of `memcpy` macro to right + position. + +Fri Nov 22 04:01:58 1996 Ulrich Drepper + + * finddomain.c [!HAVE_STRING_H && !_LIBC]: Define memcpy using + bcopy if not already defined. Reported by Thomas Esken. + * bindtextdom.c: Likewise. + * l10nflist.c: Likewise. + * localealias.c: Likewise. + * textdomain.c: Likewise. + +Tue Oct 29 11:10:27 1996 Ulrich Drepper + + * Makefile.in (libdir): Change to use exec_prefix instead of + prefix. Reported by Knut-HåvardAksnes . + +Sat Aug 31 03:07:09 1996 Ulrich Drepper + + * l10nflist.c (_nl_normalize_codeset): We convert to lower case, + so don't prepend uppercase `ISO' for only numeric arg. + +Fri Jul 19 00:15:46 1996 Ulrich Drepper + + * l10nflist.c: Move inclusion of argz.h, ctype.h, stdlib.h after + definition of _GNU_SOURCE. Patch by Roland McGrath. + + * Makefile.in (uninstall): Fix another bug with `for' loop and + empty arguments. Patch by Jim Meyering. Correct name os + uninstalled files: no intl- prefix anymore. + + * Makefile.in (install-data): Again work around shells which + cannot handle mpty for list. Reported by Jim Meyering. + +Sat Jul 13 18:11:35 1996 Ulrich Drepper + + * Makefile.in (install): Split goal. Now depend on install-exec + and install-data. + (install-exec, install-data): New goals. Created from former + install goal. + Reported by Karl Berry. + +Sat Jun 22 04:58:14 1996 Ulrich Drepper + + * Makefile.in (MKINSTALLDIRS): New variable. Path to + mkinstalldirs script. + (install): use MKINSTALLDIRS variable or if the script is not present + try to find it in the $top_scrdir). + +Wed Jun 19 02:56:56 1996 Ulrich Drepper + + * l10nflist.c: Linux libc *partly* includes the argz_* functions. + Grr. Work around by renaming the static version and use macros + for renaming. + +Tue Jun 18 20:11:17 1996 Ulrich Drepper + + * l10nflist.c: Correct presence test macros of __argz_* functions. + + * l10nflist.c: Include based on test of it instead when + __argz_* functions are available. + Reported by Andreas Schwab. + +Thu Jun 13 15:17:44 1996 Ulrich Drepper + + * explodename.c, l10nflist.c: Define NULL for dumb systems. + +Tue Jun 11 17:05:13 1996 Ulrich Drepper + + * intlh.inst.in, libgettext.h (dcgettext): Rename local variable + result to __result to prevent name clash. + + * l10nflist.c, localealias.c, dcgettext.c: Define _GNU_SOURCE to + get prototype for stpcpy and strcasecmp. + + * intlh.inst.in, libgettext.h: Move declaration of + `_nl_msg_cat_cntr' outside __extension__ block to prevent warning + from gcc's -Wnested-extern option. + +Fri Jun 7 01:58:00 1996 Ulrich Drepper + + * Makefile.in (install): Remove comment. + +Thu Jun 6 17:28:17 1996 Ulrich Drepper + + * Makefile.in (install): Work around for another Buglix stupidity. + Always use an `else' close for `if's. Reported by Nelson Beebe. + + * Makefile.in (intlh.inst): Correct typo in phony rule. + Reported by Nelson Beebe. + +Thu Jun 6 01:49:52 1996 Ulrich Drepper + + * dcgettext.c (read_alias_file): Rename variable alloca_list to + block_list as the macro calls assume. + Patch by Eric Backus. + + * localealias.c [!HAVE_ALLOCA]: Define alloca as macro using + malloc. + (read_alias_file): Rename varriabe alloca_list to block_list as the + macro calls assume. + Patch by Eric Backus. + + * l10nflist.c: Correct conditional for inclusion. + Reported by Roland McGrath. + + * Makefile.in (all): Depend on all-@USE_INCLUDED_LIBINTL@, not + all-@USE_NLS@. + + * Makefile.in (install): intlh.inst comes from local dir, not + $(srcdir). + + * Makefile.in (intlh.inst): Special handling of this goal. If + used in gettext, this is really a rul to construct this file. If + used in any other package it is defined as a .PHONY rule with + empty body. + + * finddomain.c: Extract locale file information handling into + l10nfile.c. Rename local stpcpy__ function to stpcpy. + + * dcgettext.c (stpcpy): Add local definition. + + * l10nflist.c: Solve some portability problems. Patches partly by + Thomas Esken. Add local definition of stpcpy. + +Tue Jun 4 02:47:49 1996 Ulrich Drepper + + * intlh.inst.in: Don't depend including on + HAVE_LOCALE_H. Instead configure must rewrite this fiile + depending on the result of the configure run. + + * Makefile.in (install): libintl.inst is now called intlh.inst. + Add rules for updating intlh.inst from intlh.inst.in. + + * libintl.inst: Renamed to intlh.inst.in. + + * localealias.c, dcgettext.c [__GNUC__]: Define HAVE_ALLOCA to 1 + because gcc has __buitlin_alloca. + Reported by Roland McGrath. + +Mon Jun 3 00:32:16 1996 Ulrich Drepper + + * Makefile.in (installcheck): New goal to fulfill needs of + automake's distcheck. + + * Makefile.in (install): Reorder commands so that VERSION is + found. + + * Makefile.in (gettextsrcdir): Now use subdirectory intl/ in + @datadir@/gettext. + (COMSRCS): Add l10nfile.c. + (OBJECTS): Add l10nfile.o. + (DISTFILES): Rename to DISTFILE.normal. Remove $(DISTFILES.common). + (DISTFILE.gettext): Remove $(DISTFILES.common). + (all-gettext): Remove goal. + (install): If $(PACKAGE) = gettext install, otherwose do nothing. No + package but gettext itself should install libintl.h + headers. + (dist): Extend goal to work for gettext, too. + (dist-gettext): Remove goal. + + * dcgettext.c [!HAVE_ALLOCA]: Define macro alloca by using malloc. + +Sun Jun 2 17:33:06 1996 Ulrich Drepper + + * loadmsgcat.c (_nl_load_domain): Parameter is now comes from + find_l10nfile. + +Sat Jun 1 02:23:03 1996 Ulrich Drepper + + * l10nflist.c (__argz_next): Add definition. + + * dcgettext.c [!HAVE_ALLOCA]: Add code for handling missing alloca + code. Use new l10nfile handling. + + * localealias.c [!HAVE_ALLOCA]: Add code for handling missing + alloca code. + + * l10nflist.c: Initial revision. + +Tue Apr 2 18:51:18 1996 Ulrich Drepper + + * Makefile.in (all-gettext): New goal. Same as all-yes. + +Thu Mar 28 23:01:22 1996 Karl Eichwalder + + * Makefile.in (gettextsrcdir): Define using @datadir@. + +Tue Mar 26 12:39:14 1996 Ulrich Drepper + + * finddomain.c: Include . Reported by Roland McGrath. + +Sat Mar 23 02:00:35 1996 Ulrich Drepper + + * finddomain.c (stpcpy): Rename to stpcpy__ to prevent clashing + with external declaration. + +Sat Mar 2 00:47:09 1996 Ulrich Drepper + + * Makefile.in (all-no): Rename from all_no. + +Sat Feb 17 00:25:59 1996 Ulrich Drepper + + * gettextP.h [loaded_domain]: Array `successor' must now contain up + to 63 elements (because of codeset name normalization). + + * finddomain.c: Implement codeset name normalization. + +Thu Feb 15 04:39:09 1996 Ulrich Drepper + + * Makefile.in (all): Define to `all-@USE_NLS@'. + (all-yes, all_no): New goals. `all-no' is noop, `all-yes' + is former all. + +Mon Jan 15 21:46:01 1996 Howard Gayle + + * localealias.c (alias_compare): Increment string pointers in loop + of strcasecmp replacement. + +Fri Dec 29 21:16:34 1995 Ulrich Drepper + + * Makefile.in (install-src): Who commented this goal out ? :-) + +Fri Dec 29 15:08:16 1995 Ulrich Drepper + + * dcgettext.c (DCGETTEXT): Save `errno'. Failing system calls + should not effect it because a missing catalog is no error. + Reported by Harald Knig . + +Tue Dec 19 22:09:13 1995 Ulrich Drepper + + * Makefile.in (Makefile): Explicitly use $(SHELL) for running + shell scripts. + +Fri Dec 15 17:34:59 1995 Andreas Schwab + + * Makefile.in (install-src): Only install library and header when + we use the own implementation. Don't do it when using the + system's gettext or catgets functions. + + * dcgettext.c (find_msg): Must not swap domain->hash_size here. + +Sat Dec 9 16:24:37 1995 Ulrich Drepper + + * localealias.c, libintl.inst, libgettext.h, hash-string.h, + gettextP.h, finddomain.c, dcgettext.c, cat-compat.c: + Use PARAMS instead of __P. Suggested by Roland McGrath. + +Tue Dec 5 11:39:14 1995 Larry Schwimmer + + * libgettext.h: Use `#if !defined (_LIBINTL_H)' instead of `#if + !_LIBINTL_H' because Solaris defines _LIBINTL_H as empty. + +Mon Dec 4 15:42:07 1995 Ulrich Drepper + + * Makefile.in (install-src): + Install libintl.inst instead of libintl.h.install. + +Sat Dec 2 22:51:38 1995 Marcus Daniels + + * cat-compat.c (textdomain): + Reverse order in which files are tried you load. First + try local file, when this failed absolute path. + +Wed Nov 29 02:03:53 1995 Nelson H. F. Beebe + + * cat-compat.c (bindtextdomain): Add missing { }. + +Sun Nov 26 18:21:41 1995 Ulrich Drepper + + * libintl.inst: Add missing __P definition. Reported by Nelson Beebe. + + * Makefile.in: + Add dummy `all' and `dvi' goals. Reported by Tom Tromey. + +Sat Nov 25 16:12:01 1995 Franc,ois Pinard + + * hash-string.h: Capitalize arguments of macros. + +Sat Nov 25 12:01:36 1995 Ulrich Drepper + + * Makefile.in (DISTFILES): Prevent files names longer than 13 + characters. libintl.h.glibc->libintl.glibc, + libintl.h.install->libintl.inst. Reported by Joshua R. Poulson. + +Sat Nov 25 11:31:12 1995 Eric Backus + + * dcgettext.c: Fix bug in preprocessor conditionals. + +Sat Nov 25 02:35:27 1995 Nelson H. F. Beebe + + * libgettext.h: Solaris cc does not understand + #if !SYMBOL1 && !SYMBOL2. Sad but true. + +Thu Nov 23 16:22:14 1995 Ulrich Drepper + + * hash-string.h (hash_string): + Fix for machine with >32 bit `unsigned long's. + + * dcgettext.c (DCGETTEXT): + Fix horrible bug in loop for alternative translation. + +Thu Nov 23 01:45:29 1995 Ulrich Drepper + + * po2tbl.sed.in, linux-msg.sed, xopen-msg.sed: + Some further simplifications in message number generation. + +Mon Nov 20 21:08:43 1995 Ulrich Drepper + + * libintl.h.glibc: Use __const instead of const in prototypes. + + * Makefile.in (install-src): + Install libintl.h.install instead of libintl.h. This + is a stripped-down version. Suggested by Peter Miller. + + * libintl.h.install, libintl.h.glibc: Initial revision. + + * localealias.c (_nl_expand_alias, read_alias_file): + Protect prototypes in type casts by __P. + +Tue Nov 14 16:43:58 1995 Ulrich Drepper + + * hash-string.h: Correct prototype for hash_string. + +Sun Nov 12 12:42:30 1995 Ulrich Drepper + + * hash-string.h (hash_string): Add prototype. + + * gettextP.h: Fix copyright. + (SWAP): Add prototype. + +Wed Nov 8 22:56:33 1995 Ulrich Drepper + + * localealias.c (read_alias_file): Forgot sizeof. + Avoid calling *printf function. This introduces a big overhead. + Patch by Roland McGrath. + +Tue Nov 7 14:21:08 1995 Ulrich Drepper + + * finddomain.c, cat-compat.c: Wrong indentation in #if for stpcpy. + + * finddomain.c (stpcpy): + Define substitution function local. The macro was to flaky. + + * cat-compat.c: Fix typo. + + * xopen-msg.sed, linux-msg.sed: + While bringing message number to right place only accept digits. + + * linux-msg.sed, xopen-msg.sed: Now that the counter does not have + leading 0s we don't need to remove them. Reported by Marcus + Daniels. + + * Makefile.in (../po/cat-id-tbl.o): Use $(top_srdir) in + dependency. Reported by Marcus Daniels. + + * cat-compat.c: (stpcpy) [!_LIBC && !HAVE_STPCPY]: Define replacement. + Generally cleanup using #if instead of #ifndef. + + * Makefile.in: Correct typos in comment. By Franc,ois Pinard. + +Mon Nov 6 00:27:02 1995 Ulrich Drepper + + * Makefile.in (install-src): Don't install libintl.h and libintl.a + if we use an available gettext implementation. + +Sun Nov 5 22:02:08 1995 Ulrich Drepper + + * libgettext.h: Fix typo: HAVE_CATGETTS -> HAVE_CATGETS. Reported + by Franc,ois Pinard. + + * libgettext.h: Use #if instead of #ifdef/#ifndef. + + * finddomain.c: + Comments describing what has to be done should start with FIXME. + +Sun Nov 5 19:38:01 1995 Ulrich Drepper + + * Makefile.in (DISTFILES): Split. Use DISTFILES with normal meaning. + DISTFILES.common names the files common to both dist goals. + DISTFILES.gettext are the files only distributed in GNU gettext. + +Sun Nov 5 17:32:54 1995 Ulrich Drepper + + * dcgettext.c (DCGETTEXT): Correct searching in derived locales. + This was necessary since a change in _nl_find_msg several weeks + ago. I really don't know this is still not fixed. + +Sun Nov 5 12:43:12 1995 Ulrich Drepper + + * loadmsgcat.c (_nl_load_domain): Test for FILENAME == NULL. This + might mark a special condition. + + * finddomain.c (make_entry_rec): Don't make illegal entry as decided. + + * Makefile.in (dist): Suppress error message when ln failed. + Get files from $(srcdir) explicitly. + + * libgettext.h (gettext_const): Rename to gettext_noop. + +Fri Nov 3 07:36:50 1995 Ulrich Drepper + + * finddomain.c (make_entry_rec): + Protect against wrong locale names by testing mask. + + * libgettext.h (gettext_const): Add macro definition. + Capitalize macro arguments. + +Thu Nov 2 23:15:51 1995 Ulrich Drepper + + * finddomain.c (_nl_find_domain): + Test for pointer != NULL before accessing value. + Reported by Tom Tromey. + + * gettext.c (NULL): + Define as (void*)0 instad of 0. Reported by Franc,ois Pinard. + +Mon Oct 30 21:28:52 1995 Ulrich Drepper + + * po2tbl.sed.in: Serious typo bug fixed by Jim Meyering. + +Sat Oct 28 23:20:47 1995 Ulrich Drepper + + * libgettext.h: Disable dcgettext optimization for Solaris 2.3. + + * localealias.c (alias_compare): + Peter Miller reported that tolower in some systems is + even dumber than I thought. Protect call by `isupper'. + +Fri Oct 27 22:22:51 1995 Ulrich Drepper + + * Makefile.in (libdir, includedir): New variables. + (install-src): Install libintl.a and libintl.h in correct dirs. + +Fri Oct 27 22:07:29 1995 Ulrich Drepper + + * Makefile.in (SOURCES): Fix typo: intrl.compat.c -> intl-compat.c. + + * po2tbl.sed.in: Patch for buggy SEDs by Christian von Roques. + + * localealias.c: + Fix typo and superflous test. Reported by Christian von Roques. + +Fri Oct 6 11:52:05 1995 Ulrich Drepper + + * finddomain.c (_nl_find_domain): + Correct some remainder from the pre-CEN syntax. Now + we don't have a constant number of successors anymore. + +Wed Sep 27 21:41:13 1995 Ulrich Drepper + + * Makefile.in (DISTFILES): Add libintl.h.glibc. + + * Makefile.in (dist-libc): Add goal for packing sources for glibc. + (COMSRCS, COMHDRS): Splitted to separate sources shared with glibc. + + * loadmsgcat.c: Forget to continue #if line. + + * localealias.c: + [_LIBC]: Rename strcasecmp to __strcasecmp to keep ANSI C name + space clean. + + * dcgettext.c, finddomain.c: Better comment to last change. + + * loadmsgcat.c: + [_LIBC]: Rename fstat, open, close, read, mmap, and munmap to + __fstat, __open, __close, __read, __mmap, and __munmap resp + to keep ANSI C name space clean. + + * finddomain.c: + [_LIBC]: Rename stpcpy to __stpcpy to keep ANSI C name space clean. + + * dcgettext.c: + [_LIBC]: Rename getced and stpcpy to __getcwd and __stpcpy resp to + keep ANSI C name space clean. + + * libgettext.h: + Include sys/types.h for those old SysV systems out there. + Reported by Francesco Potorti`. + + * loadmsgcat.c (use_mmap): Define if compiled for glibc. + + * bindtextdom.c: Include all those standard headers + unconditionally if _LIBC is defined. + + * finddomain.c: Fix 2 times defiend -> defined. + + * textdomain.c: Include libintl.h instead of libgettext.h when + compiling for glibc. Include all those standard headers + unconditionally if _LIBC is defined. + + * localealias.c, loadmsgcat.c: Prepare to be compiled in glibc. + + * gettext.c: + Include libintl.h instead of libgettext.h when compiling for glibc. + Get NULL from stddef.h if we compile for glibc. + + * finddomain.c: Include libintl.h instead of libgettext.h when + compiling for glibc. Include all those standard headers + unconditionally if _LIBC is defined. + + * dcgettext.c: Include all those standard headers unconditionally + if _LIBC is defined. + + * dgettext.c: If compiled in glibc include libintl.h instead of + libgettext.h. + (locale.h): Don't rely on HAVE_LOCALE_H when compiling for glibc. + + * dcgettext.c: If compiled in glibc include libintl.h instead of + libgettext.h. + (getcwd): Don't rely on HAVE_GETCWD when compiling for glibc. + + * bindtextdom.c: + If compiled in glibc include libintl.h instead of libgettext.h. + +Mon Sep 25 22:23:06 1995 Ulrich Drepper + + * localealias.c (_nl_expand_alias): Don't call bsearch if NMAP <= 0. + Reported by Marcus Daniels. + + * cat-compat.c (bindtextdomain): + String used in putenv must not be recycled. + Reported by Marcus Daniels. + + * libgettext.h (__USE_GNU_GETTEXT): + Additional symbol to signal that we use GNU gettext + library. + + * cat-compat.c (bindtextdomain): + Fix bug with the strange stpcpy replacement. + Reported by Nelson Beebe. + +Sat Sep 23 08:23:51 1995 Ulrich Drepper + + * cat-compat.c: Include for stpcpy prototype. + + * localealias.c (read_alias_file): + While expand strdup code temporary variable `cp' hided + higher level variable with same name. Rename to `tp'. + + * textdomain.c (textdomain): + Avoid warning by using temporary variable in strdup code. + + * finddomain.c (_nl_find_domain): Remove unused variable `application'. + +Thu Sep 21 15:51:44 1995 Ulrich Drepper + + * localealias.c (alias_compare): + Use strcasecmp() only if available. Else use + implementation in place. + + * intl-compat.c: + Wrapper functions now call *__ functions instead of __*. + + * libgettext.h: Declare prototypes for *__ functions instead for __*. + + * cat-compat.c, loadmsgcat.c: + Don't use xmalloc, xstrdup, and stpcpy. These functions are not part + of the standard libc and so prevent libintl.a from being used + standalone. + + * bindtextdom.c: + Don't use xmalloc, xstrdup, and stpcpy. These functions are not part + of the standard libc and so prevent libintl.a from being used + standalone. + Rename to bindtextdomain__ if not used in GNU C Library. + + * dgettext.c: + Rename function to dgettext__ if not used in GNU C Library. + + * gettext.c: + Don't use xmalloc, xstrdup, and stpcpy. These functions are not part + of the standard libc and so prevent libintl.a from being used + standalone. + Functions now called gettext__ if not used in GNU C Library. + + * dcgettext.c, localealias.c, textdomain.c, finddomain.c: + Don't use xmalloc, xstrdup, and stpcpy. These functions are not part + of the standard libc and so prevent libintl.a from being used + standalone. + +Sun Sep 17 23:14:49 1995 Ulrich Drepper + + * finddomain.c: Correct some bugs in handling of CEN standard + locale definitions. + +Thu Sep 7 01:49:28 1995 Ulrich Drepper + + * finddomain.c: Implement CEN syntax. + + * gettextP.h (loaded_domain): Extend number of successors to 31. + +Sat Aug 19 19:25:29 1995 Ulrich Drepper + + * Makefile.in (aliaspath): Remove path to X11 locale dir. + + * Makefile.in: Make install-src depend on install. This helps + gettext to install the sources and other packages can use the + install goal. + +Sat Aug 19 15:19:33 1995 Ulrich Drepper + + * Makefile.in (uninstall): Remove stuff installed by install-src. + +Tue Aug 15 13:13:53 1995 Ulrich Drepper + + * VERSION.in: Initial revision. + + * Makefile.in (DISTFILES): + Add VERSION file. This is not necessary for gettext, but + for other packages using this library. + +Tue Aug 15 06:16:44 1995 Ulrich Drepper + + * gettextP.h (_nl_find_domain): + New prototype after changing search strategy. + + * finddomain.c (_nl_find_domain): + We now try only to find a specified catalog. Fall back to other + catalogs listed in the locale list is now done in __dcgettext. + + * dcgettext.c (__dcgettext): + Now we provide message fall back even to different languages. + I.e. if a message is not available in one language all the other + in the locale list a tried. Formerly fall back was only possible + within one language. Implemented by moving one loop from + _nl_find_domain to here. + +Mon Aug 14 23:45:50 1995 Ulrich Drepper + + * Makefile.in (gettextsrcdir): + Directory where source of GNU gettext library are made + available. + (INSTALL, INSTALL_DATA): Programs used for installing sources. + (gettext-src): New. Rule to install GNU gettext sources for use in + gettextize shell script. + +Sun Aug 13 14:40:48 1995 Ulrich Drepper + + * loadmsgcat.c (_nl_load_domain): + Use mmap for loading only when munmap function is + also available. + + * Makefile.in (install): Depend on `all' goal. + +Wed Aug 9 11:04:33 1995 Ulrich Drepper + + * localealias.c (read_alias_file): + Do not overwrite '\n' when terminating alias value string. + + * localealias.c (read_alias_file): + Handle long lines. Ignore the rest not fitting in + the buffer after the initial `fgets' call. + +Wed Aug 9 00:54:29 1995 Ulrich Drepper + + * gettextP.h (_nl_load_domain): + Add prototype, replacing prototype for _nl_load_msg_cat. + + * finddomain.c (_nl_find_domain): + Remove unneeded variable filename and filename_len. + (expand_alias): Remove prototype because functions does not + exist anymore. + + * localealias.c (read_alias_file): + Change type of fname_len parameter to int. + (xmalloc): Add prototype. + + * loadmsgcat.c: Better prototypes for xmalloc. + +Tue Aug 8 22:30:39 1995 Ulrich Drepper + + * finddomain.c (_nl_find_domain): + Allow alias name to be constructed from the four components. + + * Makefile.in (aliaspath): New variable. Set to preliminary value. + (SOURCES): Add localealias.c. + (OBJECTS): Add localealias.o. + + * gettextP.h: Add prototype for _nl_expand_alias. + + * finddomain.c: Aliasing handled in intl/localealias.c. + + * localealias.c: Aliasing for locale names. + + * bindtextdom.c: Better prototypes for xmalloc and xstrdup. + +Mon Aug 7 23:47:42 1995 Ulrich Drepper + + * Makefile.in (DISTFILES): gettext.perl is now found in misc/. + + * cat-compat.c (bindtextdomain): + Correct implementation. dirname parameter was not used. + Reported by Marcus Daniels. + + * gettextP.h (loaded_domain): + New fields `successor' and `decided' for oo, lazy + message handling implementation. + + * dcgettext.c: + Adopt for oo, lazy message handliing. + Now we can inherit translations from less specific locales. + (find_msg): New function. + + * loadmsgcat.c, finddomain.c: + Complete rewrite. Implement oo, lazy message handling :-). + We now have an additional environment variable `LANGUAGE' with + a higher priority than LC_ALL for the LC_MESSAGE locale. + Here we can set a colon separated list of specifications each + of the form `language[_territory[.codeset]][@modifier]'. + +Sat Aug 5 09:55:42 1995 Ulrich Drepper + + * finddomain.c (unistd.h): + Include to get _PC_PATH_MAX defined on system having it. + +Fri Aug 4 22:42:00 1995 Ulrich Drepper + + * finddomain.c (stpcpy): Include prototype. + + * Makefile.in (dist): Remove `copying instead' message. + +Wed Aug 2 18:52:03 1995 Ulrich Drepper + + * Makefile.in (ID, TAGS): Do not use $^. + +Tue Aug 1 20:07:11 1995 Ulrich Drepper + + * Makefile.in (TAGS, ID): Use $^ as command argument. + (TAGS): Give etags -o option t write to current directory, + not $(srcdir). + (ID): Use $(srcdir) instead os $(top_srcdir)/src. + (distclean): Remove ID. + +Sun Jul 30 11:51:46 1995 Ulrich Drepper + + * Makefile.in (gnulocaledir): + New variable, always using share/ for data directory. + (DEFS): Add GNULOCALEDIR, used in finddomain.c. + + * finddomain.c (_nl_default_dirname): + Set to GNULOCALEDIR, because it always has to point + to the directory where GNU gettext Library writes it to. + + * intl-compat.c (textdomain, bindtextdomain): + Undefine macros before function definition. + +Sat Jul 22 01:10:02 1995 Ulrich Drepper + + * libgettext.h (_LIBINTL_H): + Protect definition in case where this file is included as + libgettext.h on Solaris machines. Add comment about this. + +Wed Jul 19 02:36:42 1995 Ulrich Drepper + + * intl-compat.c (textdomain): Correct typo. + +Wed Jul 19 01:51:35 1995 Ulrich Drepper + + * dcgettext.c (dcgettext): Function now called __dcgettext. + + * dgettext.c (dgettext): Now called __dgettext and calls + __dcgettext. + + * gettext.c (gettext): + Function now called __gettext and calls __dgettext. + + * textdomain.c (textdomain): Function now called __textdomain. + + * bindtextdom.c (bindtextdomain): Function now called + __bindtextdomain. + + * intl-compat.c: Initial revision. + + * Makefile.in (SOURCES): Add intl-compat.c. + (OBJECTS): We always compile the GNU gettext library functions. + OBJECTS contains all objects but cat-compat.o, ../po/cat-if-tbl.o, + and intl-compat.o. + (GETTOBJS): Contains now only intl-compat.o. + + * libgettext.h: + Re-include protection matches dualistic character of libgettext.h. + For all functions in GNU gettext library define __ counter part. + + * finddomain.c (strchr): Define as index if not found in C library. + (_nl_find_domain): For relative paths paste / in between. + +Tue Jul 18 16:37:45 1995 Ulrich Drepper + + * loadmsgcat.c, finddomain.c: Add inclusion of sys/types.h. + + * xopen-msg.sed: Fix bug with `msgstr ""' lines. + A little bit better comments. + +Tue Jul 18 01:18:27 1995 Ulrich Drepper + + * Makefile.in: + po-mode.el, makelinks, combine-sh are now found in ../misc. + + * po-mode.el, makelinks, combine-sh, elisp-comp: + Moved to ../misc/. + + * libgettext.h, gettextP.h, gettext.h: Uniform test for __STDC__. + +Sun Jul 16 22:33:02 1995 Ulrich Drepper + + * Makefile.in (INSTALL, INSTALL_DATA): New variables. + (install-data, uninstall): Install/uninstall .elc file. + + * po-mode.el (Installation comment): + Add .pox as possible extension of .po files. + +Sun Jul 16 13:23:27 1995 Ulrich Drepper + + * elisp-comp: Complete new version by Franc,ois: This does not + fail when not compiling in the source directory. + +Sun Jul 16 00:12:17 1995 Ulrich Drepper + + * Makefile.in (../po/cat-id-tbl.o): + Use $(MAKE) instead of make for recursive make. + + * Makefile.in (.el.elc): Use $(SHELL) instead of /bin/sh. + (install-exec): Add missing dummy goal. + (install-data, uninstall): @ in multi-line shell command at + beginning, not in front of echo. Reported by Eric Backus. + +Sat Jul 15 00:21:28 1995 Ulrich Drepper + + * Makefile.in (DISTFILES): + Rename libgettext.perl to gettext.perl to fit in 14 chars + file systems. + + * gettext.perl: + Rename to gettext.perl to fit in 14 chars file systems. + +Thu Jul 13 23:17:20 1995 Ulrich Drepper + + * cat-compat.c: If !STDC_HEADERS try to include malloc.h. + +Thu Jul 13 20:55:02 1995 Ulrich Drepper + + * po2tbl.sed.in: Pretty printing. + + * linux-msg.sed, xopen-msg.sed: + Correct bugs with handling substitute flags in branches. + + * hash-string.h (hash_string): + Old K&R compilers don't under stand `unsigned char'. + + * gettext.h (nls_uint32): + Some old K&R compilers (eg HP) don't understand `unsigned int'. + + * cat-compat.c (msg_to_cat_id): De-ANSI-fy prototypes. + +Thu Jul 13 01:34:33 1995 Ulrich Drepper + + * Makefile.in (ELCFILES): New variable. + (DISTFILES): Add elisp-comp. + Add implicit rule for .el -> .elc compilation. + (install-data): install $ELCFILES + (clean): renamed po-to-tbl and po-to-msg to po2tbl and po2msg resp. + + * elisp-comp: Initial revision + +Wed Jul 12 16:14:52 1995 Ulrich Drepper + + * Makefile.in: + cat-id-tbl.c is now found in po/. This enables us to use an identical + intl/ directory in all packages. + + * dcgettext.c (dcgettext): hashing does not work for table size <= 2. + + * textdomain.c: fix typo (#if def -> #if defined) + +Tue Jul 11 18:44:43 1995 Ulrich Drepper + + * Makefile.in (stamp-cat-id): use top_srcdir to address source files + (DISTFILES,distclean): move tupdate.perl to src/ + + * po-to-tbl.sed.in: + add additional jump to clear change flag to recognize multiline strings + +Tue Jul 11 01:32:50 1995 Ulrich Drepper + + * textdomain.c: Protect inclusion of stdlib.h and string.h. + + * loadmsgcat.c: Protect inclusion of stdlib.h. + + * libgettext.h: Protect inclusion of locale.h. + Allow use in C++ programs. + Define NULL is not happened already. + + * Makefile.in (DISTFILES): ship po-to-tbl.sed.in instead of + po-to-tbl.sed. + (distclean): remove po-to-tbl.sed and tupdate.perl. + + * tupdate.perl.in: Substitute Perl path even in exec line. + Don't include entries without translation from old .po file. + +Tue Jul 4 00:41:51 1995 Ulrich Drepper + + * tupdate.perl.in: use "Updated: " in msgid "". + + * cat-compat.c: Fix typo (LOCALDIR -> LOCALEDIR). + Define getenv if !__STDC__. + + * bindtextdom.c: Protect stdlib.h and string.h inclusion. + Define free if !__STDC__. + + * finddomain.c: Change DEF_MSG_DOM_DIR to LOCALEDIR. + Define free if !__STDC__. + + * cat-compat.c: Change DEF_MSG_DOM_DIR to LOCALEDIR. + +Mon Jul 3 23:56:30 1995 Ulrich Drepper + + * Makefile.in: Use LOCALEDIR instead of DEF_MSG_DOM_DIR. + Remove unneeded $(srcdir) from Makefile.in dependency. + + * makelinks: Add copyright and short description. + + * po-mode.el: Last version for 0.7. + + * tupdate.perl.in: Fix die message. + + * dcgettext.c: Protect include of string.h. + + * gettext.c: Protect include of stdlib.h and further tries to get NULL. + + * finddomain.c: Some corrections in includes. + + * Makefile.in (INCLUDES): Prune list correct path to Makefile.in. + + * po-to-tbl.sed: Adopt for new .po file format. + + * linux-msg.sed, xopen-msg.sed: Adopt for new .po file format. + +Sun Jul 2 23:55:03 1995 Ulrich Drepper + + * tupdate.perl.in: Complete rewrite for new .po file format. + +Sun Jul 2 02:06:50 1995 Ulrich Drepper + + * First official release. This directory contains all the code + needed to internationalize own packages. It provides functions + which allow to use the X/Open catgets function with an interface + like the Uniforum gettext function. For system which does not + have neither of those a complete implementation is provided. --- openjade-1.4devel1.orig/intl/cat-compat.c +++ openjade-1.4devel1/intl/cat-compat.c @@ -1,20 +1,19 @@ /* Compatibility code for gettext-using-catgets interface. - Copyright (C) 1995 Free Software Foundation, Inc. + Copyright (C) 1995, 1997 Free Software Foundation, Inc. -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ + 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. */ #ifdef HAVE_CONFIG_H # include @@ -40,6 +39,16 @@ /* @@ end of prolog @@ */ +/* XPG3 defines the result of `setlocale (category, NULL)' as: + ``Directs `setlocale()' to query `category' and return the current + setting of `local'.'' + However it does not specify the exact format. And even worse: POSIX + defines this not at all. So we can use this feature only on selected + system (e.g. those using GNU C Library). */ +#ifdef _LIBC +# define HAVE_LOCALE_NULL +#endif + /* The catalog descriptor. */ static nl_catd catalog = (nl_catd) -1; @@ -50,11 +59,11 @@ static const char *catalog_name = default_catalog_name; /* Get ID for given string. If not found return -1. */ -static int msg_to_cat_id __P ((const char *msg)); +static int msg_to_cat_id PARAMS ((const char *msg)); /* Substitution for systems lacking this function in their C library. */ #if !_LIBC && !HAVE_STPCPY -static char *stpcpy __P ((char *dest, const char *src)); +static char *stpcpy PARAMS ((char *dest, const char *src)); #endif @@ -68,7 +77,8 @@ size_t new_name_len; char *lang; -#if HAVE_SETLOCALE && HAVE_LC_MESSAGES && HAVE_SETLOCALE_NULL +#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES \ + && defined HAVE_LOCALE_NULL lang = setlocale (LC_MESSAGES, NULL); #else lang = getenv ("LC_ALL"); --- openjade-1.4devel1.orig/intl/gettext.h +++ openjade-1.4devel1/intl/gettext.h @@ -1,20 +1,20 @@ -/* gettext.h - internal header for GNU gettext internationalization functions - Copyright (C) 1995 Software Foundation, Inc. +/* Internal header for GNU gettext internationalization functions. + Copyright (C) 1995, 1997 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 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. + 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 Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ #ifndef _GETTEXT_H #define _GETTEXT_H 1 --- openjade-1.4devel1.orig/intl/libgettext.h +++ openjade-1.4devel1/intl/libgettext.h @@ -1,27 +1,27 @@ -/* libgettext.h -- Message catalogs for internationalization. - Copyright (C) 1995 Free Software Foundation, Inc. +/* Message catalogs for internationalization. + Copyright (C) 1995, 1996, 1997, 1998 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. */ + 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. */ /* Because on some systems (e.g. Solaris) we sometimes have to include the systems libintl.h as well as this file we have more complex include protection above. But the systems header might perhaps also define _LIBINTL_H and therefore we have to protect the definition here. */ -#if !defined (_LIBINTL_H) || !defined (_LIBGETTEXT_H) -#if !_LIBINTL_H +#if !defined _LIBINTL_H || !defined _LIBGETTEXT_H +#ifndef _LIBINTL_H # define _LIBINTL_H 1 #endif #define _LIBGETTEXT_H 1 @@ -43,11 +43,11 @@ /* @@ end of prolog @@ */ -#ifndef __P -# if __STDC__ -# define __P(args) args +#ifndef PARAMS +# if __STDC__ || defined __cplusplus +# define PARAMS(args) args # else -# define __P(args) () +# define PARAMS(args) () # endif #endif @@ -91,33 +91,34 @@ /* Look up MSGID in the current default message catalog for the current LC_MESSAGES locale. If not found, returns MSGID itself (the default text). */ -extern char *gettext __P ((const char *__msgid)); -extern char *gettext__ __P ((const char *__msgid)); +extern char *gettext PARAMS ((const char *__msgid)); +extern char *gettext__ PARAMS ((const char *__msgid)); /* Look up MSGID in the DOMAINNAME message catalog for the current LC_MESSAGES locale. */ -extern char *dgettext __P ((const char *__domainname, const char *__msgid)); -extern char *dgettext__ __P ((const char *__domainname, const char *__msgid)); +extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid)); +extern char *dgettext__ PARAMS ((const char *__domainname, + const char *__msgid)); /* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY locale. */ -extern char *dcgettext __P ((const char *__domainname, const char *__msgid, - int __category)); -extern char *dcgettext__ __P ((const char *__domainname, const char *__msgid, - int __category)); +extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid, + int __category)); +extern char *dcgettext__ PARAMS ((const char *__domainname, + const char *__msgid, int __category)); /* Set the current default message catalog to DOMAINNAME. If DOMAINNAME is null, return the current default. If DOMAINNAME is "", reset to the default of "messages". */ -extern char *textdomain __P ((const char *__domainname)); -extern char *textdomain__ __P ((const char *__domainname)); +extern char *textdomain PARAMS ((const char *__domainname)); +extern char *textdomain__ PARAMS ((const char *__domainname)); /* Specify that the DOMAINNAME message catalog will be found in DIRNAME rather than in the system locale data base. */ -extern char *bindtextdomain __P ((const char *__domainname, +extern char *bindtextdomain PARAMS ((const char *__domainname, const char *__dirname)); -extern char *bindtextdomain__ __P ((const char *__domainname, +extern char *bindtextdomain__ PARAMS ((const char *__domainname, const char *__dirname)); #if ENABLE_NLS @@ -127,33 +128,37 @@ has dcgettext. */ # if !HAVE_CATGETS && (!HAVE_GETTEXT || HAVE_DCGETTEXT) -# define gettext(Msgid) \ +# define gettext(Msgid) \ dgettext (NULL, Msgid) -# define dgettext(Domainname, Msgid) \ +# define dgettext(Domainname, Msgid) \ dcgettext (Domainname, Msgid, LC_MESSAGES) # if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ >= 7 -# define dcgettext(Domainname, Msgid, Category) \ +/* This global variable is defined in loadmsgcat.c. We need a sign, + whether a new catalog was loaded, which can be associated with all + translations. */ +extern int _nl_msg_cat_cntr; + +# define dcgettext(Domainname, Msgid, Category) \ (__extension__ \ ({ \ - char *result; \ + char *__result; \ if (__builtin_constant_p (Msgid)) \ { \ - extern int _nl_msg_cat_cntr; \ static char *__translation__; \ static int __catalog_counter__; \ if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr) \ { \ __translation__ = \ - dcgettext__ ((Domainname), (Msgid), (Category)); \ + dcgettext__ (Domainname, Msgid, Category); \ __catalog_counter__ = _nl_msg_cat_cntr; \ } \ - result = __translation__; \ + __result = __translation__; \ } \ else \ - result = dcgettext__ ((Domainname), (Msgid), (Category)); \ - result; \ + __result = dcgettext__ (Domainname, Msgid, Category); \ + __result; \ })) # endif # endif @@ -163,8 +168,8 @@ # define gettext(Msgid) (Msgid) # define dgettext(Domainname, Msgid) (Msgid) # define dcgettext(Domainname, Msgid, Category) (Msgid) -# define textdomain(Domainname) while (0) /* nothing */ -# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */ +# define textdomain(Domainname) ((char *) Domainname) +# define bindtextdomain(Domainname, Dirname) ((char *) Dirname) #endif --- openjade-1.4devel1.orig/jade/Makefile.am +++ openjade-1.4devel1/jade/Makefile.am @@ -8,13 +8,13 @@ HtmlFOTBuilder.h TeXFOTBuilder.h TransformFOTBuilder.h \ MifFOTBuilder.h \ JadeMessages.h HtmlMessages.h RtfMessages.h TeXMessages.h \ - MifMessages.h TmpOutputByteStream.h + MifMessages.h TmpOutputByteStream.h MessageModule.cxx openjade_LDADD = $(top_builddir)/style/libostyle.la \ $(top_builddir)/spgrove/libospgrove.la \ $(top_builddir)/grove/libogrove.la -losp -INCLUDES = -I$(top_srcdir)/grove -I$(top_srcdir)/spgrove -I$(top_srcdir)/style +AM_CPPFLAGS = -I$(top_srcdir)/grove -I$(top_srcdir)/spgrove -I$(top_srcdir)/style EXTRA_DIST = JadeMessages.msg JadeMessages.rc \ HtmlMessages.msg HtmlMessages.rc \ @@ -38,7 +38,9 @@ TeXFOTBuilder_inst.cxx TransformFOTBuilder_inst.cxx \ MifFOTBuilder_inst.cxx -MSGGENFLAGS = -l xModule +MAINTAINERCLEANFILES = Makefile.in jade-out.fot + +MSGGENFLAGS = -l jadeModule SUFFIXES = .msg .m4 .rc @@ -46,4 +48,4 @@ $(PERL) $(top_srcdir)/instmac.pl $< >$@ %.h %.cxx %.rc: %.msg - $(PERL) -w $(top_builddir)/msggen.pl $(MSGGENFLAGS) $< + [ ! -f $(top_srcdir)/msggen.pl ] || $(PERL) -w $(top_srcdir)/msggen.pl $(MSGGENFLAGS) $< --- openjade-1.4devel1.orig/jade/MessageModule.cxx +++ openjade-1.4devel1/jade/MessageModule.cxx @@ -0,0 +1,24 @@ +// Copyright (c) 2002 Ian Castle +// See the file COPYING for copying permission. + +#ifdef __GNUG__ +#pragma implementation +#endif + +// #include "splib.h" +// #include "MessageTable.h" + +#include "stylelib.h" + +#include + +#ifdef SP_NAMESPACE +namespace SP_NAMESPACE { +#endif + +MessageModule jadeModule; + +#ifdef SP_NAMESPACE +} +#endif + --- openjade-1.4devel1.orig/jade/RtfFOTBuilder.cxx +++ openjade-1.4devel1/jade/RtfFOTBuilder.cxx @@ -1163,6 +1163,9 @@ #if 0 os() << "{\\field{\\*\\fldinst SYMBOL " << (unsigned long)code << " \\\\f \"" << symbolFonts[ff - 1].name << "\"}{\\fldrslt "; + if (specFormat_.inputWhitespaceTreatment != symbolPreserve) + for (; n > 0 && *s == ' '; s++, n--) + ; #endif int &n = fontFamilyCharsetsTable_[ff].rtfFontNumber[nWinCharsets - 1]; if (n < 0) @@ -2051,8 +2054,9 @@ } else if (inlineState_ == inlineField) { os() << "\\tab "; - inlineState_ = inlineMiddle; + } + inlineState_ = inlineMiddle; end(); } --- openjade-1.4devel1.orig/jade/TeXFOTBuilder.cxx +++ openjade-1.4devel1/jade/TeXFOTBuilder.cxx @@ -386,6 +386,7 @@ void setPageNColumns(long); void setPageColumnSep(Length); void setPageBalanceColumns(bool); + void setPageTwoSide(bool); void setGridRowSep(Length); void setGridColumnSep(Length); void setSubscriptDepth(Length); @@ -413,11 +414,12 @@ void setInlineSpaceSpace(const OptInlineSpace &); void setGlyphSubstTable(const Vector > &tables); - void startDisplay( const DisplayNIC & ); - void endDisplay(); + void startDisplay( const DisplayNIC & ) {}; + void endDisplay() {}; enum FotObjectClassType { oc_Unknown, oc_Cell }; + static const Length lengthUnspecified = LONG_MAX; struct Format { @@ -427,8 +429,10 @@ FotBorderPriority( 0 ), FotBorderPresent( true ), FotLineRepeat( 1 ), + FotLines( symbolWrap ), FotLineSep( 1000 ), - FotDisplayAlignment( symbolStart ), + FotDisplayAlignment( symbolNotApplicable ), + FotCellRowAlignment( symbolNotApplicable ), FotStartIndentSpec( 0 ), FotEndIndentSpec( 0 ), FotLeftMargin( 1 ), @@ -437,8 +441,9 @@ FotPageNColumns( 1 ), FotPageColumnSep( 72000/2 ), FotSpan( 1 ), - FotCellBeforeColumnMargin( 0 ), - FotCellAfterColumnMargin( 0 ), + FotCellBeforeColumnMargin( lengthUnspecified ), + FotCellAfterColumnMargin( lengthUnspecified ), + FotCellBackground(false), FotObjectClass( oc_Unknown ) {} long FotCurDisplaySize; @@ -448,7 +453,9 @@ bool FotBorderPresent; long FotLineRepeat; Length FotLineSep; + Symbol FotLines; Symbol FotDisplayAlignment; + Symbol FotCellRowAlignment; LengthSpec FotStartIndentSpec; LengthSpec FotEndIndentSpec; Length FotLeftMargin; @@ -457,6 +464,8 @@ long FotPageNColumns; Length FotPageColumnSep; long FotSpan; + bool FotCellBackground; + DeviceRGBColor FotBackgroundColor; Length FotCellBeforeColumnMargin; Length FotCellAfterColumnMargin; FotObjectClassType FotObjectClass; @@ -522,10 +531,13 @@ struct CompoundFotElement : public FotElement { CompoundFotElement( CompoundFotElement *parent = NULL ) - : FotElement( parent ), CurrentlyOpenChildIdx( -1 ), LastClosedChildIdx( -1 ) {} + : FotElement( parent ), CurrentlyOpenChildIdx( -1 ), + LastClosedChildIdx( -1 ) {} virtual bool isAtomic() const { return false; } virtual void open( TeXFOTBuilder &builder ) - { FotElement::open( builder ); builder.setCurOs( &PreContent ); }; + { FotElement::open( builder ); builder.pushOs( &PreContent ); }; + virtual void close( TeXFOTBuilder &builder ) + { builder.popOs(); FotElement::close( builder ); }; virtual void childJustClosed( FotElement &child ) { CurrentlyOpenChildIdx = -1; LastClosedChildIdx = child.siblingSeqIdx(); }; virtual void childJustOpened( FotElement &child ) @@ -552,7 +564,8 @@ #else stream << NodeInfoProlog << "\\" << name() << "%\n{" << Characteristics << '}'; #endif - PreContent.commit( stream ); + + PreContent.commit( stream ); } virtual void outEpilog( OutputByteStream &stream ) const { #ifdef TEXDEBUG @@ -618,15 +631,21 @@ struct Column { Column() : hasWidth( 0 ), computedWidth( 0 ), defaultTeXLeftBorder( 0 ), - defaultTeXRightBorder( 0 ), displayAlignment( symbolStart ), - isExplicit( false ) {} + defaultTeXRightBorder( 0 ), displayAlignment( symbolStart ), + isExplicit( false ), displaySize(0), + defaultCellBeforeColumnMargin( 0 ), + defaultCellAfterColumnMargin( 0 ) {} bool isExplicit; bool hasWidth; TableLengthSpec width; long computedWidth; + long displaySize; Symbol displayAlignment; int defaultTeXLeftBorder; // also used as column border count; int defaultTeXRightBorder; // + bool defaultCellBackground; + Length defaultCellBeforeColumnMargin; + Length defaultCellAfterColumnMargin; }; struct TablePart; @@ -636,9 +655,15 @@ : CompoundFotElement( parent ), missing( false ), OverlappingCell( NULL ), nRowsSpanned( 1 ), nColumnsSpanned( 1 ), displaySize( 0 ), beforeRowBorder(), afterRowBorder(), beforeColumnBorder(), - afterColumnBorder(), TeXTableRowIdx( -1 ), TeXTableColumnIdx( -1 ), - displayAlignment( symbolStart ), effectiveAlignment( symbolStart ), - paragraphChildrenNum( 0 ) {} + afterColumnBorder(), TeXTableRowIdx( -1 ), TeXTableColumnIdx(-1), + needsTeXColumnOverride(false), + beforeColumnMargin( lengthUnspecified ), + effectiveBeforeColumnMargin( lengthUnspecified ), + afterColumnMargin( lengthUnspecified ), + effectiveAfterColumnMargin( lengthUnspecified ), + effectiveAlignment( symbolStart ), + rowAlignment( symbolNotApplicable ), + cellBackground(false) {} bool missing; int TeXTableRowIdx; @@ -649,29 +674,37 @@ CellAfterRowBorder afterRowBorder; CellBeforeColumnBorder beforeColumnBorder; CellAfterColumnBorder afterColumnBorder; - Symbol displayAlignment; + bool needsTeXColumnOverride; + Length beforeColumnMargin; + Length effectiveBeforeColumnMargin; + Length afterColumnMargin; + Length effectiveAfterColumnMargin; + Symbol rowAlignment; Symbol effectiveAlignment; long displaySize; - long paragraphChildrenNum; + bool cellBackground; + DeviceRGBColor backgroundColor; Cell *OverlappingCell; OutputByteStream &content() { return Content; } virtual void open( TeXFOTBuilder &builder ) - { CompoundFotElement::open( builder ); - builder.setCurOs( &Content ); + { builder.pushFotElementState(); + CompoundFotElement::open( builder ); + builder.pushOs( &Content ); builder.curFotElementState().EnforcingStructure = false; } virtual void close( TeXFOTBuilder &builder ) - { computeMultiParFlag(); + { builder.popOs(); CompoundFotElement::close( builder ); - builder.curFotElementState().EnforcingStructure = true; } + builder.popFotElementState(); } virtual const char *name() const { return "TableCell"; } bool singleRowBeforeRowBorderPresent() const; bool singleRowAfterRowBorderPresent() const; bool singleColumnBeforeColumnBorderPresent() const; bool singleColumnAfterColumnBorderPresent() const; void computeOverridingTeXColumnBorders( TablePart &tablePart ); - void computeOverridingTeXDisplayAlignment( TablePart &tablePart ); - void computeMultiParFlag(); + void computeEffectiveTeXCellWidth( TablePart &tablePart ); + void computeEffectiveTeXColumnMargins( TablePart &tablePart ); + void computeTeXRowSpanFiller( TablePart &tablePart ); bool isOverlapped() const { return OverlappingCell == this ? false : true; } virtual FotElement &child( size_t ) { assert( false ); return *this; } @@ -679,7 +712,8 @@ protected: virtual void outProlog( OutputByteStream &stream ) const; virtual void outEpilog( OutputByteStream &stream ) const; - void outContent( OutputByteStream &stream ) const { Content.commit( stream ); } + void outContent( OutputByteStream &stream ) const + { if ( !isOverlapped() ) Content.commit( stream ); } TeXTmpOutputByteStream Content; }; @@ -716,7 +750,7 @@ String FooterEpilog; void processColumns( TeXFOTBuilder &builder ); - void computeTeXColumnBordersAndDisplayAlignment(); + void computeOverridingTeXCharacteristics(); void normalizeRows(); void begin(); @@ -742,7 +776,8 @@ Table( CompoundFotElement *parent = NULL ) : CompoundFotElement( parent ), beforeRowBorder(), afterRowBorder(), beforeColumnBorder(), afterColumnBorder(), CurCell( NULL ), - CurTablePart( NULL ), NoTablePartsSeen( true ) {} + displayAlignment( symbolStart ), CurTablePart( NULL ), + NoTablePartsSeen( true ) {} Vector TableParts; @@ -763,12 +798,19 @@ unsigned startingRowIdx, bool hasFirstTableRow, bool hasLastTableRow ); void begin(); + virtual void open( TeXFOTBuilder &builder ) + { builder.pushFotElementState(); + CompoundFotElement::open( builder ); + builder.curFotElementState().EnforcingStructure = true; } + virtual void close( TeXFOTBuilder &builder ) + { CompoundFotElement::close( builder ); + builder.popFotElementState(); } void end( TeXFOTBuilder &builder ); Vector &curRows() { assert( CurRows != NULL ); return *CurRows; } TablePart &curTablePart() { assert( CurTablePart != NULL ); return *CurTablePart; } Cell &curCell() { assert( CurCell != NULL ); return *CurCell; } - + TablePart *CurTablePart; Cell *CurCell; Vector *CurRows; @@ -778,18 +820,29 @@ protected: void outContent( OutputByteStream &stream ) const; }; - + long computeLengthSpec( const LengthSpec &spec ) const; const Format &curFormat() const { assert( FormatStack.size() > 0 ); return FormatStack.back(); } - Table &curTable() { return CurTable; } - FotElementState &curFotElementState() { return CurFotElementState; } - void setCurOs( OutputByteStream *to ) { CurOs = to; } + Table &curTable() { assert( TableStack.size() > 0 ); + return TableStack.back(); } + FotElementState &curFotElementState() + { assert( FotElementStateStack_.size() > 0 ); + return FotElementStateStack_.back(); } + void pushFotElementState() + { FotElementStateStack_.resize(FotElementStateStack_.size() + 1 ); } + void popFotElementState() + { assert( FotElementStateStack_.size() > 0 ); + FotElementStateStack_.resize(FotElementStateStack_.size() - 1 ); } + + void pushOs( OutputByteStream *to ); + void popOs(); + void elementStart( FotObjectClassType objectClassType ); OutputByteStream *fileout_; private: // Variables. - OutputByteStream *CurOs; + Vector osStack_; StrOutputByteStream stringout_; Messenger *mgr_; bool preserveSdata_; @@ -824,8 +877,8 @@ Vector FormatStack; Format NextFormat; - Table CurTable; - FotElementState CurFotElementState; + Vector TableStack; + Vector FotElementStateStack_; // Functions. OutputByteStream &os(); @@ -844,6 +897,7 @@ void setlength(const char *,Length); void set(const char *,const StringC &); void set(const char *,const GroveString &); + void set(const char *,const GroveString &,long unsigned int); void set(const char *,Symbol); void set(const char *,const LengthSpec &); void set(const char *,double); @@ -851,6 +905,7 @@ void set(const char *,bool); void set(const char *,long); void set(const char *,long unsigned int); + void set(const char *,long unsigned int,long unsigned int); void set(const char *name,unsigned int n) { set(name, (unsigned long)n); } @@ -960,7 +1015,6 @@ // --------- TeXFOTBuilder::FotElement --------------------------------------- void TeXFOTBuilder::FotElement::open( TeXFOTBuilder &builder ) { - builder.curFotElementState().IsOpen = true; if( parent() ) parent()->childJustOpened( *this ); @@ -972,13 +1026,10 @@ } void TeXFOTBuilder::FotElement::close( TeXFOTBuilder &builder ) { - if( parent() ) parent()->childJustClosed( *this ); - else { + else builder.curFotElementState().IsOpen = false; - builder.setCurOs( NULL ); - } } TeXFOTBuilder::FotElement *TeXFOTBuilder::FotElement::lastClosed_() { @@ -989,19 +1040,16 @@ // --------- TeXFOTBuilder Standard Display/Element Handling ----------------- void TeXFOTBuilder::elementStart( FotObjectClassType objectClassType ) { - NextFormat.FotObjectClass = objectClassType; FormatStack.push_back( NextFormat ); } void TeXFOTBuilder::start() { - NextFormat.FotObjectClass = oc_Unknown; FormatStack.push_back( NextFormat ); } void TeXFOTBuilder::end() { - assert( FormatStack.size() > 0 ); FormatStack.resize( FormatStack.size()-1 ); @@ -1009,24 +1057,6 @@ NextFormat = FormatStack.back(); } -void TeXFOTBuilder::startDisplay( const DisplayNIC & ) { - - if( curTable().CurCell != NULL ) - NextFormat.FotCurDisplaySize = curTable().CurCell->displaySize; - else if( NextFormat.FotSpan > 1 ) - NextFormat.FotCurDisplaySize - = NextFormat.FotPageWidth - NextFormat.FotLeftMargin - NextFormat.FotRightMargin; - else - NextFormat.FotCurDisplaySize - = ( NextFormat.FotPageWidth - NextFormat.FotLeftMargin - NextFormat.FotRightMargin - - NextFormat.FotPageColumnSep * ( NextFormat.FotPageNColumns - 1 ) ) - / NextFormat.FotPageNColumns; - -} - -void TeXFOTBuilder::endDisplay() { -} - // --------- TeXFOTBuilder Misc ---------------------------------------------- long TeXFOTBuilder::computeLengthSpec( const LengthSpec &spec ) const { @@ -1173,7 +1203,7 @@ if( tablePart.needsColumnReprocessing ) tablePart.processColumns( builder ); - tablePart.computeTeXColumnBordersAndDisplayAlignment(); + tablePart.computeOverridingTeXCharacteristics(); } } @@ -1213,7 +1243,7 @@ return Footer[idx]; } -void TeXFOTBuilder::TablePart::computeTeXColumnBordersAndDisplayAlignment() { +void TeXFOTBuilder::TablePart::computeOverridingTeXCharacteristics() { Vector *rows; for( int step = 0; step < 3; step++ ) { @@ -1274,8 +1304,9 @@ for( size_t c = 0; c < (*rows)[r].Cells.size()-1; c++ ) { if( !(*rows)[r].Cells[c].isOverlapped() ) { (*rows)[r].Cells[c].computeOverridingTeXColumnBorders( *this ); - (*rows)[r].Cells[c].computeOverridingTeXDisplayAlignment( *this ); - } + } else { + (*rows)[r].Cells[c].computeTeXRowSpanFiller( *this ); + } } } } @@ -1317,15 +1348,26 @@ Columns[i].computedWidth = long(proportionalUnit); } + // Compute display size of the column + for( size_t i = 0; i < Columns.size(); i++ ) { + if (Columns[i].computedWidth > 0) { + Columns[i].displaySize = Columns[i].computedWidth; + if (Columns[i].defaultCellBeforeColumnMargin != lengthUnspecified) + Columns[i].displaySize -= Columns[i].defaultCellBeforeColumnMargin; + + if (Columns[i].defaultCellAfterColumnMargin != lengthUnspecified) + Columns[i].displaySize -= Columns[i].defaultCellAfterColumnMargin; + } + } + columnsProcessed = true; } void TeXFOTBuilder::TablePart::outContent( OutputByteStream &stream ) const { stream << "\\TeXTable%\n{" << LengthInPoints( parentTable().tableWidth ) - << "}{" << Columns.size() << '}'; + << "}{" << Columns.size() << "}{"; - stream << '{'; for( size_t i = 0; i < Columns.size(); i++ ) { #ifdef TEXDEBUG stream << "\nCOLUMN " << i << " DEF_LEFT_B: " << Columns[i].defaultTeXLeftBorder @@ -1333,20 +1375,35 @@ #endif if( i == 0 && Columns[i].defaultTeXLeftBorder ) stream << '|'; + + //Cell before margin if( Columns[i].computedWidth > 0 ) { + char alignment; switch( Columns[i].displayAlignment ) { - case symbolInside: - case symbolStart: - stream << "L{" << LengthInPoints( Columns[i].computedWidth ) << '}'; - break; case symbolOutside: case symbolEnd: - stream << "R{" << LengthInPoints( Columns[i].computedWidth ) << '}'; + alignment = 'U'; + break; + case symbolCenter: + alignment = 'Y'; + break; + case symbolInside: + case symbolStart: + default: + alignment = 'T'; break; - case symbolCenter: default: - stream << "C{" << LengthInPoints( Columns[i].computedWidth ) << '}'; } + stream << alignment << '{' + << LengthInPoints(Columns[i].defaultCellBeforeColumnMargin) + << "}{" << LengthInPoints( Columns[i].displaySize ) + << "}{" + << LengthInPoints(Columns[i].defaultCellAfterColumnMargin) + << '}'; } else { + stream << "@{\\hspace{" + << LengthInPoints(Columns[i].defaultCellBeforeColumnMargin) + << "}}"; + switch( Columns[i].displayAlignment ) { case symbolOutside: case symbolEnd: stream << 'r'; break; @@ -1355,6 +1412,9 @@ case symbolStart: default: stream << 'l'; break; } + stream << "@{\\hspace{" + << LengthInPoints(Columns[i].defaultCellAfterColumnMargin) + << "}}"; } if( Columns[i].defaultTeXRightBorder ) stream << '|'; @@ -1424,15 +1484,27 @@ bool first = true; for( size_t i = 0; i + 1 < Cells.size(); i++ ) { - if( !Cells[i].isOverlapped() ) { - if( !first ) - stream << "&"; - else - first = false; - Cells[i].out( stream ); + /* Output the overlapped cells in a row span but not + those in a column span. + + If the overlapping cell is both row and column spanning + only output the first cell in the row. + */ + bool outputCell = !Cells[i].isOverlapped() || + (Cells[i].OverlappingCell->nRowsSpanned > 1 && + Cells[i].OverlappingCell->TeXTableColumnIdx == i); + + if( !first ) { + if (outputCell) + stream << "&"; } + else + first = false; + if (outputCell) + Cells[i].out( stream ); } } + void TeXFOTBuilder::Row::outVerticalBorders ( const TeXFOTBuilder::Row *upperRow, @@ -1476,46 +1548,135 @@ // --------- TeXFOTBuilder::Cell ---------------------------------------------- -void TeXFOTBuilder::Cell::outProlog( OutputByteStream &stream ) const { +void TeXFOTBuilder::Cell::outProlog( OutputByteStream &stream ) const +{ + if ( nColumnsSpanned > 1 || needsTeXColumnOverride || + (rowAlignment != symbolNotApplicable && + rowAlignment != symbolStart ) || + cellBackground ) + { + char color_buf[32]; + if ( cellBackground ) { + double r,g,b; + r = (double)backgroundColor.red / 255.0; + g = (double)backgroundColor.green / 255.0; + b = (double)backgroundColor.blue / 255.0; + sprintf( color_buf, "{%.2f, %.2f, %.2f}", r, g, b ); + } + else + strcpy( color_buf, ""); - if( nColumnsSpanned > 1 ) { - stream << "\\multicolumn%\n{" << nColumnsSpanned << "}{"; + stream << "\\TeXTableCell{" << nColumnsSpanned << "}{"; + if( beforeColumnBorder.borderPresent ) stream << '|'; - switch( effectiveAlignment ) { + + if (displaySize) { + char alignment; + switch( effectiveAlignment ) { case symbolOutside: - case symbolEnd: stream << 'r'; break; - case symbolCenter: stream << 'c'; break; + case symbolEnd: + switch (rowAlignment) { + case symbolOutside: + case symbolEnd: + alignment = cellBackground ? '3' : 'M'; + break; + case symbolCenter: + alignment = cellBackground ? '6' : 'J'; + break; + case symbolInside: + case symbolStart: + default: + alignment = cellBackground ? '9' : 'U'; + break; + } + break; + case symbolCenter: + switch (rowAlignment) { + case symbolOutside: + case symbolEnd: + alignment = cellBackground ? '2' : 'N'; + break; + case symbolCenter: + alignment = cellBackground ? '5' : 'H'; + break; + case symbolInside: + case symbolStart: + default: + alignment = cellBackground ? '8' : 'Y'; + break; + } + break; case symbolInside: case symbolStart: - default: stream << 'l'; break; + default: + switch (rowAlignment) { + case symbolOutside: + case symbolEnd: + alignment = cellBackground ? '1' : 'B'; + break; + case symbolCenter: + alignment = cellBackground ? '4' : 'G'; + break; + case symbolInside: + case symbolStart: + default: + alignment = cellBackground ? '7' : 'T'; + break; + } + break; + } + stream << alignment + << '{' << LengthInPoints(effectiveBeforeColumnMargin) + << "}{" << LengthInPoints(displaySize) << "}{" + << LengthInPoints(effectiveAfterColumnMargin) + << '}' << color_buf; + } + else { + //cell-before-margin + stream << "@{\\hspace{" << LengthInPoints(effectiveBeforeColumnMargin) + << "}}"; + if ( cellBackground ) + stream << ">{\\columncolor[rgb]" << color_buf << "}"; + + switch (rowAlignment) { + case symbolOutside: + case symbolEnd: + stream << 'r'; + break; + case symbolCenter: + stream << 'c'; + break; + case symbolInside: + case symbolStart: + default: + stream << 'l'; + break; + } + //cell-after-margin + stream << "@{\\hspace{" << LengthInPoints(effectiveAfterColumnMargin) + << "}}"; } + if( afterColumnBorder.borderPresent ) stream << '|'; - stream << "}{"; - } + stream << "}%\n{%\n"; + } + CompoundFotElement::outProlog( stream ); } void TeXFOTBuilder::Cell::outEpilog( OutputByteStream &stream ) const { CompoundFotElement::outEpilog( stream ); - if( nColumnsSpanned > 1 ) + if ( nColumnsSpanned > 1 || needsTeXColumnOverride || + (rowAlignment != symbolNotApplicable && + rowAlignment != symbolStart ) || + cellBackground ) stream << "}%\n"; } -void TeXFOTBuilder::Cell::computeMultiParFlag() { - - if( paragraphChildrenNum > 1 ) { - StrOutputByteStream str; - str << "\\def\\MultiPar{1}"; - String s; - str.extractString( s ); - Characteristics += s; - } -} - void TeXFOTBuilder::Cell::computeOverridingTeXColumnBorders( TablePart &tablePart ) { StrOutputByteStream str; @@ -1533,28 +1694,49 @@ Characteristics += s; } -void TeXFOTBuilder::Cell::computeOverridingTeXDisplayAlignment( TablePart &tablePart ) { - - effectiveAlignment - = tablePart.Columns[TeXTableColumnIdx].isExplicit - ? tablePart.Columns[TeXTableColumnIdx].displayAlignment : displayAlignment; +void TeXFOTBuilder::Cell::computeTeXRowSpanFiller( TablePart &tablePart ) { StrOutputByteStream str; - if( effectiveAlignment != tablePart.Columns[TeXTableColumnIdx].displayAlignment ) { - str << "\\def\\TeXTableCellDisplayAlignment{"; - switch( effectiveAlignment ) { - case symbolOutside: - case symbolEnd: str << 'r'; break; - case symbolCenter: str << 'c'; break; - case symbolInside: - case symbolStart: - default: str << 'l'; break; - } - str << '}'; - String s; - str.extractString( s ); - Characteristics += s; + + if ( isOverlapped() && OverlappingCell->nRowsSpanned > 1 ) + { + // This isn't output automatically for overlapped cell + str << "\\def\\ColumnIndex{" << TeXTableColumnIdx <<'}'; + str << "\\def\\TeXRowSpanFiller{1}"; } + + String s; + str.extractString( s ); + Characteristics += s; +} + +void TeXFOTBuilder::Cell::computeEffectiveTeXColumnMargins( TablePart &tablePart ) { + effectiveBeforeColumnMargin = beforeColumnMargin != lengthUnspecified + ? beforeColumnMargin : + tablePart.Columns[TeXTableColumnIdx].defaultCellBeforeColumnMargin; + if( effectiveBeforeColumnMargin != lengthUnspecified && + (tablePart.Columns[TeXTableColumnIdx].defaultCellBeforeColumnMargin + != effectiveBeforeColumnMargin || nColumnsSpanned > 1) ) + needsTeXColumnOverride = true; + + + effectiveAfterColumnMargin = afterColumnMargin != lengthUnspecified + ? afterColumnMargin : + tablePart.Columns[TeXTableColumnIdx].defaultCellAfterColumnMargin; + if( effectiveAfterColumnMargin != lengthUnspecified && + (tablePart.Columns[TeXTableColumnIdx].defaultCellAfterColumnMargin + != effectiveAfterColumnMargin || nColumnsSpanned > 1) ) + needsTeXColumnOverride = true; +} + +void TeXFOTBuilder::Cell::computeEffectiveTeXCellWidth( TablePart &tablePart ) +{ + displaySize = 0; + for (unsigned i = 0; i < nColumnsSpanned; i++ ) + displaySize += tablePart.Columns[TeXTableColumnIdx + i].computedWidth; + + if (displaySize) + displaySize -= effectiveBeforeColumnMargin + effectiveAfterColumnMargin; } bool TeXFOTBuilder::Cell::singleRowBeforeRowBorderPresent() const { @@ -1643,7 +1825,20 @@ inline OutputByteStream &TeXFOTBuilder::os() { - return CurOs == NULL ? *fileout_ : *CurOs; + return *(osStack_.back()); +} + +void +TeXFOTBuilder::pushOs(OutputByteStream *to) +{ + osStack_.push_back( to ); +} + +void +TeXFOTBuilder::popOs() +{ + assert( osStack_.size() > 0 ); + osStack_.resize( osStack_.size() - 1); } // @@ -1733,6 +1928,12 @@ 0 }, { + "UNREGISTERED::OpenJade//Characteristic::page-two-side?", + (void (FOTBuilder::*)(bool))&TeXFOTBuilder::setPageTwoSide, + 0, + 0 + }, + { "UNREGISTERED::James Clark//Characteristic::subscript-depth", 0, 0, @@ -1821,7 +2022,7 @@ //////////////////////////////////////////////////////////////////////// TeXFOTBuilder::TeXFOTBuilder(OutputByteStream *o, Messenger *mgr) -: fileout_(o), mgr_(mgr), CurOs( NULL ), preserveSdata_(1) +: fileout_(o), mgr_(mgr), preserveSdata_(1) #ifdef OUTLINES ,inHeading_(0),headingSet_(0),lastHeaded_(0) #endif @@ -1832,7 +2033,9 @@ #endif NextFormat.FotCurDisplaySize = Format::INITIAL_PAGE_SIZE(); FormatStack.push_back( NextFormat ); - os() << "\\FOT{2}"; + pushFotElementState(); + pushOs(o); + os() << "\\FOT{3}"; #ifdef OUTLINES return_ += Char('\n'); protectedChar_ += Char('\\'); @@ -1875,6 +2078,19 @@ } #endif break; + case ' ': + case '\t': + if ( NextFormat.FotLines == symbolAsis ) + os() << '~'; + else + os() << char(*s); +#ifdef OUTLINES + if (needToCollect()){ + addHeadedText(s,1); + //top(parStack_).headingText_.append(s,1); + } +#endif + break; case '\\': case '^': case '_': @@ -1972,7 +2188,7 @@ setTableColumnNIC(nic); if( nic.columnIndex >= curTable().curTablePart().Columns.size() ) - curTable().curTablePart().Columns.resize( nic.columnIndex + 1 ); + curTable().curTablePart().Columns.resize( nic.columnIndex + 1 ); Column &col = curTable().curTablePart().Columns[nic.columnIndex]; @@ -1981,7 +2197,12 @@ if( nic.hasWidth ) col.width = nic.width; - col.displayAlignment = curFormat().FotDisplayAlignment; + if ( curFormat().FotDisplayAlignment != symbolNotApplicable ) + col.displayAlignment = curFormat().FotDisplayAlignment; + if ( curFormat().FotCellBeforeColumnMargin != lengthUnspecified ) + col.defaultCellBeforeColumnMargin = curFormat().FotCellBeforeColumnMargin; + if ( curFormat().FotCellAfterColumnMargin != lengthUnspecified ) + col.defaultCellAfterColumnMargin = curFormat().FotCellAfterColumnMargin; insertAtomic("TableColumn"); } @@ -2038,14 +2259,16 @@ { GroveString id; unsigned long ei; - + unsigned long gi; // FIX ME! // Only PARTIALLY supported -- I currently allow cross-references // only to elements. if (node->getId(id) == accessOK) { - set("Label",id); + gi=node->groveIndex(); + set("Label",id,gi); } else if (node->elementIndex(ei) == accessOK) { - set("Element",ei); + gi=node->groveIndex(); + set("Element",ei,gi); } else { message(TeXMessages::unsupportedPageNumberNonElement); return; @@ -2092,8 +2315,6 @@ void TeXFOTBuilder::startParagraph(const ParagraphNIC &nic) { startDisplay( nic ); - if( curFormat().FotObjectClass == oc_Cell ) - curTable().curCell().paragraphChildrenNum++; start(); setParagraphNIC(nic); #ifdef OUTLINES @@ -2251,16 +2472,20 @@ #ifdef TEXDEBUG *fileout_ << "\nTABLE_START\n"; #endif + TableStack.resize( TableStack.size() + 1 ); startDisplay( nic ); start(); - + setTableNIC(nic); Length curStartIndent = computeLengthSpec( curFormat().FotStartIndentSpec ); curTable().startIndent = curStartIndent; + startGroup( curTable() ); + curTable().open( *this); curTable().begin(); - curTable().displayAlignment = curFormat().FotDisplayAlignment; + if ( curFormat().FotDisplayAlignment != symbolNotApplicable ) + curTable().displayAlignment = curFormat().FotDisplayAlignment; if( nic.widthType == TableNIC::widthExplicit ) curTable().tableWidth = computeLengthSpec( nic.width ); @@ -2269,12 +2494,12 @@ = curFormat().FotCurDisplaySize - curStartIndent - computeLengthSpec( curFormat().FotEndIndentSpec ); - startGroup( curTable() ); curTable().curTablePart().open( *this ); } void TeXFOTBuilder::endTable() { + assert( TableStack.size() > 0 ); #ifdef TEXDEBUG *fileout_ << "\nTABLE_END\n"; #endif @@ -2291,6 +2516,8 @@ endGroup(); end(); endDisplay(); + + TableStack.resize( TableStack.size() - 1 ); } // A call for each border is made immediately @@ -2338,17 +2565,20 @@ setTablePartNIC(nic); - if( curTable().NoTablePartsSeen ) + if( curTable().NoTablePartsSeen ) { curTable().NoTablePartsSeen = false; + /* begin() was arleady called from Table() and + open() was called from startTable() */ + } else { curTable().TableParts.resize( curTable().TableParts.size()+1 ); curTable().TableParts.back().setSiblingSeqIdx( curTable().TableParts.size()-1 ); curTable().TableParts.back().setParent( &curTable() ); - } - - curTable().TableParts.back().begin(); - curTable().TableParts.back().open( *this ); + curTable().TableParts.back().begin(); + curTable().TableParts.back().open( *this ); + } + startGroup( curTable().curTablePart() ); } @@ -2388,6 +2618,10 @@ #endif } +/* + * FIXME: We are getting one extra table cell in each + * row whic nic.missing set . What is this ??? + */ void TeXFOTBuilder::startTableCell(const TableCellNIC &nic) { #ifdef TEXDEBUG @@ -2420,27 +2654,40 @@ if( nic.nRowsSpanned != 1 ) cell.nRowsSpanned = nic.nRowsSpanned; - - long newDisplaySize = 0; - for( size_t i = nic.columnIndex; i < nic.columnIndex + nic.nColumnsSpanned; i++ ) - if( i < tp.Columns.size() ) { - if( tp.Columns[i].hasWidth ) - newDisplaySize - += computeLengthSpec( tp.Columns[i].width ); - } else - if( !nic.missing ) { - tp.Columns.resize( tp.Columns.size() + 1 ); - tp.Columns.back().hasWidth = false; - } - if( newDisplaySize > 0 ) { - newDisplaySize -= NextFormat.FotCellBeforeColumnMargin - + NextFormat.FotCellAfterColumnMargin; - NextFormat.FotCurDisplaySize = newDisplaySize; + for( size_t i = nic.columnIndex; i < nic.columnIndex + nic.nColumnsSpanned; i++ ) + { + if( i >= tp.Columns.size() && !nic.missing ) { + tp.Columns.resize( tp.Columns.size() + 1 ); + tp.Columns.back().hasWidth = false; + tp.Columns.back().isExplicit = false; + tp.columnsProcessed = false; + } } + // We may need reprocessing + if( !tp.columnsProcessed ) + tp.processColumns( *this ); - cell.displaySize = NextFormat.FotCurDisplaySize; - cell.displayAlignment = NextFormat.FotDisplayAlignment; + if ( !nic.missing ) { + if ( NextFormat.FotCellRowAlignment != symbolNotApplicable ) + cell.rowAlignment = NextFormat.FotCellRowAlignment; + if ( NextFormat.FotCellBeforeColumnMargin != lengthUnspecified ) + cell.beforeColumnMargin = NextFormat.FotCellBeforeColumnMargin; + if ( NextFormat.FotCellAfterColumnMargin != lengthUnspecified ) + cell.afterColumnMargin = NextFormat.FotCellAfterColumnMargin; + + if (NextFormat.FotCellBackground) { + cell.cellBackground = true; + cell.backgroundColor = NextFormat.FotBackgroundColor; + } + + cell.TeXTableColumnIdx = nic.columnIndex; + cell.effectiveAlignment = tp.Columns[nic.columnIndex].displayAlignment; + cell.computeEffectiveTeXColumnMargins( tp ); + cell.computeEffectiveTeXCellWidth( tp ); + + NextFormat.FotCurDisplaySize = cell.displaySize; + } elementStart( oc_Cell ); startGroup( cell ); @@ -2824,12 +3071,14 @@ { GroveString id; unsigned long ei; - + unsigned long gi=0; if (node->getId(id) == accessOK) { - set("Label",id); + gi=node->groveIndex(); + set("Label",id,gi); } else if (node->elementIndex(ei) == accessOK) { - set("Element", ei); + gi=node->groveIndex(); + set("Element", ei,gi); } unsigned long g = node->groveIndex(); if (g) { @@ -2866,7 +3115,7 @@ { GroveString id; unsigned long ei; - + unsigned long gi; // FIX ME! // This needs a lot of work -- for now, it supports only links to // elements. @@ -2875,10 +3124,11 @@ case Address::none: break; case Address::resolvedNode: + gi=addr.node->groveIndex(); if (addr.node->getId(id) == accessOK) { - set("Label",id); + set("Label",id,gi); } else if (addr.node->elementIndex(ei) == accessOK) { - set("Element", ei); + set("Element", ei,gi); } else { message(TeXMessages::unsupportedLinkNonElement); @@ -2997,6 +3247,7 @@ void TeXFOTBuilder::setLines(Symbol lines) { + NextFormat.FotLines = lines; set("Lines",lines); } @@ -3028,6 +3279,7 @@ void TeXFOTBuilder::setBackgroundColor(const DeviceRGBColor &color) { + NextFormat.FotBackgroundColor = color; set("BackgroundColor",color); } @@ -3178,6 +3430,7 @@ void TeXFOTBuilder::setCellBackground(bool flag) { + NextFormat.FotCellBackground = flag; set("CellBackground",flag); } @@ -3304,6 +3557,7 @@ void TeXFOTBuilder::setCellRowAlignment(Symbol align) { + NextFormat.FotCellRowAlignment = align; set("CellRowAlignment",align); } @@ -3367,6 +3621,8 @@ void TeXFOTBuilder::setSpan(long n) { NextFormat.FotSpan = n; + NextFormat.FotCurDisplaySize + = NextFormat.FotPageWidth - NextFormat.FotLeftMargin - NextFormat.FotRightMargin; set("Span",n); } @@ -3794,6 +4050,15 @@ << value << '}'; } +// +// For idref addresses +// +void TeXFOTBuilder::set(const char *name,const GroveString &value, long unsigned int g) +{ + stringout_ << "\\def\\" << name << "%\n{" + < +#else +#ifdef __xlC__ +#pragma define(Vector) +#else +#ifdef SP_ANSI_CLASS_INST +template class Vector; +#else +typedef Vector Dummy_5; +#endif +#endif +#endif +#ifdef __DECCXX +#pragma define_template Vector +#else +#ifdef __xlC__ +#pragma define(Vector) +#else +#ifdef SP_ANSI_CLASS_INST +template class Vector; +#else +typedef Vector Dummy_6; +#endif +#endif +#endif +#ifdef __DECCXX +#pragma define_template Vector +#else +#ifdef __xlC__ +#pragma define(Vector) +#else +#ifdef SP_ANSI_CLASS_INST +template class Vector; +#else +typedef Vector Dummy_7; +#endif +#endif +#endif #ifdef OUTLINES #ifdef __DECCXX #pragma define_template Vector @@ -93,7 +132,7 @@ #ifdef SP_ANSI_CLASS_INST template class Vector; #else -typedef Vector Dummy_5; +typedef Vector Dummy_8; #endif #endif #endif --- openjade-1.4devel1.orig/jade/TeXFOTBuilder_inst.m4 +++ openjade-1.4devel1/jade/TeXFOTBuilder_inst.m4 @@ -15,6 +15,9 @@ __instantiate(Vector) __instantiate(Vector) __instantiate(Vector) +__instantiate(Vector) +__instantiate(Vector) +__instantiate(Vector) #ifdef OUTLINES __instantiate(Vector) #endif --- openjade-1.4devel1.orig/jade/TextFOTBuilder.cxx +++ openjade-1.4devel1/jade/TextFOTBuilder.cxx @@ -0,0 +1,954 @@ +// TextFOTBuilder - a formatter for plain text output. +// Copyright (c) 1999 Avi Kivity + +#include +#include +#include "config.h" +#include "TextFOTBuilder.h" +#include +#include "dsssl_ns.h" + +#ifdef JADE_TEXT + +#undef DBG_TEXT_BACKEND +#ifndef DBG_TEXT_BACKEND +# define DBG(x) void(0) +#else +# define DBG(x) x +# include +#endif + +#ifdef DSSSL_NAMESPACE +namespace DSSSL_NAMESPACE { +#endif + +#ifdef DSSSL_NAMESPACE + namespace TextBackend { +# define TEXTBACKEND_SCOPE TextBackend:: +#else +# define TEXTBACKEND_SCOPE +#endif + +#ifdef DBG_TEXT_BACKEND +class Debugger { +public: + Debugger(const char *func) : context_(func) { indent() << ">> " << context_ << endl; ++level_; } + ~Debugger() { --level_; indent() << "<< " << context_ << endl; } + ostream& indent() { for (int i = 0; i < level_; ++i) os() << " "; return os(); } + ostream& os() { return cout; } +private: + static int level_; + const char* context_; +}; + +int Debugger::level_ = 0; + +template ostream& operator << (Debugger& d, const T& v) { + return d.indent() << "-- " << v; +} +#endif + + +class Uncopyable { +public: + Uncopyable() {} +private: + Uncopyable(const Uncopyable&); // undefined + void operator=(const Uncopyable&); // undefined +}; + +class Abstract { +public: + virtual ~Abstract() {} +}; + +typedef long Ordinate; +struct BoundBox { + BoundBox() : left(0), right(0), top(0), bottom(0) {} + Ordinate left, right, top, bottom; +}; + +class LineWidthProvider : Abstract +{ +public: + virtual int& numberOfSpaces() = 0; + virtual Ordinate& freeLineWidth() = 0; + virtual void nextLine() = 0; +}; + +struct TextArea { + class Area : Abstract { + public: + virtual Ordinate width() const = 0; + virtual Ordinate height() const = 0; + virtual void chars(Ordinate x, Ordinate y, const Char* chars, unsigned n) = 0; + }; + class Page : public Area { + public: + virtual void flush() = 0; + }; + class RealPage : public Page { + public: + RealPage(OutputByteStream& os); + virtual Ordinate width() const; + virtual Ordinate height() const; + virtual void chars(Ordinate x, Ordinate y, const Char* chars, unsigned n); + virtual void flush(); + private: + Char page_[66][80]; + OutputByteStream& os_; + }; + class DummyPage : public Page { + public: + virtual Ordinate width() const; + virtual Ordinate height() const; + virtual void chars(Ordinate x, Ordinate y, const Char* chars, unsigned n); + virtual void flush(); + }; + class SubArea : public Area { + public: + SubArea(Area& container, BoundBox bbox); + virtual Ordinate width() const; + virtual Ordinate height() const; + virtual void chars(Ordinate x, Ordinate y, const Char* chars, unsigned n); + private: + BoundBox bbox_; + Area& area_; + }; + class MeasuredArea : public Area { + public: + MeasuredArea(Ordinate width, Ordinate max_height = 66); + Ordinate measuredWidth() const; + Ordinate measuredHeight() const; + virtual Ordinate width() const; + virtual Ordinate height() const; + virtual void chars(Ordinate x, Ordinate y, const Char* chars, unsigned n); + private: + Ordinate width_; + Ordinate height_; + Ordinate measuredHeight_; + Ordinate measuredWidth_; + }; + class PageFactory : Abstract { + public: + virtual Page* create() const = 0; + }; + class RealPageFactory : public PageFactory { + public: + RealPageFactory(OutputByteStream* os) : os_(os) {} + virtual Page* create() const { return new RealPage(*os_); } + private: + OutputByteStream* os_; + }; + class DummyPageFactory : public PageFactory { + public: + virtual Page* create() const { return new DummyPage; } + }; +}; + +const double xCellSize = (1.0/80)*6.5*72000; + +Ordinate +length2xordinate(Ordinate displaySize, const FOTBuilder::LengthSpec& ls) +{ + return ls.length / xCellSize + ls.displaySizeFactor * displaySize; +} + +Ordinate +length2xordinate(TextArea::Area& area, const FOTBuilder::LengthSpec& ls) +{ + return length2xordinate(area.width(), ls); +} + +class TextFOTBuilder +: Uncopyable, public FOTBuilder +{ +public: + TextFOTBuilder(TextArea::PageFactory& pageFactory, LineWidthProvider& lineWidthProvider); + ~TextFOTBuilder(); +private: + virtual void startSimplePageSequence(FOTBuilder* headerFooter[nHF]); + virtual void endSimplePageSequenceHeaderFooter(); + virtual void endSimplePageSequence(); + virtual void startParagraph(const ParagraphNIC &); + virtual void endParagraph(); + virtual void characters(const Char *, size_t); + virtual void setQuadding(Symbol); + virtual void setStartIndent(const LengthSpec &); + virtual void setEndIndent(const LengthSpec &); + virtual void setFirstLineStartIndent(const LengthSpec &); +public: + struct Style { + Style(); + Symbol quadding; + LengthSpec startIndent; + LengthSpec endIndent; + LengthSpec firstLineStartIndent; + }; + struct Model { + struct Generated { + Generated() : height(0), height_specified(0) {} + SaveFOTBuilder content; + Ordinate height; + Boolean height_specified; + }; + struct Region { + Generated header; + Generated footer; + BoundBox boundBox; + }; + struct PageModel { + PageModel() : principalRegion(0) {} + Vector regions; + size_t principalRegion; + }; + struct PageSequence { + Vector initial; + Vector repeat; + }; + }; + struct Output { + class FlowPort : Abstract { + public: + // can be defined in terms of next function + virtual Ordinate currentWidth() const = 0; + virtual void chars(Ordinate x, const Char* chars, unsigned n) = 0; + virtual void verticalSpace(Ordinate height) = 0; + }; + class ParaBuilder : Abstract { + public: + virtual void chars(const Char* chars, unsigned n) = 0; + virtual void pbreak() = 0; + }; + class NestedParaBuilder : public ParaBuilder { + public: + virtual void chars(const Char* chars, unsigned n); + virtual void pbreak(); + void push(ParaBuilder* inner); + void pop(); + ParaBuilder* top(); + private: + Vector stack_; + }; + class FlowParaBuilder : public ParaBuilder { + public: + FlowParaBuilder(FlowPort& flow, TextFOTBuilder& fotb); + ~FlowParaBuilder(); + virtual void chars(const Char* chars, unsigned n); + virtual void pbreak(); + private: + void allocLine(); + void flushLine(); + Ordinate currentWidth(); + LengthSpec currentStartIndent(); + private: + FlowPort& flow_; + TextFOTBuilder& fotb_; + Ordinate x_; + Ordinate limit_; + Ordinate offset_; + Boolean isFirstLine_; + }; + class AreaFlowPort : public FlowPort { + public: + AreaFlowPort(TextArea::Area& area); + virtual Ordinate currentWidth() const; + virtual void chars(Ordinate x, const Char* chars, unsigned n); + virtual void verticalSpace(Ordinate height); + private: + TextArea::Area& area_; + Ordinate y_; + }; + class PageSeqFlowPort : public FlowPort { + public: + PageSeqFlowPort(TextFOTBuilder& fotb, Model::PageSequence model); + ~PageSeqFlowPort(); + virtual Ordinate currentWidth() const; + virtual void chars(Ordinate x, const Char* chars, unsigned n); + virtual void verticalSpace(Ordinate height); + private: + const TextArea::Area* getArea() const; + TextArea::Area* getArea(); + TextArea::Area* createPrinicipalArea(TextArea::Area& page); + private: + TextFOTBuilder& fotb_; + TextArea::PageFactory& pageFactory_; + Vector output_; + TextArea::Area* currentArea_; + Model::PageSequence model_; + Ordinate y_; + }; + }; +public: + Ordinate measureGenerated(const Model::Generated& gen, const TextArea::Area& area); + Ordinate quaddingOffset(Symbol quadding, Ordinate freeLineWidth); + const Style& style() const { return styleStack_.top(); } + Style& style() { return styleStack_.top(); } + virtual void start(); + virtual void end(); +public: + TextArea::PageFactory& pageFactory_; + LineWidthProvider& lineWidthProvider_; + FOTBuilder bitBucket_; + Output::FlowPort* principalPort_; + Output::NestedParaBuilder* para_; + SaveFOTBuilder* spsHF; + std::stack