diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-17 21:41:51 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-17 21:41:51 +0000 |
commit | 487ca4806cc046076293cf6cc5fbba0db282bac7 (patch) | |
tree | 847b412ab5158dd7bdd7ed7e5a4cc3fbca94be32 /Build/source/texk/windvi | |
parent | a3d3111bfe26b8e5f5bc6049dfb2a4ca2edc7881 (diff) |
texk 1
git-svn-id: svn://tug.org/texlive/trunk@1485 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/windvi')
177 files changed, 83285 insertions, 0 deletions
diff --git a/Build/source/texk/windvi/ANNOUNCE b/Build/source/texk/windvi/ANNOUNCE new file mode 100644 index 00000000000..e10ab9667ee --- /dev/null +++ b/Build/source/texk/windvi/ANNOUNCE @@ -0,0 +1,42 @@ +Xdvik with t1 fonts. + +With this I announce the availability of xdvik-22.06-t1-beta1. The +last public release was xdvik-22.06-t1-alpha4. Due to the excelent +work done by Paul Vojta in xdvi and Rainer Menzner in t1lib this has +been a lot easier than it could have been. + +The t1 functionality will eventualy be part of xdvik, so test now or +tear your hair later ;-) + +xdvik-t1-beta1 has these features: +- Based on t1lib 0.9 +- Faster startup than alpha4 due to defered t1 font loading. But t1 + font loading still has quite high overhead compared to pk font + loading. Keep your xdvi going, don't quit it each time. +- Correct glyph sizes for scaled fonts (e.g., cmr10 at 17pt and so on) +- Better accomodation for asian languages. +- dvips compatible w.r.t. fontmaps, but some changes in your maps to + accomodate xdvi might still be needed. +- automatic encoding recognition heuristic, minimizing the fontmaps needed + in most cases. No fontmaps needed for cmr10 and the other type1 cm and + ams fonts, or indeed, most other TeX fonts. +- helper program to steal fonts from ghostscript to use as Times-Roman + and all the other usual Postscript fonts. Some of these will require + fontmaps though. +- helper function to use your commercial postscript fonts. Some of these + will also require fontmaps - you can probably use your existing maps. + +Please read the documents, in particular the README and XDVIFONTS +files, there are new things in these for everyone. It should be quite +easy to install in a recent teTeX installation though. + +I want comments, remarks and patches, even for the smallest nit, xdvi +is quite important to the Unix TeX community, so help me help you. +Please send it to janl@linpro.no. Due to time restraints it might be +a while before I'm able to answer or adress the problems raised +though. + +xdvik-t1 is available from http://www.math.uio.no/~janl/xdvi/t1/, +ftp://ftp.tug.org/tex/ and, after a mirroring delay, on CTAN. + +13/05/1999 -- Nicolai Langfeldt diff --git a/Build/source/texk/windvi/BUGS b/Build/source/texk/windvi/BUGS new file mode 100644 index 00000000000..18cca17dc0f --- /dev/null +++ b/Build/source/texk/windvi/BUGS @@ -0,0 +1,55 @@ +This is a file of notes I made in my work with the k version of Xdvi. +The notes are intended as being usefull for myself as well as people +that try to compile xdvik on platforms where it has not been atempted +before. Because the largest problem is the autoconf stuff. I can't +seem to find good docs and I find the info manual confusing. + +Please send bug-reports to janl@math.uio.no and include as much (relevant) +information as possible (such as platform, compiler, experiments carried +out to try to fix the problem and so forth). + +xdvik-21.23 compiles and runs fine for me on HP-UX 10.20, Linux/Redhat +5.1 and Solaris 5.5. That is not to say that all issues in the k port +of xdvi has been adressed, or even found. + +Known features: +* Controll of font/file generation by X-resource and commandline is + over-ridden by controll by environment variable/texmf.cnf setting. + This is unfortunate but as far as I know unavoidable and thus a + feature rather than a bug. If you want it to be resource/commandline + controlled make sure there is no setting in the environment/texmf.cnf +* Under kpathsea the user cannot select MOTIF interface. I'm not quite + sure if it works correctly either, the k patch touch code at and around + places where xdvi had #if MOTIF. +* Some k features such as HTEX/HAVE_LIBWWW is not practical to turn off. + Changes in the autoconf setup must be acompanied by changes in + mksedscript. The HTEX features also appear to be rather fragile w.r.t. + going back across documents/file/http borders. + +configure.in: +- autoscan says we're missing these tests: + AC_CHECK_HEADERS(sys/file.h sys/time.h) + AC_CHECK_FUNCS(mkdir rmdir select) + AC_PROG_GCC_TRADITIONAL + On the other hand, their outcome would not be used. + +c-auto.in: +- Not sure if there are tests for all the things mentioned in this file. + Not sure how to find out. +- There is no AC_ARG_WITH in configure.in to activate MOTIF. There is + a macro in Pauls configure.in for this but there is another, incompatible + from kpathsea for toolkit selection. Kpathsea code used on unclear + grouds. +- Not sure that there is a actual test for wether the user wants + MKTEXPK/MAKETEXPK anywhere? +- GS_PATH cannot be set except by CFLAGS=-DGS_PATH=... + Paul has a macro for this. Must be compatible with kpathsea, but + I haven't checked this yet. + +config.hin: +- This file is not used in the k port. c-auto.in is kpathsea style... +- A lot of the symbols from this was moved to c-auto.in, those _not_ moved + are left in the file as a reference. I suspect they should be moved + but found them confusing + +Nicolai Langfeldt (janl@math.uio.no) diff --git a/Build/source/texk/windvi/Examples/auto/rotsample.el b/Build/source/texk/windvi/Examples/auto/rotsample.el new file mode 100644 index 00000000000..e39afe64eaa --- /dev/null +++ b/Build/source/texk/windvi/Examples/auto/rotsample.el @@ -0,0 +1,12 @@ +(TeX-add-style-hook "rotsample" + (function + (lambda () + (TeX-add-symbols + "foo") + (TeX-run-style-hooks + "rotating" + "graphicx" + "latex2e" + "art10" + "article")))) + diff --git a/Build/source/texk/windvi/Examples/auto/wtest.el b/Build/source/texk/windvi/Examples/auto/wtest.el new file mode 100644 index 00000000000..758cb5e3aad --- /dev/null +++ b/Build/source/texk/windvi/Examples/auto/wtest.el @@ -0,0 +1,26 @@ +(TeX-add-style-hook "wtest" + (function + (lambda () + (LaTeX-add-labels + "fig:f7") + (TeX-add-symbols + '("XX" 2) + "WDVI" + "HR") + (TeX-run-style-hooks + "xy" + "graphicx" + "pstcol" + "pst-node" + "pst-tree" + "graphics" + "pspicture" + "epic" + "eepic" + "color" + "latex2e" + "art11" + "article" + "a4paper" + "11pt")))) + diff --git a/Build/source/texk/windvi/Examples/backcol.aux b/Build/source/texk/windvi/Examples/backcol.aux new file mode 100644 index 00000000000..f23e54680b7 --- /dev/null +++ b/Build/source/texk/windvi/Examples/backcol.aux @@ -0,0 +1 @@ +\relax diff --git a/Build/source/texk/windvi/Examples/backcol.dvi b/Build/source/texk/windvi/Examples/backcol.dvi Binary files differnew file mode 100644 index 00000000000..4b449292755 --- /dev/null +++ b/Build/source/texk/windvi/Examples/backcol.dvi diff --git a/Build/source/texk/windvi/Examples/backcol.log b/Build/source/texk/windvi/Examples/backcol.log new file mode 100644 index 00000000000..23cb52e1d2d --- /dev/null +++ b/Build/source/texk/windvi/Examples/backcol.log @@ -0,0 +1,78 @@ +This is TeX, Version 3.14159 (Web2c 7.3.1) (format=latex 1999.9.14) 17 SEP 1999 15:22 +**\nonstopmode\input{backcol.tex} +(backcol.tex (d:/Local/TeX/texmf/tex/latex/base/article.cls +Document Class: article 1999/01/07 v1.4a Standard LaTeX document class +(d:/Local/TeX/texmf/tex/latex/base/size10.clo +File: size10.clo 1999/01/07 v1.4a Standard LaTeX file (size option) +) +\c@part=\count79 +\c@section=\count80 +\c@subsection=\count81 +\c@subsubsection=\count82 +\c@paragraph=\count83 +\c@subparagraph=\count84 +\c@figure=\count85 +\c@table=\count86 +\abovecaptionskip=\skip41 +\belowcaptionskip=\skip42 +\bibindent=\dimen102 +) +(d:/Local/TeX/texmf/tex/latex/graphics/graphicx.sty +Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR) + +(d:/Local/TeX/texmf/tex/latex/graphics/keyval.sty +Package: keyval 1999/03/16 v1.13 key=value parser (DPC) +\KV@toks@=\toks14 +) +(d:/Local/TeX/texmf/tex/latex/graphics/graphics.sty +Package: graphics 1999/02/16 v1.0l Standard LaTeX Graphics (DPC,SPQR) + +(d:/Local/TeX/texmf/tex/latex/graphics/trig.sty +Package: trig 1999/03/16 v1.09 sin cos tan (DPC) +) +(d:/Local/TeX/texmf/tex/latex/config/graphics.cfg) +Package graphics Info: Driver file: dvips.def on input line 80. + +(d:/Local/TeX/texmf/tex/latex/graphics/dvips.def +File: dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR) +)) +\Gin@req@height=\dimen103 +\Gin@req@width=\dimen104 +) +(d:/Local/TeX/texmf/tex/latex/graphics/color.sty +Package: color 1999/02/16 v1.0i Standard LaTeX Color (DPC) + +(d:/Local/TeX/texmf/tex/latex/config/color.cfg) +Package color Info: Driver file: dvips.def on input line 125. + +(d:/Local/TeX/texmf/tex/latex/graphics/dvipsnam.def +File: dvipsnam.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR) +)) +No file backcol.aux. +\openout1 = `backcol.aux'. + +LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 4. +LaTeX Font Info: ... okay on input line 4. +LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 4. +LaTeX Font Info: ... okay on input line 4. +LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 4. +LaTeX Font Info: ... okay on input line 4. +LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 4. +LaTeX Font Info: ... okay on input line 4. +LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 4. +LaTeX Font Info: ... okay on input line 4. +LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 4. +LaTeX Font Info: ... okay on input line 4. +[1 + +] [2] [3] [4] [5] [6] (backcol.aux) ) +Here is how much of TeX's memory you used: + 671 strings out of 10905 + 8135 string characters out of 72579 + 51997 words of memory out of 263001 + 3657 multiletter control sequences out of 10000+0 + 3640 words of font info for 14 fonts, out of 400000 for 1000 + 14 hyphenation exceptions out of 1000 + 26i,5n,21p,204b,168s stack positions out of 300i,100n,500p,50000b,4000s + +Output written on backcol.dvi (6 pages, 1428 bytes). diff --git a/Build/source/texk/windvi/Examples/backcol.tex b/Build/source/texk/windvi/Examples/backcol.tex new file mode 100644 index 00000000000..3808a4190cd --- /dev/null +++ b/Build/source/texk/windvi/Examples/backcol.tex @@ -0,0 +1,25 @@ +\documentclass[a4paper]{article} +\usepackage[dvips]{graphicx,color} + +\begin{document} +\pagecolor{yellow} +This is page one, yellow +\newpage +This is page two, yellow +\newpage +\pagecolor{green} +This is page three, green +\newpage +This is page four, green +\newpage +\pagecolor{red} +This is page five, red +\newpage +This is page six, red + +\end{document} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: diff --git a/Build/source/texk/windvi/Examples/coffee_bean.bmp b/Build/source/texk/windvi/Examples/coffee_bean.bmp Binary files differnew file mode 100644 index 00000000000..e1d927dbe82 --- /dev/null +++ b/Build/source/texk/windvi/Examples/coffee_bean.bmp diff --git a/Build/source/texk/windvi/Examples/color.txt b/Build/source/texk/windvi/Examples/color.txt new file mode 100644 index 00000000000..7b0e20801df --- /dev/null +++ b/Build/source/texk/windvi/Examples/color.txt @@ -0,0 +1,5 @@ +1.0 1.0 0.0 setrgbcolor +newpath 0 0 moveto 829 0 rlineto +0 1172 rlineto -829 0 rlineto fill +1.0 0.0 1.0 setrgbcolor +showpage
\ No newline at end of file diff --git a/Build/source/texk/windvi/Examples/ehm.dvi b/Build/source/texk/windvi/Examples/ehm.dvi Binary files differnew file mode 100644 index 00000000000..2b83c783467 --- /dev/null +++ b/Build/source/texk/windvi/Examples/ehm.dvi diff --git a/Build/source/texk/windvi/Examples/ehm.log b/Build/source/texk/windvi/Examples/ehm.log new file mode 100644 index 00000000000..2c3959fc598 --- /dev/null +++ b/Build/source/texk/windvi/Examples/ehm.log @@ -0,0 +1,4 @@ +This is TeX, Version 3.14159 (Web2c 7.2) (format=tex 1998.3.26) 18 SEP 1998 14:20 +**ehm +(ehm.tex (g:/Local/TeX/texmf/tex/plain/dvips/colordvi.tex) [1] [2] [3] [4] ) +Output written on ehm.dvi (4 pages, 852 bytes). diff --git a/Build/source/texk/windvi/Examples/ehm.tex b/Build/source/texk/windvi/Examples/ehm.tex new file mode 100644 index 00000000000..d9829af0546 --- /dev/null +++ b/Build/source/texk/windvi/Examples/ehm.tex @@ -0,0 +1,15 @@ + \input colordvi + This is the \Yellow{first} page with \Green{some} colors. + \vfill\eject + This is `normal'. + \Goldenrod{This is \vfill\eject Goldenrod}, + \PineGreen{PineGreen}, \Gray{Gray}, + \Lavender{Lavender} and \Red{Red}. + \vfill\eject + Agian, \Blue{some} other colors. + \bye + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: diff --git a/Build/source/texk/windvi/Examples/f1.ps b/Build/source/texk/windvi/Examples/f1.ps new file mode 100644 index 00000000000..1c3b957ff9c --- /dev/null +++ b/Build/source/texk/windvi/Examples/f1.ps @@ -0,0 +1,99 @@ +%!PS-Adobe-1.0 +%%Title: figs.drw +%%Creator: XDraw 2.0 +%%BoundingBox: 19.8885 16.4172 384.994 137.114 +.0283464 dup scale +27 setlinewidth +[] 0 setdash 1 setlinecap +%currentdevice getdeviceprops +% { +% counttomark 0 eq {pop exit} if +% exch =string cvs print ( ) print == +% } +% loop +newpath 13061 4312 20 180.000 540.000 arc stroke +newpath 11773 4312 20 180.000 540.000 arc stroke +newpath 10348 4325 20 180.000 540.000 arc stroke +newpath 9073 4250 20 180.000 540.000 arc stroke +newpath 7623 4000 20 180.000 540.000 arc stroke +newpath 6348 3550 20 180.000 540.000 arc stroke +newpath 5211 2737 20 180.000 540.000 arc stroke +newpath 4186 1787 20 180.000 540.000 arc stroke +newpath 3294 756 20 180.000 540.000 arc stroke +20 setlinewidth +[0 106] 0 setdash 1 setlinecap +11767 4315 moveto 12460 4788 lineto stroke +12461 4787 moveto 13061 4312 lineto stroke +11137 4819 moveto 11767 4315 lineto stroke +10350 4315 moveto 11137 4819 lineto stroke +9906 4762 moveto 10350 4315 lineto stroke +9080 4254 moveto 9906 4762 lineto stroke +8318 4572 moveto 9080 4254 lineto stroke +7620 4000 moveto 8318 4572 lineto stroke +6858 4191 moveto 7620 4000 lineto stroke +6350 3556 moveto 6858 4191 lineto stroke +5588 3556 moveto 6350 3556 lineto stroke +5207 2730 moveto 5588 3556 lineto stroke +4381 2667 moveto 5207 2730 lineto stroke +4191 1778 moveto 4381 2667 lineto stroke +3429 1651 moveto 4191 1778 lineto stroke +3302 762 moveto 3429 1651 lineto stroke +[] 0 setdash 1 setlinecap +2730 1079 moveto 2984 1270 lineto stroke +2730 1079 moveto 2857 1397 lineto stroke +3619 2222 moveto 3556 1968 lineto stroke +3619 2222 moveto 3429 2095 lineto stroke +3611 2200 moveto 2730 1079 lineto stroke +5971 3276 moveto 6066 3244 lineto stroke +5971 3276 moveto 6003 3181 lineto stroke +5971 3276 moveto 6570 2646 lineto stroke +12460 4315 moveto 13059 4315 lineto stroke +3302 762 moveto + 3454 957 lineto + 3610 1150 lineto + 3771 1338 lineto + 3937 1524 lineto + 4121 1720 lineto + 4309 1913 lineto + 4502 2101 lineto + 4699 2286 lineto + 4914 2484 lineto + 5133 2678 lineto + 5358 2866 lineto + 5588 3048 lineto + 5800 3205 lineto + 6019 3353 lineto + 6131 3424 lineto + 6244 3492 lineto + 6359 3557 lineto + 6477 3619 lineto + 6583 3669 lineto + 6692 3716 lineto + 6801 3759 lineto + 6913 3800 lineto + 7138 3873 lineto + 7366 3937 lineto + 7680 4013 lineto + 7997 4081 lineto + 8315 4140 lineto + 8636 4191 lineto + 8952 4234 lineto + 9269 4270 lineto + 9587 4298 lineto + 9906 4318 lineto + 10223 4325 lineto + 10541 4326 lineto + 10858 4322 lineto + 11176 4318 lineto + 12446 4318 lineto + 12446 4318 lineto + stroke +/Courier findfont 281.17 scalefont setfont +(Clock Cycle) 699 1651 moveto show +(x\(\(m+1\)T\)) 12775 4095 moveto show +(x\(mT\)) 11547 4095 moveto show +(x\(2T\)) 5278 2551 moveto show +(x\(T\)) 4207 1606 moveto show +(x\(0\)) 3357 598 moveto show +(Envelope) 6601 2520 moveto show +showpage diff --git a/Build/source/texk/windvi/Examples/f2.ps b/Build/source/texk/windvi/Examples/f2.ps new file mode 100644 index 00000000000..2ee32762e64 --- /dev/null +++ b/Build/source/texk/windvi/Examples/f2.ps @@ -0,0 +1,336 @@ +%!PS-Adobe-2.0 +%%Creator: MATLAB, The Mathworks, Inc. +%%Title: MATLAB graph +%%CreationDate: 06/11/93 15:02:09 +%%DocumentFonts: Times-Roman +%%DocumentNeededFonts: Times-Roman +%%DocumentProcessColors: Cyan Magenta Yellow Black +%%Pages: (atend) +%%BoundingBox: (atend) +%%EndComments + +%%BeginProlog + +% MathWorks dictionary +/MathWorks 120 dict begin + +% definition operators +/bdef {bind def} bind def +/ldef {load def} bind def +/xdef {exch def} bdef +/xstore {exch store} bdef + +% operator abbreviations +/c /clip ldef +/cc /concat ldef +/cp /closepath ldef +/gr /grestore ldef +/gs /gsave ldef +/mt /moveto ldef +/np /newpath ldef +/rc {rectclip} bdef +/rf {rectfill} bdef +/rm /rmoveto ldef +/rl /rlineto ldef +/s /show ldef +/sc /setrgbcolor ldef + +% page state control +/pgsv () def +/bpage {/pgsv save def} bdef +/epage {pgsv restore} bdef +/bplot /gsave ldef +/eplot {stroke grestore} bdef + +% bounding box in default coordinates +%initialize variables used in binded macros +/llx 0 def +/lly 0 def +/urx 0 def +/ury 0 def +/bbox {/ury xdef /urx xdef /lly xdef /llx xdef} bdef + +% orientation switch +/portraitMode (op) def +/landscapeMode (ol) def +/Orientation portraitMode def +/portrait {/Orientation portraitMode def} bdef +/landscape {/Orientation landscapeMode def} bdef + +% coordinate system mappings +/dpi2point 0 def + +% font control +/FontSize 0 def +/FMS { + /FontSize xstore %save size off stack + findfont + [FontSize dpi2point mul 0 0 FontSize dpi2point mul neg 0 0] + makefont + setfont + }bdef +/setPortrait { + 1 dpi2point div -1 dpi2point div scale + llx ury neg translate + } bdef +/setLandscape { + 1 dpi2point div -1 dpi2point div scale + urx ury neg translate + 90 rotate + } bdef + +/csm {Orientation portraitMode eq {setPortrait} {setLandscape} ifelse} bdef +% line types: solid, dotted, dashed, dotdash +/SO { [] 0 setdash } bdef +/DO { [.5 dpi2point mul 4 dpi2point mul] 0 setdash } bdef +/DA { [6 dpi2point mul] 0 setdash } bdef +/DD { [.5 dpi2point mul 4 dpi2point mul 6 dpi2point mul 4 dpi2point mul] 0 setdash } bdef + +% macros for lines and objects +/L { % LineTo + lineto + stroke + } bdef +/MP { % MakePoly + 3 1 roll moveto + 1 sub {rlineto} repeat + } bdef +/AP { % AddPoly + {rlineto} repeat + } bdef +/PP { % PaintPoly + closepath fill + } bdef +/DP { % DrawPoly + closepath stroke + } bdef +/MR { % MakeRect + 4 -2 roll moveto + dup 0 exch rlineto + exch 0 rlineto + neg 0 exch rlineto + closepath + } bdef +/FR { % FrameRect + MR stroke + } bdef +/PR { % PaintRect + MR fill + } bdef +/L1i { % Level 1 Image + { currentfile picstr readhexstring pop } image + } bdef + +/half_width 0 def +/half_height 0 def +/MakeOval { + newpath + /ury xstore /urx xstore /lly xstore /llx xstore + /half_width urx llx sub 2 div store + /half_height ury lly sub 2 div store + llx half_width add lly half_height add translate + half_width half_height scale + .5 half_width div setlinewidth + 0 0 1 0 360 arc + } bdef +/FO { + gsave + MakeOval stroke + grestore + } bdef +/PO { + gsave + MakeOval fill + grestore + } bdef + +/PD { + 2 copy moveto lineto stroke + } bdef + + +currentdict end def %dictionary +%%EndProlog + +%%BeginSetup +MathWorks begin + +% fonts for text, standard numbers and exponents +%%IncludeFont: Times-Roman + +%line width, line cap, and joint spec +1 setlinecap 1 setlinejoin + +end +%%EndSetup + +%%Page: 1 1 +%%BeginPageSetup +%%PageBoundingBox: 018 180 594 612 +MathWorks begin +bpage +%%EndPageSetup + +%%BeginObject: graph1 1 +bplot + +/dpi2point 12 def +0216 2160 7128 7344 bbox portrait csm + +0 0 6912 5184 MR c np +6.00 setlinewidth +% Colortable Dictionary +/colortable 76 dict begin +/c0 { 0 0 0 sc} bdef +/c1 { 1 1 1 sc} bdef +/c2 { 1 0 0 sc} bdef +/c3 { 0 1 0 sc} bdef +/c4 { 0 0 1 sc} bdef +/c5 { 1 1 0 sc} bdef +/c6 { 1 0 1 sc} bdef +/c7 { 0 1 1 sc} bdef +currentdict end def % Colortable + +colortable begin + + +/Helvetica 14 FMS + + +/Helvetica 10 FMS + + +/Helvetica 14 FMS + +c1 + 0 0 6912 5184 PR +DO +SO +c0 + 898 4614 mt 6221 4614 L + 898 414 mt 6221 414 L +6221 4614 mt 6221 414 L + 898 4614 mt 898 414 L +6221 4614 mt 6221 4614 L + 898 4614 mt 898 4614 L + 898 4614 mt 6221 4614 L + 898 4614 mt 898 414 L + 898 4614 mt 898 4614 L + 898 4614 mt 898 4561 L + 898 414 mt 898 467 L + 852 4797 mt (0) s +1785 4614 mt 1785 4561 L +1785 414 mt 1785 467 L +1669 4797 mt (0.5) s +2672 4614 mt 2672 4561 L +2672 414 mt 2672 467 L +2626 4797 mt (1) s +3560 4614 mt 3560 4561 L +3560 414 mt 3560 467 L +3444 4797 mt (1.5) s +4447 4614 mt 4447 4561 L +4447 414 mt 4447 467 L +4401 4797 mt (2) s +5334 4614 mt 5334 4561 L +5334 414 mt 5334 467 L +5218 4797 mt (2.5) s +6221 4614 mt 6221 4561 L +6221 414 mt 6221 467 L +6175 4797 mt (3) s + +/Helvetica 10 FMS + + +/Helvetica 14 FMS + +5798 5073 mt (x 10) s + +/Helvetica 10 FMS + +6115 4962 mt (-9) s + +/Helvetica 14 FMS + + 898 4614 mt 951 4614 L +6221 4614 mt 6168 4614 L + 582 4676 mt (-1.6) s + 898 4147 mt 951 4147 L +6221 4147 mt 6168 4147 L + 582 4209 mt (-1.4) s + 898 3681 mt 951 3681 L +6221 3681 mt 6168 3681 L + 582 3743 mt (-1.2) s + 898 3214 mt 951 3214 L +6221 3214 mt 6168 3214 L + 722 3276 mt (-1) s + 898 2747 mt 951 2747 L +6221 2747 mt 6168 2747 L + 582 2809 mt (-0.8) s + 898 2281 mt 951 2281 L +6221 2281 mt 6168 2281 L + 582 2343 mt (-0.6) s + 898 1814 mt 951 1814 L +6221 1814 mt 6168 1814 L + 582 1876 mt (-0.4) s + 898 1347 mt 951 1347 L +6221 1347 mt 6168 1347 L + 582 1409 mt (-0.2) s + 898 881 mt 951 881 L +6221 881 mt 6168 881 L + 778 943 mt (0) s + 898 414 mt 951 414 L +6221 414 mt 6168 414 L + 638 476 mt (0.2) s +gs 898 414 5324 4201 MR c np +140 9 140 -7 140 -6 140 0 140 -19 140 17 141 6 140 8 +140 19 140 8 140 -22 140 -8 140 -33 140 -33 140 18 140 17 +140 30 140 89 140 79 141 -104 140 -26 140 -151 140 -197 140 88 +140 3 140 173 140 371 140 275 140 -151 140 -77 140 -429 141 -1224 +140 199 140 19 140 416 140 2348 140 628 140 0 898 881 39 MP stroke +DA +140 1636 140 821 140 -2111 140 910 140 1155 140 -1724 141 329 140 1299 +140 -1279 140 -129 140 1247 140 -885 140 -472 140 1087 140 -475 140 -588 +140 949 140 -73 140 -647 141 625 140 49 140 -819 140 270 140 272 +140 -527 140 389 140 743 140 -211 140 -129 140 338 140 -898 141 -1157 +140 595 140 -329 140 258 140 2518 140 687 140 2 898 881 39 MP stroke +DO +140 1 140 -4 140 -4 140 -7 140 -8 140 3 141 13 140 7 +140 21 140 6 140 -24 140 -10 140 -34 140 -31 140 15 140 34 +140 31 140 73 140 56 141 -78 140 -8 140 -125 140 -219 140 57 +140 16 140 155 140 415 140 287 140 -140 140 -131 140 -482 141 -1211 +140 229 140 53 140 318 140 2367 140 675 140 53 898 839 39 MP stroke +SO +107 0 106 0 107 0 106 0 107 0 4829 708 6 MP stroke +gr +5468 797 mt (Exact ) s +gs 898 414 5324 4201 MR c np +DA +107 0 106 0 107 0 106 0 107 0 4829 1002 6 MP stroke +gr +5468 1091 mt (Pade\(8\)) s +gs 898 414 5324 4201 MR c np +DO +107 0 106 0 107 0 106 0 107 0 4829 1296 6 MP stroke +gr +5468 1385 mt (BT\(8\) ) s + 898 414 mt 6221 414 L + 898 4614 mt 6221 4614 L + 898 4614 mt 898 414 L +6221 4614 mt 6221 414 L + 898 414 mt 898 414 L +6221 414 mt 6221 414 L + +end % pop colortable dictionary + +eplot +%%EndObject graph 1 + +epage +end + +showpage + +%%Trailer +%%BoundingBox: 018 180 594 612 +%%Pages: 001 +%%EOF diff --git a/Build/source/texk/windvi/Examples/f3.ps.gz b/Build/source/texk/windvi/Examples/f3.ps.gz Binary files differnew file mode 100644 index 00000000000..6480a750479 --- /dev/null +++ b/Build/source/texk/windvi/Examples/f3.ps.gz diff --git a/Build/source/texk/windvi/Examples/f4.ps b/Build/source/texk/windvi/Examples/f4.ps new file mode 100644 index 00000000000..24b8b2ed694 --- /dev/null +++ b/Build/source/texk/windvi/Examples/f4.ps @@ -0,0 +1,11107 @@ +%!PS-Adobe-2.0 +%%Creator: MATLAB, The Mathworks, Inc. +%%Title: MATLAB graph +%%CreationDate: 10/11/93 16:15:16 +%%DocumentFonts: Times-Roman +%%DocumentNeededFonts: Times-Roman +%%DocumentProcessColors: Cyan Magenta Yellow Black +%%Extensions: CMYK +%%Pages: (atend) +%%BoundingBox: (atend) +%%EndComments + +%%BeginProlog + +% MathWorks dictionary +/MathWorks 120 dict begin + +% definition operators +/bdef {bind def} bind def +/ldef {load def} bind def +/xdef {exch def} bdef +/xstore {exch store} bdef + +% operator abbreviations +/c /clip ldef +/cc /concat ldef +/cp /closepath ldef +/gr /grestore ldef +/gs /gsave ldef +/mt /moveto ldef +/np /newpath ldef +/cm /currentmatrix ldef +/sm /setmatrix ldef +/rc {rectclip} bdef +/rf {rectfill} bdef +/rm /rmoveto ldef +/rl /rlineto ldef +/s /show ldef +/sc /setrgbcolor ldef +/w /setlinewidth ldef +/cap /setlinecap ldef + +% page state control +/pgsv () def +/bpage {/pgsv save def} bdef +/epage {pgsv restore} bdef +/bplot /gsave ldef +/eplot {stroke grestore} bdef + +% orientation switch +/portraitMode 0 def +/landscapeMode 1 def + +% coordinate system mappings +/dpi2point 0 def + +% font control +/FontSize 0 def +/FMS { + /FontSize xstore %save size off stack + findfont + [FontSize 0 0 FontSize neg 0 0] + makefont + setfont + }bdef + +/csm { + 1 dpi2point div -1 dpi2point div scale + neg translate + landscapeMode eq {90 rotate} if + } bdef +% line types: solid, dotted, dashed, dotdash +/SO { [] 0 setdash } bdef +/DO { [.5 dpi2point mul 4 dpi2point mul] 0 setdash } bdef +/DA { [6 dpi2point mul] 0 setdash } bdef +/DD { [.5 dpi2point mul 4 dpi2point mul 6 dpi2point mul 4 dpi2point mul] 0 setdash } bdef + +% macros for lines and objects +/L { + lineto + stroke + } bdef +/MP { + 3 1 roll moveto + 1 sub {rlineto} repeat + } bdef +/AP { + {rlineto} repeat + } bdef +/PP { + closepath fill + } bdef +/DP { + closepath stroke + } bdef +/MR { + 4 -2 roll moveto + dup 0 exch rlineto + exch 0 rlineto + neg 0 exch rlineto + closepath + } bdef +/FR { + MR stroke + } bdef +/PR { + MR fill + } bdef +/L1i { + { currentfile picstr readhexstring pop } image + } bdef + +/tMatrix matrix def +/MakeOval { + newpath + tMatrix currentmatrix pop + translate scale + 0 0 1 0 360 arc + tMatrix setmatrix + } bdef +/FO { + MakeOval + stroke + } bdef +/PO { + MakeOval + fill + } bdef + +/PD { + 2 copy moveto lineto stroke + } bdef + + +currentdict end def +%%EndProlog + +%%BeginSetup +MathWorks begin + +% fonts for text, standard numbers and exponents +%%IncludeFont: Times-Roman + +%line width, line cap, and joint spec +0 cap 1 setlinejoin + +end +%%EndSetup + +%%Page: 1 1 +%%BeginPageSetup +%%PageBoundingBox: 74 209 558 583 +MathWorks begin +bpage +%%EndPageSetup + +%%BeginObject: graph1 1 +bplot + +/dpi2point 12 def +portraitMode 0216 7344 csm + + 673 341 5810 4485 MR c np +76 dict begin %Colortable dictionary +/c0 { 0 0 0 sc} bdef +/c1 { 1 1 1 sc} bdef +/c2 { 1 0 0 sc} bdef +/c3 { 0 1 0 sc} bdef +/c4 { 0 0 1 sc} bdef +/c5 { 1 1 0 sc} bdef +/c6 { 1 0 1 sc} bdef +/c7 { 0 1 1 sc} bdef + +/Helvetica 144 FMS + +c1 + 0 0 6917 5187 PR +6 w +DO +4 w +SO +6 w +c0 +3226 4615 mt 6258 3794 L +3226 4615 mt 899 3545 L + 899 3545 mt 899 1210 L +3226 4615 mt 3297 4648 L +3322 4793 mt +(-4) s +3984 4410 mt 4055 4443 L +4080 4588 mt +(-2) s +4742 4205 mt 4813 4237 L +4838 4383 mt +(0) s +5500 3999 mt 5571 4032 L +5596 4177 mt +(2) s +6258 3794 mt 6329 3827 L +6354 3972 mt +(4) s +3226 4615 mt 3150 4636 L +2996 4777 mt +(-4) s +2644 4348 mt 2568 4368 L +2414 4509 mt +(-2) s +2062 4080 mt 1987 4101 L +1880 4242 mt +(0) s +1481 3813 mt 1405 3833 L +1299 3974 mt +(2) s + 899 3545 mt 823 3566 L + 717 3707 mt +(4) s + 899 3545 mt 828 3512 L + 675 3554 mt +(-4) s + 899 2961 mt 828 2929 L + 675 2970 mt +(-2) s + 899 2378 mt 828 2345 L + 723 2386 mt +(0) s + 899 1794 mt 828 1761 L + 723 1803 mt +(2) s + 899 1210 mt 828 1177 L + 723 1219 mt +(4) s +gs 899 389 5360 4227 MR c np +/c8 { 0.593750 0.000000 1.000000 sc} bdef +c8 + +-33 -47 -422 127 21 50 3129 2029 4 MP PP +c0 + +-33 -47 -422 127 21 50 3129 2029 4 MP DP +c8 + +-36 -46 -407 123 21 50 3150 2079 4 MP PP +c0 + +-36 -46 -407 123 21 50 3150 2079 4 MP DP +c8 + +-28 -46 -434 130 21 49 3108 1980 4 MP PP +c0 + +-28 -46 -434 130 21 49 3108 1980 4 MP DP +c8 + +-38 -43 -388 117 19 49 3171 2129 4 MP PP +c0 + +-38 -43 -388 117 19 49 3171 2129 4 MP DP +/c9 { 0.500000 0.000000 1.000000 sc} bdef +c9 + +-21 -50 -422 52 2 52 3591 2025 4 MP PP +c0 + +-21 -50 -422 52 2 52 3591 2025 4 MP DP +c9 + +-21 -50 -441 54 7 52 3584 1973 4 MP PP +c0 + +-21 -50 -441 54 7 52 3584 1973 4 MP DP +c9 + +-19 -49 -400 50 -3 51 3593 2077 4 MP PP +c0 + +-19 -49 -400 50 -3 51 3593 2077 4 MP DP +c9 + +-21 -49 -455 56 12 50 3572 1923 4 MP PP +c0 + +-21 -49 -455 56 12 50 3572 1923 4 MP DP +c8 + +-23 -44 -441 133 20 43 3088 1937 4 MP PP +c0 + +-23 -44 -441 133 20 43 3088 1937 4 MP DP +c8 + +-37 -38 -368 111 17 44 3190 2178 4 MP PP +c0 + +-37 -38 -368 111 17 44 3190 2178 4 MP DP +c9 + +-17 -44 -374 46 -9 48 3590 2128 4 MP PP +c0 + +-17 -44 -374 46 -9 48 3590 2128 4 MP DP +c9 + +-20 -43 -464 57 17 44 3555 1879 4 MP PP +c0 + +-20 -43 -464 57 17 44 3555 1879 4 MP DP +c8 + +-16 -39 -444 132 17 38 3071 1899 4 MP PP +c0 + +-16 -39 -444 132 17 38 3071 1899 4 MP DP +c8 + +-35 -30 -347 103 14 38 3207 2222 4 MP PP +c0 + +-35 -30 -347 103 14 38 3207 2222 4 MP DP +/c10 { 0.687500 0.000000 1.000000 sc} bdef +c10 + +-42 -43 -374 180 33 47 2695 2159 4 MP PP +c0 + +-42 -43 -374 180 33 47 2695 2159 4 MP DP +c10 + +-47 -41 -363 175 36 46 2728 2206 4 MP PP +c0 + +-47 -41 -363 175 36 46 2728 2206 4 MP DP +c9 + +-14 -38 -346 43 -14 41 3581 2176 4 MP PP +c0 + +-14 -38 -346 43 -14 41 3581 2176 4 MP DP +c9 + +-17 -38 -467 58 21 37 3534 1842 4 MP PP +c0 + +-17 -38 -467 58 21 37 3534 1842 4 MP DP +c10 + +-34 -45 -383 184 28 46 2667 2113 4 MP PP +c0 + +-34 -45 -383 184 28 46 2667 2113 4 MP DP +c10 + +-49 -37 -352 169 38 43 2764 2252 4 MP PP +c0 + +-49 -37 -352 169 38 43 2764 2252 4 MP DP +c8 + +-8 -33 -443 131 15 30 3056 1869 4 MP PP +c0 + +-8 -33 -443 131 15 30 3056 1869 4 MP DP +c10 + +-27 -44 -389 185 23 44 2644 2069 4 MP PP +c0 + +-27 -44 -389 185 23 44 2644 2069 4 MP DP +c8 + +-33 -23 -324 97 10 29 3221 2260 4 MP PP +c0 + +-33 -23 -324 97 10 29 3221 2260 4 MP DP +c10 + +-51 -29 -338 160 37 38 2802 2295 4 MP PP +c0 + +-51 -29 -338 160 37 38 2802 2295 4 MP DP +c9 + +-10 -29 -319 39 -17 33 3567 2217 4 MP PP +c0 + +-10 -29 -319 39 -17 33 3567 2217 4 MP DP +c9 + +-15 -30 -463 57 23 29 3511 1813 4 MP PP +c0 + +-15 -30 -463 57 23 29 3511 1813 4 MP DP +/c11 { 0.312500 0.000000 1.000000 sc} bdef +c11 + +-2 -52 -388 -28 -15 52 3996 2053 4 MP PP +c0 + +-2 -52 -388 -28 -15 52 3996 2053 4 MP DP +c11 + +-7 -52 -405 -28 -5 51 4001 2002 4 MP PP +c0 + +-7 -52 -405 -28 -5 51 4001 2002 4 MP DP +c11 + +3 -51 -368 -27 -23 50 3981 2105 4 MP PP +c0 + +3 -51 -368 -27 -23 50 3981 2105 4 MP DP +c10 + +-16 -41 -393 185 16 39 2628 2030 4 MP PP +c0 + +-16 -41 -393 185 16 39 2628 2030 4 MP DP +c10 + +-49 -23 -324 153 35 30 2839 2333 4 MP PP +c0 + +-49 -23 -324 153 35 30 2839 2333 4 MP DP +c11 + +-12 -50 -417 -29 4 49 3997 1953 4 MP PP +c0 + +-12 -50 -417 -29 4 49 3997 1953 4 MP DP +c11 + +9 -48 -346 -24 -31 45 3958 2155 4 MP PP +c0 + +9 -48 -346 -24 -31 45 3958 2155 4 MP DP +c8 + +-1 -24 -436 128 11 20 3045 1849 4 MP PP +c0 + +-1 -24 -436 128 11 20 3045 1849 4 MP DP +c8 + +-27 -13 -303 89 6 21 3231 2289 4 MP PP +c0 + +-27 -13 -303 89 6 21 3231 2289 4 MP DP +c9 + +-6 -21 -291 36 -22 24 3550 2250 4 MP PP +c0 + +-6 -21 -291 36 -22 24 3550 2250 4 MP DP +c11 + +-17 -44 -425 -30 13 45 3984 1908 4 MP PP +c0 + +-17 -44 -425 -30 13 45 3984 1908 4 MP DP +c9 + +-11 -20 -455 56 25 18 3486 1795 4 MP PP +c0 + +-11 -20 -455 56 25 18 3486 1795 4 MP DP +c11 + +14 -41 -322 -23 -38 40 3927 2200 4 MP PP +c0 + +14 -41 -322 -23 -38 40 3927 2200 4 MP DP +c10 + +-7 -36 -393 183 8 33 2620 1997 4 MP PP +c0 + +-7 -36 -393 183 8 33 2620 1997 4 MP DP +c10 + +-46 -14 -311 144 33 23 2874 2363 4 MP PP +c0 + +-46 -14 -311 144 33 23 2874 2363 4 MP DP +c11 + +-21 -37 -429 -29 23 38 3961 1870 4 MP PP +c0 + +-21 -37 -429 -29 23 38 3961 1870 4 MP DP +c8 + +7 -16 -426 124 8 11 3037 1838 4 MP PP +c0 + +7 -16 -426 124 8 11 3037 1838 4 MP DP +c11 + +17 -33 -297 -21 -42 31 3889 2240 4 MP PP +c0 + +17 -33 -297 -21 -42 31 3889 2240 4 MP DP +c8 + +-22 -4 -283 82 2 11 3237 2310 4 MP PP +c0 + +-22 -4 -283 82 2 11 3237 2310 4 MP DP +c9 + +-2 -11 -265 33 -24 14 3528 2274 4 MP PP +c0 + +-2 -11 -265 33 -24 14 3528 2274 4 MP DP +c10 + +4 -30 -392 180 1 24 2619 1973 4 MP PP +c0 + +4 -30 -392 180 1 24 2619 1973 4 MP DP +c9 + +-8 -11 -441 54 26 8 3460 1787 4 MP PP +c0 + +-8 -11 -441 54 26 8 3460 1787 4 MP DP +/c12 { 0.781250 0.000000 1.000000 sc} bdef +c12 + +-49 -40 -316 215 42 43 2312 2343 4 MP PP +c0 + +-49 -40 -316 215 42 43 2312 2343 4 MP DP +c12 + +-55 -35 -308 209 47 41 2354 2386 4 MP PP +c0 + +-55 -35 -308 209 47 41 2354 2386 4 MP DP +c10 + +-40 -4 -298 135 27 13 2907 2386 4 MP PP +c0 + +-40 -4 -298 135 27 13 2907 2386 4 MP DP +c12 + +-42 -43 -323 218 34 45 2278 2298 4 MP PP +c0 + +-42 -43 -323 218 34 45 2278 2298 4 MP DP +c12 + +-58 -29 -299 201 49 37 2401 2427 4 MP PP +c0 + +-58 -29 -299 201 49 37 2401 2427 4 MP DP +c11 + +-23 -29 -427 -28 30 30 3931 1840 4 MP PP +c0 + +-23 -29 -427 -28 30 30 3931 1840 4 MP DP +c11 + +22 -24 -274 -19 -45 22 3847 2271 4 MP PP +c0 + +22 -24 -274 -19 -45 22 3847 2271 4 MP DP +c12 + +-32 -43 -331 220 27 44 2251 2254 4 MP PP +c0 + +-32 -43 -331 220 27 44 2251 2254 4 MP DP +c8 + +15 -6 -411 119 2 -1 3035 1839 4 MP PP +c0 + +15 -6 -411 119 2 -1 3035 1839 4 MP DP +c12 + +-59 -21 -291 193 51 29 2450 2464 4 MP PP +c0 + +-59 -21 -291 193 51 29 2450 2464 4 MP DP +c8 + +-14 6 -266 76 -3 0 3239 2321 4 MP PP +c0 + +-14 6 -266 76 -3 0 3239 2321 4 MP DP +c9 + +3 0 -243 30 -25 3 3504 2288 4 MP PP +c0 + +3 0 -243 30 -25 3 3504 2288 4 MP DP +c10 + +15 -22 -387 174 -7 16 2626 1957 4 MP PP +c0 + +15 -22 -387 174 -7 16 2626 1957 4 MP DP +c9 + +-2 1 -423 51 26 -2 3434 1789 4 MP PP +c0 + +-2 1 -423 51 26 -2 3434 1789 4 MP DP +c10 + +-33 4 -287 127 22 4 2934 2399 4 MP PP +c0 + +-33 4 -287 127 22 4 2934 2399 4 MP DP +c12 + +-21 -43 -336 221 16 41 2235 2213 4 MP PP +c0 + +-21 -43 -336 221 16 41 2235 2213 4 MP DP +c11 + +-25 -18 -420 -27 37 20 3894 1820 4 MP PP +c0 + +-25 -18 -420 -27 37 20 3894 1820 4 MP DP +c12 + +-57 -13 -283 183 49 23 2501 2493 4 MP PP +c0 + +-57 -13 -283 183 49 23 2501 2493 4 MP DP +c11 + +24 -14 -253 -16 -45 11 3802 2293 4 MP PP +c0 + +24 -14 -253 -16 -45 11 3802 2293 4 MP DP +c12 + +-9 -40 -341 219 7 36 2228 2177 4 MP PP +c0 + +-9 -40 -341 219 7 36 2228 2177 4 MP DP +c8 + +22 4 -394 112 -1 -10 3036 1849 4 MP PP +c0 + +22 4 -394 112 -1 -10 3036 1849 4 MP DP +c8 + +-7 16 -251 70 -8 -10 3236 2321 4 MP PP +c0 + +-7 16 -251 70 -8 -10 3236 2321 4 MP DP +c10 + +24 -14 -379 168 -15 6 2641 1951 4 MP PP +c0 + +24 -14 -379 168 -15 6 2641 1951 4 MP DP +c9 + +8 10 -225 28 -26 -8 3479 2291 4 MP PP +c0 + +8 10 -225 28 -26 -8 3479 2291 4 MP DP +/c13 { 0.218750 0.000000 1.000000 sc} bdef +c13 + +15 -52 -322 -99 -27 49 4330 2155 4 MP PP +c0 + +15 -52 -322 -99 -27 49 4330 2155 4 MP DP +c13 + +23 -50 -307 -95 -38 46 4303 2204 4 MP PP +c0 + +23 -50 -307 -95 -38 46 4303 2204 4 MP DP +c12 + +-53 -5 -276 174 46 14 2550 2516 4 MP PP +c0 + +-53 -5 -276 174 46 14 2550 2516 4 MP DP +c9 + +1 10 -399 50 24 -14 3410 1803 4 MP PP +c0 + +1 10 -399 50 24 -14 3410 1803 4 MP DP +c10 + +-24 14 -277 119 14 -6 2956 2403 4 MP PP +c0 + +-24 14 -277 119 14 -6 2956 2403 4 MP DP +c11 + +-26 -8 -408 -25 41 10 3853 1810 4 MP PP +c0 + +-26 -8 -408 -25 41 10 3853 1810 4 MP DP +c13 + +5 -51 -334 -102 -15 50 4345 2105 4 MP PP +c0 + +5 -51 -334 -102 -15 50 4345 2105 4 MP DP +c13 + +31 -45 -292 -90 -46 40 4265 2250 4 MP PP +c0 + +31 -45 -292 -90 -46 40 4265 2250 4 MP DP +c11 + +25 -3 -233 -14 -45 1 3757 2304 4 MP PP +c0 + +25 -3 -233 -14 -45 1 3757 2304 4 MP DP +c13 + +-4 -49 -344 -103 -3 48 4348 2057 4 MP PP +c0 + +-4 -49 -344 -103 -3 48 4348 2057 4 MP DP +c13 + +38 -40 -277 -84 -53 34 4219 2290 4 MP PP +c0 + +38 -40 -277 -84 -53 34 4219 2290 4 MP DP +c12 + +4 -36 -343 215 -4 30 2232 2147 4 MP PP +c0 + +4 -36 -343 215 -4 30 2232 2147 4 MP DP +c8 + +27 13 -373 106 -6 -21 3042 1870 4 MP PP +c0 + +27 13 -373 106 -6 -21 3042 1870 4 MP DP +c8 + +0 25 -240 66 -11 -21 3228 2311 4 MP PP +c0 + +0 25 -240 66 -11 -21 3228 2311 4 MP DP +c12 + +-46 5 -270 165 40 4 2596 2530 4 MP PP +c0 + +-46 5 -270 165 40 4 2596 2530 4 MP DP +c9 + +11 21 -211 26 -25 -19 3453 2283 4 MP PP +c0 + +11 21 -211 26 -25 -19 3453 2283 4 MP DP +c10 + +33 -5 -370 160 -22 -4 2663 1955 4 MP PP +c0 + +33 -5 -370 160 -22 -4 2663 1955 4 MP DP +c13 + +-13 -45 -351 -104 9 46 4339 2011 4 MP PP +c0 + +-13 -45 -351 -104 9 46 4339 2011 4 MP DP +c13 + +42 -31 -261 -78 -58 25 4166 2324 4 MP PP +c0 + +42 -31 -261 -78 -58 25 4166 2324 4 MP DP +c9 + +6 21 -374 46 21 -24 3389 1827 4 MP PP +c0 + +6 21 -374 46 21 -24 3389 1827 4 MP DP +c11 + +-26 2 -393 -23 45 0 3808 1810 4 MP PP +c0 + +-26 2 -393 -23 45 0 3808 1810 4 MP DP +c10 + +-15 22 -269 113 7 -16 2970 2397 4 MP PP +c0 + +-15 22 -269 113 7 -16 2970 2397 4 MP DP +c11 + +26 8 -217 -12 -42 -10 3712 2305 4 MP PP +c0 + +26 8 -217 -12 -42 -10 3712 2305 4 MP DP +c12 + +15 -29 -343 209 -15 22 2247 2125 4 MP PP +c0 + +15 -29 -343 209 -15 22 2247 2125 4 MP DP +c13 + +-23 -38 -355 -103 22 40 4317 1971 4 MP PP +c0 + +-23 -38 -355 -103 22 40 4317 1971 4 MP DP +c13 + +45 -22 -247 -72 -59 16 4108 2349 4 MP PP +c0 + +45 -22 -247 -72 -59 16 4108 2349 4 MP DP +c8 + +32 23 -352 98 -10 -30 3052 1900 4 MP PP +c0 + +32 23 -352 98 -10 -30 3052 1900 4 MP DP +c8 + +9 32 -234 63 -15 -29 3217 2290 4 MP PP +c0 + +9 32 -234 63 -15 -29 3217 2290 4 MP DP +c12 + +-37 14 -266 155 33 -4 2636 2534 4 MP PP +c0 + +-37 14 -266 155 33 -4 2636 2534 4 MP DP +c9 + +15 29 -202 25 -24 -28 3428 2264 4 MP PP +c0 + +15 29 -202 25 -24 -28 3428 2264 4 MP DP +c10 + +40 5 -359 151 -27 -13 2690 1968 4 MP PP +c0 + +40 5 -359 151 -27 -13 2690 1968 4 MP DP +c9 + +10 30 -347 43 18 -34 3371 1861 4 MP PP +c0 + +10 30 -347 43 18 -34 3371 1861 4 MP DP +c11 + +-24 14 -374 -21 46 -12 3762 1822 4 MP PP +c0 + +-24 14 -374 -21 46 -12 3762 1822 4 MP DP +c10 + +-4 30 -265 108 0 -25 2977 2381 4 MP PP +c0 + +-4 30 -265 108 0 -25 2977 2381 4 MP DP +/c14 { 0.875000 0.000000 1.000000 sc} bdef +c14 + +-57 -35 -250 227 49 40 1989 2561 4 MP PP +c0 + +-57 -35 -250 227 49 40 1989 2561 4 MP DP +c11 + +25 19 -206 -11 -36 -20 3670 2295 4 MP PP +c0 + +25 19 -206 -11 -36 -20 3670 2295 4 MP DP +c14 + +-62 -28 -243 220 55 35 2038 2601 4 MP PP +c0 + +-62 -28 -243 220 55 35 2038 2601 4 MP DP +c14 + +-50 -39 -258 232 42 43 1947 2518 4 MP PP +c0 + +-50 -39 -258 232 42 43 1947 2518 4 MP DP +c13 + +-30 -30 -356 -101 32 33 4285 1938 4 MP PP +c0 + +-30 -30 -356 -101 32 33 4285 1938 4 MP DP +c13 + +45 -11 -233 -67 -59 6 4049 2365 4 MP PP +c0 + +45 -11 -233 -67 -59 6 4049 2365 4 MP DP +c12 + +27 -22 -343 202 -24 14 2271 2111 4 MP PP +c0 + +27 -22 -343 202 -24 14 2271 2111 4 MP DP +c14 + +-64 -20 -237 211 58 29 2093 2636 4 MP PP +c0 + +-64 -20 -237 211 58 29 2093 2636 4 MP DP +c14 + +-39 -42 -266 236 32 43 1915 2475 4 MP PP +c0 + +-39 -42 -266 236 32 43 1915 2475 4 MP DP +c8 + +36 30 -330 91 -14 -38 3066 1938 4 MP PP +c0 + +36 30 -330 91 -14 -38 3066 1938 4 MP DP +c8 + +16 39 -233 62 -17 -38 3202 2261 4 MP PP +c0 + +16 39 -233 62 -17 -38 3202 2261 4 MP DP +c9 + +17 38 -199 25 -20 -38 3404 2236 4 MP PP +c0 + +17 38 -199 25 -20 -38 3404 2236 4 MP DP +c9 + +14 38 -319 39 14 -41 3357 1902 4 MP PP +c0 + +14 38 -319 39 14 -41 3357 1902 4 MP DP +c12 + +-27 22 -263 147 24 -14 2669 2530 4 MP PP +c0 + +-27 22 -263 147 24 -14 2669 2530 4 MP DP +c10 + +46 14 -346 143 -32 -23 2722 1991 4 MP PP +c0 + +46 14 -346 143 -32 -23 2722 1991 4 MP DP +c14 + +-64 -12 -232 202 59 21 2151 2665 4 MP PP +c0 + +-64 -12 -232 202 59 21 2151 2665 4 MP DP +c14 + +-28 -44 -273 237 21 43 1894 2432 4 MP PP +c0 + +-28 -44 -273 237 21 43 1894 2432 4 MP DP +c11 + +-21 24 -352 -19 45 -22 3717 1844 4 MP PP +c0 + +-21 24 -352 -19 45 -22 3717 1844 4 MP DP +c10 + +7 36 -263 104 -9 -32 2977 2356 4 MP PP +c0 + +7 36 -263 104 -9 -32 2977 2356 4 MP DP +/c15 { 0.406250 1.000000 0.000000 sc} bdef +c15 + +55 -36 -276 -187 -39 45 3988 3779 4 MP PP +c0 + +55 -36 -276 -187 -39 45 3988 3779 4 MP DP +c11 + +24 28 -200 -9 -30 -30 3634 2275 4 MP PP +c0 + +24 28 -200 -9 -30 -30 3634 2275 4 MP DP +c15 + +56 -34 -260 -178 -38 46 4026 3733 4 MP PP +c0 + +56 -34 -260 -178 -38 46 4026 3733 4 MP DP +c13 + +-37 -20 -354 -98 42 25 4243 1913 4 MP PP +c0 + +-37 -20 -354 -98 42 25 4243 1913 4 MP DP +/c16 { 0.500000 1.000000 0.000000 sc} bdef +c16 + +38 -46 -285 -75 -7 52 4280 3802 4 MP PP +c0 + +38 -46 -285 -75 -7 52 4280 3802 4 MP DP +c13 + +45 -1 -222 -61 -56 -5 3990 2371 4 MP PP +c0 + +45 -1 -222 -61 -56 -5 3990 2371 4 MP DP +c16 + +39 -45 -317 -83 -7 53 4273 3854 4 MP PP +c0 + +39 -45 -317 -83 -7 53 4273 3854 4 MP DP +/c17 { 0.312500 1.000000 0.000000 sc} bdef +c17 + +64 -27 -224 -272 -55 36 3728 3601 4 MP PP +c0 + +64 -27 -224 -272 -55 36 3728 3601 4 MP DP +c8 + +37 38 -308 83 -17 -44 3083 1982 4 MP PP +c0 + +37 38 -308 83 -17 -44 3083 1982 4 MP DP +c15 + +54 -34 -293 -196 -37 43 3949 3824 4 MP PP +c0 + +54 -34 -293 -196 -37 43 3949 3824 4 MP DP +c17 + +63 -28 -233 -278 -54 34 3673 3637 4 MP PP +c0 + +63 -28 -233 -278 -54 34 3673 3637 4 MP DP +c8 + +22 44 -235 62 -20 -44 3185 2223 4 MP PP +c0 + +22 44 -235 62 -20 -44 3185 2223 4 MP DP +c17 + +62 -25 -215 -263 -56 34 3784 3567 4 MP PP +c0 + +62 -25 -215 -263 -56 34 3784 3567 4 MP DP +c9 + +20 44 -202 25 -17 -44 3384 2198 4 MP PP +c0 + +20 44 -202 25 -17 -44 3384 2198 4 MP DP +c16 + +36 -43 -254 -69 -5 51 4285 3751 4 MP PP +c0 + +36 -43 -254 -69 -5 51 4285 3751 4 MP DP +c15 + +52 -33 -242 -166 -36 43 4062 3690 4 MP PP +c0 + +52 -33 -242 -166 -36 43 4062 3690 4 MP DP +/c18 { 0.687500 1.000000 0.000000 sc} bdef +c18 + +7 -52 -286 33 30 49 4529 3772 4 MP PP +c0 + +7 -52 -286 33 30 49 4529 3772 4 MP DP +c16 + +37 -43 -346 -89 -8 49 4266 3907 4 MP PP +c0 + +37 -43 -346 -89 -8 49 4266 3907 4 MP DP +c12 + +37 -14 -340 194 -33 5 2304 2106 4 MP PP +c0 + +37 -14 -340 194 -33 5 2304 2106 4 MP DP +c9 + +17 44 -291 36 8 -47 3349 1949 4 MP PP +c0 + +17 44 -291 36 8 -47 3349 1949 4 MP DP +c18 + +7 -53 -321 38 28 48 4559 3821 4 MP PP +c0 + +7 -53 -321 38 28 48 4559 3821 4 MP DP +c14 + +-61 -3 -228 192 57 13 2210 2686 4 MP PP +c0 + +-61 -3 -228 192 57 13 2210 2686 4 MP DP +c14 + +-16 -43 -280 236 9 40 1885 2392 4 MP PP +c0 + +-16 -43 -280 236 9 40 1885 2392 4 MP DP +c18 + +5 -51 -249 30 30 46 4499 3726 4 MP PP +c0 + +5 -51 -249 30 30 46 4499 3726 4 MP DP +c17 + +60 -26 -243 -284 -50 32 3619 3671 4 MP PP +c0 + +60 -26 -243 -284 -50 32 3619 3671 4 MP DP +c15 + +50 -32 -309 -203 -34 39 3912 3867 4 MP PP +c0 + +50 -32 -309 -203 -34 39 3912 3867 4 MP DP +c10 + +49 22 -332 134 -36 -30 2758 2021 4 MP PP +c0 + +49 22 -332 134 -36 -30 2758 2021 4 MP DP +c8 + +37 43 -288 77 -19 -48 3102 2030 4 MP PP +c0 + +37 43 -288 77 -19 -48 3102 2030 4 MP DP +/c19 { 0.218750 1.000000 0.000000 sc} bdef +c19 + +68 -21 -166 -341 -63 28 3449 3365 4 MP PP +c0 + +68 -21 -166 -341 -63 28 3449 3365 4 MP DP +c17 + +58 -22 -209 -254 -52 33 3836 3534 4 MP PP +c0 + +58 -22 -209 -254 -52 33 3836 3534 4 MP DP +c18 + +8 -49 -355 42 26 45 4587 3869 4 MP PP +c0 + +8 -49 -355 42 26 45 4587 3869 4 MP DP +c8 + +29 46 -243 64 -21 -48 3165 2179 4 MP PP +c0 + +29 46 -243 64 -21 -48 3165 2179 4 MP DP +/c20 { 0.781250 1.000000 0.000000 sc} bdef +c20 + +-30 -49 -255 137 53 37 4761 3647 4 MP PP +c0 + +-30 -49 -255 137 53 37 4761 3647 4 MP DP +c11 + +-18 34 -328 -17 42 -31 3675 1875 4 MP PP +c0 + +-18 34 -328 -17 42 -31 3675 1875 4 MP DP +c19 + +67 -19 -161 -334 -64 27 3513 3338 4 MP PP +c0 + +67 -19 -161 -334 -64 27 3513 3338 4 MP DP +c10 + +17 41 -264 102 -16 -39 2968 2324 4 MP PP +c0 + +17 41 -264 102 -16 -39 2968 2324 4 MP DP +c16 + +33 -39 -223 -61 -4 46 4289 3705 4 MP PP +c0 + +33 -39 -223 -61 -4 46 4289 3705 4 MP DP +c12 + +-15 29 -263 140 15 -22 2693 2516 4 MP PP +c0 + +-15 29 -263 140 15 -22 2693 2516 4 MP DP +c9 + +21 48 -211 26 -12 -49 3367 2154 4 MP PP +c0 + +21 48 -211 26 -12 -49 3367 2154 4 MP DP +c20 + +-28 -48 -279 148 52 37 4814 3684 4 MP PP +c0 + +-28 -48 -279 148 52 37 4814 3684 4 MP DP +c19 + +68 -21 -174 -346 -60 26 3386 3393 4 MP PP +c0 + +68 -21 -174 -346 -60 26 3386 3393 4 MP DP +c9 + +19 48 -266 33 4 -51 3345 2000 4 MP PP +c0 + +19 48 -266 33 4 -51 3345 2000 4 MP DP +c15 + +46 -28 -226 -156 -33 39 4095 3651 4 MP PP +c0 + +46 -28 -226 -156 -33 39 4095 3651 4 MP DP +c11 + +20 38 -197 -9 -23 -38 3604 2245 4 MP PP +c0 + +20 38 -197 -9 -23 -38 3604 2245 4 MP DP +c16 + +34 -39 -372 -94 -8 44 4258 3956 4 MP PP +c0 + +34 -39 -372 -94 -8 44 4258 3956 4 MP DP +c20 + +-30 -46 -232 125 53 35 4708 3612 4 MP PP +c0 + +-30 -46 -232 125 53 35 4708 3612 4 MP DP +c8 + +36 45 -270 72 -21 -51 3123 2081 4 MP PP +c0 + +36 45 -270 72 -21 -51 3123 2081 4 MP DP +c18 + +4 -46 -214 25 30 43 4469 3683 4 MP PP +c0 + +4 -46 -214 25 30 43 4469 3683 4 MP DP +c8 + +33 48 -255 66 -21 -50 3144 2131 4 MP PP +c0 + +33 48 -255 66 -21 -50 3144 2131 4 MP DP +c13 + +-41 -10 -349 -93 50 15 4193 1898 4 MP PP +c0 + +-41 -10 -349 -93 50 15 4193 1898 4 MP DP +c13 + +42 10 -215 -56 -49 -15 3934 2366 4 MP PP +c0 + +42 10 -215 -56 -49 -15 3934 2366 4 MP DP +c9 + +21 50 -224 28 -8 -52 3355 2105 4 MP PP +c0 + +21 50 -224 28 -8 -52 3355 2105 4 MP DP +c9 + +21 51 -243 30 -2 -53 3347 2053 4 MP PP +c0 + +21 51 -243 30 -2 -53 3347 2053 4 MP DP +c19 + +62 -16 -158 -326 -62 25 3575 3313 4 MP PP +c0 + +62 -16 -158 -326 -62 25 3575 3313 4 MP DP +c20 + +-26 -45 -300 157 47 36 4866 3721 4 MP PP +c0 + +-26 -45 -300 157 47 36 4866 3721 4 MP DP +c17 + +54 -25 -254 -288 -43 29 3569 3703 4 MP PP +c0 + +54 -25 -254 -288 -43 29 3569 3703 4 MP DP +/c21 { 0.875000 1.000000 0.000000 sc} bdef +c21 + +-53 -37 -205 223 65 26 4954 3435 4 MP PP +c0 + +-53 -37 -205 223 65 26 4954 3435 4 MP DP +c19 + +63 -22 -183 -349 -54 25 3326 3419 4 MP PP +c0 + +63 -22 -183 -349 -54 25 3326 3419 4 MP DP +c18 + +8 -44 -384 45 21 41 4613 3914 4 MP PP +c0 + +8 -44 -384 45 21 41 4613 3914 4 MP DP +c14 + +-55 7 -226 180 53 5 2267 2699 4 MP PP +c0 + +-55 7 -226 180 53 5 2267 2699 4 MP DP +c20 + +-30 -43 -209 114 51 32 4657 3580 4 MP PP +c0 + +-30 -43 -209 114 51 32 4657 3580 4 MP DP +c14 + +-2 -41 -287 233 -4 36 1889 2356 4 MP PP +c0 + +-2 -41 -287 233 -4 36 1889 2356 4 MP DP +c15 + +43 -29 -323 -207 -29 33 3878 3906 4 MP PP +c0 + +43 -29 -323 -207 -29 33 3878 3906 4 MP DP +c21 + +-52 -37 -216 233 63 27 5019 3461 4 MP PP +c0 + +-52 -37 -216 233 63 27 5019 3461 4 MP DP +c17 + +50 -19 -203 -243 -46 28 3882 3506 4 MP PP +c0 + +50 -19 -203 -243 -46 28 3882 3506 4 MP DP +c10 + +50 30 -319 126 -37 -38 2795 2059 4 MP PP +c0 + +50 30 -319 126 -37 -38 2795 2059 4 MP DP +c12 + +46 -5 -336 185 -40 -5 2344 2111 4 MP PP +c0 + +46 -5 -336 185 -40 -5 2344 2111 4 MP DP +c21 + +-53 -35 -193 212 64 24 4890 3411 4 MP PP +c0 + +-53 -35 -193 212 64 24 4890 3411 4 MP DP +c10 + +26 44 -268 102 -22 -44 2952 2285 4 MP PP +c0 + +26 44 -268 102 -22 -44 2952 2285 4 MP DP +c11 + +-14 41 -304 -14 37 -39 3638 1914 4 MP PP +c0 + +-14 41 -304 -14 37 -39 3638 1914 4 MP DP +c16 + +27 -34 -194 -54 -2 41 4291 3664 4 MP PP +c0 + +27 -34 -194 -54 -2 41 4291 3664 4 MP DP +c11 + +17 44 -201 -8 -13 -45 3581 2207 4 MP PP +c0 + +17 44 -201 -8 -13 -45 3581 2207 4 MP DP +c16 + +29 -33 -393 -99 -8 38 4250 4000 4 MP PP +c0 + +29 -33 -393 -99 -8 38 4250 4000 4 MP DP +c18 + +2 -41 -180 22 27 37 4442 3646 4 MP PP +c0 + +2 -41 -180 22 27 37 4442 3646 4 MP DP +c15 + +40 -24 -213 -145 -27 34 4122 3617 4 MP PP +c0 + +40 -24 -213 -145 -27 34 4122 3617 4 MP DP +c21 + +-47 -36 -229 243 60 26 5082 3488 4 MP PP +c0 + +-47 -36 -229 243 60 26 5082 3488 4 MP DP +c19 + +55 -13 -158 -317 -58 22 3633 3291 4 MP PP +c0 + +55 -13 -158 -317 -58 22 3633 3291 4 MP DP +c20 + +-21 -41 -320 166 41 32 4913 3757 4 MP PP +c0 + +-21 -41 -320 166 41 32 4913 3757 4 MP DP +/c22 { 0.125000 1.000000 0.000000 sc} bdef +c22 + +71 -15 -108 -381 -68 21 3220 3052 4 MP PP +c0 + +71 -15 -108 -381 -68 21 3220 3052 4 MP DP +c12 + +-3 36 -264 134 4 -30 2708 2494 4 MP PP +c0 + +-3 36 -264 134 4 -30 2708 2494 4 MP DP +c10 + +50 37 -306 118 -37 -43 2832 2102 4 MP PP +c0 + +50 37 -306 118 -37 -43 2832 2102 4 MP DP +c22 + +69 -13 -105 -375 -68 21 3288 3031 4 MP PP +c0 + +69 -13 -105 -375 -68 21 3288 3031 4 MP DP +c21 + +-51 -32 -182 201 59 21 4831 3390 4 MP PP +c0 + +-51 -32 -182 201 59 21 4831 3390 4 MP DP +c13 + +-45 0 -340 -88 56 5 4137 1893 4 MP PP +c0 + +-45 0 -340 -88 56 5 4137 1893 4 MP DP +c22 + +70 -18 -115 -385 -63 22 3152 3073 4 MP PP +c0 + +70 -18 -115 -385 -63 22 3152 3073 4 MP DP +c19 + +56 -21 -194 -350 -45 22 3272 3444 4 MP PP +c0 + +56 -21 -194 -350 -45 22 3272 3444 4 MP DP +c10 + +35 45 -274 103 -29 -46 2930 2241 4 MP PP +c0 + +35 45 -274 103 -29 -46 2930 2241 4 MP DP +c13 + +36 20 -208 -51 -43 -25 3885 2351 4 MP PP +c0 + +36 20 -208 -51 -43 -25 3885 2351 4 MP DP +c20 + +-27 -37 -188 103 45 28 4612 3552 4 MP PP +c0 + +-27 -37 -188 103 45 28 4612 3552 4 MP DP +c17 + +45 -22 -264 -289 -35 23 3526 3732 4 MP PP +c0 + +45 -22 -264 -289 -35 23 3526 3732 4 MP DP +/c23 { 0.968750 1.000000 0.000000 sc} bdef +c23 + +-63 -27 -147 296 71 18 5158 3174 4 MP PP +c0 + +-63 -27 -147 296 71 18 5158 3174 4 MP DP +c23 + +-65 -26 -139 287 70 17 5088 3157 4 MP PP +c0 + +-65 -26 -139 287 70 17 5088 3157 4 MP DP +c11 + +-8 47 -281 -12 31 -46 3607 1960 4 MP PP +c0 + +-8 47 -281 -12 31 -46 3607 1960 4 MP DP +c18 + +8 -38 -409 48 17 35 4634 3955 4 MP PP +c0 + +8 -38 -409 48 17 35 4634 3955 4 MP DP +c11 + +12 49 -208 -8 -5 -49 3568 2162 4 MP PP +c0 + +12 49 -208 -8 -5 -49 3568 2162 4 MP DP +c10 + +47 41 -293 112 -36 -45 2868 2147 4 MP PP +c0 + +47 41 -293 112 -36 -45 2868 2147 4 MP DP +c10 + +41 43 -282 108 -33 -48 2901 2195 4 MP PP +c0 + +41 43 -282 108 -33 -48 2901 2195 4 MP DP +c14 + +-46 15 -226 170 46 -5 2320 2704 4 MP PP +c0 + +-46 15 -226 170 46 -5 2320 2704 4 MP DP +c17 + +41 -14 -199 -234 -40 24 3922 3482 4 MP PP +c0 + +41 -14 -199 -234 -40 24 3922 3482 4 MP DP +c14 + +12 -36 -293 228 -15 29 1904 2327 4 MP PP +c0 + +12 -36 -293 228 -15 29 1904 2327 4 MP DP +c22 + +64 -10 -104 -367 -67 19 3355 3012 4 MP PP +c0 + +64 -10 -104 -367 -67 19 3355 3012 4 MP DP +c15 + +35 -23 -334 -211 -24 27 3849 3939 4 MP PP +c0 + +35 -23 -334 -211 -24 27 3849 3939 4 MP DP +c21 + +-41 -32 -241 250 53 25 5142 3514 4 MP PP +c0 + +-41 -32 -241 250 53 25 5142 3514 4 MP DP +c23 + +-60 -26 -154 304 67 18 5229 3192 4 MP PP +c0 + +-60 -26 -154 304 67 18 5229 3192 4 MP DP +c23 + +-64 -24 -134 278 67 14 5021 3143 4 MP PP +c0 + +-64 -24 -134 278 67 14 5021 3143 4 MP DP +/c24 { 0.125000 0.000000 1.000000 sc} bdef +c24 + +38 -46 -235 -149 -48 40 4548 2359 4 MP PP +c0 + +38 -46 -235 -149 -48 40 4548 2359 4 MP DP +c22 + +66 -19 -125 -387 -56 21 3089 3095 4 MP PP +c0 + +66 -19 -125 -387 -56 21 3089 3095 4 MP DP +c12 + +53 5 -330 175 -46 -14 2390 2125 4 MP PP +c0 + +53 5 -330 175 -46 -14 2390 2125 4 MP DP +c24 + +46 -40 -224 -143 -57 34 4500 2399 4 MP PP +c0 + +46 -40 -224 -143 -57 34 4500 2399 4 MP DP +c24 + +27 -49 -245 -155 -38 45 4586 2314 4 MP PP +c0 + +27 -49 -245 -155 -38 45 4586 2314 4 MP DP +c11 + +-4 51 -258 -11 24 -49 3583 2009 4 MP PP +c0 + +-4 51 -258 -11 24 -49 3583 2009 4 MP DP +c16 + +22 -27 -169 -47 -1 33 4292 3631 4 MP PP +c0 + +22 -27 -169 -47 -1 33 4292 3631 4 MP DP +c11 + +8 52 -222 -8 6 -52 3563 2113 4 MP PP +c0 + +8 52 -222 -8 6 -52 3563 2113 4 MP DP +c18 + +1 -33 -151 18 23 30 4419 3616 4 MP PP +c0 + +1 -33 -151 18 23 30 4419 3616 4 MP DP +c19 + +45 -9 -161 -308 -50 19 3683 3272 4 MP PP +c0 + +45 -9 -161 -308 -50 19 3683 3272 4 MP DP +c11 + +2 53 -238 -9 14 -52 3569 2061 4 MP PP +c0 + +2 53 -238 -9 14 -52 3569 2061 4 MP DP +c20 + +-17 -35 -337 173 34 28 4954 3789 4 MP PP +c0 + +-17 -35 -337 173 34 28 4954 3789 4 MP DP +c21 + +-45 -28 -174 190 52 18 4779 3372 4 MP PP +c0 + +-45 -28 -174 190 52 18 4779 3372 4 MP DP +c16 + +24 -27 -410 -101 -7 29 4242 4038 4 MP PP +c0 + +24 -27 -410 -101 -7 29 4242 4038 4 MP DP +c15 + +30 -18 -200 -135 -22 27 4144 3590 4 MP PP +c0 + +30 -18 -200 -135 -22 27 4144 3590 4 MP DP +c24 + +53 -34 -214 -135 -63 26 4443 2433 4 MP PP +c0 + +53 -34 -214 -135 -63 26 4443 2433 4 MP DP +c24 + +15 -50 -256 -159 -25 47 4611 2267 4 MP PP +c0 + +15 -50 -256 -159 -25 47 4611 2267 4 MP DP +c23 + +-53 -25 -163 310 62 19 5296 3210 4 MP PP +c0 + +-53 -25 -163 310 62 19 5296 3210 4 MP DP +c12 + +9 40 -266 130 -7 -36 2712 2464 4 MP PP +c0 + +9 40 -266 130 -7 -36 2712 2464 4 MP DP +c19 + +47 -20 -207 -348 -34 18 3227 3466 4 MP PP +c0 + +47 -20 -207 -348 -34 18 3227 3466 4 MP DP +c13 + +-46 12 -329 -83 59 -6 4078 1899 4 MP PP +c0 + +-46 12 -329 -83 59 -6 4078 1899 4 MP DP +c23 + +-59 -21 -131 268 60 11 4961 3132 4 MP PP +c0 + +-59 -21 -131 268 60 11 4961 3132 4 MP DP +c22 + +56 -6 -107 -358 -62 16 3417 2996 4 MP PP +c0 + +56 -6 -107 -358 -62 16 3417 2996 4 MP DP +c20 + +-23 -30 -170 94 38 21 4574 3531 4 MP PP +c0 + +-23 -30 -170 94 38 21 4574 3531 4 MP DP +c13 + +30 30 -206 -48 -32 -33 3842 2326 4 MP PP +c0 + +30 30 -206 -48 -32 -33 3842 2326 4 MP DP +c22 + +60 -19 -138 -388 -47 20 3033 3116 4 MP PP +c0 + +60 -19 -138 -388 -47 20 3033 3116 4 MP DP +/c25 { 1.000000 0.937500 0.000000 sc} bdef +c25 + +-71 -18 -74 331 74 10 5229 2851 4 MP PP +c0 + +-71 -18 -74 331 74 10 5229 2851 4 MP DP +c17 + +34 -18 -273 -289 -25 18 3491 3755 4 MP PP +c0 + +34 -18 -273 -289 -25 18 3491 3755 4 MP DP +c21 + +-34 -28 -251 256 44 22 5195 3539 4 MP PP +c0 + +-34 -28 -251 256 44 22 5195 3539 4 MP DP +c18 + +7 -29 -427 50 11 27 4651 3990 4 MP PP +c0 + +7 -29 -427 50 11 27 4651 3990 4 MP DP +c24 + +58 -25 -205 -127 -67 17 4380 2459 4 MP PP +c0 + +58 -25 -205 -127 -67 17 4380 2459 4 MP DP +c25 + +-67 -18 -79 338 72 11 5303 2861 4 MP PP +c0 + +-67 -18 -79 338 72 11 5303 2861 4 MP DP +c24 + +3 -48 -266 -162 -12 49 4623 2218 4 MP PP +c0 + +3 -48 -266 -162 -12 49 4623 2218 4 MP DP +c25 + +-70 -17 -71 323 71 7 5158 2844 4 MP PP +c0 + +-70 -17 -71 323 71 7 5158 2844 4 MP DP +c14 + +-36 23 -227 161 37 -14 2366 2699 4 MP PP +c0 + +-36 23 -227 161 37 -14 2366 2699 4 MP DP +c14 + +24 -30 -296 221 -27 22 1931 2305 4 MP PP +c0 + +24 -30 -296 221 -27 22 1931 2305 4 MP DP +c12 + +57 13 -323 166 -49 -22 2439 2147 4 MP PP +c0 + +57 13 -323 166 -49 -22 2439 2147 4 MP DP +c17 + +30 -9 -198 -224 -30 18 3952 3464 4 MP PP +c0 + +30 -9 -198 -224 -30 18 3952 3464 4 MP DP +c15 + +25 -18 -342 -211 -17 18 3825 3966 4 MP PP +c0 + +25 -18 -342 -211 -17 18 3825 3966 4 MP DP +c25 + +-62 -19 -86 345 69 12 5375 2872 4 MP PP +c0 + +-62 -19 -86 345 69 12 5375 2872 4 MP DP +c21 + +-38 -21 -167 180 43 12 4736 3360 4 MP PP +c0 + +-38 -21 -167 180 43 12 4736 3360 4 MP DP +c23 + +-44 -22 -172 314 53 18 5358 3229 4 MP PP +c0 + +-44 -22 -172 314 53 18 5358 3229 4 MP DP +/c26 { 0.031250 1.000000 0.000000 sc} bdef +c26 + +73 -11 -70 -389 -70 18 3044 2692 4 MP PP +c0 + +73 -11 -70 -389 -70 18 3044 2692 4 MP DP +c16 + +14 -18 -148 -41 1 23 4291 3608 4 MP PP +c0 + +14 -18 -148 -41 1 23 4291 3608 4 MP DP +c19 + +33 -4 -166 -298 -41 14 3724 3258 4 MP PP +c0 + +33 -4 -166 -298 -41 14 3724 3258 4 MP DP +c25 + +-67 -14 -70 313 65 5 5093 2839 4 MP PP +c0 + +-67 -14 -70 313 65 5 5093 2839 4 MP DP +c12 + +21 42 -270 129 -17 -41 2705 2428 4 MP PP +c0 + +21 42 -270 129 -17 -41 2705 2428 4 MP DP +c20 + +-11 -27 -349 177 23 23 4988 3817 4 MP PP +c0 + +-11 -27 -349 177 23 23 4988 3817 4 MP DP +c18 + +-1 -23 -127 15 20 22 4399 3594 4 MP PP +c0 + +-1 -23 -127 15 20 22 4399 3594 4 MP DP +c23 + +-52 -18 -130 258 52 8 4909 3124 4 MP PP +c0 + +-52 -18 -130 258 52 8 4909 3124 4 MP DP +c26 + +72 -14 -76 -394 -66 19 2974 2710 4 MP PP +c0 + +72 -14 -76 -394 -66 19 2974 2710 4 MP DP +c24 + +59 -16 -197 -119 -67 8 4313 2476 4 MP PP +c0 + +59 -16 -197 -119 -67 8 4313 2476 4 MP DP +c26 + +70 -7 -67 -382 -71 15 3115 2677 4 MP PP +c0 + +70 -7 -67 -382 -71 15 3115 2677 4 MP DP +c24 + +-9 -46 -275 -161 2 46 4621 2172 4 MP PP +c0 + +-9 -46 -275 -161 2 46 4621 2172 4 MP DP +c13 + +-45 22 -316 -77 59 -16 4019 1915 4 MP PP +c0 + +-45 22 -316 -77 59 -16 4019 1915 4 MP DP +c22 + +45 -3 -113 -348 -55 13 3472 2983 4 MP PP +c0 + +45 -3 -113 -348 -55 13 3472 2983 4 MP DP +c13 + +23 38 -208 -46 -21 -40 3810 2293 4 MP PP +c0 + +23 38 -208 -46 -21 -40 3810 2293 4 MP DP +c16 + +17 -18 -420 -102 -7 19 4235 4067 4 MP PP +c0 + +17 -18 -420 -102 -7 19 4235 4067 4 MP DP +c15 + +21 -11 -192 -126 -14 18 4158 3572 4 MP PP +c0 + +21 -11 -192 -126 -14 18 4158 3572 4 MP DP +c22 + +50 -18 -153 -386 -35 16 2986 3136 4 MP PP +c0 + +50 -18 -153 -386 -35 16 2986 3136 4 MP DP +c19 + +35 -16 -219 -346 -23 14 3193 3484 4 MP PP +c0 + +35 -16 -219 -346 -23 14 3193 3484 4 MP DP +c20 + +-20 -22 -155 85 30 14 4544 3517 4 MP PP +c0 + +-20 -22 -155 85 30 14 4544 3517 4 MP DP +c12 + +59 21 -315 157 -50 -30 2489 2177 4 MP PP +c0 + +59 21 -315 157 -50 -30 2489 2177 4 MP DP +c26 + +68 -16 -84 -397 -60 19 2908 2729 4 MP PP +c0 + +68 -16 -84 -397 -60 19 2908 2729 4 MP DP +c26 + +65 -4 -68 -374 -69 13 3184 2664 4 MP PP +c0 + +65 -4 -68 -374 -69 13 3184 2664 4 MP DP +c21 + +-23 -23 -261 260 33 19 5239 3561 4 MP PP +c0 + +-23 -23 -261 260 33 19 5239 3561 4 MP DP +c25 + +-53 -18 -94 350 61 13 5444 2884 4 MP PP +c0 + +-53 -18 -94 350 61 13 5444 2884 4 MP DP +c17 + +23 -14 -281 -285 -15 10 3466 3773 4 MP PP +c0 + +23 -14 -281 -285 -15 10 3466 3773 4 MP DP +c12 + +31 44 -275 129 -26 -44 2688 2387 4 MP PP +c0 + +31 44 -275 129 -26 -44 2688 2387 4 MP DP +c25 + +-60 -11 -72 304 58 3 5035 2836 4 MP PP +c0 + +-60 -11 -72 304 58 3 5035 2836 4 MP DP +c18 + +7 -19 -438 50 4 19 4662 4017 4 MP PP +c0 + +7 -19 -438 50 4 19 4662 4017 4 MP DP +c14 + +-25 30 -229 153 27 -22 2403 2685 4 MP PP +c0 + +-25 30 -229 153 27 -22 2403 2685 4 MP DP +c14 + +36 -24 -299 213 -37 14 1968 2291 4 MP PP +c0 + +36 -24 -299 213 -37 14 1968 2291 4 MP DP +c24 + +59 -6 -192 -110 -64 -3 4246 2484 4 MP PP +c0 + +59 -6 -192 -110 -64 -3 4246 2484 4 MP DP +/c27 { 1.000000 0.843750 0.000000 sc} bdef +c27 + +-72 -11 -12 346 75 3 5312 2523 4 MP PP +c0 + +-72 -11 -12 346 75 3 5312 2523 4 MP DP +c24 + +-22 -40 -282 -161 16 43 4605 2129 4 MP PP +c0 + +-22 -40 -282 -161 16 43 4605 2129 4 MP DP +c27 + +-74 -10 -9 338 74 0 5238 2523 4 MP PP +c0 + +-74 -10 -9 338 74 0 5238 2523 4 MP DP +c13 + +-42 31 -302 -71 58 -25 3961 1940 4 MP PP +c0 + +-42 31 -302 -71 58 -25 3961 1940 4 MP DP +c13 + +13 45 -211 -46 -10 -45 3789 2253 4 MP PP +c0 + +13 45 -211 -46 -10 -45 3789 2253 4 MP DP +c23 + +-33 -19 -182 317 43 16 5411 3247 4 MP PP +c0 + +-33 -19 -182 317 43 16 5411 3247 4 MP DP +c12 + +58 29 -306 148 -50 -37 2539 2214 4 MP PP +c0 + +58 29 -306 148 -50 -37 2539 2214 4 MP DP +c17 + +17 -3 -198 -215 -21 11 3973 3453 4 MP PP +c0 + +17 -3 -198 -215 -21 11 3973 3453 4 MP DP +c15 + +15 -10 -347 -210 -10 9 3808 3984 4 MP PP +c0 + +15 -10 -347 -210 -10 9 3808 3984 4 MP DP +c27 + +-69 -12 -15 353 72 5 5387 2526 4 MP PP +c0 + +-69 -12 -15 353 72 5 5387 2526 4 MP DP +c21 + +-30 -14 -162 171 32 7 4704 3353 4 MP PP +c0 + +-30 -14 -162 171 32 7 4704 3353 4 MP DP +c23 + +-43 -12 -130 248 40 5 4869 3119 4 MP PP +c0 + +-43 -12 -130 248 40 5 4869 3119 4 MP DP +c12 + +42 43 -282 131 -35 -45 2662 2343 4 MP PP +c0 + +42 43 -282 131 -35 -45 2662 2343 4 MP DP +/c28 { 0.968750 0.000000 1.000000 sc} bdef +c28 + +-64 -28 -184 214 57 35 1731 2793 4 MP PP +c0 + +-64 -28 -184 214 57 35 1731 2793 4 MP DP +c26 + +61 -18 -95 -397 -50 18 2848 2748 4 MP PP +c0 + +61 -18 -95 -397 -50 18 2848 2748 4 MP DP +c28 + +-57 -34 -191 221 50 39 1681 2754 4 MP PP +c0 + +-57 -34 -191 221 50 39 1681 2754 4 MP DP +c26 + +57 0 -72 -365 -64 10 3248 2654 4 MP PP +c0 + +57 0 -72 -365 -64 10 3248 2654 4 MP DP +c27 + +-71 -7 -9 328 69 -2 5169 2525 4 MP PP +c0 + +-71 -7 -9 328 69 -2 5169 2525 4 MP DP +c22 + +33 2 -123 -338 -45 9 3517 2974 4 MP PP +c0 + +33 2 -123 -338 -45 9 3517 2974 4 MP DP +c19 + +21 0 -174 -288 -30 9 3754 3249 4 MP PP +c0 + +21 0 -174 -288 -30 9 3754 3249 4 MP DP +c12 + +55 36 -298 140 -47 -41 2586 2255 4 MP PP +c0 + +55 36 -298 140 -47 -41 2586 2255 4 MP DP +c20 + +-4 -19 -359 181 14 15 5011 3840 4 MP PP +c0 + +-4 -19 -359 181 14 15 5011 3840 4 MP DP +c16 + +6 -10 -133 -36 2 13 4289 3595 4 MP PP +c0 + +6 -10 -133 -36 2 13 4289 3595 4 MP DP +c28 + +-67 -20 -179 206 62 28 1788 2828 4 MP PP +c0 + +-67 -20 -179 206 62 28 1788 2828 4 MP DP +c12 + +49 39 -290 135 -41 -43 2627 2298 4 MP PP +c0 + +49 39 -290 135 -41 -43 2627 2298 4 MP DP +c18 + +-2 -13 -108 14 13 11 4386 3583 4 MP PP +c0 + +-2 -13 -108 14 13 11 4386 3583 4 MP DP +c28 + +-47 -39 -198 226 39 42 1642 2712 4 MP PP +c0 + +-47 -39 -198 226 39 42 1642 2712 4 MP DP +c22 + +38 -17 -168 -382 -23 13 2951 3152 4 MP PP +c0 + +38 -17 -168 -382 -23 13 2951 3152 4 MP DP +c25 + +-43 -16 -103 353 52 13 5505 2897 4 MP PP +c0 + +-43 -16 -103 353 52 13 5505 2897 4 MP DP +c16 + +10 -9 -425 -102 -5 9 4228 4086 4 MP PP +c0 + +10 -9 -425 -102 -5 9 4228 4086 4 MP DP +c13 + +-37 39 -286 -65 53 -34 3908 1974 4 MP PP +c0 + +-37 39 -286 -65 53 -34 3908 1974 4 MP DP +c13 + +5 49 -219 -46 3 -49 3779 2208 4 MP PP +c0 + +5 49 -219 -46 3 -49 3779 2208 4 MP DP +c15 + +8 -4 -185 -119 -6 10 4164 3562 4 MP PP +c0 + +8 -4 -185 -119 -6 10 4164 3562 4 MP DP +c27 + +-61 -13 -22 359 68 7 5459 2531 4 MP PP +c0 + +-61 -13 -22 359 68 7 5459 2531 4 MP DP +c19 + +23 -13 -233 -341 -9 8 3170 3498 4 MP PP +c0 + +23 -13 -233 -341 -9 8 3170 3498 4 MP DP +c24 + +56 5 -189 -102 -59 -13 4182 2481 4 MP PP +c0 + +56 5 -189 -102 -59 -13 4182 2481 4 MP DP +c25 + +-52 -8 -74 296 46 -1 4989 2837 4 MP PP +c0 + +-52 -8 -74 296 46 -1 4989 2837 4 MP DP +c24 + +-32 -33 -288 -158 30 38 4575 2091 4 MP PP +c0 + +-32 -33 -288 -158 30 38 4575 2091 4 MP DP +c20 + +-13 -11 -145 77 20 8 4524 3509 4 MP PP +c0 + +-13 -11 -145 77 20 8 4524 3509 4 MP DP +c28 + +-69 -10 -174 196 64 20 1850 2856 4 MP PP +c0 + +-69 -10 -174 196 64 20 1850 2856 4 MP DP +c21 + +-14 -15 -268 261 21 14 5272 3580 4 MP PP +c0 + +-14 -15 -268 261 21 14 5272 3580 4 MP DP +c27 + +-65 -5 -11 319 62 -4 5107 2529 4 MP PP +c0 + +-65 -5 -11 319 62 -4 5107 2529 4 MP DP +c28 + +-36 -44 -206 229 28 44 1614 2668 4 MP PP +c0 + +-36 -44 -206 229 28 44 1614 2668 4 MP DP +c14 + +-11 37 -233 145 15 -29 2430 2663 4 MP PP +c0 + +-11 37 -233 145 15 -29 2430 2663 4 MP DP +c14 + +47 -15 -300 203 -46 5 2014 2286 4 MP PP +c0 + +47 -15 -300 203 -46 5 2014 2286 4 MP DP +c13 + +-31 46 -270 -60 46 -40 3862 2014 4 MP PP +c0 + +-31 46 -270 -60 46 -40 3862 2014 4 MP DP +c13 + +-6 52 -229 -48 16 -50 3782 2159 4 MP PP +c0 + +-6 52 -229 -48 16 -50 3782 2159 4 MP DP +c17 + +9 -8 -288 -281 -2 4 3451 3783 4 MP PP +c0 + +9 -8 -288 -281 -2 4 3451 3783 4 MP DP +c26 + +52 -19 -109 -395 -38 17 2798 2766 4 MP PP +c0 + +52 -19 -109 -395 -38 17 2798 2766 4 MP DP +c18 + +5 -9 -442 51 -1 8 4666 4036 4 MP PP +c0 + +5 -9 -442 51 -1 8 4666 4036 4 MP DP +c26 + +46 4 -79 -355 -56 6 3304 2648 4 MP PP +c0 + +46 4 -79 -355 -56 6 3304 2648 4 MP DP +c23 + +-21 -14 -190 317 29 14 5454 3263 4 MP PP +c0 + +-21 -14 -190 317 29 14 5454 3263 4 MP DP +c13 + +-24 49 -255 -54 37 -46 3825 2060 4 MP PP +c0 + +-24 49 -255 -54 37 -46 3825 2060 4 MP DP +c13 + +-14 52 -242 -51 27 -49 3798 2109 4 MP PP +c0 + +-14 52 -242 -51 27 -49 3798 2109 4 MP DP +c28 + +-67 -2 -171 186 64 12 1914 2876 4 MP PP +c0 + +-67 -2 -171 186 64 12 1914 2876 4 MP DP +c23 + +-32 -7 -133 241 28 0 4841 3119 4 MP PP +c0 + +-32 -7 -133 241 28 0 4841 3119 4 MP DP +c17 + +4 2 -202 -207 -8 4 3981 3449 4 MP PP +c0 + +4 2 -202 -207 -8 4 3981 3449 4 MP DP +c27 + +-52 -13 -29 364 59 8 5527 2538 4 MP PP +c0 + +-52 -13 -29 364 59 8 5527 2538 4 MP DP +c21 + +-20 -8 -160 164 20 2 4684 3351 4 MP PP +c0 + +-20 -8 -160 164 20 2 4684 3351 4 MP DP +c28 + +-24 -44 -214 229 16 43 1598 2625 4 MP PP +c0 + +-24 -44 -214 229 16 43 1598 2625 4 MP DP +c15 + +2 -4 -348 -206 -1 0 3798 3993 4 MP PP +c0 + +2 -4 -348 -206 -1 0 3798 3993 4 MP DP +c22 + +19 5 -135 -327 -33 4 3550 2970 4 MP PP +c0 + +19 5 -135 -327 -33 4 3550 2970 4 MP DP +c24 + +49 15 -186 -95 -52 -22 4123 2468 4 MP PP +c0 + +49 15 -186 -95 -52 -22 4123 2468 4 MP DP +c24 + +-42 -25 -290 -153 41 31 4534 2060 4 MP PP +c0 + +-42 -25 -290 -153 41 31 4534 2060 4 MP DP +c25 + +-29 -14 -114 354 40 13 5557 2910 4 MP PP +c0 + +-29 -14 -114 354 40 13 5557 2910 4 MP DP +c19 + +6 5 -183 -279 -17 3 3771 3246 4 MP PP +c0 + +6 5 -183 -279 -17 3 3771 3246 4 MP DP +c20 + +1 -8 -362 180 2 9 5025 3855 4 MP PP +c0 + +1 -8 -362 180 2 9 5025 3855 4 MP DP +c27 + +-58 -3 -14 310 51 -6 5056 2535 4 MP PP +c0 + +-58 -3 -14 310 51 -6 5056 2535 4 MP DP +c22 + +25 -15 -185 -376 -8 9 2928 3165 4 MP PP +c0 + +25 -15 -185 -376 -8 9 2928 3165 4 MP DP +c16 + +-1 0 -125 -33 4 2 4285 3593 4 MP PP +c0 + +-1 0 -125 -33 4 2 4285 3593 4 MP DP +/c29 { 0.000000 1.000000 0.062500 sc} bdef +c29 + +74 -8 -47 -370 -72 14 2904 2321 4 MP PP +c0 + +74 -8 -47 -370 -72 14 2904 2321 4 MP DP +c18 + +-4 -2 -97 12 8 2 4378 3581 4 MP PP +c0 + +-4 -2 -97 12 8 2 4378 3581 4 MP DP +/c30 { 1.000000 0.750000 0.000000 sc} bdef +c30 + +-75 -3 51 329 74 -8 5262 2205 4 MP PP +c0 + +-75 -3 51 329 74 -8 5262 2205 4 MP DP +c25 + +-40 -5 -80 287 33 -3 4956 2840 4 MP PP +c0 + +-40 -5 -80 287 33 -3 4956 2840 4 MP DP +c29 + +72 -3 -45 -364 -73 11 2977 2310 4 MP PP +c0 + +72 -3 -45 -364 -73 11 2977 2310 4 MP DP +c14 + +2 40 -238 141 3 -36 2445 2634 4 MP PP +c0 + +2 40 -238 141 3 -36 2445 2634 4 MP DP +c30 + +-72 -5 49 337 74 -3 5336 2197 4 MP PP +c0 + +-72 -5 49 337 74 -3 5336 2197 4 MP DP +c14 + +55 -6 -299 193 -53 -5 2067 2291 4 MP PP +c0 + +55 -6 -299 193 -53 -5 2067 2291 4 MP DP +c29 + +73 -11 -52 -375 -68 16 2832 2335 4 MP PP +c0 + +73 -11 -52 -375 -68 16 2832 2335 4 MP DP +c30 + +-74 0 50 318 71 -9 5191 2214 4 MP PP +c0 + +-74 0 50 318 71 -9 5191 2214 4 MP DP +c16 + +1 0 -422 -100 -4 -2 4223 4095 4 MP PP +c0 + +1 0 -422 -100 -4 -2 4223 4095 4 MP DP +c15 + +-2 3 -183 -113 1 0 4163 3562 4 MP PP +c0 + +-2 3 -183 -113 1 0 4163 3562 4 MP DP +c19 + +8 -9 -245 -334 4 2 3161 3506 4 MP PP +c0 + +8 -9 -245 -334 4 2 3161 3506 4 MP DP +c28 + +-62 8 -170 175 61 3 1978 2888 4 MP PP +c0 + +-62 8 -170 175 61 3 1978 2888 4 MP DP +c20 + +-8 -2 -138 74 9 -1 4515 3510 4 MP PP +c0 + +-8 -2 -138 74 9 -1 4515 3510 4 MP DP +c21 + +-2 -9 -273 260 7 10 5293 3594 4 MP PP +c0 + +-2 -9 -273 260 7 10 5293 3594 4 MP DP +c26 + +39 -18 -123 -392 -25 15 2760 2783 4 MP PP +c0 + +39 -18 -123 -392 -25 15 2760 2783 4 MP DP +c28 + +-9 -45 -222 228 2 41 1596 2584 4 MP PP +c0 + +-9 -45 -222 228 2 41 1596 2584 4 MP DP +c26 + +33 7 -89 -345 -45 3 3349 2645 4 MP PP +c0 + +33 7 -89 -345 -45 3 3349 2645 4 MP DP +c29 + +68 1 -46 -356 -70 7 3047 2303 4 MP PP +c0 + +68 1 -46 -356 -70 7 3047 2303 4 MP DP +c30 + +-68 -7 47 345 70 -1 5410 2194 4 MP PP +c0 + +-68 -7 47 345 70 -1 5410 2194 4 MP DP +c29 + +67 -16 -58 -377 -61 18 2764 2351 4 MP PP +c0 + +67 -16 -58 -377 -61 18 2764 2351 4 MP DP +c30 + +-69 2 47 309 66 -13 5125 2227 4 MP PP +c0 + +-69 2 47 309 66 -13 5125 2227 4 MP DP +c27 + +-40 -13 -38 367 49 10 5586 2546 4 MP PP +c0 + +-40 -13 -38 367 49 10 5586 2546 4 MP DP +c17 + +-4 -2 -293 -275 9 -4 3449 3787 4 MP PP +c0 + +-4 -2 -293 -275 9 -4 3449 3787 4 MP DP +c24 + +43 25 -188 -90 -41 -30 4071 2446 4 MP PP +c0 + +43 25 -188 -90 -41 -30 4071 2446 4 MP DP +c18 + +4 2 -438 51 -8 -2 4665 4044 4 MP PP +c0 + +4 2 -438 51 -8 -2 4665 4044 4 MP DP +c24 + +-50 -15 -291 -147 51 22 4483 2038 4 MP PP +c0 + +-50 -15 -291 -147 51 22 4483 2038 4 MP DP +c23 + +-7 -10 -199 317 16 10 5483 3277 4 MP PP +c0 + +-7 -10 -199 317 16 10 5483 3277 4 MP DP +c23 + +-20 -2 -137 234 14 -3 4827 3122 4 MP PP +c0 + +-20 -2 -137 234 14 -3 4827 3122 4 MP DP +c27 + +-46 1 -21 301 39 -8 5017 2543 4 MP PP +c0 + +-46 1 -21 301 39 -8 5017 2543 4 MP DP +c17 + +-10 8 -206 -201 2 -3 3979 3452 4 MP PP +c0 + +-10 8 -206 -201 2 -3 3979 3452 4 MP DP +c14 + +15 44 -244 137 -9 -40 2448 2598 4 MP PP +c0 + +15 44 -244 137 -9 -40 2448 2598 4 MP DP +c21 + +-9 1 -160 158 6 -4 4678 3355 4 MP PP +c0 + +-9 1 -160 158 6 -4 4678 3355 4 MP DP +c14 + +60 3 -297 182 -57 -13 2124 2304 4 MP PP +c0 + +60 3 -297 182 -57 -13 2124 2304 4 MP DP +c22 + +4 9 -149 -318 -21 0 3571 2970 4 MP PP +c0 + +4 9 -149 -318 -21 0 3571 2970 4 MP DP +c25 + +-16 -10 -125 353 27 11 5597 2923 4 MP PP +c0 + +-16 -10 -125 353 27 11 5597 2923 4 MP DP +c28 + +-54 17 -171 165 55 -7 2039 2891 4 MP PP +c0 + +-54 17 -171 165 55 -7 2039 2891 4 MP DP +c15 + +-9 4 -346 -201 7 -9 3797 3993 4 MP PP +c0 + +-9 4 -346 -201 7 -9 3797 3993 4 MP DP +c29 + +60 6 -48 -348 -65 4 3112 2299 4 MP PP +c0 + +60 6 -48 -348 -65 4 3112 2299 4 MP DP +c30 + +-59 -8 43 350 63 3 5480 2193 4 MP PP +c0 + +-59 -8 43 350 63 3 5480 2193 4 MP DP +c19 + +-9 9 -194 -271 -4 -2 3775 3248 4 MP PP +c0 + +-9 9 -194 -271 -4 -2 3775 3248 4 MP DP +c29 + +59 -18 -65 -378 -52 19 2703 2369 4 MP PP +c0 + +59 -18 -65 -378 -52 19 2703 2369 4 MP DP +c30 + +-62 4 44 298 57 -14 5068 2241 4 MP PP +c0 + +-62 4 44 298 57 -14 5068 2241 4 MP DP +c20 + +8 2 -361 178 -9 0 5027 3864 4 MP PP +c0 + +8 2 -361 178 -9 0 5027 3864 4 MP DP +c22 + +11 -12 -202 -369 6 5 2920 3174 4 MP PP +c0 + +11 -12 -202 -369 6 5 2920 3174 4 MP DP +c28 + +5 -42 -229 224 -12 36 1608 2548 4 MP PP +c0 + +5 -42 -229 224 -12 36 1608 2548 4 MP DP +c25 + +-28 0 -87 279 20 -5 4936 2845 4 MP PP +c0 + +-28 0 -87 279 20 -5 4936 2845 4 MP DP +c16 + +-9 9 -122 -31 6 -8 4279 3601 4 MP PP +c0 + +-9 9 -122 -31 6 -8 4279 3601 4 MP DP +c18 + +-6 8 -93 12 2 -8 4376 3589 4 MP PP +c0 + +-6 8 -93 12 2 -8 4376 3589 4 MP DP +c16 + +-7 9 -412 -96 -3 -13 4219 4093 4 MP PP +c0 + +-7 9 -412 -96 -3 -13 4219 4093 4 MP DP +c24 + +32 33 -191 -85 -29 -38 4030 2416 4 MP PP +c0 + +32 33 -191 -85 -29 -38 4030 2416 4 MP DP +c24 + +-56 -5 -290 -140 59 12 4424 2026 4 MP PP +c0 + +-56 -5 -290 -140 59 12 4424 2026 4 MP DP +c15 + +-15 11 -184 -110 9 -9 4154 3571 4 MP PP +c0 + +-15 11 -184 -110 9 -9 4154 3571 4 MP DP +c19 + +-6 -5 -256 -326 17 -3 3165 3508 4 MP PP +c0 + +-6 -5 -256 -326 17 -3 3165 3508 4 MP DP +c26 + +26 -18 -138 -386 -11 12 2735 2798 4 MP PP +c0 + +26 -18 -138 -386 -11 12 2735 2798 4 MP DP +c20 + +-2 8 -137 71 -2 -8 4517 3518 4 MP PP +c0 + +-2 8 -137 71 -2 -8 4517 3518 4 MP DP +c26 + +19 11 -101 -335 -33 -2 3382 2647 4 MP PP +c0 + +19 11 -101 -335 -33 -2 3382 2647 4 MP DP +c14 + +28 43 -251 136 -21 -42 2439 2558 4 MP PP +c0 + +28 43 -251 136 -21 -42 2439 2558 4 MP DP +c14 + +64 12 -294 172 -59 -21 2183 2325 4 MP PP +c0 + +64 12 -294 172 -59 -21 2183 2325 4 MP DP +c21 + +9 0 -276 257 -6 3 5300 3604 4 MP PP +c0 + +9 0 -276 257 -6 3 5300 3604 4 MP DP +c27 + +-27 -11 -47 367 36 11 5635 2556 4 MP PP +c0 + +-27 -11 -47 367 36 11 5635 2556 4 MP DP +c29 + +51 10 -53 -338 -57 0 3169 2299 4 MP PP +c0 + +51 10 -53 -338 -57 0 3169 2299 4 MP DP +c28 + +-45 25 -172 155 46 -15 2094 2884 4 MP PP +c0 + +-45 25 -172 155 46 -15 2094 2884 4 MP DP +c17 + +-17 3 -296 -266 20 -12 3458 3783 4 MP PP +c0 + +-17 3 -296 -266 20 -12 3458 3783 4 MP DP +c30 + +-49 -10 38 354 54 6 5543 2196 4 MP PP +c0 + +-49 -10 38 354 54 6 5543 2196 4 MP DP +c18 + +3 13 -427 50 -14 -12 4657 4042 4 MP PP +c0 + +3 13 -427 50 -14 -12 4657 4042 4 MP DP +c23 + +6 -3 -206 312 1 8 5499 3287 4 MP PP +c0 + +6 -3 -206 312 1 8 5499 3287 4 MP DP +c29 + +49 -20 -75 -376 -39 18 2651 2388 4 MP PP +c0 + +49 -20 -75 -376 -39 18 2651 2388 4 MP DP +c27 + +-33 3 -28 294 25 -10 4992 2553 4 MP PP +c0 + +-33 3 -28 294 25 -10 4992 2553 4 MP DP +c30 + +-51 6 39 288 45 -16 5023 2257 4 MP PP +c0 + +-51 6 39 288 45 -16 5023 2257 4 MP DP +c28 + +19 -38 -236 218 -24 30 1632 2518 4 MP PP +c0 + +19 -38 -236 218 -24 30 1632 2518 4 MP DP +c23 + +-6 4 -143 229 -2 -7 4829 3129 4 MP PP +c0 + +-6 4 -143 229 -2 -7 4829 3129 4 MP DP +c14 + +40 43 -260 137 -31 -44 2418 2516 4 MP PP +c0 + +40 43 -260 137 -31 -44 2418 2516 4 MP DP +c14 + +65 20 -289 163 -58 -29 2241 2354 4 MP PP +c0 + +65 20 -289 163 -58 -29 2241 2354 4 MP DP +c17 + +-23 14 -214 -196 15 -11 3964 3463 4 MP PP +c0 + +-23 14 -214 -196 15 -11 3964 3463 4 MP DP +c24 + +21 40 -196 -82 -16 -43 4001 2378 4 MP PP +c0 + +21 40 -196 -82 -16 -43 4001 2378 4 MP DP +c21 + +2 8 -163 155 -8 -9 4686 3364 4 MP PP +c0 + +2 8 -163 155 -8 -9 4686 3364 4 MP DP +c24 + +-59 6 -287 -133 65 3 4359 2023 4 MP PP +c0 + +-59 6 -287 -133 65 3 4359 2023 4 MP DP +c25 + +-1 -8 -135 351 11 10 5624 2934 4 MP PP +c0 + +-1 -8 -135 351 11 10 5624 2934 4 MP DP +c22 + +-11 12 -166 -309 -6 -5 3577 2975 4 MP PP +c0 + +-11 12 -166 -309 -6 -5 3577 2975 4 MP DP +c15 + +-20 12 -340 -194 14 -19 3804 3984 4 MP PP +c0 + +-20 12 -340 -194 14 -19 3804 3984 4 MP DP +/c31 { 1.000000 0.656250 0.000000 sc} bdef +c31 + +-74 8 116 290 71 -19 5149 1926 4 MP PP +c0 + +-74 8 116 290 71 -19 5149 1926 4 MP DP +c31 + +-74 3 120 301 70 -14 5220 1907 4 MP PP +c0 + +-74 3 120 301 70 -14 5220 1907 4 MP DP +c19 + +-22 13 -207 -264 10 -8 3765 3256 4 MP PP +c0 + +-22 13 -207 -264 10 -8 3765 3256 4 MP DP +c31 + +-71 9 113 279 66 -22 5083 1948 4 MP PP +c0 + +-71 9 113 279 66 -22 5083 1948 4 MP DP +c14 + +49 39 -267 141 -42 -43 2387 2472 4 MP PP +c0 + +49 39 -267 141 -42 -43 2387 2472 4 MP DP +c14 + +62 28 -282 154 -55 -36 2296 2390 4 MP PP +c0 + +62 28 -282 154 -55 -36 2296 2390 4 MP DP +c20 + +14 12 -355 173 -20 -7 5018 3864 4 MP PP +c0 + +14 12 -355 173 -20 -7 5018 3864 4 MP DP +c22 + +-4 -9 -218 -361 20 1 2926 3179 4 MP PP +c0 + +-4 -9 -218 -361 20 1 2926 3179 4 MP DP +c25 + +-14 3 -95 274 3 -8 4933 2853 4 MP PP +c0 + +-14 3 -95 274 3 -8 4933 2853 4 MP DP +c16 + +-17 18 -125 -30 7 -20 4272 3621 4 MP PP +c0 + +-17 18 -125 -30 7 -20 4272 3621 4 MP DP +c18 + +-7 20 -97 12 -5 -18 4381 3607 4 MP PP +c0 + +-7 20 -97 12 -5 -18 4381 3607 4 MP DP +c14 + +57 34 -275 146 -49 -39 2345 2429 4 MP PP +c0 + +57 34 -275 146 -49 -39 2345 2429 4 MP DP +c16 + +-14 19 -397 -92 -1 -23 4216 4080 4 MP PP +c0 + +-14 19 -397 -92 -1 -23 4216 4080 4 MP DP +c15 + +-25 17 -190 -108 17 -18 4137 3589 4 MP PP +c0 + +-25 17 -190 -108 17 -18 4137 3589 4 MP DP +c31 + +-70 1 121 310 69 -10 5290 1893 4 MP PP +c0 + +-70 1 121 310 69 -10 5290 1893 4 MP DP +c19 + +-20 -1 -265 -316 29 -9 3182 3505 4 MP PP +c0 + +-20 -1 -265 -316 29 -9 3182 3505 4 MP DP +c26 + +12 -16 -154 -379 4 9 2724 2810 4 MP PP +c0 + +12 -16 -154 -379 4 9 2724 2810 4 MP DP +c28 + +-32 32 -176 146 36 -23 2140 2869 4 MP PP +c0 + +-32 32 -176 146 36 -23 2140 2869 4 MP DP +c29 + +37 14 -59 -328 -46 -4 3215 2303 4 MP PP +c0 + +37 14 -59 -328 -46 -4 3215 2303 4 MP DP +c26 + +3 14 -115 -326 -19 -5 3401 2652 4 MP PP +c0 + +3 14 -115 -326 -19 -5 3401 2652 4 MP DP +c20 + +5 18 -141 71 -13 -16 4530 3534 4 MP PP +c0 + +5 18 -141 71 -13 -16 4530 3534 4 MP DP +c27 + +-11 -10 -57 365 21 12 5671 2567 4 MP PP +c0 + +-11 -10 -57 365 21 12 5671 2567 4 MP DP +c31 + +-66 13 108 266 59 -25 5024 1973 4 MP PP +c0 + +-66 13 108 266 59 -25 5024 1973 4 MP DP +c24 + +10 45 -204 -80 -2 -47 3985 2335 4 MP PP +c0 + +10 45 -204 -80 -2 -47 3985 2335 4 MP DP +c21 + +20 7 -277 251 -19 -1 5294 3607 4 MP PP +c0 + +20 7 -277 251 -19 -1 5294 3607 4 MP DP +c24 + +-59 16 -281 -124 67 -7 4292 2030 4 MP PP +c0 + +-59 16 -281 -124 67 -7 4292 2030 4 MP DP +c30 + +-36 -11 32 356 42 9 5597 2202 4 MP PP +c0 + +-36 -11 32 356 42 9 5597 2202 4 MP DP +c29 + +37 -21 -86 -373 -26 18 2612 2406 4 MP PP +c0 + +37 -21 -86 -373 -26 18 2612 2406 4 MP DP +c28 + +33 -32 -241 210 -36 24 1668 2494 4 MP PP +c0 + +33 -32 -241 210 -36 24 1668 2494 4 MP DP +c30 + +-39 8 33 278 32 -16 4991 2273 4 MP PP +c0 + +-39 8 33 278 32 -16 4991 2273 4 MP DP +c17 + +-29 9 -297 -257 30 -18 3478 3771 4 MP PP +c0 + +-29 9 -297 -257 30 -18 3478 3771 4 MP DP +c18 + +1 23 -409 48 -19 -21 4643 4030 4 MP PP +c0 + +1 23 -409 48 -19 -21 4643 4030 4 MP DP +c23 + +19 1 -212 308 -13 3 5500 3295 4 MP PP +c0 + +19 1 -212 308 -13 3 5500 3295 4 MP DP +c27 + +-20 5 -36 287 10 -11 4982 2564 4 MP PP +c0 + +-20 5 -36 287 10 -11 4982 2564 4 MP DP +c31 + +-63 -3 121 317 63 -4 5359 1883 4 MP PP +c0 + +-63 -3 121 317 63 -4 5359 1883 4 MP DP +/c32 { 0.031250 0.000000 1.000000 sc} bdef +c32 + +48 -40 -152 -187 -59 32 4711 2554 4 MP PP +c0 + +48 -40 -152 -187 -59 32 4711 2554 4 MP DP +c17 + +-34 18 -222 -193 25 -17 3939 3480 4 MP PP +c0 + +-34 18 -222 -193 25 -17 3939 3480 4 MP DP +c32 + +57 -34 -143 -178 -66 25 4652 2586 4 MP PP +c0 + +57 -34 -143 -178 -66 25 4652 2586 4 MP DP +c23 + +8 9 -151 226 -15 -11 4844 3140 4 MP PP +c0 + +8 9 -151 226 -15 -11 4844 3140 4 MP DP +c15 + +-30 18 -331 -185 21 -27 3818 3965 4 MP PP +c0 + +-30 18 -331 -185 21 -27 3818 3965 4 MP DP +c32 + +38 -45 -163 -195 -49 39 4760 2515 4 MP PP +c0 + +38 -45 -163 -195 -49 39 4760 2515 4 MP DP +c24 + +-3 49 -212 -81 11 -48 3983 2288 4 MP PP +c0 + +-3 49 -212 -81 11 -48 3983 2288 4 MP DP +c24 + +-58 25 -273 -115 66 -17 4226 2047 4 MP PP +c0 + +-58 25 -273 -115 66 -17 4226 2047 4 MP DP +c21 + +13 16 -169 154 -20 -14 4706 3378 4 MP PP +c0 + +13 16 -169 154 -20 -14 4706 3378 4 MP DP +c22 + +-25 15 -183 -302 9 -9 3568 2984 4 MP PP +c0 + +-25 15 -183 -302 9 -9 3568 2984 4 MP DP +c31 + +-57 14 101 254 50 -26 4974 1999 4 MP PP +c0 + +-57 14 101 254 50 -26 4974 1999 4 MP DP +c25 + +13 -3 -144 346 -4 8 5635 2944 4 MP PP +c0 + +13 -3 -144 346 -4 8 5635 2944 4 MP DP +c32 + +63 -26 -136 -168 -70 16 4586 2611 4 MP PP +c0 + +63 -26 -136 -168 -70 16 4586 2611 4 MP DP +/c33 { 0.000000 1.000000 0.156250 sc} bdef +c33 + +75 -1 -22 -329 -74 8 2859 1957 4 MP PP +c0 + +75 -1 -22 -329 -74 8 2859 1957 4 MP DP +c19 + +-35 17 -219 -259 23 -14 3742 3270 4 MP PP +c0 + +-35 17 -219 -259 23 -14 3742 3270 4 MP DP +c33 + +74 -7 -23 -333 -73 11 2785 1965 4 MP PP +c0 + +74 -7 -23 -333 -73 11 2785 1965 4 MP DP +c16 + +-24 27 -135 -32 7 -29 4265 3650 4 MP PP +c0 + +-24 27 -135 -32 7 -29 4265 3650 4 MP DP +c20 + +19 21 -344 167 -30 -15 4998 3857 4 MP PP +c0 + +19 21 -344 167 -30 -15 4998 3857 4 MP DP +c18 + +-7 29 -109 14 -11 -27 4392 3634 4 MP PP +c0 + +-7 29 -109 14 -11 -27 4392 3634 4 MP DP +c28 + +-19 38 -182 138 25 -30 2176 2846 4 MP PP +c0 + +-19 38 -182 138 25 -30 2176 2846 4 MP DP +c22 + +-19 -6 -232 -350 33 -5 2946 3180 4 MP PP +c0 + +-19 -6 -232 -350 33 -5 2946 3180 4 MP DP +c32 + +25 -47 -174 -201 -38 44 4798 2471 4 MP PP +c0 + +25 -47 -174 -201 -38 44 4798 2471 4 MP DP +c25 + +2 7 -106 269 -11 -10 4944 2863 4 MP PP +c0 + +2 7 -106 269 -11 -10 4944 2863 4 MP DP +c16 + +-21 27 -377 -86 1 -33 4215 4057 4 MP PP +c0 + +-21 27 -377 -86 1 -33 4215 4057 4 MP DP +c33 + +72 6 -21 -322 -72 3 2931 1954 4 MP PP +c0 + +72 6 -21 -322 -72 3 2931 1954 4 MP DP +c15 + +-35 24 -198 -109 24 -27 4113 3616 4 MP PP +c0 + +-35 24 -198 -109 24 -27 4113 3616 4 MP DP +c33 + +70 -12 -26 -337 -67 16 2712 1976 4 MP PP +c0 + +70 -12 -26 -337 -67 16 2712 1976 4 MP DP +c24 + +-16 50 -222 -83 26 -48 3994 2240 4 MP PP +c0 + +-16 50 -222 -83 26 -48 3994 2240 4 MP DP +c24 + +-53 34 -265 -107 63 -26 4163 2073 4 MP PP +c0 + +-53 34 -265 -107 63 -26 4163 2073 4 MP DP +c32 + +67 -17 -132 -157 -71 6 4516 2627 4 MP PP +c0 + +67 -17 -132 -157 -71 6 4516 2627 4 MP DP +c29 + +24 17 -68 -318 -33 -7 3248 2310 4 MP PP +c0 + +24 17 -68 -318 -33 -7 3248 2310 4 MP DP +c19 + +-33 5 -273 -307 41 -14 3211 3496 4 MP PP +c0 + +-33 5 -273 -307 41 -14 3211 3496 4 MP DP +c28 + +44 -25 -244 202 -47 15 1715 2479 4 MP PP +c0 + +44 -25 -244 202 -47 15 1715 2479 4 MP DP +c20 + +11 27 -149 73 -24 -22 4554 3556 4 MP PP +c0 + +11 27 -149 73 -24 -22 4554 3556 4 MP DP +c26 + +-4 -14 -169 -371 19 6 2728 2819 4 MP PP +c0 + +-4 -14 -169 -371 19 6 2728 2819 4 MP DP +c26 + +-11 16 -131 -317 -4 -9 3405 2661 4 MP PP +c0 + +-11 16 -131 -317 -4 -9 3405 2661 4 MP DP +c30 + +-21 -12 25 356 28 12 5639 2211 4 MP PP +c0 + +-21 -12 25 356 28 12 5639 2211 4 MP DP +c31 + +-54 -6 119 322 56 1 5422 1879 4 MP PP +c0 + +-54 -6 119 322 56 1 5422 1879 4 MP DP +c27 + +4 -8 -67 362 6 11 5692 2579 4 MP PP +c0 + +4 -8 -67 362 6 11 5692 2579 4 MP DP +c21 + +30 15 -275 244 -32 -8 5275 3606 4 MP PP +c0 + +30 15 -275 244 -32 -8 5275 3606 4 MP DP +c32 + +12 -49 -187 -204 -24 47 4822 2424 4 MP PP +c0 + +12 -49 -187 -204 -24 47 4822 2424 4 MP DP +c29 + +22 -22 -96 -367 -12 16 2586 2424 4 MP PP +c0 + +22 -22 -96 -367 -12 16 2586 2424 4 MP DP +c24 + +-27 49 -232 -88 37 -44 4020 2192 4 MP PP +c0 + +-27 49 -232 -88 37 -44 4020 2192 4 MP DP +c24 + +-46 40 -255 -99 57 -34 4106 2107 4 MP PP +c0 + +-46 40 -255 -99 57 -34 4106 2107 4 MP DP +c17 + +-41 14 -296 -248 40 -23 3508 3753 4 MP PP +c0 + +-41 14 -296 -248 40 -23 3508 3753 4 MP DP +c30 + +-25 10 26 270 18 -16 4973 2289 4 MP PP +c0 + +-25 10 26 270 18 -16 4973 2289 4 MP DP +c18 + +-1 33 -384 45 -24 -30 4624 4009 4 MP PP +c0 + +-1 33 -384 45 -24 -30 4624 4009 4 MP DP +c33 + +66 11 -21 -313 -68 -1 2999 1955 4 MP PP +c0 + +66 11 -21 -313 -68 -1 2999 1955 4 MP DP +c24 + +-37 46 -244 -93 49 -41 4057 2148 4 MP PP +c0 + +-37 46 -244 -93 49 -41 4057 2148 4 MP DP +c31 + +-45 16 94 242 38 -26 4936 2025 4 MP PP +c0 + +-45 16 94 242 38 -26 4936 2025 4 MP DP +c33 + +64 -17 -31 -338 -59 18 2645 1992 4 MP PP +c0 + +64 -17 -31 -338 -59 18 2645 1992 4 MP DP +c32 + +67 -8 -130 -145 -69 -4 4445 2633 4 MP PP +c0 + +67 -8 -130 -145 -69 -4 4445 2633 4 MP DP +c17 + +-45 21 -231 -192 35 -24 3904 3504 4 MP PP +c0 + +-45 21 -231 -192 35 -24 3904 3504 4 MP DP +c15 + +-40 23 -319 -174 28 -34 3839 3938 4 MP PP +c0 + +-40 23 -319 -174 28 -34 3839 3938 4 MP DP +c23 + +32 8 -216 300 -28 0 5487 3298 4 MP PP +c0 + +32 8 -216 300 -28 0 5487 3298 4 MP DP +c27 + +-3 8 -46 281 -6 -11 4988 2575 4 MP PP +c0 + +-3 8 -46 281 -6 -11 4988 2575 4 MP DP +c28 + +-6 43 -187 132 11 -37 2201 2816 4 MP PP +c0 + +-6 43 -187 132 11 -37 2201 2816 4 MP DP +c16 + +-30 33 -152 -34 8 -38 4257 3688 4 MP PP +c0 + +-30 33 -152 -34 8 -38 4257 3688 4 MP DP +c23 + +20 14 -158 224 -30 -14 4874 3154 4 MP PP +c0 + +20 14 -158 224 -30 -14 4874 3154 4 MP DP +c21 + +24 22 -176 156 -33 -19 4739 3397 4 MP PP +c0 + +24 22 -176 156 -33 -19 4739 3397 4 MP DP +c32 + +-2 -46 -199 -206 -10 47 4832 2377 4 MP PP +c0 + +-2 -46 -199 -206 -10 47 4832 2377 4 MP DP +c19 + +-47 19 -231 -256 34 -18 3708 3288 4 MP PP +c0 + +-47 19 -231 -256 34 -18 3708 3288 4 MP DP +c22 + +-38 17 -199 -296 22 -13 3546 2997 4 MP PP +c0 + +-38 17 -199 -296 22 -13 3546 2997 4 MP DP +c18 + +-8 38 -127 16 -16 -35 4408 3669 4 MP PP +c0 + +-8 38 -127 16 -16 -35 4408 3669 4 MP DP +c16 + +-28 34 -351 -79 2 -41 4216 4024 4 MP PP +c0 + +-28 34 -351 -79 2 -41 4216 4024 4 MP DP +c15 + +-43 28 -209 -112 30 -33 4083 3649 4 MP PP +c0 + +-43 28 -209 -112 30 -33 4083 3649 4 MP DP +c20 + +24 30 -330 158 -38 -21 4968 3842 4 MP PP +c0 + +24 30 -330 158 -38 -21 4968 3842 4 MP DP +c25 + +28 0 -153 340 -19 6 5631 2952 4 MP PP +c0 + +28 0 -153 340 -19 6 5631 2952 4 MP DP +c28 + +55 -17 -247 192 -55 6 1770 2473 4 MP PP +c0 + +55 -17 -247 192 -55 6 1770 2473 4 MP DP +c22 + +-33 -1 -244 -341 45 -8 2979 3175 4 MP PP +c0 + +-33 -1 -244 -341 45 -8 2979 3175 4 MP DP +c33 + +57 16 -23 -303 -60 -6 3059 1961 4 MP PP +c0 + +57 16 -23 -303 -60 -6 3059 1961 4 MP DP +c19 + +-45 8 -278 -296 50 -19 3252 3482 4 MP PP +c0 + +-45 8 -278 -296 50 -19 3252 3482 4 MP DP +c32 + +64 3 -130 -134 -64 -14 4376 2629 4 MP PP +c0 + +64 3 -130 -134 -64 -14 4376 2629 4 MP DP +/c34 { 1.000000 0.000000 0.937500 sc} bdef +c34 + +-63 -29 -127 185 57 34 1483 2980 4 MP PP +c0 + +-63 -29 -127 185 57 34 1483 2980 4 MP DP +c20 + +16 35 -162 78 -33 -28 4587 3584 4 MP PP +c0 + +16 35 -162 78 -33 -28 4587 3584 4 MP DP +c25 + +15 11 -115 266 -26 -12 4970 2875 4 MP PP +c0 + +15 11 -115 266 -26 -12 4970 2875 4 MP DP +c34 + +-68 -21 -123 178 64 28 1540 3014 4 MP PP +c0 + +-68 -21 -123 178 64 28 1540 3014 4 MP DP +c17 + +-50 19 -292 -238 46 -29 3548 3730 4 MP PP +c0 + +-50 19 -292 -238 46 -29 3548 3730 4 MP DP +c31 + +-42 -9 116 324 45 7 5478 1880 4 MP PP +c0 + +-42 -9 116 324 45 7 5478 1880 4 MP DP +c33 + +54 -22 -36 -336 -49 20 2586 2010 4 MP PP +c0 + +54 -22 -36 -336 -49 20 2586 2010 4 MP DP +c29 + +8 19 -77 -308 -19 -11 3267 2321 4 MP PP +c0 + +8 19 -77 -308 -19 -11 3267 2321 4 MP DP +c34 + +-53 -36 -133 190 47 39 1436 2941 4 MP PP +c0 + +-53 -36 -133 190 47 39 1436 2941 4 MP DP +c18 + +-2 41 -355 41 -27 -37 4600 3979 4 MP PP +c0 + +-2 41 -355 41 -27 -37 4600 3979 4 MP DP +/c35 { 1.000000 0.562500 0.000000 sc} bdef +c35 + +-71 19 194 233 60 -32 4966 1706 4 MP PP +c0 + +-71 19 194 233 60 -32 4966 1706 4 MP DP +c21 + +38 21 -270 235 -43 -12 5243 3598 4 MP PP +c0 + +38 21 -270 235 -43 -12 5243 3598 4 MP DP +c34 + +-72 -12 -118 170 67 20 1604 3042 4 MP PP +c0 + +-72 -12 -118 170 67 20 1604 3042 4 MP DP +c15 + +-46 29 -305 -164 32 -39 3867 3904 4 MP PP +c0 + +-46 29 -305 -164 32 -39 3867 3904 4 MP DP +c17 + +-54 25 -241 -195 43 -28 3861 3532 4 MP PP +c0 + +-54 25 -241 -195 43 -28 3861 3532 4 MP DP +c26 + +-19 -10 -183 -362 33 1 2747 2825 4 MP PP +c0 + +-19 -10 -183 -362 33 1 2747 2825 4 MP DP +c35 + +-66 22 183 220 55 -36 4911 1742 4 MP PP +c0 + +-66 22 183 220 55 -36 4911 1742 4 MP DP +c32 + +-16 -43 -211 -205 5 46 4827 2331 4 MP PP +c0 + +-16 -43 -211 -205 5 46 4827 2331 4 MP DP +c26 + +-26 18 -146 -310 11 -12 3394 2673 4 MP PP +c0 + +-26 18 -146 -310 11 -12 3394 2673 4 MP DP +c30 + +-6 -11 17 353 14 14 5667 2223 4 MP PP +c0 + +-6 -11 17 353 14 14 5667 2223 4 MP DP +c29 + +7 -21 -107 -360 4 14 2574 2440 4 MP PP +c0 + +7 -21 -107 -360 4 14 2574 2440 4 MP DP +c35 + +-70 14 202 244 62 -25 5026 1674 4 MP PP +c0 + +-70 14 202 244 62 -25 5026 1674 4 MP DP +c31 + +-32 16 87 232 26 -26 4910 2051 4 MP PP +c0 + +-32 16 87 232 26 -26 4910 2051 4 MP DP +c27 + +19 -6 -76 357 -10 11 5698 2590 4 MP PP +c0 + +19 -6 -76 357 -10 11 5698 2590 4 MP DP +c16 + +-34 39 -174 -39 8 -44 4249 3732 4 MP PP +c0 + +-34 39 -174 -39 8 -44 4249 3732 4 MP DP +c28 + +10 44 -195 128 -2 -40 2212 2779 4 MP PP +c0 + +10 44 -195 128 -2 -40 2212 2779 4 MP DP +c34 + +-43 -41 -139 193 36 44 1400 2897 4 MP PP +c0 + +-43 -41 -139 193 36 44 1400 2897 4 MP DP +c30 + +-10 11 19 264 2 -15 4971 2304 4 MP PP +c0 + +-10 11 19 264 2 -15 4971 2304 4 MP DP +c15 + +-50 32 -222 -117 34 -39 4049 3688 4 MP PP +c0 + +-50 32 -222 -117 34 -39 4049 3688 4 MP DP +c16 + +-32 39 -323 -72 4 -46 4218 3983 4 MP PP +c0 + +-32 39 -323 -72 4 -46 4218 3983 4 MP DP +c18 + +-8 44 -151 19 -22 -41 4430 3710 4 MP PP +c0 + +-8 44 -151 19 -22 -41 4430 3710 4 MP DP +c34 + +-72 -1 -115 161 69 10 1671 3062 4 MP PP +c0 + +-72 -1 -115 161 69 10 1671 3062 4 MP DP +c19 + +-56 21 -244 -255 45 -21 3663 3309 4 MP PP +c0 + +-56 21 -244 -255 45 -21 3663 3309 4 MP DP +c35 + +-59 25 172 206 48 -38 4863 1780 4 MP PP +c0 + +-59 25 172 206 48 -38 4863 1780 4 MP DP +c28 + +62 -8 -247 181 -60 -3 1830 2476 4 MP PP +c0 + +62 -8 -247 181 -60 -3 1830 2476 4 MP DP +c23 + +43 12 -219 293 -40 -5 5459 3298 4 MP PP +c0 + +43 12 -219 293 -40 -5 5459 3298 4 MP DP +c32 + +59 13 -133 -124 -56 -23 4312 2615 4 MP PP +c0 + +59 13 -133 -124 -56 -23 4312 2615 4 MP DP +c20 + +27 37 -311 148 -46 -27 4930 3821 4 MP PP +c0 + +27 37 -311 148 -46 -27 4930 3821 4 MP DP +c21 + +33 28 -185 159 -44 -22 4783 3419 4 MP PP +c0 + +33 28 -185 159 -44 -22 4783 3419 4 MP DP +c23 + +33 19 -168 224 -43 -16 4917 3170 4 MP PP +c0 + +33 19 -168 224 -43 -16 4917 3170 4 MP DP +c22 + +-50 19 -215 -292 35 -17 3511 3014 4 MP PP +c0 + +-50 19 -215 -292 35 -17 3511 3014 4 MP DP +c33 + +46 21 -26 -293 -51 -10 3110 1971 4 MP PP +c0 + +46 21 -26 -293 -51 -10 3110 1971 4 MP DP +c17 + +-58 22 -286 -228 52 -32 3594 3701 4 MP PP +c0 + +-58 22 -286 -228 52 -32 3594 3701 4 MP DP +c19 + +-55 13 -281 -287 58 -22 3302 3463 4 MP PP +c0 + +-55 13 -281 -287 58 -22 3302 3463 4 MP DP +c35 + +-69 10 210 253 61 -19 5088 1649 4 MP PP +c0 + +-69 10 210 253 61 -19 5088 1649 4 MP DP +c27 + +11 10 -55 278 -21 -11 5009 2586 4 MP PP +c0 + +11 10 -55 278 -21 -11 5009 2586 4 MP DP +c15 + +-52 32 -289 -153 36 -43 3899 3865 4 MP PP +c0 + +-52 32 -289 -153 36 -43 3899 3865 4 MP DP +c18 + +-4 46 -322 38 -29 -43 4573 3942 4 MP PP +c0 + +-4 46 -322 38 -29 -43 4573 3942 4 MP DP +c20 + +22 41 -179 85 -41 -33 4628 3617 4 MP PP +c0 + +22 41 -179 85 -41 -33 4628 3617 4 MP DP +c17 + +-59 27 -252 -198 50 -32 3811 3564 4 MP PP +c0 + +-59 27 -252 -198 50 -32 3811 3564 4 MP DP +c34 + +-29 -46 -146 196 24 44 1376 2853 4 MP PP +c0 + +-29 -46 -146 196 24 44 1376 2853 4 MP DP +c22 + +-45 2 -254 -330 55 -13 3024 3167 4 MP PP +c0 + +-45 2 -254 -330 55 -13 3024 3167 4 MP DP +c16 + +-37 43 -200 -44 8 -49 4241 3781 4 MP PP +c0 + +-37 43 -200 -44 8 -49 4241 3781 4 MP DP +c15 + +-54 35 -238 -124 37 -43 4012 3731 4 MP PP +c0 + +-54 35 -238 -124 37 -43 4012 3731 4 MP DP +c33 + +41 -25 -40 -332 -37 21 2537 2030 4 MP PP +c0 + +41 -25 -40 -332 -37 21 2537 2030 4 MP DP +c32 + +-30 -38 -222 -202 19 43 4808 2288 4 MP PP +c0 + +-30 -38 -222 -202 19 43 4808 2288 4 MP DP +c25 + +40 5 -160 332 -33 3 5612 2958 4 MP PP +c0 + +40 5 -160 332 -33 3 5612 2958 4 MP DP +c16 + +-36 43 -292 -64 5 -51 4222 3937 4 MP PP +c0 + +-36 43 -292 -64 5 -51 4222 3937 4 MP DP +c34 + +-69 8 -113 151 67 2 1740 3072 4 MP PP +c0 + +-69 8 -113 151 67 2 1740 3072 4 MP DP +c28 + +23 45 -203 127 -15 -44 2210 2739 4 MP PP +c0 + +23 45 -203 127 -15 -44 2210 2739 4 MP DP +c18 + +-8 49 -181 22 -25 -46 4455 3756 4 MP PP +c0 + +-8 49 -181 22 -25 -46 4455 3756 4 MP DP +c15 + +-56 35 -272 -143 39 -45 3935 3822 4 MP PP +c0 + +-56 35 -272 -143 39 -45 3935 3822 4 MP DP +c35 + +-50 26 161 193 38 -39 4825 1819 4 MP PP +c0 + +-50 26 161 193 38 -39 4825 1819 4 MP DP +c21 + +46 27 -263 225 -53 -17 5200 3586 4 MP PP +c0 + +46 27 -263 225 -53 -17 5200 3586 4 MP DP +c15 + +-55 35 -255 -132 38 -46 3974 3777 4 MP PP +c0 + +-55 35 -255 -132 38 -46 3974 3777 4 MP DP +c17 + +-62 26 -280 -219 56 -35 3646 3669 4 MP PP +c0 + +-62 26 -280 -219 56 -35 3646 3669 4 MP DP +c31 + +-28 -12 112 324 32 12 5523 1887 4 MP PP +c0 + +-28 -12 112 324 32 12 5523 1887 4 MP DP +c25 + +30 14 -126 265 -40 -12 5010 2887 4 MP PP +c0 + +30 14 -126 265 -40 -12 5010 2887 4 MP DP +c16 + +-38 46 -229 -50 7 -52 4234 3833 4 MP PP +c0 + +-38 46 -229 -50 7 -52 4234 3833 4 MP DP +c17 + +-64 28 -261 -203 54 -35 3757 3599 4 MP PP +c0 + +-64 28 -261 -203 54 -35 3757 3599 4 MP DP +c19 + +-64 22 -255 -255 54 -25 3609 3334 4 MP PP +c0 + +-64 22 -255 -255 54 -25 3609 3334 4 MP DP +c16 + +-39 45 -260 -56 7 -53 4227 3886 4 MP PP +c0 + +-39 45 -260 -56 7 -53 4227 3886 4 MP DP +c28 + +67 1 -245 170 -64 -12 1894 2488 4 MP PP +c0 + +67 1 -245 170 -64 -12 1894 2488 4 MP DP +c18 + +-5 51 -287 34 -30 -47 4544 3899 4 MP PP +c0 + +-5 51 -287 34 -30 -47 4544 3899 4 MP DP +c20 + +29 43 -290 137 -50 -32 4884 3794 4 MP PP +c0 + +29 43 -290 137 -50 -32 4884 3794 4 MP DP +c29 + +-7 21 -88 -300 -3 -14 3270 2335 4 MP PP +c0 + +-7 21 -88 -300 -3 -14 3270 2335 4 MP DP +c17 + +-64 26 -271 -210 55 -35 3702 3634 4 MP PP +c0 + +-64 26 -271 -210 55 -35 3702 3634 4 MP DP +c32 + +52 22 -139 -115 -46 -31 4256 2592 4 MP PP +c0 + +52 22 -139 -115 -46 -31 4256 2592 4 MP DP +c19 + +-62 16 -281 -277 62 -26 3360 3441 4 MP PP +c0 + +-62 16 -281 -277 62 -26 3360 3441 4 MP DP +c35 + +-63 4 214 261 59 -12 5149 1630 4 MP PP +c0 + +-63 4 214 261 59 -12 5149 1630 4 MP DP +c26 + +-33 -8 -195 -352 45 -2 2780 2826 4 MP PP +c0 + +-33 -8 -195 -352 45 -2 2780 2826 4 MP DP +c34 + +-15 -47 -151 194 9 45 1367 2808 4 MP PP +c0 + +-15 -47 -151 194 9 45 1367 2808 4 MP DP +c18 + +-7 52 -214 25 -29 -48 4484 3804 4 MP PP +c0 + +-7 52 -214 25 -29 -48 4484 3804 4 MP DP +c26 + +-40 18 -161 -304 25 -15 3369 2688 4 MP PP +c0 + +-40 18 -161 -304 25 -15 3369 2688 4 MP DP +c20 + +25 46 -198 93 -48 -36 4676 3653 4 MP PP +c0 + +25 46 -198 93 -48 -36 4676 3653 4 MP DP +c21 + +41 33 -196 165 -53 -25 4836 3444 4 MP PP +c0 + +41 33 -196 165 -53 -25 4836 3444 4 MP DP +c31 + +-18 16 81 222 10 -23 4900 2074 4 MP PP +c0 + +-18 16 81 222 10 -23 4900 2074 4 MP DP +c18 + +-7 53 -250 29 -30 -48 4514 3852 4 MP PP +c0 + +-7 53 -250 29 -30 -48 4514 3852 4 MP DP +c30 + +10 -11 9 349 -2 15 5681 2237 4 MP PP +c0 + +10 -11 9 349 -2 15 5681 2237 4 MP DP +c23 + +53 17 -220 284 -52 -8 5419 3293 4 MP PP +c0 + +53 17 -220 284 -52 -8 5419 3293 4 MP DP +c29 + +-9 -19 -117 -351 19 10 2578 2454 4 MP PP +c0 + +-9 -19 -117 -351 19 10 2578 2454 4 MP DP +c22 + +-59 19 -230 -290 47 -19 3464 3033 4 MP PP +c0 + +-59 19 -230 -290 47 -19 3464 3033 4 MP DP +c34 + +-62 17 -113 142 62 -8 1807 3074 4 MP PP +c0 + +-62 17 -113 142 62 -8 1807 3074 4 MP DP +c27 + +33 -3 -84 351 -25 9 5688 2601 4 MP PP +c0 + +33 -3 -84 351 -25 9 5688 2601 4 MP DP +c28 + +36 43 -211 127 -28 -43 2195 2695 4 MP PP +c0 + +36 43 -211 127 -28 -43 2195 2695 4 MP DP +c19 + +-67 22 -265 -258 59 -27 3550 3361 4 MP PP +c0 + +-67 22 -265 -258 59 -27 3550 3361 4 MP DP +c23 + +44 22 -178 227 -53 -18 4970 3188 4 MP PP +c0 + +44 22 -178 227 -53 -18 4970 3188 4 MP DP +c30 + +6 11 11 260 -13 -14 4984 2318 4 MP PP +c0 + +6 11 11 260 -13 -14 4984 2318 4 MP DP +c33 + +32 24 -31 -282 -37 -14 3147 1985 4 MP PP +c0 + +32 24 -31 -282 -37 -14 3147 1985 4 MP DP +c32 + +-41 -31 -233 -197 33 38 4775 2250 4 MP PP +c0 + +-41 -31 -233 -197 33 38 4775 2250 4 MP DP +c22 + +-56 7 -260 -321 62 -16 3079 3154 4 MP PP +c0 + +-56 7 -260 -321 62 -16 3079 3154 4 MP DP +c19 + +-67 19 -278 -270 64 -26 3422 3415 4 MP PP +c0 + +-67 19 -278 -270 64 -26 3422 3415 4 MP DP +c20 + +30 47 -267 125 -53 -35 4834 3762 4 MP PP +c0 + +30 47 -267 125 -53 -35 4834 3762 4 MP DP +c28 + +68 11 -242 159 -65 -20 1959 2508 4 MP PP +c0 + +68 11 -242 159 -65 -20 1959 2508 4 MP DP +c21 + +50 32 -254 214 -59 -21 5147 3569 4 MP PP +c0 + +50 32 -254 214 -59 -21 5147 3569 4 MP DP +c20 + +29 48 -221 103 -52 -37 4728 3690 4 MP PP +c0 + +29 48 -221 103 -52 -37 4728 3690 4 MP DP +c19 + +-69 21 -273 -263 64 -28 3486 3389 4 MP PP +c0 + +-69 21 -273 -263 64 -28 3486 3389 4 MP DP +c35 + +-38 26 149 180 27 -39 4798 1858 4 MP PP +c0 + +-38 26 149 180 27 -39 4798 1858 4 MP DP +c20 + +30 48 -244 114 -53 -37 4781 3727 4 MP PP +c0 + +30 48 -244 114 -53 -37 4781 3727 4 MP DP +c33 + +29 -28 -47 -326 -22 22 2500 2051 4 MP PP +c0 + +29 -28 -47 -326 -22 22 2500 2051 4 MP DP +c27 + +26 12 -65 277 -36 -11 5045 2597 4 MP PP +c0 + +26 12 -65 277 -36 -11 5045 2597 4 MP DP +c25 + +52 8 -165 324 -47 0 5579 2961 4 MP PP +c0 + +52 8 -165 324 -47 0 5579 2961 4 MP DP +c28 + +48 40 -219 130 -40 -43 2167 2652 4 MP PP +c0 + +48 40 -219 130 -40 -43 2167 2652 4 MP DP +c21 + +48 36 -208 173 -60 -27 4896 3471 4 MP PP +c0 + +48 36 -208 173 -60 -27 4896 3471 4 MP DP +c34 + +0 -46 -157 192 -5 42 1372 2766 4 MP PP +c0 + +0 -46 -157 192 -5 42 1372 2766 4 MP DP +c32 + +41 30 -147 -108 -33 -37 4210 2561 4 MP PP +c0 + +41 30 -147 -108 -33 -37 4210 2561 4 MP DP +c28 + +68 20 -239 150 -62 -28 2021 2536 4 MP PP +c0 + +68 20 -239 150 -62 -28 2021 2536 4 MP DP +c35 + +-56 -1 217 266 53 -4 5208 1618 4 MP PP +c0 + +-56 -1 217 266 53 -4 5208 1618 4 MP DP +c25 + +43 16 -136 267 -52 -13 5062 2900 4 MP PP +c0 + +43 16 -136 267 -52 -13 5062 2900 4 MP DP +c22 + +-67 18 -242 -290 56 -21 3408 3054 4 MP PP +c0 + +-67 18 -242 -290 56 -21 3408 3054 4 MP DP +c28 + +56 34 -226 135 -49 -39 2127 2609 4 MP PP +c0 + +56 34 -226 135 -49 -39 2127 2609 4 MP DP +c21 + +53 35 -244 204 -63 -25 5088 3548 4 MP PP +c0 + +53 35 -244 204 -63 -25 5088 3548 4 MP DP +c34 + +-54 27 -113 132 54 -17 1869 3066 4 MP PP +c0 + +-54 27 -113 132 54 -17 1869 3066 4 MP DP +c28 + +64 27 -233 142 -57 -34 2078 2570 4 MP PP +c0 + +64 27 -233 142 -57 -34 2078 2570 4 MP DP +c23 + +59 21 -218 274 -61 -11 5367 3285 4 MP PP +c0 + +59 21 -218 274 -61 -11 5367 3285 4 MP DP +c22 + +-64 9 -263 -311 67 -19 3141 3138 4 MP PP +c0 + +-64 9 -263 -311 67 -19 3141 3138 4 MP DP +c31 + +-14 -14 107 321 19 17 5555 1899 4 MP PP +c0 + +-14 -14 107 321 19 17 5555 1899 4 MP DP +c21 + +52 37 -220 182 -64 -26 4960 3497 4 MP PP +c0 + +52 37 -220 182 -64 -26 4960 3497 4 MP DP +c23 + +53 25 -187 231 -62 -18 5032 3206 4 MP PP +c0 + +53 25 -187 231 -62 -18 5032 3206 4 MP DP +c26 + +-46 -4 -205 -341 56 -7 2825 2824 4 MP PP +c0 + +-46 -4 -205 -341 56 -7 2825 2824 4 MP DP +c32 + +-51 -22 -241 -190 46 31 4729 2219 4 MP PP +c0 + +-51 -22 -241 -190 46 31 4729 2219 4 MP DP +c26 + +-51 19 -176 -301 38 -17 3331 2705 4 MP PP +c0 + +-51 19 -176 -301 38 -17 3331 2705 4 MP DP +c21 + +53 37 -232 193 -65 -26 5025 3523 4 MP PP +c0 + +53 37 -232 193 -65 -26 5025 3523 4 MP DP +c29 + +-22 22 -98 -293 11 -16 3259 2351 4 MP PP +c0 + +-22 22 -98 -293 11 -16 3259 2351 4 MP DP +c22 + +-70 18 -253 -293 64 -22 3344 3076 4 MP PP +c0 + +-70 18 -253 -293 64 -22 3344 3076 4 MP DP +c31 + +-2 15 73 215 -3 -21 4903 2095 4 MP PP +c0 + +-2 15 73 215 -3 -21 4903 2095 4 MP DP +c22 + +-69 13 -263 -303 69 -21 3208 3119 4 MP PP +c0 + +-69 13 -263 -303 69 -21 3208 3119 4 MP DP +c27 + +47 0 -92 343 -39 8 5663 2610 4 MP PP +c0 + +47 0 -92 343 -39 8 5663 2610 4 MP DP +c29 + +-23 -17 -127 -342 33 8 2597 2464 4 MP PP +c0 + +-23 -17 -127 -342 33 8 2597 2464 4 MP DP +c35 + +-26 26 138 167 15 -36 4783 1894 4 MP PP +c0 + +-26 26 138 167 15 -36 4783 1894 4 MP DP +c33 + +18 27 -36 -272 -24 -17 3171 2002 4 MP PP +c0 + +18 27 -36 -272 -24 -17 3171 2002 4 MP DP +c30 + +25 -9 2 342 -18 16 5679 2252 4 MP PP +c0 + +25 -9 2 342 -18 16 5679 2252 4 MP DP +c34 + +15 -44 -162 188 -19 38 1391 2728 4 MP PP +c0 + +15 -44 -162 188 -19 38 1391 2728 4 MP DP +c32 + +29 38 -156 -103 -20 -43 4177 2524 4 MP PP +c0 + +29 38 -156 -103 -20 -43 4177 2524 4 MP DP +c22 + +-71 16 -259 -297 67 -22 3277 3098 4 MP PP +c0 + +-71 16 -259 -297 67 -22 3277 3098 4 MP DP +c23 + +63 25 -215 264 -66 -15 5306 3274 4 MP PP +c0 + +63 25 -215 264 -66 -15 5306 3274 4 MP DP +c25 + +61 11 -169 316 -57 -3 5532 2961 4 MP PP +c0 + +61 11 -169 316 -57 -3 5532 2961 4 MP DP +c23 + +60 27 -196 238 -67 -19 5099 3225 4 MP PP +c0 + +60 27 -196 238 -67 -19 5099 3225 4 MP DP +c30 + +21 11 4 257 -29 -12 5013 2330 4 MP PP +c0 + +21 11 4 257 -29 -12 5013 2330 4 MP DP +c34 + +-42 33 -116 124 45 -25 1923 3049 4 MP PP +c0 + +-42 33 -116 124 45 -25 1923 3049 4 MP DP +c25 + +53 18 -145 270 -62 -13 5124 2913 4 MP PP +c0 + +53 18 -145 270 -62 -13 5124 2913 4 MP DP +c33 + +13 -28 -53 -319 -7 21 2478 2073 4 MP PP +c0 + +13 -28 -53 -319 -7 21 2478 2073 4 MP DP +c27 + +40 12 -75 278 -49 -10 5094 2607 4 MP PP +c0 + +40 12 -75 278 -49 -10 5094 2607 4 MP DP +c23 + +65 26 -210 254 -70 -16 5240 3259 4 MP PP +c0 + +65 26 -210 254 -70 -16 5240 3259 4 MP DP +c35 + +-45 -7 217 268 45 5 5261 1614 4 MP PP +c0 + +-45 -7 217 268 45 5 5261 1614 4 MP DP +c32 + +-59 -12 -246 -181 56 22 4673 2197 4 MP PP +c0 + +-59 -12 -246 -181 56 22 4673 2197 4 MP DP +c23 + +64 26 -203 246 -71 -18 5170 3243 4 MP PP +c0 + +64 26 -203 246 -71 -18 5170 3243 4 MP DP +c26 + +-56 0 -213 -332 64 -9 2881 2817 4 MP PP +c0 + +-56 0 -213 -332 64 -9 2881 2817 4 MP DP +c26 + +-62 17 -189 -299 50 -19 3281 2724 4 MP PP +c0 + +-62 17 -189 -299 50 -19 3281 2724 4 MP DP +/c36 { 0.000000 1.000000 0.250000 sc} bdef +c36 + +74 7 15 -269 -75 1 2838 1635 4 MP PP +c0 + +74 7 15 -269 -75 1 2838 1635 4 MP DP +c36 + +74 -2 15 -274 -74 7 2763 1636 4 MP PP +c0 + +74 -2 15 -274 -74 7 2763 1636 4 MP DP +c32 + +16 43 -167 -100 -5 -46 4157 2481 4 MP PP +c0 + +16 43 -167 -100 -5 -46 4157 2481 4 MP DP +/c37 { 1.000000 0.468750 0.000000 sc} bdef +c37 + +-55 36 258 141 36 -45 4672 1610 4 MP PP +c0 + +-55 36 258 141 36 -45 4672 1610 4 MP DP +c34 + +29 -40 -166 182 -33 32 1424 2696 4 MP PP +c0 + +29 -40 -166 182 -33 32 1424 2696 4 MP DP +c25 + +66 15 -169 306 -66 -5 5475 2958 4 MP PP +c0 + +66 15 -169 306 -66 -5 5475 2958 4 MP DP +c31 + +2 -15 101 315 4 21 5574 1916 4 MP PP +c0 + +2 -15 101 315 4 21 5574 1916 4 MP DP +c36 + +71 14 14 -261 -72 -6 2910 1641 4 MP PP +c0 + +71 14 14 -261 -72 -6 2910 1641 4 MP DP +c36 + +72 -9 13 -277 -70 12 2689 1643 4 MP PP +c0 + +72 -9 13 -277 -70 12 2689 1643 4 MP DP +c37 + +-48 38 239 132 29 -49 4643 1659 4 MP PP +c0 + +-48 38 239 132 29 -49 4643 1659 4 MP DP +c29 + +-36 21 -109 -287 26 -18 3233 2369 4 MP PP +c0 + +-36 21 -109 -287 26 -18 3233 2369 4 MP DP +c37 + +-60 32 276 151 42 -42 4708 1565 4 MP PP +c0 + +-60 32 276 151 42 -42 4708 1565 4 MP DP +c25 + +62 18 -154 275 -68 -12 5192 2925 4 MP PP +c0 + +62 18 -154 275 -68 -12 5192 2925 4 MP DP +c27 + +57 3 -97 333 -52 7 5624 2618 4 MP PP +c0 + +57 3 -97 333 -52 7 5624 2618 4 MP DP +c34 + +-30 40 -118 116 32 -32 1968 3024 4 MP PP +c0 + +-30 40 -118 116 32 -32 1968 3024 4 MP DP +c35 + +-10 23 127 157 2 -32 4781 1926 4 MP PP +c0 + +-10 23 127 157 2 -32 4781 1926 4 MP DP +c32 + +-65 -3 -249 -171 64 14 4609 2183 4 MP PP +c0 + +-65 -3 -249 -171 64 14 4609 2183 4 MP DP +c29 + +-38 -14 -135 -332 46 4 2630 2472 4 MP PP +c0 + +-38 -14 -135 -332 46 4 2630 2472 4 MP DP +c26 + +-65 4 -217 -323 69 -13 2945 2808 4 MP PP +c0 + +-65 4 -217 -323 69 -13 2945 2808 4 MP DP +c26 + +-68 16 -201 -301 59 -19 3222 2743 4 MP PP +c0 + +-68 16 -201 -301 59 -19 3222 2743 4 MP DP +c33 + +3 29 -42 -262 -8 -19 3179 2021 4 MP PP +c0 + +3 29 -42 -262 -8 -19 3179 2021 4 MP DP +c31 + +13 14 68 209 -19 -17 4922 2112 4 MP PP +c0 + +13 14 68 209 -19 -17 4922 2112 4 MP DP +c30 + +39 -8 -5 334 -32 16 5661 2268 4 MP PP +c0 + +39 -8 -5 334 -32 16 5661 2268 4 MP DP +c37 + +-38 39 220 121 19 -50 4624 1709 4 MP PP +c0 + +-38 39 220 121 19 -50 4624 1709 4 MP DP +c36 + +64 22 13 -253 -66 -11 2976 1652 4 MP PP +c0 + +64 22 13 -253 -66 -11 2976 1652 4 MP DP +c27 + +52 13 -84 280 -59 -9 5153 2616 4 MP PP +c0 + +52 13 -84 280 -59 -9 5153 2616 4 MP DP +c25 + +70 16 -168 297 -71 -7 5409 2953 4 MP PP +c0 + +70 16 -168 297 -71 -7 5409 2953 4 MP DP +c37 + +-62 25 292 160 46 -34 4750 1523 4 MP PP +c0 + +-62 25 292 160 46 -34 4750 1523 4 MP DP +c36 + +65 -18 12 -276 -64 17 2619 1655 4 MP PP +c0 + +65 -18 12 -276 -64 17 2619 1655 4 MP DP +c25 + +67 19 -160 281 -73 -12 5265 2937 4 MP PP +c0 + +67 19 -160 281 -73 -12 5265 2937 4 MP DP +c30 + +36 11 -4 256 -42 -9 5055 2339 4 MP PP +c0 + +36 11 -4 256 -42 -9 5055 2339 4 MP DP +c32 + +2 47 -179 -99 10 -48 4152 2435 4 MP PP +c0 + +2 47 -179 -99 10 -48 4152 2435 4 MP DP +c25 + +71 18 -166 288 -73 -9 5338 2946 4 MP PP +c0 + +71 18 -166 288 -73 -9 5338 2946 4 MP DP +c33 + +-3 -29 -59 -309 9 19 2471 2094 4 MP PP +c0 + +-3 -29 -59 -309 9 19 2471 2094 4 MP DP +c35 + +-32 -12 214 267 35 13 5306 1619 4 MP PP +c0 + +-32 -12 214 267 35 13 5306 1619 4 MP DP +c26 + +-71 8 -217 -315 71 -16 3014 2795 4 MP PP +c0 + +-71 8 -217 -315 71 -16 3014 2795 4 MP DP +c26 + +-72 14 -210 -304 67 -18 3155 2761 4 MP PP +c0 + +-72 14 -210 -304 67 -18 3155 2761 4 MP DP +c34 + +42 -34 -170 174 -44 25 1468 2671 4 MP PP +c0 + +42 -34 -170 174 -44 25 1468 2671 4 MP DP +c32 + +-67 7 -250 -160 69 4 4540 2179 4 MP PP +c0 + +-67 7 -250 -160 69 4 4540 2179 4 MP DP +c26 + +-72 11 -215 -308 70 -18 3085 2779 4 MP PP +c0 + +-72 11 -215 -308 70 -18 3085 2779 4 MP DP +c37 + +-27 39 201 110 9 -48 4615 1757 4 MP PP +c0 + +-27 39 201 110 9 -48 4615 1757 4 MP DP +c27 + +66 5 -102 324 -61 4 5572 2625 4 MP PP +c0 + +66 5 -102 324 -61 4 5572 2625 4 MP DP +c36 + +55 28 11 -242 -57 -16 3033 1668 4 MP PP +c0 + +55 28 11 -242 -57 -16 3033 1668 4 MP DP +c34 + +-15 45 -122 109 19 -38 2000 2992 4 MP PP +c0 + +-15 45 -122 109 19 -38 2000 2992 4 MP DP +c37 + +-61 19 304 167 49 -26 4796 1489 4 MP PP +c0 + +-61 19 304 167 49 -26 4796 1489 4 MP DP +c36 + +57 -24 9 -274 -54 22 2555 1672 4 MP PP +c0 + +57 -24 9 -274 -54 22 2555 1672 4 MP DP +c32 + +-11 48 -193 -101 25 -46 4162 2387 4 MP PP +c0 + +-11 48 -193 -101 25 -46 4162 2387 4 MP DP +c29 + +-49 20 -119 -284 40 -18 3193 2387 4 MP PP +c0 + +-49 20 -119 -284 40 -18 3193 2387 4 MP DP +c27 + +62 13 -91 284 -67 -7 5220 2623 4 MP PP +c0 + +62 13 -91 284 -67 -7 5220 2623 4 MP DP +c31 + +18 -16 94 308 -11 23 5578 1937 4 MP PP +c0 + +18 -16 94 308 -11 23 5578 1937 4 MP DP +c29 + +-50 -10 -141 -322 56 0 2676 2476 4 MP PP +c0 + +-50 -10 -141 -322 56 0 2676 2476 4 MP DP +c32 + +-66 17 -248 -149 71 -6 4469 2185 4 MP PP +c0 + +-66 17 -248 -149 71 -6 4469 2185 4 MP DP +c35 + +3 21 119 148 -11 -27 4792 1953 4 MP PP +c0 + +3 21 119 148 -11 -27 4792 1953 4 MP DP +c30 + +52 -7 -11 325 -46 16 5629 2284 4 MP PP +c0 + +52 -7 -11 325 -46 16 5629 2284 4 MP DP +c27 + +71 7 -104 315 -69 2 5511 2629 4 MP PP +c0 + +71 7 -104 315 -69 2 5511 2629 4 MP DP +c32 + +-26 48 -204 -105 37 -44 4187 2341 4 MP PP +c0 + +-26 48 -204 -105 37 -44 4187 2341 4 MP DP +c33 + +-13 28 -47 -252 7 -21 3172 2042 4 MP PP +c0 + +-13 28 -47 -252 7 -21 3172 2042 4 MP DP +c34 + +54 -26 -172 165 -55 17 1523 2654 4 MP PP +c0 + +54 -26 -172 165 -55 17 1523 2654 4 MP DP +c30 + +49 10 -10 258 -54 -6 5109 2345 4 MP PP +c0 + +49 10 -10 258 -54 -6 5109 2345 4 MP DP +c31 + +29 12 62 206 -33 -12 4955 2124 4 MP PP +c0 + +29 12 62 206 -33 -12 4955 2124 4 MP DP +c27 + +68 12 -96 290 -73 -5 5293 2628 4 MP PP +c0 + +68 12 -96 290 -73 -5 5293 2628 4 MP DP +c37 + +-15 36 183 101 0 -45 4615 1802 4 MP PP +c0 + +-15 36 183 101 0 -45 4615 1802 4 MP DP +c32 + +-63 26 -243 -138 70 -16 4399 2201 4 MP PP +c0 + +-63 26 -243 -138 70 -16 4399 2201 4 MP DP +c36 + +43 32 9 -230 -46 -21 3079 1689 4 MP PP +c0 + +43 32 9 -230 -46 -21 3079 1689 4 MP DP +c34 + +0 46 -128 106 6 -43 2019 2954 4 MP PP +c0 + +0 46 -128 106 6 -43 2019 2954 4 MP DP +c37 + +-59 12 314 172 49 -17 4845 1463 4 MP PP +c0 + +-59 12 314 172 49 -17 4845 1463 4 MP DP +c32 + +-37 44 -217 -110 50 -39 4224 2297 4 MP PP +c0 + +-37 44 -217 -110 50 -39 4224 2297 4 MP DP +c33 + +-18 -27 -64 -299 23 17 2480 2113 4 MP PP +c0 + +-18 -27 -64 -299 23 17 2480 2113 4 MP DP +c27 + +73 9 -103 307 -74 -1 5442 2631 4 MP PP +c0 + +73 9 -103 307 -74 -1 5442 2631 4 MP DP +c36 + +45 -29 5 -270 -41 25 2501 1694 4 MP PP +c0 + +45 -29 5 -270 -41 25 2501 1694 4 MP DP +c27 + +73 12 -101 297 -75 -2 5368 2630 4 MP PP +c0 + +73 12 -101 297 -75 -2 5368 2630 4 MP DP +c35 + +-19 -17 210 264 23 20 5341 1632 4 MP PP +c0 + +-19 -17 210 264 23 20 5341 1632 4 MP DP +c32 + +-57 34 -236 -128 66 -24 4333 2225 4 MP PP +c0 + +-57 34 -236 -128 66 -24 4333 2225 4 MP DP +c32 + +-49 41 -227 -118 59 -33 4274 2258 4 MP PP +c0 + +-49 41 -227 -118 59 -33 4274 2258 4 MP DP +c29 + +-60 19 -128 -282 51 -19 3142 2406 4 MP PP +c0 + +-60 19 -128 -282 51 -19 3142 2406 4 MP DP +c29 + +-60 -6 -146 -312 65 -4 2732 2476 4 MP PP +c0 + +-60 -6 -146 -312 65 -4 2732 2476 4 MP DP +c34 + +63 -18 -173 156 -62 8 1585 2646 4 MP PP +c0 + +63 -18 -173 156 -62 8 1585 2646 4 MP DP +c30 + +61 -4 -16 315 -56 14 5583 2300 4 MP PP +c0 + +61 -4 -16 315 -56 14 5583 2300 4 MP DP +c31 + +32 -16 87 298 -25 26 5567 1960 4 MP PP +c0 + +32 -16 87 298 -25 26 5567 1960 4 MP DP +c30 + +59 9 -15 262 -63 -3 5172 2348 4 MP PP +c0 + +59 9 -15 262 -63 -3 5172 2348 4 MP DP +c34 + +16 47 -134 103 -10 -44 2025 2911 4 MP PP +c0 + +16 47 -134 103 -10 -44 2025 2911 4 MP DP +c37 + +-2 32 168 92 -12 -39 4627 1841 4 MP PP +c0 + +-2 32 168 92 -12 -39 4627 1841 4 MP DP +c35 + +19 17 111 142 -24 -20 4816 1973 4 MP PP +c0 + +19 17 111 142 -24 -20 4816 1973 4 MP DP +c36 + +29 37 6 -219 -32 -24 3111 1713 4 MP PP +c0 + +29 37 6 -219 -32 -24 3111 1713 4 MP DP +c29 + +-67 15 -137 -282 62 -17 3080 2423 4 MP PP +c0 + +-67 15 -137 -282 62 -17 3080 2423 4 MP DP +c33 + +-28 28 -53 -245 22 -22 3150 2064 4 MP PP +c0 + +-28 28 -53 -245 22 -22 3150 2064 4 MP DP +c37 + +-53 4 320 175 47 -7 4894 1446 4 MP PP +c0 + +-53 4 320 175 47 -7 4894 1446 4 MP DP +c31 + +42 9 58 206 -44 -6 4999 2130 4 MP PP +c0 + +42 9 58 206 -44 -6 4999 2130 4 MP DP +c29 + +-68 -1 -149 -303 71 -8 2797 2472 4 MP PP +c0 + +-68 -1 -149 -303 71 -8 2797 2472 4 MP DP +c36 + +31 -35 3 -263 -29 28 2460 1719 4 MP PP +c0 + +31 -35 3 -263 -29 28 2460 1719 4 MP DP +/c38 { 0.000000 0.062500 1.000000 sc} bdef +c38 + +59 -32 -63 -198 -68 21 4783 2763 4 MP PP +c0 + +59 -32 -63 -198 -68 21 4783 2763 4 MP DP +c38 + +66 -25 -56 -184 -73 11 4715 2784 4 MP PP +c0 + +66 -25 -56 -184 -73 11 4715 2784 4 MP DP +c34 + +68 -8 -172 146 -67 -1 1652 2647 4 MP PP +c0 + +68 -8 -172 146 -67 -1 1652 2647 4 MP DP +c38 + +49 -39 -72 -209 -62 30 4845 2733 4 MP PP +c0 + +49 -39 -72 -209 -62 30 4845 2733 4 MP DP +c33 + +-33 -24 -69 -289 38 14 2503 2130 4 MP PP +c0 + +-33 -24 -69 -289 38 14 2503 2130 4 MP DP +c30 + +69 -2 -19 304 -66 13 5527 2314 4 MP PP +c0 + +69 -2 -19 304 -66 13 5527 2314 4 MP DP +c34 + +29 45 -140 103 -23 -45 2015 2867 4 MP PP +c0 + +29 45 -140 103 -23 -45 2015 2867 4 MP DP +c38 + +70 -16 -53 -170 -73 2 4642 2795 4 MP PP +c0 + +70 -16 -53 -170 -73 2 4642 2795 4 MP DP +c30 + +67 7 -19 268 -70 0 5242 2348 4 MP PP +c0 + +67 7 -19 268 -70 0 5242 2348 4 MP DP +c29 + +-72 12 -142 -284 68 -16 3012 2439 4 MP PP +c0 + +-72 12 -142 -284 68 -16 3012 2439 4 MP DP +c35 + +-4 -21 203 258 11 27 5364 1652 4 MP PP +c0 + +-4 -21 203 258 11 27 5364 1652 4 MP DP +c38 + +38 -44 -85 -218 -53 36 4898 2697 4 MP PP +c0 + +38 -44 -85 -218 -53 36 4898 2697 4 MP DP +c29 + +-73 3 -148 -295 72 -11 2868 2464 4 MP PP +c0 + +-73 3 -148 -295 72 -11 2868 2464 4 MP DP +c29 + +-74 7 -146 -288 72 -14 2940 2453 4 MP PP +c0 + +-74 7 -146 -288 72 -14 2940 2453 4 MP DP +c34 + +72 2 -171 137 -68 -11 1720 2658 4 MP PP +c0 + +72 2 -171 137 -68 -11 1720 2658 4 MP DP +c38 + +71 -6 -53 -156 -71 -8 4569 2797 4 MP PP +c0 + +71 -6 -53 -156 -71 -8 4569 2797 4 MP DP +c30 + +74 1 -22 293 -71 10 5461 2327 4 MP PP +c0 + +74 1 -22 293 -71 10 5461 2327 4 MP DP +c30 + +73 5 -22 275 -74 4 5316 2344 4 MP PP +c0 + +73 5 -22 275 -74 4 5316 2344 4 MP DP +c38 + +24 -47 -100 -226 -40 42 4938 2655 4 MP PP +c0 + +24 -47 -100 -226 -40 42 4938 2655 4 MP DP +c31 + +46 -16 80 288 -39 26 5542 1986 4 MP PP +c0 + +46 -16 80 288 -39 26 5542 1986 4 MP DP +/c39 { 1.000000 0.000000 0.843750 sc} bdef +c39 + +-72 -15 -57 126 68 21 1413 3199 4 MP PP +c0 + +-72 -15 -57 126 68 21 1413 3199 4 MP DP +c34 + +42 42 -146 104 -36 -43 1992 2822 4 MP PP +c0 + +42 42 -146 104 -36 -43 1992 2822 4 MP DP +c39 + +-66 -25 -61 132 63 29 1350 3170 4 MP PP +c0 + +-66 -25 -61 132 63 29 1350 3170 4 MP DP +/c40 { 1.000000 0.375000 0.000000 sc} bdef +c40 + +-29 49 300 47 7 -52 4365 1615 4 MP PP +c0 + +-29 49 300 47 7 -52 4365 1615 4 MP DP +c30 + +75 2 -23 284 -74 7 5390 2337 4 MP PP +c0 + +75 2 -23 284 -74 7 5390 2337 4 MP DP +c39 + +-74 -5 -55 119 72 12 1481 3220 4 MP PP +c0 + +-74 -5 -55 119 72 12 1481 3220 4 MP DP +c40 + +-19 50 278 44 -1 -52 4366 1667 4 MP PP +c0 + +-19 50 278 44 -1 -52 4366 1667 4 MP DP +c36 + +14 38 3 -206 -18 -27 3129 1740 4 MP PP +c0 + +14 38 3 -206 -18 -27 3129 1740 4 MP DP +c39 + +-57 -33 -64 136 53 36 1297 3134 4 MP PP +c0 + +-57 -33 -64 136 53 36 1297 3134 4 MP DP +c37 + +11 27 154 85 -20 -32 4647 1873 4 MP PP +c0 + +11 27 154 85 -20 -32 4647 1873 4 MP DP +c34 + +72 11 -167 128 -68 -20 1788 2678 4 MP PP +c0 + +72 11 -167 128 -68 -20 1788 2678 4 MP DP +c40 + +-36 45 321 51 15 -49 4372 1563 4 MP PP +c0 + +-36 45 321 51 15 -49 4372 1563 4 MP DP +c33 + +-42 25 -59 -239 36 -21 3114 2085 4 MP PP +c0 + +-42 25 -59 -239 36 -21 3114 2085 4 MP DP +c36 + +17 -37 -1 -254 -13 28 2431 1747 4 MP PP +c0 + +17 -37 -1 -254 -13 28 2431 1747 4 MP DP +c31 + +54 6 56 209 -56 -2 5055 2132 4 MP PP +c0 + +54 6 56 209 -56 -2 5055 2132 4 MP DP +c34 + +54 36 -152 108 -48 -40 1956 2779 4 MP PP +c0 + +54 36 -152 108 -48 -40 1956 2779 4 MP DP +c37 + +-45 -5 322 176 43 4 4941 1439 4 MP PP +c0 + +-45 -5 322 176 43 4 4941 1439 4 MP DP +c35 + +33 12 106 139 -35 -13 4851 1986 4 MP PP +c0 + +33 12 106 139 -35 -13 4851 1986 4 MP DP +c39 + +-74 6 -53 112 72 1 1553 3232 4 MP PP +c0 + +-74 6 -53 112 72 1 1553 3232 4 MP DP +c38 + +69 4 -57 -143 -65 -17 4498 2789 4 MP PP +c0 + +69 4 -57 -143 -65 -17 4498 2789 4 MP DP +c39 + +-46 -40 -68 139 43 41 1254 3093 4 MP PP +c0 + +-46 -40 -68 139 43 41 1254 3093 4 MP DP +c40 + +-9 48 258 42 -10 -52 4376 1719 4 MP PP +c0 + +-9 48 258 42 -10 -52 4376 1719 4 MP DP +c34 + +68 21 -163 119 -64 -27 1852 2705 4 MP PP +c0 + +68 21 -163 119 -64 -27 1852 2705 4 MP DP +c38 + +10 -47 -116 -231 -27 46 4965 2609 4 MP PP +c0 + +10 -47 -116 -231 -27 46 4965 2609 4 MP DP +c34 + +63 29 -159 113 -56 -34 1908 2739 4 MP PP +c0 + +63 29 -159 113 -56 -34 1908 2739 4 MP DP +c33 + +-46 -21 -73 -278 50 10 2541 2144 4 MP PP +c0 + +-46 -21 -73 -278 50 10 2541 2144 4 MP DP +c39 + +-70 16 -52 104 69 -8 1625 3233 4 MP PP +c0 + +-70 16 -52 104 69 -8 1625 3233 4 MP DP +c40 + +-42 42 340 52 23 -43 4387 1514 4 MP PP +c0 + +-42 42 340 52 23 -43 4387 1514 4 MP DP +c39 + +-33 -46 -71 140 29 46 1225 3047 4 MP PP +c0 + +-33 -46 -71 140 29 46 1225 3047 4 MP DP +c35 + +11 -23 194 249 -2 32 5375 1679 4 MP PP +c0 + +11 -23 194 249 -2 32 5375 1679 4 MP DP +c31 + +56 -14 74 276 -50 26 5503 2012 4 MP PP +c0 + +56 -14 74 276 -50 26 5503 2012 4 MP DP +c40 + +0 45 239 38 -18 -48 4394 1767 4 MP PP +c0 + +0 45 239 38 -18 -48 4394 1767 4 MP DP +c38 + +64 14 -65 -130 -56 -27 4433 2772 4 MP PP +c0 + +64 14 -65 -130 -56 -27 4433 2772 4 MP DP +c38 + +-5 -46 -133 -232 -13 47 4978 2562 4 MP PP +c0 + +-5 -46 -133 -232 -13 47 4978 2562 4 MP DP +c39 + +-63 25 -51 96 62 -17 1694 3225 4 MP PP +c0 + +-63 25 -51 96 62 -17 1694 3225 4 MP DP +c31 + +63 3 54 213 -63 4 5118 2128 4 MP PP +c0 + +63 3 54 213 -63 4 5118 2128 4 MP DP +c36 + +-1 39 -1 -195 -3 -29 3132 1769 4 MP PP +c0 + +-1 39 -1 -195 -3 -29 3132 1769 4 MP DP +c39 + +-19 -49 -75 140 15 47 1210 3000 4 MP PP +c0 + +-19 -49 -75 140 15 47 1210 3000 4 MP DP +c33 + +-54 22 -65 -235 49 -20 3065 2105 4 MP PP +c0 + +-54 22 -65 -235 49 -20 3065 2105 4 MP DP +c37 + +24 20 145 80 -30 -23 4677 1896 4 MP PP +c0 + +24 20 145 80 -30 -23 4677 1896 4 MP DP +c40 + +-46 34 357 55 29 -37 4410 1471 4 MP PP +c0 + +-46 34 357 55 29 -37 4410 1471 4 MP DP +c36 + +1 -39 -5 -244 3 29 2418 1775 4 MP PP +c0 + +1 -39 -5 -244 3 29 2418 1775 4 MP DP +c33 + +-57 -16 -76 -268 60 6 2591 2154 4 MP PP +c0 + +-57 -16 -76 -268 60 6 2591 2154 4 MP DP +c37 + +-35 -13 320 175 37 14 4984 1443 4 MP PP +c0 + +-35 -13 320 175 37 14 4984 1443 4 MP DP +c35 + +44 6 104 138 -45 -4 4896 1990 4 MP PP +c0 + +44 6 104 138 -45 -4 4896 1990 4 MP DP +c31 + +66 -13 67 264 -59 25 5453 2038 4 MP PP +c0 + +66 -13 67 264 -59 25 5453 2038 4 MP DP +c38 + +56 23 -75 -119 -46 -34 4377 2745 4 MP PP +c0 + +56 23 -75 -119 -46 -34 4377 2745 4 MP DP +c39 + +-54 34 -51 89 54 -27 1756 3208 4 MP PP +c0 + +-54 34 -51 89 54 -27 1756 3208 4 MP DP +c40 + +12 39 221 35 -25 -42 4419 1809 4 MP PP +c0 + +12 39 221 35 -25 -42 4419 1809 4 MP DP +c39 + +-2 -50 -79 138 0 46 1210 2954 4 MP PP +c0 + +-2 -50 -79 138 0 46 1210 2954 4 MP DP +c38 + +-19 -43 -151 -231 4 47 4974 2515 4 MP PP +c0 + +-19 -43 -151 -231 4 47 4974 2515 4 MP DP +c31 + +70 0 54 220 -69 10 5187 2118 4 MP PP +c0 + +70 0 54 220 -69 10 5187 2118 4 MP DP +c35 + +25 -26 183 239 -14 36 5373 1711 4 MP PP +c0 + +25 -26 183 239 -14 36 5373 1711 4 MP DP +c33 + +-63 17 -70 -233 60 -19 3005 2124 4 MP PP +c0 + +-63 17 -70 -233 60 -19 3005 2124 4 MP DP +c31 + +71 -10 62 252 -66 22 5394 2063 4 MP PP +c0 + +71 -10 62 252 -66 22 5394 2063 4 MP DP +c33 + +-66 -12 -78 -257 68 1 2651 2160 4 MP PP +c0 + +-66 -12 -78 -257 68 1 2651 2160 4 MP DP +c31 + +74 -4 55 230 -71 14 5258 2104 4 MP PP +c0 + +74 -4 55 230 -71 14 5258 2104 4 MP DP +c40 + +-49 26 371 56 35 -27 4439 1434 4 MP PP +c0 + +-49 26 371 56 35 -27 4439 1434 4 MP DP +c39 + +-42 41 -51 81 42 -33 1810 3181 4 MP PP +c0 + +-42 41 -51 81 42 -33 1810 3181 4 MP DP +c31 + +74 -7 58 240 -70 19 5328 2085 4 MP PP +c0 + +74 -7 58 240 -70 19 5328 2085 4 MP DP +c36 + +-17 37 -5 -185 13 -28 3119 1797 4 MP PP +c0 + +-17 37 -5 -185 13 -28 3119 1797 4 MP DP +c39 + +12 -50 -81 134 -15 44 1225 2910 4 MP PP +c0 + +12 -50 -81 134 -15 44 1225 2910 4 MP DP +c38 + +46 31 -88 -110 -33 -40 4331 2711 4 MP PP +c0 + +46 31 -88 -110 -33 -40 4331 2711 4 MP DP +c36 + +-14 -38 -9 -233 18 27 2421 1804 4 MP PP +c0 + +-14 -38 -9 -233 18 27 2421 1804 4 MP DP +c38 + +-33 -38 -166 -227 18 45 4956 2470 4 MP PP +c0 + +-33 -38 -166 -227 18 45 4956 2470 4 MP DP +c33 + +-71 12 -73 -235 67 -15 2938 2139 4 MP PP +c0 + +-71 12 -73 -235 67 -15 2938 2139 4 MP DP +c37 + +35 13 139 77 -37 -14 4714 1910 4 MP PP +c0 + +35 13 139 77 -37 -14 4714 1910 4 MP DP +c35 + +56 2 103 140 -52 3 4948 1987 4 MP PP +c0 + +56 2 103 140 -52 3 4948 1987 4 MP DP +c40 + +20 32 208 32 -31 -34 4450 1843 4 MP PP +c0 + +20 32 208 32 -31 -34 4450 1843 4 MP DP +c33 + +-72 -5 -79 -249 73 -3 2719 2161 4 MP PP +c0 + +-72 -5 -79 -249 73 -3 2719 2161 4 MP DP +c37 + +-23 -20 313 172 30 23 5021 1457 4 MP PP +c0 + +-23 -20 313 172 30 23 5021 1457 4 MP DP +/c41 { 0.000000 1.000000 0.343750 sc} bdef +c41 + +72 12 64 -183 -74 -7 2852 1374 4 MP PP +c0 + +72 12 64 -183 -74 -7 2852 1374 4 MP DP +c39 + +-27 47 -54 74 30 -40 1852 3148 4 MP PP +c0 + +-27 47 -54 74 30 -40 1852 3148 4 MP DP +c33 + +-74 7 -77 -238 72 -12 2866 2151 4 MP PP +c0 + +-74 7 -77 -238 72 -12 2866 2151 4 MP DP +c41 + +68 22 62 -178 -71 -14 2923 1388 4 MP PP +c0 + +68 22 62 -178 -71 -14 2923 1388 4 MP DP +c33 + +-74 1 -79 -243 74 -7 2792 2158 4 MP PP +c0 + +-74 1 -79 -243 74 -7 2792 2158 4 MP DP +c39 + +28 -46 -84 128 -29 40 1254 2870 4 MP PP +c0 + +28 -46 -84 128 -29 40 1254 2870 4 MP DP +c41 + +74 3 64 -188 -74 2 2778 1367 4 MP PP +c0 + +74 3 64 -188 -74 2 2778 1367 4 MP DP +c35 + +39 -26 172 226 -28 39 5359 1747 4 MP PP +c0 + +39 -26 172 226 -28 39 5359 1747 4 MP DP +c41 + +61 31 59 -170 -64 -22 2987 1410 4 MP PP +c0 + +61 31 59 -170 -64 -22 2987 1410 4 MP DP +c38 + +33 37 -103 -102 -18 -45 4298 2671 4 MP PP +c0 + +33 37 -103 -102 -18 -45 4298 2671 4 MP DP +c40 + +-49 17 382 57 38 -18 4474 1407 4 MP PP +c0 + +-49 17 382 57 38 -18 4474 1407 4 MP DP +c38 + +-46 -31 -181 -220 32 40 4924 2430 4 MP PP +c0 + +-46 -31 -181 -220 32 40 4924 2430 4 MP DP +c41 + +71 -8 65 -189 -72 9 2704 1369 4 MP PP +c0 + +71 -8 65 -189 -72 9 2704 1369 4 MP DP +c36 + +-31 34 -9 -176 28 -28 3091 1825 4 MP PP +c0 + +-31 34 -9 -176 28 -28 3091 1825 4 MP DP +c39 + +-13 49 -56 70 15 -45 1882 3108 4 MP PP +c0 + +-13 49 -56 70 15 -45 1882 3108 4 MP DP +c41 + +51 38 56 -161 -55 -28 3042 1438 4 MP PP +c0 + +51 38 56 -161 -55 -28 3042 1438 4 MP DP +c36 + +-29 -36 -13 -221 33 24 2439 1831 4 MP PP +c0 + +-29 -36 -13 -221 33 24 2439 1831 4 MP DP +c35 + +63 -4 107 145 -59 12 5007 1975 4 MP PP +c0 + +63 -4 107 145 -59 12 5007 1975 4 MP DP +c39 + +42 -41 -85 122 -42 34 1296 2836 4 MP PP +c0 + +42 -41 -85 122 -42 34 1296 2836 4 MP DP +c41 + +67 -17 63 -190 -65 18 2632 1378 4 MP PP +c0 + +67 -17 63 -190 -65 18 2632 1378 4 MP DP +c40 + +30 23 197 30 -35 -26 4485 1869 4 MP PP +c0 + +30 23 197 30 -35 -26 4485 1869 4 MP DP +c37 + +45 4 137 76 -43 -4 4757 1914 4 MP PP +c0 + +45 4 137 76 -43 -4 4757 1914 4 MP DP +/c42 { 1.000000 0.281250 0.000000 sc} bdef +c42 + +1 52 334 -29 -17 -51 4048 1695 4 MP PP +c0 + +1 52 334 -29 -17 -51 4048 1695 4 MP DP +c35 + +50 -26 160 213 -38 39 5331 1786 4 MP PP +c0 + +50 -26 160 213 -38 39 5331 1786 4 MP DP +c42 + +10 52 318 -28 -24 -50 4072 1745 4 MP PP +c0 + +10 52 318 -28 -24 -50 4072 1745 4 MP DP +c38 + +20 43 -120 -98 -3 -47 4280 2626 4 MP PP +c0 + +20 43 -120 -98 -3 -47 4280 2626 4 MP DP +c37 + +-11 -27 304 167 20 32 5051 1480 4 MP PP +c0 + +-11 -27 304 167 20 32 5051 1480 4 MP DP +c38 + +-56 -22 -195 -211 46 34 4878 2396 4 MP PP +c0 + +-56 -22 -195 -211 46 34 4878 2396 4 MP DP +c41 + +38 43 52 -151 -43 -32 3085 1470 4 MP PP +c0 + +38 43 52 -151 -43 -32 3085 1470 4 MP DP +c39 + +3 50 -59 66 0 -46 1897 3063 4 MP PP +c0 + +3 50 -59 66 0 -46 1897 3063 4 MP DP +c42 + +-7 52 349 -32 -8 -49 4031 1644 4 MP PP +c0 + +-7 52 349 -32 -8 -49 4031 1644 4 MP DP +c42 + +18 48 304 -26 -30 -47 4102 1792 4 MP PP +c0 + +18 48 304 -26 -30 -47 4102 1792 4 MP DP +c39 + +53 -34 -85 115 -54 26 1350 2810 4 MP PP +c0 + +53 -34 -85 115 -54 26 1350 2810 4 MP DP +c35 + +69 -10 111 153 -62 19 5069 1956 4 MP PP +c0 + +69 -10 111 153 -62 19 5069 1956 4 MP DP +c41 + +58 -26 62 -188 -57 24 2567 1396 4 MP PP +c0 + +58 -26 62 -188 -57 24 2567 1396 4 MP DP +c36 + +-45 30 -12 -170 42 -25 3049 1850 4 MP PP +c0 + +-45 30 -12 -170 42 -25 3049 1850 4 MP DP +c40 + +-47 7 389 56 40 -6 4512 1389 4 MP PP +c0 + +-47 7 389 56 40 -6 4512 1389 4 MP DP +c35 + +59 -25 148 200 -47 38 5293 1825 4 MP PP +c0 + +59 -25 148 200 -47 38 5293 1825 4 MP DP +c36 + +-43 -33 -16 -209 46 21 2472 1855 4 MP PP +c0 + +-43 -33 -16 -209 46 21 2472 1855 4 MP DP +c38 + +5 46 -137 -97 12 -47 4277 2579 4 MP PP +c0 + +5 46 -137 -97 12 -47 4277 2579 4 MP DP +c42 + +-15 49 364 -35 0 -46 4023 1595 4 MP PP +c0 + +-15 49 364 -35 0 -46 4023 1595 4 MP DP +c39 + +18 49 -61 64 -16 -47 1897 3017 4 MP PP +c0 + +18 49 -61 64 -16 -47 1897 3017 4 MP DP +c41 + +25 47 47 -140 -29 -37 3114 1507 4 MP PP +c0 + +25 47 47 -140 -29 -37 3114 1507 4 MP DP +c38 + +-64 -14 -205 -199 57 26 4821 2370 4 MP PP +c0 + +-64 -14 -205 -199 57 26 4821 2370 4 MP DP +c42 + +25 42 292 -25 -35 -42 4137 1834 4 MP PP +c0 + +25 42 292 -25 -35 -42 4137 1834 4 MP DP +c39 + +64 -25 -86 107 -63 18 1413 2792 4 MP PP +c0 + +64 -25 -86 107 -63 18 1413 2792 4 MP DP +c35 + +71 -14 118 162 -62 26 5131 1930 4 MP PP +c0 + +71 -14 118 162 -62 26 5131 1930 4 MP DP +c35 + +66 -22 137 186 -55 36 5246 1863 4 MP PP +c0 + +66 -22 137 186 -55 36 5246 1863 4 MP DP +c40 + +37 14 192 27 -39 -15 4524 1884 4 MP PP +c0 + +37 14 192 27 -39 -15 4524 1884 4 MP DP +c35 + +70 -19 127 174 -60 31 5191 1899 4 MP PP +c0 + +70 -19 127 174 -60 31 5191 1899 4 MP DP +c37 + +52 -3 139 76 -47 7 4804 1907 4 MP PP +c0 + +52 -3 139 76 -47 7 4804 1907 4 MP DP +c41 + +48 -35 59 -182 -45 29 2510 1420 4 MP PP +c0 + +48 -35 59 -182 -45 29 2510 1420 4 MP DP +c39 + +33 46 -65 63 -29 -45 1881 2970 4 MP PP +c0 + +33 46 -65 63 -29 -45 1881 2970 4 MP DP +c37 + +2 -32 291 160 11 39 5071 1512 4 MP PP +c0 + +2 -32 291 160 11 39 5071 1512 4 MP DP +c39 + +70 -16 -85 100 -68 8 1481 2784 4 MP PP +c0 + +70 -16 -85 100 -68 8 1481 2784 4 MP DP +c38 + +-10 48 -154 -99 27 -46 4289 2532 4 MP PP +c0 + +-10 48 -154 -99 27 -46 4289 2532 4 MP DP +c36 + +-57 24 -15 -165 54 -22 2995 1872 4 MP PP +c0 + +-57 24 -15 -165 54 -22 2995 1872 4 MP DP +c38 + +-69 -4 -212 -187 65 18 4756 2352 4 MP PP +c0 + +-69 -4 -212 -187 65 18 4756 2352 4 MP DP +c42 + +-23 43 378 -38 9 -40 4023 1549 4 MP PP +c0 + +-23 43 378 -38 9 -40 4023 1549 4 MP DP +c36 + +-55 -28 -18 -197 57 16 2518 1876 4 MP PP +c0 + +-55 -28 -18 -197 57 16 2518 1876 4 MP DP +c41 + +9 49 43 -130 -14 -38 3128 1545 4 MP PP +c0 + +9 49 43 -130 -14 -38 3128 1545 4 MP DP +c42 + +31 34 282 -25 -39 -36 4176 1870 4 MP PP +c0 + +31 34 282 -25 -39 -36 4176 1870 4 MP DP +c39 + +46 40 -69 65 -42 -42 1852 2925 4 MP PP +c0 + +46 40 -69 65 -42 -42 1852 2925 4 MP DP +c39 + +73 -6 -83 92 -72 -2 1553 2786 4 MP PP +c0 + +73 -6 -83 92 -72 -2 1553 2786 4 MP DP +c40 + +-43 -4 391 56 41 4 4552 1383 4 MP PP +c0 + +-43 -4 391 56 41 4 4552 1383 4 MP DP +c38 + +-25 46 -170 -103 41 -42 4316 2486 4 MP PP +c0 + +-25 46 -170 -103 41 -42 4316 2486 4 MP DP +c41 + +35 -41 55 -176 -31 35 2465 1449 4 MP PP +c0 + +35 -41 55 -176 -31 35 2465 1449 4 MP DP +c39 + +57 34 -72 67 -54 -36 1810 2883 4 MP PP +c0 + +57 34 -72 67 -54 -36 1810 2883 4 MP DP +c39 + +75 5 -82 84 -72 -11 1625 2797 4 MP PP +c0 + +75 5 -82 84 -72 -11 1625 2797 4 MP DP +c38 + +-71 6 -216 -173 70 8 4686 2344 4 MP PP +c0 + +-71 6 -216 -173 70 8 4686 2344 4 MP DP +c39 + +66 24 -75 72 -63 -29 1756 2847 4 MP PP +c0 + +66 24 -75 72 -63 -29 1756 2847 4 MP DP +c39 + +72 15 -79 78 -68 -21 1693 2818 4 MP PP +c0 + +72 15 -79 78 -68 -21 1693 2818 4 MP DP +c36 + +-65 17 -18 -163 63 -17 2932 1889 4 MP PP +c0 + +-65 17 -18 -163 63 -17 2932 1889 4 MP DP +c37 + +59 -12 144 80 -49 17 4853 1890 4 MP PP +c0 + +59 -12 144 80 -49 17 4853 1890 4 MP DP +c36 + +-64 -21 -20 -188 66 12 2575 1892 4 MP PP +c0 + +-64 -21 -20 -188 66 12 2575 1892 4 MP DP +c37 + +14 -36 276 151 1 45 5082 1551 4 MP PP +c0 + +14 -36 276 151 1 45 5082 1551 4 MP DP +c38 + +-37 44 -185 -111 52 -36 4357 2444 4 MP PP +c0 + +-37 44 -185 -111 52 -36 4357 2444 4 MP DP +c40 + +43 4 190 26 -41 -4 4565 1888 4 MP PP +c0 + +43 4 190 26 -41 -4 4565 1888 4 MP DP +c38 + +-70 16 -217 -159 74 -2 4612 2346 4 MP PP +c0 + +-70 16 -217 -159 74 -2 4612 2346 4 MP DP +c41 + +-6 48 38 -119 1 -39 3127 1584 4 MP PP +c0 + +-6 48 38 -119 1 -39 3127 1584 4 MP DP +c42 + +-29 37 390 -43 17 -32 4032 1509 4 MP PP +c0 + +-29 37 390 -43 17 -32 4032 1509 4 MP DP +c38 + +-50 39 -197 -121 62 -29 4409 2408 4 MP PP +c0 + +-50 39 -197 -121 62 -29 4409 2408 4 MP DP +c38 + +-66 24 -213 -145 72 -12 4540 2358 4 MP PP +c0 + +-66 24 -213 -145 72 -12 4540 2358 4 MP DP +c36 + +-71 10 -20 -163 71 -12 2861 1901 4 MP PP +c0 + +-71 10 -20 -163 71 -12 2861 1901 4 MP DP +c42 + +35 26 274 -27 -41 -27 4217 1897 4 MP PP +c0 + +35 26 274 -27 -41 -27 4217 1897 4 MP DP +c36 + +-71 -15 -21 -178 72 5 2641 1904 4 MP PP +c0 + +-71 -15 -21 -178 72 5 2641 1904 4 MP DP +c38 + +-59 33 -207 -133 69 -21 4471 2379 4 MP PP +c0 + +-59 33 -207 -133 69 -21 4471 2379 4 MP DP +c41 + +21 -45 51 -168 -17 37 2434 1484 4 MP PP +c0 + +21 -45 51 -168 -17 37 2434 1484 4 MP DP +c36 + +-75 1 -20 -165 74 -7 2787 1908 4 MP PP +c0 + +-75 1 -20 -165 74 -7 2787 1908 4 MP DP +c36 + +-74 -6 -21 -171 74 -1 2713 1909 4 MP PP +c0 + +-74 -6 -21 -171 74 -1 2713 1909 4 MP DP +c37 + +62 -19 154 85 -49 26 4902 1864 4 MP PP +c0 + +62 -19 154 85 -49 26 4902 1864 4 MP DP +c40 + +-37 -14 389 55 39 15 4593 1387 4 MP PP +c0 + +-37 -14 389 55 39 15 4593 1387 4 MP DP +c37 + +28 -39 257 142 -9 48 5083 1596 4 MP PP +c0 + +28 -39 257 142 -9 48 5083 1596 4 MP DP +c41 + +-21 45 33 -110 17 -37 3110 1621 4 MP PP +c0 + +-21 45 33 -110 17 -37 3110 1621 4 MP DP +c41 + +6 -48 46 -159 -1 39 2417 1521 4 MP PP +c0 + +6 -48 46 -159 -1 39 2417 1521 4 MP DP +c40 + +47 -7 192 26 -40 6 4605 1882 4 MP PP +c0 + +47 -7 192 26 -40 6 4605 1882 4 MP DP +c42 + +-35 27 401 -46 24 -24 4049 1477 4 MP PP +c0 + +-35 27 401 -46 24 -24 4049 1477 4 MP DP +c37 + +62 -26 167 92 -46 34 4948 1830 4 MP PP +c0 + +62 -26 167 92 -46 34 4948 1830 4 MP DP +c42 + +39 15 268 -28 -40 -17 4257 1914 4 MP PP +c0 + +39 15 268 -28 -40 -17 4257 1914 4 MP DP +c37 + +38 -39 238 131 -19 50 5074 1644 4 MP PP +c0 + +38 -39 238 131 -19 50 5074 1644 4 MP DP +/c43 { 1.000000 0.187500 0.000000 sc} bdef +c43 + +24 50 371 -90 -31 -48 3708 1833 4 MP PP +c0 + +24 50 371 -90 -31 -48 3708 1833 4 MP DP +c43 + +30 47 364 -88 -38 -45 3746 1878 4 MP PP +c0 + +30 47 364 -88 -38 -45 3746 1878 4 MP DP +c41 + +-35 41 29 -102 31 -34 3079 1655 4 MP PP +c0 + +-35 41 29 -102 31 -34 3079 1655 4 MP DP +c43 + +17 51 379 -95 -25 -46 3677 1785 4 MP PP +c0 + +17 51 379 -95 -25 -46 3677 1785 4 MP DP +c37 + +60 -31 183 100 -42 41 4990 1789 4 MP PP +c0 + +60 -31 183 100 -42 41 4990 1789 4 MP DP +c37 + +47 -38 220 120 -29 49 5055 1694 4 MP PP +c0 + +47 -38 220 120 -29 49 5055 1694 4 MP DP +/c44 { 1.000000 0.000000 0.750000 sc} bdef +c44 + +-68 20 23 44 70 -16 1572 3345 4 MP PP +c0 + +-68 20 23 44 70 -16 1572 3345 4 MP DP +c44 + +-73 10 25 48 74 -6 1498 3351 4 MP PP +c0 + +-73 10 25 48 74 -6 1498 3351 4 MP DP +c43 + +35 42 356 -86 -41 -42 3787 1920 4 MP PP +c0 + +35 42 356 -86 -41 -42 3787 1920 4 MP DP +c44 + +-60 31 20 38 63 -25 1642 3329 4 MP PP +c0 + +-60 31 20 38 63 -25 1642 3329 4 MP DP +c44 + +-73 -1 26 52 74 5 1424 3346 4 MP PP +c0 + +-73 -1 26 52 74 5 1424 3346 4 MP DP +c37 + +55 -36 201 110 -36 46 5026 1743 4 MP PP +c0 + +55 -36 201 110 -36 46 5026 1743 4 MP DP +c40 + +-30 -23 384 52 35 26 4632 1402 4 MP PP +c0 + +-30 -23 384 52 35 26 4632 1402 4 MP DP +c44 + +-51 38 17 34 54 -34 1705 3304 4 MP PP +c0 + +-51 38 17 34 54 -34 1705 3304 4 MP DP +c44 + +-72 -11 27 56 72 15 1352 3331 4 MP PP +c0 + +-72 -11 27 56 72 15 1352 3331 4 MP DP +c41 + +-10 -49 42 -148 14 38 2416 1560 4 MP PP +c0 + +-10 -49 42 -148 14 38 2416 1560 4 MP DP +c44 + +-38 45 13 30 42 -41 1759 3270 4 MP PP +c0 + +-38 45 13 30 42 -41 1759 3270 4 MP DP +c44 + +-66 -23 27 60 66 25 1286 3306 4 MP PP +c0 + +-66 -23 27 60 66 25 1286 3306 4 MP DP +c43 + +8 49 387 -100 -16 -44 3652 1739 4 MP PP +c0 + +8 49 387 -100 -16 -44 3652 1739 4 MP DP +c44 + +-25 50 11 27 27 -47 1801 3229 4 MP PP +c0 + +-25 50 11 27 27 -47 1801 3229 4 MP DP +c44 + +-59 -32 27 62 57 33 1229 3273 4 MP PP +c0 + +-59 -32 27 62 57 33 1229 3273 4 MP DP +c40 + +49 -17 199 25 -38 18 4643 1864 4 MP PP +c0 + +49 -17 199 25 -38 18 4643 1864 4 MP DP +c43 + +39 36 350 -86 -44 -37 3831 1957 4 MP PP +c0 + +39 36 350 -86 -44 -37 3831 1957 4 MP DP +c42 + +-38 18 408 -50 31 -14 4073 1453 4 MP PP +c0 + +-38 18 408 -50 31 -14 4073 1453 4 MP DP +c41 + +-48 35 25 -95 45 -30 3034 1685 4 MP PP +c0 + +-48 35 25 -95 45 -30 3034 1685 4 MP DP +c44 + +-10 53 8 23 13 -49 1828 3182 4 MP PP +c0 + +-10 53 8 23 13 -49 1828 3182 4 MP DP +c44 + +-48 -39 25 63 46 40 1183 3233 4 MP PP +c0 + +-48 -39 25 63 46 40 1183 3233 4 MP DP +c42 + +41 4 267 -30 -39 -8 4296 1922 4 MP PP +c0 + +41 4 267 -30 -39 -8 4296 1922 4 MP DP +/c45 { 0.000000 0.156250 1.000000 sc} bdef +c45 + +68 -21 10 -174 -74 7 4779 2951 4 MP PP +c0 + +68 -21 10 -174 -74 7 4779 2951 4 MP DP +c45 + +62 -30 4 -188 -71 17 4850 2934 4 MP PP +c0 + +62 -30 4 -188 -71 17 4850 2934 4 MP DP +c45 + +73 -11 11 -160 -74 -3 4705 2958 4 MP PP +c0 + +73 -11 11 -160 -74 -3 4705 2958 4 MP DP +c41 + +-24 -47 37 -137 29 36 2430 1598 4 MP PP +c0 + +-24 -47 37 -137 29 36 2430 1598 4 MP DP +c44 + +6 52 5 21 -3 -50 1841 3133 4 MP PP +c0 + +6 52 5 21 -3 -50 1841 3133 4 MP DP +c45 + +53 -36 -5 -201 -65 26 4915 2908 4 MP PP +c0 + +53 -36 -5 -201 -65 26 4915 2908 4 MP DP +c44 + +-35 -47 23 64 33 46 1150 3187 4 MP PP +c0 + +-35 -47 23 64 33 46 1150 3187 4 MP DP +c43 + +0 46 395 -106 -8 -40 3636 1695 4 MP PP +c0 + +0 46 395 -106 -8 -40 3636 1695 4 MP DP +c45 + +73 -2 9 -145 -71 -13 4631 2955 4 MP PP +c0 + +73 -2 9 -145 -71 -13 4631 2955 4 MP DP +c40 + +-20 -32 373 50 31 34 4667 1428 4 MP PP +c0 + +-20 -32 373 50 31 34 4667 1428 4 MP DP +c44 + +21 51 2 19 -18 -49 1838 3083 4 MP PP +c0 + +21 51 2 19 -18 -49 1838 3083 4 MP DP +c45 + +40 -42 -17 -211 -55 34 4970 2874 4 MP PP +c0 + +40 -42 -17 -211 -55 34 4970 2874 4 MP DP +c41 + +-58 26 22 -90 57 -24 2977 1709 4 MP PP +c0 + +-58 26 22 -90 57 -24 2977 1709 4 MP DP +c44 + +-21 -50 21 63 19 49 1131 3138 4 MP PP +c0 + +-21 -50 21 63 19 49 1131 3138 4 MP DP +c43 + +41 27 345 -87 -45 -30 3876 1987 4 MP PP +c0 + +41 27 345 -87 -45 -30 3876 1987 4 MP DP +c44 + +36 46 -1 19 -33 -46 1820 3034 4 MP PP +c0 + +36 46 -1 19 -33 -46 1820 3034 4 MP DP +c45 + +71 8 2 -131 -64 -22 4560 2942 4 MP PP +c0 + +71 8 2 -131 -64 -22 4560 2942 4 MP DP +c41 + +-39 -43 33 -127 43 33 2459 1634 4 MP PP +c0 + +-39 -43 33 -127 43 33 2459 1634 4 MP DP +c44 + +-6 -53 19 62 2 50 1129 3088 4 MP PP +c0 + +-6 -53 19 62 2 50 1129 3088 4 MP DP +c40 + +49 -26 210 26 -35 27 4678 1837 4 MP PP +c0 + +49 -26 210 26 -35 27 4678 1837 4 MP DP +c45 + +27 -46 -32 -219 -44 40 5014 2834 4 MP PP +c0 + +27 -46 -32 -219 -44 40 5014 2834 4 MP DP +c44 + +47 40 -2 19 -46 -40 1787 2988 4 MP PP +c0 + +47 40 -2 19 -46 -40 1787 2988 4 MP DP +c44 + +10 -52 15 59 -12 50 1141 3038 4 MP PP +c0 + +10 -52 15 59 -12 50 1141 3038 4 MP DP +c42 + +-40 6 413 -53 35 -3 4104 1439 4 MP PP +c0 + +-40 6 413 -53 35 -3 4104 1439 4 MP DP +c41 + +-66 17 21 -88 65 -17 2912 1726 4 MP PP +c0 + +-66 17 21 -88 65 -17 2912 1726 4 MP DP +c45 + +65 17 -7 -117 -56 -31 4496 2920 4 MP PP +c0 + +65 17 -7 -117 -56 -31 4496 2920 4 MP DP +c44 + +59 32 -4 21 -57 -34 1741 2948 4 MP PP +c0 + +59 32 -4 21 -57 -34 1741 2948 4 MP DP +c42 + +40 -6 269 -34 -36 4 4332 1918 4 MP PP +c0 + +40 -6 269 -34 -36 4 4332 1918 4 MP DP +c44 + +24 -50 13 57 -28 46 1169 2992 4 MP PP +c0 + +24 -50 13 57 -28 46 1169 2992 4 MP DP +c41 + +-50 -38 28 -117 55 28 2502 1667 4 MP PP +c0 + +-50 -38 28 -117 55 28 2502 1667 4 MP DP +c43 + +-9 40 402 -113 2 -33 3628 1655 4 MP PP +c0 + +-9 40 402 -113 2 -33 3628 1655 4 MP DP +c40 + +-11 -39 359 47 25 42 4698 1462 4 MP PP +c0 + +-11 -39 359 47 25 42 4698 1462 4 MP DP +c45 + +13 -47 -49 -225 -31 45 5045 2789 4 MP PP +c0 + +13 -47 -49 -225 -31 45 5045 2789 4 MP DP +c44 + +66 22 -4 23 -66 -24 1684 2914 4 MP PP +c0 + +66 22 -4 23 -66 -24 1684 2914 4 MP DP +c44 + +39 -45 9 53 -42 41 1211 2951 4 MP PP +c0 + +39 -45 9 53 -42 41 1211 2951 4 MP DP +c41 + +-72 8 20 -88 71 -10 2841 1736 4 MP PP +c0 + +-72 8 20 -88 71 -10 2841 1736 4 MP DP +c43 + +40 17 341 -90 -43 -22 3919 2009 4 MP PP +c0 + +40 17 341 -90 -43 -22 3919 2009 4 MP DP +c44 + +72 12 -4 26 -72 -15 1618 2890 4 MP PP +c0 + +72 12 -4 26 -72 -15 1618 2890 4 MP DP +c44 + +50 -39 6 49 -53 34 1264 2917 4 MP PP +c0 + +50 -39 6 49 -53 34 1264 2917 4 MP DP +c41 + +-61 -31 25 -107 64 21 2557 1695 4 MP PP +c0 + +-61 -31 25 -107 64 21 2557 1695 4 MP DP +c40 + +46 -34 224 27 -29 37 4707 1800 4 MP PP +c0 + +46 -34 224 27 -29 37 4707 1800 4 MP DP +c44 + +74 1 -3 30 -75 -5 1546 2875 4 MP PP +c0 + +74 1 -3 30 -75 -5 1546 2875 4 MP DP +c44 + +61 -30 3 44 -64 25 1328 2892 4 MP PP +c0 + +61 -30 3 44 -64 25 1328 2892 4 MP DP +c45 + +56 27 -20 -106 -43 -38 4440 2889 4 MP PP +c0 + +56 27 -20 -106 -43 -38 4440 2889 4 MP DP +c44 + +72 -10 -2 34 -73 6 1471 2870 4 MP PP +c0 + +72 -10 -2 34 -73 6 1471 2870 4 MP DP +c44 + +68 -21 0 39 -70 16 1398 2876 4 MP PP +c0 + +68 -21 0 39 -70 16 1398 2876 4 MP DP +c41 + +-74 -3 19 -90 75 -1 2766 1737 4 MP PP +c0 + +-74 -3 19 -90 75 -1 2766 1737 4 MP DP +c41 + +-68 -22 22 -100 71 15 2621 1716 4 MP PP +c0 + +-68 -22 22 -100 71 15 2621 1716 4 MP DP +c41 + +-72 -12 20 -94 74 6 2692 1731 4 MP PP +c0 + +-72 -12 20 -94 74 6 2692 1731 4 MP DP +/c46 { 0.000000 1.000000 0.437500 sc} bdef +c46 + +44 42 101 -61 -51 -38 3094 1287 4 MP PP +c0 + +44 42 101 -61 -51 -38 3094 1287 4 MP DP +c46 + +55 34 107 -64 -61 -31 3043 1249 4 MP PP +c0 + +55 34 107 -64 -61 -31 3043 1249 4 MP DP +c46 + +32 47 94 -57 -38 -43 3132 1330 4 MP PP +c0 + +32 47 94 -57 -38 -43 3132 1330 4 MP DP +c45 + +-4 -47 -67 -227 -15 48 5060 2741 4 MP PP +c0 + +-4 -47 -67 -227 -15 48 5060 2741 4 MP DP +c40 + +-1 -45 342 44 18 48 4723 1504 4 MP PP +c0 + +-1 -45 342 44 18 48 4723 1504 4 MP DP +c46 + +64 25 111 -67 -68 -22 2982 1218 4 MP PP +c0 + +64 25 111 -67 -68 -22 2982 1218 4 MP DP +c46 + +17 52 88 -53 -25 -47 3157 1377 4 MP PP +c0 + +17 52 88 -53 -25 -47 3157 1377 4 MP DP +/c47 { 1.000000 0.093750 0.000000 sc} bdef +c47 + +38 45 406 -134 -40 -44 3342 2011 4 MP PP +c0 + +38 45 406 -134 -40 -44 3342 2011 4 MP DP +c42 + +-41 -4 415 -56 39 7 4139 1436 4 MP PP +c0 + +-41 -4 415 -56 39 7 4139 1436 4 MP DP +c40 + +42 -41 241 30 -23 43 4730 1757 4 MP PP +c0 + +42 -41 241 30 -23 43 4730 1757 4 MP DP +c46 + +69 15 114 -70 -72 -12 2914 1196 4 MP PP +c0 + +69 15 114 -70 -72 -12 2914 1196 4 MP DP +c47 + +41 42 404 -133 -45 -42 3387 2053 4 MP PP +c0 + +41 42 404 -133 -45 -42 3387 2053 4 MP DP +c46 + +3 53 80 -48 -9 -49 3166 1426 4 MP PP +c0 + +3 53 80 -48 -9 -49 3166 1426 4 MP DP +c45 + +46 34 -35 -97 -31 -43 4397 2851 4 MP PP +c0 + +46 34 -35 -97 -31 -43 4397 2851 4 MP DP +c43 + +-17 32 407 -119 12 -26 3630 1622 4 MP PP +c0 + +-17 32 407 -119 12 -26 3630 1622 4 MP DP +c42 + +38 -18 273 -36 -30 14 4362 1904 4 MP PP +c0 + +38 -18 273 -36 -30 14 4362 1904 4 MP DP +c47 + +31 48 409 -139 -34 -43 3302 1967 4 MP PP +c0 + +31 48 409 -139 -34 -43 3302 1967 4 MP DP +c40 + +9 -48 323 40 10 52 4741 1552 4 MP PP +c0 + +9 -48 323 40 10 52 4741 1552 4 MP DP +c45 + +-18 -45 -86 -226 0 48 5060 2693 4 MP PP +c0 + +-18 -45 -86 -226 0 48 5060 2693 4 MP DP +c46 + +71 4 117 -71 -74 -3 2842 1184 4 MP PP +c0 + +71 4 117 -71 -74 -3 2842 1184 4 MP DP +c47 + +44 37 400 -133 -47 -40 3434 2093 4 MP PP +c0 + +44 37 400 -133 -47 -40 3434 2093 4 MP DP +c46 + +-12 52 74 -44 6 -48 3160 1474 4 MP PP +c0 + +-12 52 74 -44 6 -48 3160 1474 4 MP DP +c43 + +39 8 338 -95 -39 -12 3958 2021 4 MP PP +c0 + +39 8 338 -95 -39 -12 3958 2021 4 MP DP +c40 + +36 -46 260 32 -15 49 4745 1708 4 MP PP +c0 + +36 -46 260 32 -15 49 4745 1708 4 MP DP +c40 + +19 -50 303 38 1 52 4751 1604 4 MP PP +c0 + +19 -50 303 38 1 52 4751 1604 4 MP DP +c40 + +29 -49 281 35 -7 52 4752 1656 4 MP PP +c0 + +29 -49 281 35 -7 52 4752 1656 4 MP DP +c47 + +25 46 411 -144 -27 -41 3268 1924 4 MP PP +c0 + +25 46 411 -144 -27 -41 3268 1924 4 MP DP +c46 + +71 -8 117 -71 -71 8 2768 1181 4 MP PP +c0 + +71 -8 117 -71 -71 8 2768 1181 4 MP DP +c45 + +33 40 -53 -90 -15 -47 4366 2808 4 MP PP +c0 + +33 40 -53 -90 -15 -47 4366 2808 4 MP DP +c46 + +-27 48 68 -40 21 -45 3139 1519 4 MP PP +c0 + +-27 48 68 -40 21 -45 3139 1519 4 MP DP +c45 + +-32 -40 -104 -223 15 47 5045 2646 4 MP PP +c0 + +-32 -40 -104 -223 15 47 5045 2646 4 MP DP +c47 + +45 30 397 -136 -47 -34 3481 2127 4 MP PP +c0 + +45 30 397 -136 -47 -34 3481 2127 4 MP DP +/c48 { 1.000000 0.000000 0.656250 sc} bdef +c48 + +27 48 37 -10 -21 -51 1843 3104 4 MP PP +c0 + +27 48 37 -10 -21 -51 1843 3104 4 MP DP +c48 + +40 45 33 -9 -36 -46 1822 3053 4 MP PP +c0 + +40 45 33 -9 -36 -46 1822 3053 4 MP DP +c46 + +67 -17 117 -71 -67 17 2697 1189 4 MP PP +c0 + +67 -17 117 -71 -67 17 2697 1189 4 MP DP +c46 + +-40 44 62 -37 35 -41 3104 1560 4 MP PP +c0 + +-40 44 62 -37 35 -41 3104 1560 4 MP DP +c48 + +14 51 43 -13 -6 -52 1849 3156 4 MP PP +c0 + +14 51 43 -13 -6 -52 1849 3156 4 MP DP +c42 + +-39 -15 413 -58 41 17 4178 1443 4 MP PP +c0 + +-39 -15 413 -58 41 17 4178 1443 4 MP DP +c48 + +49 40 31 -9 -47 -40 1786 3007 4 MP PP +c0 + +49 40 31 -9 -47 -40 1786 3007 4 MP DP +c43 + +-24 24 412 -126 19 -17 3642 1596 4 MP PP +c0 + +-24 24 412 -126 19 -17 3642 1596 4 MP DP +c42 + +35 -27 281 -40 -25 23 4387 1881 4 MP PP +c0 + +35 -27 281 -40 -25 23 4387 1881 4 MP DP +c48 + +1 49 51 -14 10 -53 1839 3209 4 MP PP +c0 + +1 49 51 -14 10 -53 1839 3209 4 MP DP +c45 + +18 45 -71 -87 0 -48 4351 2761 4 MP PP +c0 + +18 45 -71 -87 0 -48 4351 2761 4 MP DP +c47 + +16 44 412 -151 -17 -37 3241 1883 4 MP PP +c0 + +16 44 412 -151 -17 -37 3241 1883 4 MP DP +c48 + +57 32 33 -9 -59 -32 1739 2967 4 MP PP +c0 + +57 32 33 -9 -59 -32 1739 2967 4 MP DP +c46 + +61 -28 114 -69 -58 26 2630 1206 4 MP PP +c0 + +61 -28 114 -69 -58 26 2630 1206 4 MP DP +c45 + +-46 -34 -121 -216 30 43 5015 2603 4 MP PP +c0 + +-46 -34 -121 -216 30 43 5015 2603 4 MP DP +c46 + +-51 37 57 -34 48 -35 3056 1595 4 MP PP +c0 + +-51 37 57 -34 48 -35 3056 1595 4 MP DP +c48 + +-13 47 62 -18 25 -50 1814 3259 4 MP PP +c0 + +-13 47 62 -18 25 -50 1814 3259 4 MP DP +c43 + +36 -4 338 -99 -34 -3 3992 2024 4 MP PP +c0 + +36 -4 338 -99 -34 -3 3992 2024 4 MP DP +c48 + +63 23 36 -10 -66 -22 1680 2935 4 MP PP +c0 + +63 23 36 -10 -66 -22 1680 2935 4 MP DP +c47 + +43 22 395 -140 -46 -27 3527 2154 4 MP PP +c0 + +43 22 395 -140 -46 -27 3527 2154 4 MP DP +c45 + +3 47 -90 -86 16 -48 4351 2713 4 MP PP +c0 + +3 47 -90 -86 16 -48 4351 2713 4 MP DP +c46 + +51 -37 111 -67 -48 35 2572 1232 4 MP PP +c0 + +51 -37 111 -67 -48 35 2572 1232 4 MP DP +c48 + +-26 41 74 -21 38 -45 1776 3304 4 MP PP +c0 + +-26 41 74 -21 38 -45 1776 3304 4 MP DP +c46 + +-61 28 54 -32 58 -26 2998 1621 4 MP PP +c0 + +-61 28 54 -32 58 -26 2998 1621 4 MP DP +c48 + +65 14 43 -12 -72 -12 1614 2913 4 MP PP +c0 + +65 14 43 -12 -72 -12 1614 2913 4 MP DP +c45 + +-57 -26 -137 -207 44 38 4971 2565 4 MP PP +c0 + +-57 -26 -137 -207 44 38 4971 2565 4 MP DP +c42 + +-35 -26 408 -59 40 27 4219 1460 4 MP PP +c0 + +-35 -26 408 -59 40 27 4219 1460 4 MP DP +c47 + +8 40 412 -160 -8 -31 3224 1846 4 MP PP +c0 + +8 40 412 -160 -8 -31 3224 1846 4 MP DP +c42 + +29 -37 291 -44 -16 33 4403 1848 4 MP PP +c0 + +29 -37 291 -44 -16 33 4403 1848 4 MP DP +c48 + +-38 35 86 -25 51 -38 1725 3342 4 MP PP +c0 + +-38 35 86 -25 51 -38 1725 3342 4 MP DP +c46 + +40 -44 106 -64 -35 41 2524 1267 4 MP PP +c0 + +40 -44 106 -64 -35 41 2524 1267 4 MP DP +c46 + +-67 17 51 -30 66 -17 2932 1638 4 MP PP +c0 + +-67 17 51 -30 66 -17 2932 1638 4 MP DP +c45 + +-12 47 -108 -88 30 -45 4367 2665 4 MP PP +c0 + +-12 47 -108 -88 30 -45 4367 2665 4 MP DP +c43 + +-31 14 415 -133 28 -7 3661 1579 4 MP PP +c0 + +-31 14 415 -133 28 -7 3661 1579 4 MP DP +c48 + +65 3 52 -14 -74 -1 1542 2901 4 MP PP +c0 + +65 3 52 -14 -74 -1 1542 2901 4 MP DP +c45 + +-65 -18 -150 -195 55 30 4916 2535 4 MP PP +c0 + +-65 -18 -150 -195 55 30 4916 2535 4 MP DP +c47 + +39 12 392 -145 -42 -20 3569 2174 4 MP PP +c0 + +39 12 392 -145 -42 -20 3569 2174 4 MP DP +c2 + +45 42 428 -161 -45 -41 2959 2213 4 MP PP +c0 + +45 42 428 -161 -45 -41 2959 2213 4 MP DP +c2 + +47 40 428 -160 -48 -41 3007 2254 4 MP PP +c0 + +47 40 428 -160 -48 -41 3007 2254 4 MP DP +c46 + +26 -48 101 -61 -21 45 2489 1308 4 MP PP +c0 + +26 -48 101 -61 -21 45 2489 1308 4 MP DP +/c49 { 1.000000 0.000000 0.562500 sc} bdef +c49 + +44 43 85 -40 -40 -45 1859 3043 4 MP PP +c0 + +44 43 85 -40 -40 -45 1859 3043 4 MP DP +c49 + +50 39 84 -39 -49 -40 1819 2998 4 MP PP +c0 + +50 39 84 -39 -49 -40 1819 2998 4 MP DP +c46 + +-71 8 50 -30 72 -8 2860 1646 4 MP PP +c0 + +-71 8 50 -30 72 -8 2860 1646 4 MP DP +c43 + +30 -14 340 -106 -28 7 4020 2017 4 MP PP +c0 + +30 -14 340 -106 -28 7 4020 2017 4 MP DP +c48 + +-48 27 99 -28 60 -31 1665 3373 4 MP PP +c0 + +-48 27 99 -28 60 -31 1665 3373 4 MP DP +c45 + +-27 46 -125 -94 44 -40 4397 2620 4 MP PP +c0 + +-27 46 -125 -94 44 -40 4397 2620 4 MP DP +c2 + +40 44 426 -165 -38 -40 2914 2172 4 MP PP +c0 + +40 44 426 -165 -38 -40 2914 2172 4 MP DP +c49 + +36 43 89 -42 -27 -48 1886 3091 4 MP PP +c0 + +36 43 89 -42 -27 -48 1886 3091 4 MP DP +c49 + +55 34 86 -41 -57 -32 1770 2958 4 MP PP +c0 + +55 34 86 -41 -57 -32 1770 2958 4 MP DP +c48 + +62 -7 62 -17 -72 10 1468 2900 4 MP PP +c0 + +62 -7 62 -17 -72 10 1468 2900 4 MP DP +c2 + +47 34 427 -161 -50 -38 3057 2292 4 MP PP +c0 + +47 34 427 -161 -50 -38 3057 2292 4 MP DP +c42 + +-31 -34 400 -61 39 36 4259 1487 4 MP PP +c0 + +-31 -34 400 -61 39 36 4259 1487 4 MP DP +c45 + +-70 -8 -160 -183 65 23 4851 2512 4 MP PP +c0 + +-70 -8 -160 -183 65 23 4851 2512 4 MP DP +c46 + +13 -52 94 -57 -6 48 2468 1353 4 MP PP +c0 + +13 -52 94 -57 -6 48 2468 1353 4 MP DP +c42 + +23 -43 304 -48 -9 40 4412 1808 4 MP PP +c0 + +23 -43 304 -48 -9 40 4412 1808 4 MP DP +c46 + +-71 -4 51 -30 74 3 2786 1643 4 MP PP +c0 + +-71 -4 51 -30 74 3 2786 1643 4 MP DP +c45 + +-41 42 -139 -102 55 -34 4441 2580 4 MP PP +c0 + +-41 42 -139 -102 55 -34 4441 2580 4 MP DP +c48 + +-56 17 111 -32 68 -20 1597 3393 4 MP PP +c0 + +-56 17 111 -32 68 -20 1597 3393 4 MP DP +c47 + +-2 33 412 -169 2 -24 3216 1815 4 MP PP +c0 + +-2 33 412 -169 2 -24 3216 1815 4 MP DP +c49 + +26 43 98 -47 -14 -51 1900 3142 4 MP PP +c0 + +26 43 98 -47 -14 -51 1900 3142 4 MP DP +c49 + +56 27 93 -45 -63 -23 1713 2926 4 MP PP +c0 + +56 27 93 -45 -63 -23 1713 2926 4 MP DP +c45 + +-74 2 -165 -168 71 13 4780 2499 4 MP PP +c0 + +-74 2 -165 -168 71 13 4780 2499 4 MP DP +c46 + +-3 -53 87 -53 10 49 2462 1401 4 MP PP +c0 + +-3 -53 87 -53 10 49 2462 1401 4 MP DP +c46 + +-69 -15 54 -31 72 12 2714 1631 4 MP PP +c0 + +-69 -15 54 -31 72 12 2714 1631 4 MP DP +c2 + +34 43 424 -171 -32 -37 2876 2132 4 MP PP +c0 + +34 43 424 -171 -32 -37 2876 2132 4 MP DP +c48 + +57 -17 73 -21 -68 21 1396 2910 4 MP PP +c0 + +57 -17 73 -21 -68 21 1396 2910 4 MP DP +c45 + +-52 36 -152 -112 65 -26 4496 2546 4 MP PP +c0 + +-52 36 -152 -112 65 -26 4496 2546 4 MP DP +c2 + +46 27 424 -165 -49 -34 3106 2326 4 MP PP +c0 + +46 27 424 -165 -49 -34 3106 2326 4 MP DP +c46 + +-18 -52 81 -48 24 47 2472 1450 4 MP PP +c0 + +-18 -52 81 -48 24 47 2472 1450 4 MP DP +c45 + +-72 12 -168 -153 74 3 4706 2496 4 MP PP +c0 + +-72 12 -168 -153 74 3 4706 2496 4 MP DP +c46 + +-63 -25 57 -34 68 22 2646 1609 4 MP PP +c0 + +-63 -25 57 -34 68 22 2646 1609 4 MP DP +c43 + +-35 3 416 -139 34 3 3689 1572 4 MP PP +c0 + +-35 3 416 -139 34 3 3689 1572 4 MP DP +c45 + +-62 29 -161 -124 71 -17 4561 2520 4 MP PP +c0 + +-62 29 -161 -124 71 -17 4561 2520 4 MP DP +c42 + +-25 -42 389 -61 36 42 4298 1523 4 MP PP +c0 + +-25 -42 389 -61 36 42 4298 1523 4 MP DP +c45 + +-69 21 -166 -138 74 -7 4632 2503 4 MP PP +c0 + +-69 21 -166 -138 74 -7 4632 2503 4 MP DP +c46 + +-31 -47 73 -44 39 43 2496 1497 4 MP PP +c0 + +-31 -47 73 -44 39 43 2496 1497 4 MP DP +c46 + +-55 -34 62 -37 61 31 2585 1578 4 MP PP +c0 + +-55 -34 62 -37 61 31 2585 1578 4 MP DP +c48 + +-62 7 123 -35 73 -10 1524 3403 4 MP PP +c0 + +-62 7 123 -35 73 -10 1524 3403 4 MP DP +c47 + +34 3 389 -153 -37 -12 3606 2186 4 MP PP +c0 + +34 3 389 -153 -37 -12 3606 2186 4 MP DP +c42 + +15 -49 318 -51 0 46 4412 1762 4 MP PP +c0 + +15 -49 318 -51 0 46 4412 1762 4 MP DP +c46 + +-45 -42 68 -40 50 38 2535 1540 4 MP PP +c0 + +-45 -42 68 -40 50 38 2535 1540 4 MP DP +c49 + +16 40 110 -55 -1 -49 1901 3191 4 MP PP +c0 + +16 40 110 -55 -1 -49 1901 3191 4 MP DP +c49 + +56 21 102 -52 -65 -14 1650 2903 4 MP PP +c0 + +56 21 102 -52 -65 -14 1650 2903 4 MP DP +c48 + +48 -27 86 -24 -61 30 1328 2931 4 MP PP +c0 + +48 -27 86 -24 -61 30 1328 2931 4 MP DP +c43 + +25 -23 342 -113 -20 17 4040 2000 4 MP PP +c0 + +25 -23 342 -113 -20 17 4040 2000 4 MP DP +c2 + +27 41 419 -180 -22 -32 2844 2095 4 MP PP +c0 + +27 41 419 -180 -22 -32 2844 2095 4 MP DP +c42 + +-18 -48 377 -60 30 47 4334 1565 4 MP PP +c0 + +-18 -48 377 -60 30 47 4334 1565 4 MP DP +c48 + +-65 -3 134 -38 73 1 1451 3402 4 MP PP +c0 + +-65 -3 134 -38 73 1 1451 3402 4 MP DP +/c50 { 1.000000 0.000000 0.468750 sc} bdef +c50 + +51 39 184 -96 -50 -39 1904 2958 4 MP PP +c0 + +51 39 184 -96 -50 -39 1904 2958 4 MP DP +c42 + +7 -52 333 -54 8 49 4404 1713 4 MP PP +c0 + +7 -52 333 -54 8 49 4404 1713 4 MP DP +c2 + +42 20 421 -172 -46 -29 3152 2355 4 MP PP +c0 + +42 20 421 -172 -46 -29 3152 2355 4 MP DP +c50 + +47 39 185 -96 -44 -43 1948 3001 4 MP PP +c0 + +47 39 185 -96 -44 -43 1948 3001 4 MP DP +c50 + +53 37 186 -99 -55 -34 1854 2919 4 MP PP +c0 + +53 37 186 -99 -55 -34 1854 2919 4 MP DP +c48 + +38 -35 98 -28 -50 39 1267 2961 4 MP PP +c0 + +38 -35 98 -28 -50 39 1267 2961 4 MP DP +c42 + +-10 -52 363 -58 24 50 4364 1612 4 MP PP +c0 + +-10 -52 363 -58 24 50 4364 1612 4 MP DP +c42 + +-1 -52 348 -57 16 51 4388 1662 4 MP PP +c0 + +-1 -52 348 -57 16 51 4388 1662 4 MP DP +c47 + +-12 26 412 -179 12 -16 3218 1791 4 MP PP +c0 + +-12 26 412 -179 12 -16 3218 1791 4 MP DP +/c51 { 1.000000 0.000000 0.187500 sc} bdef +c51 + +50 38 418 -173 -50 -39 2639 2466 4 MP PP +c0 + +50 38 418 -173 -50 -39 2639 2466 4 MP DP +c51 + +48 41 417 -175 -47 -39 2589 2427 4 MP PP +c0 + +48 41 417 -175 -47 -39 2589 2427 4 MP DP +c49 + +3 36 125 -64 13 -47 1888 3238 4 MP PP +c0 + +3 36 125 -64 13 -47 1888 3238 4 MP DP +c49 + +52 11 115 -60 -65 -3 1585 2889 4 MP PP +c0 + +52 11 115 -60 -65 -3 1585 2889 4 MP DP +c48 + +-66 -14 142 -40 72 11 1379 3391 4 MP PP +c0 + +-66 -14 142 -40 72 11 1379 3391 4 MP DP +c50 + +41 38 188 -100 -36 -43 1984 3044 4 MP PP +c0 + +41 38 188 -100 -36 -43 1984 3044 4 MP DP +c50 + +52 32 190 -104 -56 -27 1799 2885 4 MP PP +c0 + +52 32 190 -104 -56 -27 1799 2885 4 MP DP +c43 + +-39 -7 415 -144 40 12 3723 1575 4 MP PP +c0 + +-39 -7 415 -144 40 12 3723 1575 4 MP DP +c48 + +26 -41 111 -32 -39 45 1217 3000 4 MP PP +c0 + +26 -41 111 -32 -39 45 1217 3000 4 MP DP +c51 + +49 34 418 -174 -51 -38 2690 2504 4 MP PP +c0 + +49 34 418 -174 -51 -38 2690 2504 4 MP DP +c51 + +45 41 414 -179 -42 -37 2542 2388 4 MP PP +c0 + +45 41 414 -179 -42 -37 2542 2388 4 MP DP +c47 + +28 -7 386 -162 -30 -2 3636 2188 4 MP PP +c0 + +28 -7 386 -162 -30 -2 3636 2188 4 MP DP +c48 + +-62 -23 148 -43 66 23 1313 3368 4 MP PP +c0 + +-62 -23 148 -43 66 23 1313 3368 4 MP DP +c43 + +16 -33 347 -119 -11 26 4051 1974 4 MP PP +c0 + +16 -33 347 -119 -11 26 4051 1974 4 MP DP +c2 + +17 37 415 -190 -13 -27 2822 2063 4 MP PP +c0 + +17 37 415 -190 -13 -27 2822 2063 4 MP DP +c48 + +13 -47 122 -35 -24 50 1178 3045 4 MP PP +c0 + +13 -47 122 -35 -24 50 1178 3045 4 MP DP +c2 + +37 12 417 -181 -42 -21 3194 2376 4 MP PP +c0 + +37 12 417 -181 -42 -21 3194 2376 4 MP DP +c51 + +46 29 416 -178 -49 -35 2739 2539 4 MP PP +c0 + +46 29 416 -178 -49 -35 2739 2539 4 MP DP +c50 + +34 35 193 -105 -26 -43 2010 3087 4 MP PP +c0 + +34 35 193 -105 -26 -43 2010 3087 4 MP DP +c48 + +-57 -33 152 -43 59 32 1254 3336 4 MP PP +c0 + +-57 -33 152 -43 59 32 1254 3336 4 MP DP +/c52 { 1.000000 0.000000 0.375000 sc} bdef +c52 + +51 38 285 -147 -51 -39 2089 2862 4 MP PP +c0 + +51 38 285 -147 -51 -39 2089 2862 4 MP DP +c52 + +52 38 286 -148 -53 -37 2038 2823 4 MP PP +c0 + +52 38 286 -148 -53 -37 2038 2823 4 MP DP +c50 + +48 27 198 -110 -56 -21 1743 2858 4 MP PP +c0 + +48 27 198 -110 -56 -21 1743 2858 4 MP DP +c48 + +-1 -49 133 -38 -10 52 1154 3095 4 MP PP +c0 + +-1 -49 133 -38 -10 52 1154 3095 4 MP DP +c49 + +-8 31 141 -75 26 -41 1862 3279 4 MP PP +c0 + +-8 31 141 -75 26 -41 1862 3279 4 MP DP +c49 + +47 3 130 -70 -62 7 1520 2886 4 MP PP +c0 + +47 3 130 -70 -62 7 1520 2886 4 MP DP +/c53 { 1.000000 0.000000 0.281250 sc} bdef +c53 + +51 38 368 -172 -52 -38 2323 2676 4 MP PP +c0 + +51 38 368 -172 -52 -38 2323 2676 4 MP DP +/c54 { 0.000000 1.000000 0.531250 sc} bdef +c54 + +-32 47 105 26 27 -48 3201 1482 4 MP PP +c0 + +-32 47 105 26 27 -48 3201 1482 4 MP DP +c51 + +38 40 411 -187 -35 -32 2500 2351 4 MP PP +c0 + +38 40 411 -187 -35 -32 2500 2351 4 MP DP +c54 + +-17 50 110 28 12 -52 3228 1434 4 MP PP +c0 + +-17 50 110 28 12 -52 3228 1434 4 MP DP +c54 + +-44 43 100 25 40 -44 3161 1526 4 MP PP +c0 + +-44 43 100 25 40 -44 3161 1526 4 MP DP +c48 + +-50 -39 154 -44 48 39 1206 3297 4 MP PP +c0 + +-50 -39 154 -44 48 39 1206 3297 4 MP DP +c53 + +50 39 368 -174 -50 -37 2271 2638 4 MP PP +c0 + +50 39 368 -174 -50 -37 2271 2638 4 MP DP +c52 + +48 36 285 -148 -47 -39 2136 2901 4 MP PP +c0 + +48 36 285 -148 -47 -39 2136 2901 4 MP DP +c48 + +-15 -50 142 -41 6 53 1144 3147 4 MP PP +c0 + +-15 -50 142 -41 6 53 1144 3147 4 MP DP +c52 + +50 37 288 -153 -52 -32 1985 2786 4 MP PP +c0 + +50 37 288 -153 -52 -32 1985 2786 4 MP DP +c48 + +-39 -45 152 -44 35 47 1171 3250 4 MP PP +c0 + +-39 -45 152 -44 35 47 1171 3250 4 MP DP +c54 + +-4 51 117 30 -3 -53 3240 1382 4 MP PP +c0 + +-4 51 117 30 -3 -53 3240 1382 4 MP DP +c53 + +49 35 367 -172 -51 -38 2374 2714 4 MP PP +c0 + +49 35 367 -172 -51 -38 2374 2714 4 MP DP +c48 + +-27 -49 148 -42 21 50 1150 3200 4 MP PP +c0 + +-27 -49 148 -42 21 50 1150 3200 4 MP DP +c54 + +-54 36 96 24 51 -37 3110 1563 4 MP PP +c0 + +-54 36 96 24 51 -37 3110 1563 4 MP DP +c47 + +-19 17 410 -190 21 -6 3230 1775 4 MP PP +c0 + +-19 17 410 -190 21 -6 3230 1775 4 MP DP +c43 + +-41 -17 413 -149 43 22 3763 1587 4 MP PP +c0 + +-41 -17 413 -149 43 22 3763 1587 4 MP DP +c54 + +11 48 123 34 -17 -52 3237 1329 4 MP PP +c0 + +11 48 123 34 -17 -52 3237 1329 4 MP DP +c53 + +47 39 367 -179 -46 -34 2221 2601 4 MP PP +c0 + +47 39 367 -179 -46 -34 2221 2601 4 MP DP +c54 + +-62 28 93 23 61 -28 3049 1591 4 MP PP +c0 + +-62 28 93 23 61 -28 3049 1591 4 MP DP +c51 + +42 21 413 -184 -46 -31 2785 2570 4 MP PP +c0 + +42 21 413 -184 -46 -31 2785 2570 4 MP DP +c52 + +43 33 286 -151 -41 -38 2177 2939 4 MP PP +c0 + +43 33 286 -151 -41 -38 2177 2939 4 MP DP +c50 + +25 31 201 -113 -16 -40 2026 3127 4 MP PP +c0 + +25 31 201 -113 -16 -40 2026 3127 4 MP DP +c43 + +9 -40 352 -126 -2 33 4053 1941 4 MP PP +c0 + +9 -40 352 -126 -2 33 4053 1941 4 MP DP +c53 + +46 31 365 -175 -48 -36 2422 2750 4 MP PP +c0 + +46 31 365 -175 -48 -36 2422 2750 4 MP DP +c2 + +8 31 410 -202 -3 -19 2809 2036 4 MP PP +c0 + +8 31 410 -202 -3 -19 2809 2036 4 MP DP +c54 + +26 45 129 36 -32 -47 3220 1277 4 MP PP +c0 + +26 45 129 36 -32 -47 3220 1277 4 MP DP +c52 + +46 34 290 -160 -48 -27 1933 2754 4 MP PP +c0 + +46 34 290 -160 -48 -27 1933 2754 4 MP DP +c47 + +20 -17 384 -171 -21 7 3657 2181 4 MP PP +c0 + +20 -17 384 -171 -21 7 3657 2181 4 MP DP +c54 + +-68 19 92 23 67 -17 2982 1608 4 MP PP +c0 + +-68 19 92 23 67 -17 2982 1608 4 MP DP +c50 + +44 21 206 -120 -52 -11 1687 2837 4 MP PP +c0 + +44 21 206 -120 -52 -11 1687 2837 4 MP DP +c51 + +32 37 406 -197 -27 -27 2465 2319 4 MP PP +c0 + +32 37 406 -197 -27 -27 2465 2319 4 MP DP +c49 + +-20 23 159 -85 38 -35 1824 3314 4 MP PP +c0 + +-20 23 159 -85 38 -35 1824 3314 4 MP DP +c49 + +40 -6 147 -81 -57 17 1458 2893 4 MP PP +c0 + +40 -6 147 -81 -57 17 1458 2893 4 MP DP +c2 + +30 2 412 -190 -35 -15 3229 2391 4 MP PP +c0 + +30 2 412 -190 -35 -15 3229 2391 4 MP DP +c53 + +42 37 365 -187 -40 -29 2175 2567 4 MP PP +c0 + +42 37 365 -187 -40 -29 2175 2567 4 MP DP +c54 + +38 39 135 39 -44 -42 3188 1230 4 MP PP +c0 + +38 39 135 39 -44 -42 3188 1230 4 MP DP +/c55 { 0.000000 0.250000 1.000000 sc} bdef +c55 + +74 -7 49 -130 -74 -5 4730 3093 4 MP PP +c0 + +74 -7 49 -130 -74 -5 4730 3093 4 MP DP +c55 + +71 -17 49 -142 -75 5 4805 3088 4 MP PP +c0 + +71 -17 49 -142 -75 5 4805 3088 4 MP DP +c54 + +-70 9 91 25 71 -8 2911 1616 4 MP PP +c0 + +-70 9 91 25 71 -8 2911 1616 4 MP DP +c55 + +74 3 47 -118 -72 -15 4656 3088 4 MP PP +c0 + +74 3 47 -118 -72 -15 4656 3088 4 MP DP +c55 + +65 -26 45 -154 -71 16 4876 3072 4 MP PP +c0 + +65 -26 45 -154 -71 16 4876 3072 4 MP DP +c43 + +-40 -27 409 -151 44 29 3806 1609 4 MP PP +c0 + +-40 -27 409 -151 44 29 3806 1609 4 MP DP +c53 + +41 25 363 -180 -43 -33 2465 2783 4 MP PP +c0 + +41 25 363 -180 -43 -33 2465 2783 4 MP DP +c52 + +36 28 288 -156 -34 -35 2211 2974 4 MP PP +c0 + +36 28 288 -156 -34 -35 2211 2974 4 MP DP +c55 + +71 13 41 -106 -65 -25 4584 3073 4 MP PP +c0 + +71 13 41 -106 -65 -25 4584 3073 4 MP DP +c55 + +55 -34 39 -164 -65 25 4941 3047 4 MP PP +c0 + +55 -34 39 -164 -65 25 4941 3047 4 MP DP +c47 + +-28 7 408 -199 30 2 3251 1769 4 MP PP +c0 + +-28 7 408 -199 30 2 3251 1769 4 MP DP +c51 + +35 15 409 -194 -41 -25 2826 2595 4 MP PP +c0 + +35 15 409 -194 -41 -25 2826 2595 4 MP DP +c43 + +0 -46 359 -133 7 40 4046 1901 4 MP PP +c0 + +0 -46 359 -133 7 40 4046 1901 4 MP DP +c52 + +40 29 294 -168 -44 -21 1885 2727 4 MP PP +c0 + +40 29 294 -168 -44 -21 1885 2727 4 MP DP +c54 + +50 31 140 42 -55 -34 3144 1188 4 MP PP +c0 + +50 31 140 42 -55 -34 3144 1188 4 MP DP +c54 + +-69 -2 92 26 71 4 2840 1612 4 MP PP +c0 + +-69 -2 92 26 71 4 2840 1612 4 MP DP +c50 + +14 26 210 -122 -3 -36 2029 3163 4 MP PP +c0 + +14 26 210 -122 -3 -36 2029 3163 4 MP DP +c55 + +64 22 33 -95 -56 -33 4519 3048 4 MP PP +c0 + +64 22 33 -95 -56 -33 4519 3048 4 MP DP +c55 + +44 -40 29 -173 -55 33 4996 3014 4 MP PP +c0 + +44 -40 29 -173 -55 33 4996 3014 4 MP DP +c50 + +37 13 216 -130 -47 -3 1635 2826 4 MP PP +c0 + +37 13 216 -130 -47 -3 1635 2826 4 MP DP +c51 + +22 32 400 -208 -16 -21 2438 2292 4 MP PP +c0 + +22 32 400 -208 -16 -21 2438 2292 4 MP DP +c49 + +-30 15 177 -97 48 -27 1776 3341 4 MP PP +c0 + +-30 15 177 -97 48 -27 1776 3341 4 MP DP +c49 + +30 -16 165 -92 -48 27 1401 2910 4 MP PP +c0 + +30 -16 165 -92 -48 27 1401 2910 4 MP DP +c53 + +35 32 364 -196 -34 -23 2135 2538 4 MP PP +c0 + +35 32 364 -196 -34 -23 2135 2538 4 MP DP +c2 + +-2 24 404 -215 8 -11 2806 2017 4 MP PP +c0 + +-2 24 404 -215 8 -11 2806 2017 4 MP DP +c47 + +11 -26 383 -181 -12 16 3669 2165 4 MP PP +c0 + +11 -26 383 -181 -12 16 3669 2165 4 MP DP +c54 + +58 23 146 44 -64 -25 3089 1154 4 MP PP +c0 + +58 23 146 44 -64 -25 3089 1154 4 MP DP +c43 + +-39 -36 404 -152 44 37 3850 1638 4 MP PP +c0 + +-39 -36 404 -152 44 37 3850 1638 4 MP DP +c54 + +-65 -12 94 28 69 15 2771 1597 4 MP PP +c0 + +-65 -12 94 28 69 15 2771 1597 4 MP DP +c55 + +56 31 21 -86 -44 -40 4463 3015 4 MP PP +c0 + +56 31 21 -86 -44 -40 4463 3015 4 MP DP +c2 + +21 -7 407 -203 -27 -5 3256 2396 4 MP PP +c0 + +21 -7 407 -203 -27 -5 3256 2396 4 MP DP +c55 + +31 -45 18 -180 -44 40 5040 2974 4 MP PP +c0 + +31 -45 18 -180 -44 40 5040 2974 4 MP DP +c43 + +-8 -49 366 -139 17 44 4029 1857 4 MP PP +c0 + +-8 -49 366 -139 17 44 4029 1857 4 MP DP +c53 + +33 18 361 -188 -36 -28 2501 2811 4 MP PP +c0 + +33 18 361 -188 -36 -28 2501 2811 4 MP DP +c52 + +27 21 290 -163 -25 -31 2236 3005 4 MP PP +c0 + +27 21 290 -163 -25 -31 2236 3005 4 MP DP +c54 + +66 12 149 47 -69 -15 3025 1129 4 MP PP +c0 + +66 12 149 47 -69 -15 3025 1129 4 MP DP +c54 + +-59 -23 98 31 63 25 2708 1572 4 MP PP +c0 + +-59 -23 98 31 63 25 2708 1572 4 MP DP +c55 + +43 38 9 -78 -31 -46 4419 2975 4 MP PP +c0 + +43 38 9 -78 -31 -46 4419 2975 4 MP DP +c52 + +34 23 297 -178 -37 -13 1841 2706 4 MP PP +c0 + +34 23 297 -178 -37 -13 1841 2706 4 MP DP +c43 + +-36 -42 398 -153 42 43 3894 1675 4 MP PP +c0 + +-36 -42 398 -153 42 43 3894 1675 4 MP DP +c55 + +15 -48 5 -185 -30 46 5070 2928 4 MP PP +c0 + +15 -48 5 -185 -30 46 5070 2928 4 MP DP +c51 + +27 5 403 -204 -33 -18 2859 2613 4 MP PP +c0 + +27 5 403 -204 -33 -18 2859 2613 4 MP DP +c43 + +-16 -51 375 -144 24 47 4005 1810 4 MP PP +c0 + +-16 -51 375 -144 24 47 4005 1810 4 MP DP +c47 + +-34 -3 405 -207 37 11 3281 1771 4 MP PP +c0 + +-34 -3 405 -207 37 11 3281 1771 4 MP DP +c50 + +4 18 221 -132 8 -31 2021 3194 4 MP PP +c0 + +4 18 221 -132 8 -31 2021 3194 4 MP DP +c43 + +-30 -47 391 -151 37 45 3936 1718 4 MP PP +c0 + +-30 -47 391 -151 37 45 3936 1718 4 MP DP +c49 + +-39 7 195 -109 56 -17 1720 3358 4 MP PP +c0 + +-39 7 195 -109 56 -17 1720 3358 4 MP DP +c49 + +20 -23 183 -104 -38 35 1353 2937 4 MP PP +c0 + +20 -23 183 -104 -38 35 1353 2937 4 MP DP +c43 + +-24 -50 383 -148 32 47 3973 1763 4 MP PP +c0 + +-24 -50 383 -148 32 47 3973 1763 4 MP DP +c50 + +28 6 228 -142 -40 6 1588 2823 4 MP PP +c0 + +28 6 228 -142 -40 6 1588 2823 4 MP DP +c54 + +69 2 151 49 -71 -4 2956 1114 4 MP PP +c0 + +69 2 151 49 -71 -4 2956 1114 4 MP DP +c53 + +27 27 361 -206 -24 -17 2101 2515 4 MP PP +c0 + +27 27 361 -206 -24 -17 2101 2515 4 MP DP +c54 + +-50 -31 102 33 55 34 2653 1538 4 MP PP +c0 + +-50 -31 102 33 55 34 2653 1538 4 MP DP +c51 + +13 27 394 -221 -7 -14 2422 2271 4 MP PP +c0 + +13 27 394 -221 -7 -14 2422 2271 4 MP DP +c55 + +31 43 -6 -72 -16 -49 4388 2929 4 MP PP +c0 + +31 43 -6 -72 -16 -49 4388 2929 4 MP DP +c55 + +0 -48 -10 -187 -15 49 5085 2879 4 MP PP +c0 + +0 -48 -10 -187 -15 49 5085 2879 4 MP DP +c47 + +2 -33 382 -191 -2 24 3671 2141 4 MP PP +c0 + +2 -33 382 -191 -2 24 3671 2141 4 MP DP +c2 + +-12 16 399 -228 17 -3 2814 2006 4 MP PP +c0 + +-12 16 399 -228 17 -3 2814 2006 4 MP DP +c54 + +70 -9 152 50 -71 8 2885 1110 4 MP PP +c0 + +70 -9 152 50 -71 8 2885 1110 4 MP DP +c53 + +25 11 358 -198 -27 -21 2528 2832 4 MP PP +c0 + +25 11 358 -198 -27 -21 2528 2832 4 MP DP +c2 + +12 -16 401 -215 -18 3 3274 2393 4 MP PP +c0 + +12 -16 401 -215 -18 3 3274 2393 4 MP DP +c54 + +-38 -39 107 36 45 42 2608 1496 4 MP PP +c0 + +-38 -39 107 36 45 42 2608 1496 4 MP DP +c52 + +18 15 292 -173 -14 -26 2250 3031 4 MP PP +c0 + +18 15 292 -173 -14 -26 2250 3031 4 MP DP +c55 + +15 47 -20 -70 -1 -49 4372 2880 4 MP PP +c0 + +15 47 -20 -70 -1 -49 4372 2880 4 MP DP +c55 + +-15 -47 -25 -186 1 50 5084 2829 4 MP PP +c0 + +-15 -47 -25 -186 1 50 5084 2829 4 MP DP +c52 + +24 17 301 -189 -28 -6 1804 2693 4 MP PP +c0 + +24 17 301 -189 -28 -6 1804 2693 4 MP DP +c49 + +-47 -3 212 -119 62 -7 1658 3365 4 MP PP +c0 + +-47 -3 212 -119 62 -7 1658 3365 4 MP DP +c49 + +8 -30 201 -115 -26 41 1315 2972 4 MP PP +c0 + +8 -30 201 -115 -26 41 1315 2972 4 MP DP +c54 + +67 -18 152 51 -67 17 2814 1118 4 MP PP +c0 + +67 -18 152 51 -67 17 2814 1118 4 MP DP +c47 + +-40 -12 403 -215 42 20 3318 1782 4 MP PP +c0 + +-40 -12 403 -215 42 20 3318 1782 4 MP DP +c54 + +-25 -45 114 39 31 47 2577 1449 4 MP PP +c0 + +-25 -45 114 39 31 47 2577 1449 4 MP DP +c51 + +18 -3 397 -217 -25 -11 2884 2624 4 MP PP +c0 + +18 -3 397 -217 -25 -11 2884 2624 4 MP DP +c50 + +-8 11 233 -145 20 -23 2001 3217 4 MP PP +c0 + +-8 11 233 -145 20 -23 2001 3217 4 MP DP +c55 + +0 48 -36 -69 16 -49 4371 2831 4 MP PP +c0 + +0 48 -36 -69 16 -49 4371 2831 4 MP DP +c55 + +-30 -43 -39 -183 16 48 5068 2781 4 MP PP +c0 + +-30 -43 -39 -183 16 48 5068 2781 4 MP DP +c54 + +63 -29 150 52 -61 28 2747 1135 4 MP PP +c0 + +63 -29 150 52 -61 28 2747 1135 4 MP DP +c54 + +-12 -48 120 41 18 52 2559 1397 4 MP PP +c0 + +-12 -48 120 41 18 52 2559 1397 4 MP DP +c53 + +16 21 359 -219 -14 -8 2077 2498 4 MP PP +c0 + +16 21 359 -219 -14 -8 2077 2498 4 MP DP +c50 + +18 -3 240 -155 -30 16 1548 2829 4 MP PP +c0 + +18 -3 240 -155 -30 16 1548 2829 4 MP DP +c47 + +-7 -40 382 -200 8 31 3663 2110 4 MP PP +c0 + +-7 -40 382 -200 8 31 3663 2110 4 MP DP +c51 + +3 19 387 -234 4 -6 2415 2257 4 MP PP +c0 + +3 19 387 -234 4 -6 2415 2257 4 MP DP +c54 + +54 -36 147 51 -51 37 2686 1163 4 MP PP +c0 + +54 -36 147 51 -51 37 2686 1163 4 MP DP +c54 + +4 -51 126 45 3 53 2556 1344 4 MP PP +c0 + +4 -51 126 45 3 53 2556 1344 4 MP DP +c54 + +44 -43 143 50 -40 44 2635 1200 4 MP PP +c0 + +44 -43 143 50 -40 44 2635 1200 4 MP DP +c54 + +18 -50 133 47 -13 52 2569 1292 4 MP PP +c0 + +18 -50 133 47 -13 52 2569 1292 4 MP DP +c2 + +-21 6 393 -240 27 6 2831 2003 4 MP PP +c0 + +-21 6 393 -240 27 6 2831 2003 4 MP DP +c55 + +-16 48 -50 -71 30 -46 4387 2782 4 MP PP +c0 + +-16 48 -50 -71 30 -46 4387 2782 4 MP DP +c54 + +31 -47 138 49 -26 48 2595 1244 4 MP PP +c0 + +31 -47 138 49 -26 48 2595 1244 4 MP DP +c55 + +-44 -38 -53 -178 31 46 5037 2735 4 MP PP +c0 + +-44 -38 -53 -178 31 46 5037 2735 4 MP DP +c49 + +-53 -12 227 -129 65 3 1593 3362 4 MP PP +c0 + +-53 -12 227 -129 65 3 1593 3362 4 MP DP +c49 + +-4 -36 218 -126 -13 47 1289 3013 4 MP PP +c0 + +-4 -36 218 -126 -13 47 1289 3013 4 MP DP +c53 + +14 2 356 -208 -18 -15 2546 2847 4 MP PP +c0 + +14 2 356 -208 -18 -15 2546 2847 4 MP DP +c2 + +2 -24 395 -228 -7 11 3281 2382 4 MP PP +c0 + +2 -24 395 -228 -7 11 3281 2382 4 MP DP +c52 + +7 7 296 -184 -4 -18 2254 3049 4 MP PP +c0 + +7 7 296 -184 -4 -18 2254 3049 4 MP DP +c47 + +-43 -22 400 -221 46 28 3360 1802 4 MP PP +c0 + +-43 -22 400 -221 46 28 3360 1802 4 MP DP +c55 + +-30 45 -63 -76 43 -40 4417 2736 4 MP PP +c0 + +-30 45 -63 -76 43 -40 4417 2736 4 MP DP +/c56 { 0.000000 1.000000 0.625000 sc} bdef +c56 + +-56 36 141 87 54 -36 3203 1586 4 MP PP +c0 + +-56 36 141 87 54 -36 3203 1586 4 MP DP +c52 + +14 8 305 -200 -18 3 1776 2687 4 MP PP +c0 + +14 8 305 -200 -18 3 1776 2687 4 MP DP +c55 + +-55 -30 -66 -170 44 40 4993 2695 4 MP PP +c0 + +-55 -30 -66 -170 44 40 4993 2695 4 MP DP +c56 + +-45 41 142 89 44 -43 3257 1550 4 MP PP +c0 + +-45 41 142 89 44 -43 3257 1550 4 MP DP +c56 + +-62 28 139 87 62 -28 3141 1614 4 MP PP +c0 + +-62 28 139 87 62 -28 3141 1614 4 MP DP +c47 + +-17 -44 383 -209 17 36 3646 2074 4 MP PP +c0 + +-17 -44 383 -209 17 36 3646 2074 4 MP DP +c51 + +7 -11 390 -231 -14 -2 2898 2626 4 MP PP +c0 + +7 -11 390 -231 -14 -2 2898 2626 4 MP DP +c50 + +-18 3 245 -157 30 -15 1971 3232 4 MP PP +c0 + +-18 3 245 -157 30 -15 1971 3232 4 MP DP +c56 + +-34 44 144 92 32 -47 3301 1507 4 MP PP +c0 + +-34 44 144 92 32 -47 3301 1507 4 MP DP +c56 + +-68 21 139 87 68 -19 3073 1633 4 MP PP +c0 + +-68 21 139 87 68 -19 3073 1633 4 MP DP +c55 + +-44 40 -74 -82 55 -34 4460 2696 4 MP PP +c0 + +-44 40 -74 -82 55 -34 4460 2696 4 MP DP +c49 + +-55 -20 239 -138 66 14 1527 3348 4 MP PP +c0 + +-55 -20 239 -138 66 14 1527 3348 4 MP DP +c49 + +-15 -41 232 -134 1 49 1276 3060 4 MP PP +c0 + +-15 -41 232 -134 1 49 1276 3060 4 MP DP +c55 + +-65 -23 -77 -160 56 33 4937 2662 4 MP PP +c0 + +-65 -23 -77 -160 56 33 4937 2662 4 MP DP +c50 + +7 -11 253 -167 -20 23 1518 2845 4 MP PP +c0 + +7 -11 253 -167 -20 23 1518 2845 4 MP DP +c53 + +7 14 355 -232 -3 -1 2063 2490 4 MP PP +c0 + +7 14 355 -232 -3 -1 2063 2490 4 MP DP +c47 + +-44 -29 397 -226 47 34 3406 1830 4 MP PP +c0 + +-44 -29 397 -226 47 34 3406 1830 4 MP DP +c51 + +-8 11 380 -248 15 3 2419 2251 4 MP PP +c0 + +-8 11 380 -248 15 3 2419 2251 4 MP DP +c56 + +-20 46 147 96 17 -50 3333 1460 4 MP PP +c0 + +-20 46 147 96 17 -50 3333 1460 4 MP DP +c56 + +-69 12 139 89 70 -9 3003 1642 4 MP PP +c0 + +-69 12 139 89 70 -9 3003 1642 4 MP DP +c55 + +-55 34 -84 -91 65 -25 4515 2662 4 MP PP +c0 + +-55 34 -84 -91 65 -25 4515 2662 4 MP DP +c55 + +-71 -13 -86 -150 65 25 4872 2637 4 MP PP +c0 + +-71 -13 -86 -150 65 25 4872 2637 4 MP DP +c2 + +-30 -2 387 -252 36 14 2858 2009 4 MP PP +c0 + +-30 -2 387 -252 36 14 2858 2009 4 MP DP +c47 + +-24 -47 383 -217 27 41 3619 2033 4 MP PP +c0 + +-24 -47 383 -217 27 41 3619 2033 4 MP DP +c55 + +-65 26 -90 -102 71 -15 4580 2637 4 MP PP +c0 + +-65 26 -90 -102 71 -15 4580 2637 4 MP DP +c55 + +-74 -3 -92 -138 72 15 4800 2622 4 MP PP +c0 + +-74 -3 -92 -138 72 15 4800 2622 4 MP DP +c49 + +-57 -28 250 -144 62 23 1465 3325 4 MP PP +c0 + +-57 -28 250 -144 62 23 1465 3325 4 MP DP +c49 + +-26 -43 243 -141 15 50 1277 3109 4 MP PP +c0 + +-26 -43 243 -141 15 50 1277 3109 4 MP DP +c2 + +-8 -31 390 -241 2 19 3279 2363 4 MP PP +c0 + +-8 -31 390 -241 2 19 3279 2363 4 MP DP +c55 + +-71 17 -94 -114 75 -5 4651 2622 4 MP PP +c0 + +-71 17 -94 -114 75 -5 4651 2622 4 MP DP +c55 + +-74 7 -94 -126 74 5 4726 2617 4 MP PP +c0 + +-74 7 -94 -126 74 5 4726 2617 4 MP DP +c53 + +5 -6 352 -221 -7 -7 2553 2854 4 MP PP +c0 + +5 -6 352 -221 -7 -7 2553 2854 4 MP DP +c52 + +-3 -1 299 -195 8 -11 2246 3060 4 MP PP +c0 + +-3 -1 299 -195 8 -11 2246 3060 4 MP DP +c47 + +-44 -37 393 -228 48 39 3453 1864 4 MP PP +c0 + +-44 -37 393 -228 48 39 3453 1864 4 MP DP +c56 + +-6 45 149 102 4 -51 3350 1410 4 MP PP +c0 + +-6 45 149 102 4 -51 3350 1410 4 MP DP +c56 + +-67 2 140 92 69 2 2934 1640 4 MP PP +c0 + +-67 2 140 92 69 2 2934 1640 4 MP DP +c47 + +-32 -47 386 -223 34 44 3585 1989 4 MP PP +c0 + +-32 -47 386 -223 34 44 3585 1989 4 MP DP +c52 + +3 1 309 -212 -7 11 1758 2690 4 MP PP +c0 + +3 1 309 -212 -7 11 1758 2690 4 MP DP +c49 + +-54 -34 255 -149 57 33 1408 3292 4 MP PP +c0 + +-54 -34 255 -149 57 33 1408 3292 4 MP DP +c49 + +-36 -43 252 -147 27 49 1292 3159 4 MP PP +c0 + +-36 -43 252 -147 27 49 1292 3159 4 MP DP +c47 + +-42 -43 391 -228 44 43 3501 1903 4 MP PP +c0 + +-42 -43 391 -228 44 43 3501 1903 4 MP DP +c50 + +-28 -5 257 -169 39 -7 1932 3239 4 MP PP +c0 + +-28 -5 257 -169 39 -7 1932 3239 4 MP DP +c51 + +-2 -19 383 -244 -5 6 2903 2620 4 MP PP +c0 + +-2 -19 383 -244 -5 6 2903 2620 4 MP DP +c47 + +-37 -45 388 -226 40 43 3545 1946 4 MP PP +c0 + +-37 -45 388 -226 40 43 3545 1946 4 MP DP +c49 + +-51 -39 258 -150 50 39 1358 3253 4 MP PP +c0 + +-51 -39 258 -150 50 39 1358 3253 4 MP DP +c49 + +-44 -42 257 -150 39 45 1319 3208 4 MP PP +c0 + +-44 -42 257 -150 39 45 1319 3208 4 MP DP +c50 + +-4 -18 265 -179 -8 30 1498 2868 4 MP PP +c0 + +-4 -18 265 -179 -8 30 1498 2868 4 MP DP +c56 + +8 42 152 108 -11 -48 3354 1359 4 MP PP +c0 + +8 42 152 108 -11 -48 3354 1359 4 MP DP +c56 + +-64 -7 142 96 65 12 2869 1628 4 MP PP +c0 + +-64 -7 142 96 65 12 2869 1628 4 MP DP +c53 + +-4 6 352 -245 7 7 2060 2489 4 MP PP +c0 + +-4 6 352 -245 7 7 2060 2489 4 MP DP +c2 + +-37 -11 383 -263 41 22 2894 2023 4 MP PP +c0 + +-37 -11 383 -263 41 22 2894 2023 4 MP DP +c51 + +-17 3 372 -262 25 11 2434 2254 4 MP PP +c0 + +-17 3 372 -262 25 11 2434 2254 4 MP DP +c2 + +-17 -36 384 -253 13 27 3266 2336 4 MP PP +c0 + +-17 -36 384 -253 13 27 3266 2336 4 MP DP +c53 + +-7 -13 350 -234 3 1 2550 2853 4 MP PP +c0 + +-7 -13 350 -234 3 1 2550 2853 4 MP DP +c56 + +22 39 156 114 -26 -45 3343 1311 4 MP PP +c0 + +22 39 156 114 -26 -45 3343 1311 4 MP DP +c56 + +-56 -16 143 101 59 23 2810 1605 4 MP PP +c0 + +-56 -16 143 101 59 23 2810 1605 4 MP DP +c52 + +-14 -9 304 -207 18 -3 2228 3063 4 MP PP +c0 + +-14 -9 304 -207 18 -3 2228 3063 4 MP DP +c50 + +-36 -14 268 -181 47 3 1885 3236 4 MP PP +c0 + +-36 -14 268 -181 47 3 1885 3236 4 MP DP +c52 + +-7 -7 312 -223 4 18 1751 2701 4 MP PP +c0 + +-7 -7 312 -223 4 18 1751 2701 4 MP DP +c51 + +-13 -27 376 -257 7 13 2896 2607 4 MP PP +c0 + +-13 -27 376 -257 7 13 2896 2607 4 MP DP +c50 + +-14 -26 275 -189 4 36 1490 2898 4 MP PP +c0 + +-14 -26 275 -189 4 36 1490 2898 4 MP DP +c2 + +-42 -20 378 -271 47 28 2935 2045 4 MP PP +c0 + +-42 -20 378 -271 47 28 2935 2045 4 MP DP +c2 + +-27 -41 380 -262 23 32 3243 2304 4 MP PP +c0 + +-27 -41 380 -262 23 32 3243 2304 4 MP DP +c56 + +36 32 158 121 -38 -39 3317 1266 4 MP PP +c0 + +36 32 158 121 -38 -39 3317 1266 4 MP DP +c56 + +-47 -25 146 108 50 31 2760 1574 4 MP PP +c0 + +-47 -25 146 108 50 31 2760 1574 4 MP DP +c53 + +-15 -3 349 -257 18 15 2067 2496 4 MP PP +c0 + +-15 -3 349 -257 18 15 2067 2496 4 MP DP +c51 + +-27 -6 366 -274 33 18 2459 2265 4 MP PP +c0 + +-27 -6 366 -274 33 18 2459 2265 4 MP DP +c50 + +-44 -21 279 -192 53 12 1832 3224 4 MP PP +c0 + +-44 -21 279 -192 53 12 1832 3224 4 MP DP +c53 + +-17 -21 346 -246 14 9 2536 2844 4 MP PP +c0 + +-17 -21 346 -246 14 9 2536 2844 4 MP DP +c2 + +-46 -28 375 -277 49 34 2982 2073 4 MP PP +c0 + +-46 -28 375 -277 49 34 2982 2073 4 MP DP +c52 + +-24 -16 308 -219 28 5 2200 3058 4 MP PP +c0 + +-24 -16 308 -219 28 5 2200 3058 4 MP DP +c2 + +-34 -44 376 -271 31 37 3212 2267 4 MP PP +c0 + +-34 -44 376 -271 31 37 3212 2267 4 MP DP +c50 + +-25 -31 285 -199 15 41 1494 2934 4 MP PP +c0 + +-25 -31 285 -199 15 41 1494 2934 4 MP DP +c56 + +47 25 161 127 -50 -31 3279 1227 4 MP PP +c0 + +47 25 161 127 -50 -31 3279 1227 4 MP DP +c56 + +-36 -33 149 114 38 39 2722 1535 4 MP PP +c0 + +-36 -33 149 114 38 39 2722 1535 4 MP DP +c51 + +-23 -32 370 -271 17 21 2879 2586 4 MP PP +c0 + +-23 -32 370 -271 17 21 2879 2586 4 MP DP +c52 + +-18 -15 316 -234 14 26 1755 2719 4 MP PP +c0 + +-18 -15 316 -234 14 26 1755 2719 4 MP DP +c2 + +-47 -34 372 -282 50 39 3031 2107 4 MP PP +c0 + +-47 -34 372 -282 50 39 3031 2107 4 MP DP +c2 + +-40 -43 373 -278 39 40 3173 2227 4 MP PP +c0 + +-40 -43 373 -278 39 40 3173 2227 4 MP DP +c51 + +-36 -14 362 -285 40 25 2492 2283 4 MP PP +c0 + +-36 -14 362 -285 40 25 2492 2283 4 MP DP +c53 + +-25 -11 346 -267 28 21 2085 2511 4 MP PP +c0 + +-25 -11 346 -267 28 21 2085 2511 4 MP DP +c50 + +-49 -27 288 -201 55 20 1777 3204 4 MP PP +c0 + +-49 -27 288 -201 55 20 1777 3204 4 MP DP +c2 + +-48 -39 372 -283 48 40 3081 2146 4 MP PP +c0 + +-48 -39 372 -283 48 40 3081 2146 4 MP DP +/c57 { 0.000000 0.343750 1.000000 sc} bdef +c57 + +72 15 72 -71 -67 -24 4579 3168 4 MP PP +c0 + +72 15 72 -71 -67 -24 4579 3168 4 MP DP +c57 + +74 5 77 -80 -72 -13 4651 3181 4 MP PP +c0 + +74 5 77 -80 -72 -13 4651 3181 4 MP DP +c2 + +-44 -43 372 -281 44 41 3129 2186 4 MP PP +c0 + +-44 -43 372 -281 44 41 3129 2186 4 MP DP +c57 + +65 25 66 -63 -59 -33 4512 3144 4 MP PP +c0 + +65 25 66 -63 -59 -33 4512 3144 4 MP DP +c56 + +56 17 163 133 -58 -23 3229 1196 4 MP PP +c0 + +56 17 163 133 -58 -23 3229 1196 4 MP DP +c56 + +-22 -38 151 120 25 45 2697 1490 4 MP PP +c0 + +-22 -38 151 120 25 45 2697 1490 4 MP DP +c57 + +75 -5 79 -88 -74 -3 4725 3184 4 MP PP +c0 + +75 -5 79 -88 -74 -3 4725 3184 4 MP DP +c50 + +-33 -35 292 -207 26 43 1509 2975 4 MP PP +c0 + +-33 -35 292 -207 26 43 1509 2975 4 MP DP +c57 + +56 33 58 -56 -48 -40 4453 3111 4 MP PP +c0 + +56 33 58 -56 -48 -40 4453 3111 4 MP DP +c57 + +71 -16 80 -96 -73 8 4798 3176 4 MP PP +c0 + +71 -16 80 -96 -73 8 4798 3176 4 MP DP +c53 + +-26 -27 343 -258 24 16 2512 2828 4 MP PP +c0 + +-26 -27 343 -258 24 16 2512 2828 4 MP DP +c52 + +-33 -23 312 -230 36 14 2164 3044 4 MP PP +c0 + +-33 -23 312 -230 36 14 2164 3044 4 MP DP +c51 + +-31 -37 364 -282 26 27 2853 2559 4 MP PP +c0 + +-31 -37 364 -282 26 27 2853 2559 4 MP DP +c57 + +44 40 49 -50 -35 -46 4405 3071 4 MP PP +c0 + +44 40 49 -50 -35 -46 4405 3071 4 MP DP +c57 + +65 -25 78 -104 -68 18 4866 3158 4 MP PP +c0 + +65 -25 78 -104 -68 18 4866 3158 4 MP DP +/c58 { 0.000000 1.000000 0.718750 sc} bdef +c58 + +-62 30 183 142 62 -28 3280 1701 4 MP PP +c0 + +-62 30 183 142 62 -28 3280 1701 4 MP DP +c52 + +-28 -21 319 -244 25 31 1769 2745 4 MP PP +c0 + +-28 -21 319 -244 25 31 1769 2745 4 MP DP +c58 + +-54 35 181 143 56 -36 3342 1673 4 MP PP +c0 + +-54 35 181 143 56 -36 3342 1673 4 MP DP +c58 + +-66 24 183 144 68 -21 3212 1722 4 MP PP +c0 + +-66 24 183 144 68 -21 3212 1722 4 MP DP +c50 + +-51 -32 294 -208 57 28 1720 3176 4 MP PP +c0 + +-51 -32 294 -208 57 28 1720 3176 4 MP DP +c50 + +-42 -38 298 -212 36 43 1535 3018 4 MP PP +c0 + +-42 -38 298 -212 36 43 1535 3018 4 MP DP +c57 + +31 46 40 -45 -22 -51 4370 3025 4 MP PP +c0 + +31 46 40 -45 -22 -51 4370 3025 4 MP DP +c51 + +-41 -22 356 -294 47 31 2532 2308 4 MP PP +c0 + +-41 -22 356 -294 47 31 2532 2308 4 MP DP +c56 + +64 7 165 138 -66 -12 3171 1173 4 MP PP +c0 + +64 7 165 138 -66 -12 3171 1173 4 MP DP +c56 + +-8 -43 154 127 12 48 2685 1442 4 MP PP +c0 + +-8 -43 154 127 12 48 2685 1442 4 MP DP +c57 + +55 -33 75 -111 -61 28 4927 3130 4 MP PP +c0 + +55 -33 75 -111 -61 28 4927 3130 4 MP DP +c58 + +-44 39 180 145 45 -41 3398 1637 4 MP PP +c0 + +-44 39 180 145 45 -41 3398 1637 4 MP DP +c58 + +-68 16 185 147 69 -12 3143 1734 4 MP PP +c0 + +-68 16 185 147 69 -12 3143 1734 4 MP DP +c53 + +-33 -18 344 -277 35 28 2113 2532 4 MP PP +c0 + +-33 -18 344 -277 35 28 2113 2532 4 MP DP +c50 + +-53 -37 300 -212 54 34 1666 3142 4 MP PP +c0 + +-53 -37 300 -212 54 34 1666 3142 4 MP DP +c57 + +16 49 29 -43 -5 -51 4348 2974 4 MP PP +c0 + +16 49 29 -43 -5 -51 4348 2974 4 MP DP +c50 + +-47 -40 301 -214 44 42 1571 3061 4 MP PP +c0 + +-47 -40 301 -214 44 42 1571 3061 4 MP DP +c57 + +44 -40 69 -116 -51 37 4978 3093 4 MP PP +c0 + +44 -40 69 -116 -51 37 4978 3093 4 MP DP +c50 + +-51 -38 301 -215 51 39 1615 3103 4 MP PP +c0 + +-51 -38 301 -215 51 39 1615 3103 4 MP DP +c51 + +-39 -40 359 -292 35 33 2818 2526 4 MP PP +c0 + +-39 -40 359 -292 35 33 2818 2526 4 MP DP +c58 + +-32 41 178 148 34 -44 3443 1596 4 MP PP +c0 + +-32 41 178 148 34 -44 3443 1596 4 MP DP +c56 + +68 -3 166 143 -69 -2 3105 1161 4 MP PP +c0 + +68 -3 166 143 -69 -2 3105 1161 4 MP DP +c56 + +6 -45 158 132 -4 51 2689 1391 4 MP PP +c0 + +6 -45 158 132 -4 51 2689 1391 4 MP DP +c52 + +-41 -29 315 -239 44 21 2120 3023 4 MP PP +c0 + +-41 -29 315 -239 44 21 2120 3023 4 MP DP +c57 + +1 49 19 -40 9 -52 4343 2923 4 MP PP +c0 + +1 49 19 -40 9 -52 4343 2923 4 MP DP +c53 + +-35 -33 341 -269 33 23 2479 2805 4 MP PP +c0 + +-35 -33 341 -269 33 23 2479 2805 4 MP DP +c58 + +-68 8 186 151 67 -2 3076 1736 4 MP PP +c0 + +-68 8 186 151 67 -2 3076 1736 4 MP DP +c57 + +30 -46 62 -119 -39 43 5017 3050 4 MP PP +c0 + +30 -46 62 -119 -39 43 5017 3050 4 MP DP +c51 + +-47 -28 354 -301 49 35 2579 2339 4 MP PP +c0 + +-47 -28 354 -301 49 35 2579 2339 4 MP DP +c52 + +-35 -28 321 -251 33 35 1794 2776 4 MP PP +c0 + +-35 -28 321 -251 33 35 1794 2776 4 MP DP +c57 + +-16 49 10 -41 25 -48 4352 2871 4 MP PP +c0 + +-16 49 10 -41 25 -48 4352 2871 4 MP DP +c51 + +-44 -41 355 -299 42 36 2776 2490 4 MP PP +c0 + +-44 -41 355 -299 42 36 2776 2490 4 MP DP +c56 + +69 -11 167 145 -70 9 3036 1159 4 MP PP +c0 + +69 -11 167 145 -70 9 3036 1159 4 MP DP +c56 + +20 -46 160 138 -18 50 2707 1341 4 MP PP +c0 + +20 -46 160 138 -18 50 2707 1341 4 MP DP +c57 + +15 -49 53 -122 -25 49 5042 3001 4 MP PP +c0 + +15 -49 53 -122 -25 49 5042 3001 4 MP DP +c53 + +-40 -25 341 -285 43 33 2148 2560 4 MP PP +c0 + +-40 -25 341 -285 43 33 2148 2560 4 MP DP +c58 + +-19 40 177 154 20 -46 3477 1552 4 MP PP +c0 + +-19 40 177 154 20 -46 3477 1552 4 MP DP +c51 + +-49 -34 352 -305 51 38 2628 2374 4 MP PP +c0 + +-49 -34 352 -305 51 38 2628 2374 4 MP DP +c58 + +-63 0 185 157 64 7 3012 1729 4 MP PP +c0 + +-63 0 185 157 64 7 3012 1729 4 MP DP +c51 + +-48 -40 353 -304 47 39 2729 2451 4 MP PP +c0 + +-48 -40 353 -304 47 39 2729 2451 4 MP DP +c57 + +-30 46 1 -44 39 -43 4377 2823 4 MP PP +c0 + +-30 46 1 -44 39 -43 4377 2823 4 MP DP +c52 + +-46 -34 318 -247 49 27 2071 2996 4 MP PP +c0 + +-46 -34 318 -247 49 27 2071 2996 4 MP DP +c51 + +-50 -39 352 -305 50 39 2679 2412 4 MP PP +c0 + +-50 -39 352 -305 50 39 2679 2412 4 MP DP +c56 + +67 -21 167 148 -67 18 2966 1168 4 MP PP +c0 + +67 -21 167 148 -67 18 2966 1168 4 MP DP +c56 + +34 -44 162 142 -31 47 2738 1294 4 MP PP +c0 + +34 -44 162 142 -31 47 2738 1294 4 MP DP +c57 + +-1 -50 43 -122 -9 51 5051 2950 4 MP PP +c0 + +-1 -50 43 -122 -9 51 5051 2950 4 MP DP +c53 + +-42 -36 339 -279 41 29 2438 2776 4 MP PP +c0 + +-42 -36 339 -279 41 29 2438 2776 4 MP DP +c52 + +-43 -33 322 -256 42 38 1827 2811 4 MP PP +c0 + +-43 -33 322 -256 42 38 1827 2811 4 MP DP +c56 + +63 -29 167 148 -63 29 2899 1186 4 MP PP +c0 + +63 -29 167 148 -63 29 2899 1186 4 MP DP +c56 + +45 -41 165 145 -44 43 2782 1251 4 MP PP +c0 + +45 -41 165 145 -44 43 2782 1251 4 MP DP +c56 + +55 -35 166 147 -54 36 2836 1215 4 MP PP +c0 + +55 -35 166 147 -54 36 2836 1215 4 MP DP +c57 + +-43 40 -7 -47 51 -37 4416 2780 4 MP PP +c0 + +-43 40 -7 -47 51 -37 4416 2780 4 MP DP +c57 + +-16 -48 33 -121 5 52 5046 2898 4 MP PP +c0 + +-16 -48 33 -121 5 52 5046 2898 4 MP DP +c53 + +-47 -31 340 -290 48 36 2191 2593 4 MP PP +c0 + +-47 -31 340 -290 48 36 2191 2593 4 MP DP +c58 + +-4 39 175 160 6 -45 3497 1506 4 MP PP +c0 + +-4 39 175 160 6 -45 3497 1506 4 MP DP +c52 + +-50 -37 321 -254 51 32 2020 2964 4 MP PP +c0 + +-50 -37 321 -254 51 32 2020 2964 4 MP DP +c58 + +-57 -8 186 164 56 16 2956 1713 4 MP PP +c0 + +-57 -8 186 164 56 16 2956 1713 4 MP DP +c52 + +-48 -36 323 -260 47 40 1869 2849 4 MP PP +c0 + +-48 -36 323 -260 47 40 1869 2849 4 MP DP +c57 + +-55 34 -13 -53 61 -28 4467 2743 4 MP PP +c0 + +-55 34 -13 -53 61 -28 4467 2743 4 MP DP +c53 + +-47 -39 338 -286 46 34 2392 2742 4 MP PP +c0 + +-47 -39 338 -286 46 34 2392 2742 4 MP DP +c57 + +-31 -46 22 -117 21 50 5025 2848 4 MP PP +c0 + +-31 -46 22 -117 21 50 5025 2848 4 MP DP +c52 + +-52 -38 322 -259 53 37 1967 2927 4 MP PP +c0 + +-52 -38 322 -259 53 37 1967 2927 4 MP DP +c52 + +-51 -38 323 -260 51 38 1916 2889 4 MP PP +c0 + +-51 -38 323 -260 51 38 1916 2889 4 MP DP +c53 + +-49 -35 338 -293 51 38 2239 2629 4 MP PP +c0 + +-49 -35 338 -293 51 38 2239 2629 4 MP DP +c57 + +-65 25 -16 -60 68 -18 4528 2715 4 MP PP +c0 + +-65 25 -16 -60 68 -18 4528 2715 4 MP DP +c57 + +-44 -40 12 -113 36 46 4989 2802 4 MP PP +c0 + +-44 -40 12 -113 36 46 4989 2802 4 MP DP +c53 + +-50 -39 337 -291 50 37 2342 2705 4 MP PP +c0 + +-50 -39 337 -291 50 37 2342 2705 4 MP DP +c53 + +-51 -38 337 -293 52 38 2290 2667 4 MP PP +c0 + +-51 -38 337 -293 52 38 2290 2667 4 MP DP +c57 + +-71 15 -18 -67 73 -8 4596 2697 4 MP PP +c0 + +-71 15 -18 -67 73 -8 4596 2697 4 MP DP +c57 + +-56 -33 4 -107 48 40 4941 2762 4 MP PP +c0 + +-56 -33 4 -107 48 40 4941 2762 4 MP DP +c57 + +-75 5 -17 -75 74 3 4669 2689 4 MP PP +c0 + +-75 5 -17 -75 74 3 4669 2689 4 MP DP +c58 + +9 35 174 167 -8 -42 3503 1461 4 MP PP +c0 + +9 35 174 167 -8 -42 3503 1461 4 MP DP +c57 + +-65 -25 -4 -100 59 33 4882 2729 4 MP PP +c0 + +-65 -25 -4 -100 59 33 4882 2729 4 MP DP +c57 + +-74 -5 -15 -83 72 13 4743 2692 4 MP PP +c0 + +-74 -5 -15 -83 72 13 4743 2692 4 MP DP +c57 + +-72 -15 -10 -92 67 24 4815 2705 4 MP PP +c0 + +-72 -15 -10 -92 67 24 4815 2705 4 MP DP +c58 + +-47 -17 185 172 47 25 2909 1688 4 MP PP +c0 + +-47 -17 185 172 47 25 2909 1688 4 MP DP +c58 + +24 31 172 175 -22 -39 3495 1419 4 MP PP +c0 + +24 31 172 175 -22 -39 3495 1419 4 MP DP +c58 + +-37 -24 185 180 36 33 2873 1655 4 MP PP +c0 + +-37 -24 185 180 36 33 2873 1655 4 MP DP +/c59 { 0.000000 1.000000 0.812500 sc} bdef +c59 + +-65 28 216 181 66 -24 3397 1869 4 MP PP +c0 + +-65 28 216 181 66 -24 3397 1869 4 MP DP +c59 + +-58 31 212 180 62 -30 3463 1845 4 MP PP +c0 + +-58 31 212 180 62 -30 3463 1845 4 MP DP +c58 + +36 24 172 183 -36 -32 3473 1380 4 MP PP +c0 + +36 24 172 183 -36 -32 3473 1380 4 MP DP +c59 + +-67 21 217 185 68 -16 3329 1885 4 MP PP +c0 + +-67 21 217 185 68 -16 3329 1885 4 MP DP +c58 + +-23 -31 184 189 22 38 2851 1617 4 MP PP +c0 + +-23 -31 184 189 22 38 2851 1617 4 MP DP +c59 + +-51 35 209 180 54 -35 3525 1815 4 MP PP +c0 + +-51 35 209 180 54 -35 3525 1815 4 MP DP +c59 + +-67 15 218 190 68 -8 3261 1893 4 MP PP +c0 + +-67 15 218 190 68 -8 3261 1893 4 MP DP +c59 + +-39 36 204 183 44 -39 3579 1780 4 MP PP +c0 + +-39 36 204 183 44 -39 3579 1780 4 MP DP +c58 + +48 17 171 191 -47 -25 3437 1348 4 MP PP +c0 + +48 17 171 191 -47 -25 3437 1348 4 MP DP +c58 + +-10 -35 183 196 8 43 2843 1574 4 MP PP +c0 + +-10 -35 183 196 8 43 2843 1574 4 MP DP +c59 + +-64 8 219 197 63 0 3198 1893 4 MP PP +c0 + +-64 8 219 197 63 0 3198 1893 4 MP DP +c59 + +-28 36 200 188 32 -41 3623 1741 4 MP PP +c0 + +-28 36 200 188 32 -41 3623 1741 4 MP DP +/c60 { 0.000000 0.437500 1.000000 sc} bdef +c60 + +22 51 69 -4 -12 -51 4291 3029 4 MP PP +c0 + +22 51 69 -4 -12 -51 4291 3029 4 MP DP +c60 + +35 46 79 -4 -25 -49 4316 3078 4 MP PP +c0 + +35 46 79 -4 -25 -49 4316 3078 4 MP DP +c60 + +5 51 61 -2 3 -53 4279 2978 4 MP PP +c0 + +5 51 61 -2 3 -53 4279 2978 4 MP DP +c60 + +48 40 89 -7 -40 -44 4356 3122 4 MP PP +c0 + +48 40 89 -7 -40 -44 4356 3122 4 MP DP +c60 + +-9 52 52 -2 18 -52 4282 2925 4 MP PP +c0 + +-9 52 52 -2 18 -52 4282 2925 4 MP DP +c60 + +59 33 97 -11 -50 -36 4406 3158 4 MP PP +c0 + +59 33 97 -11 -50 -36 4406 3158 4 MP DP +c58 + +56 8 171 200 -56 -17 3390 1323 4 MP PP +c0 + +56 8 171 200 -56 -17 3390 1323 4 MP DP +c59 + +-59 0 218 205 57 8 3141 1885 4 MP PP +c0 + +-59 0 218 205 57 8 3141 1885 4 MP DP +c58 + +5 -39 181 204 -6 45 2849 1529 4 MP PP +c0 + +5 -39 181 204 -6 45 2849 1529 4 MP DP +c60 + +-25 48 45 -3 32 -47 4300 2873 4 MP PP +c0 + +-25 48 45 -3 32 -47 4300 2873 4 MP DP +c60 + +67 24 106 -14 -60 -28 4466 3186 4 MP PP +c0 + +67 24 106 -14 -60 -28 4466 3186 4 MP DP +c59 + +-14 34 195 194 19 -40 3655 1700 4 MP PP +c0 + +-14 34 195 194 19 -40 3655 1700 4 MP DP +c60 + +-39 43 40 -4 44 -42 4332 2826 4 MP PP +c0 + +-39 43 40 -4 44 -42 4332 2826 4 MP DP +c60 + +72 13 113 -18 -66 -18 4532 3204 4 MP PP +c0 + +72 13 113 -18 -66 -18 4532 3204 4 MP DP +c60 + +-51 37 36 -7 55 -34 4376 2784 4 MP PP +c0 + +-51 37 36 -7 55 -34 4376 2784 4 MP DP +c60 + +74 3 119 -23 -70 -7 4602 3211 4 MP PP +c0 + +74 3 119 -23 -70 -7 4602 3211 4 MP DP +c58 + +64 0 171 207 -64 -7 3334 1306 4 MP PP +c0 + +64 0 171 207 -64 -7 3334 1306 4 MP DP +c58 + +19 -40 180 210 -20 46 2869 1483 4 MP PP +c0 + +19 -40 180 210 -20 46 2869 1483 4 MP DP +c59 + +-50 -7 216 213 47 17 3094 1868 4 MP PP +c0 + +-50 -7 216 213 47 17 3094 1868 4 MP DP +c60 + +-61 28 34 -10 63 -25 4431 2750 4 MP PP +c0 + +-61 28 34 -10 63 -25 4431 2750 4 MP DP +c60 + +73 -8 123 -27 -71 4 4673 3207 4 MP PP +c0 + +73 -8 123 -27 -71 4 4673 3207 4 MP DP +c59 + +0 31 191 202 4 -39 3674 1660 4 MP PP +c0 + +0 31 191 202 4 -39 3674 1660 4 MP DP +c60 + +-68 18 34 -13 68 -15 4494 2725 4 MP PP +c0 + +-68 18 34 -13 68 -15 4494 2725 4 MP DP +c60 + +68 -18 125 -31 -69 15 4742 3192 4 MP PP +c0 + +68 -18 125 -31 -69 15 4742 3192 4 MP DP +c58 + +67 -8 172 212 -68 3 3270 1299 4 MP PP +c0 + +67 -8 172 212 -68 3 3270 1299 4 MP DP +c58 + +32 -41 179 216 -34 44 2903 1439 4 MP PP +c0 + +32 -41 179 216 -34 44 2903 1439 4 MP DP +c60 + +-73 8 36 -17 71 -4 4562 2710 4 MP PP +c0 + +-73 8 36 -17 71 -4 4562 2710 4 MP DP +c60 + +61 -28 124 -34 -63 25 4805 3167 4 MP PP +c0 + +61 -28 124 -34 -63 25 4805 3167 4 MP DP +c58 + +69 -16 172 217 -69 11 3202 1302 4 MP PP +c0 + +69 -16 172 217 -69 11 3202 1302 4 MP DP +c58 + +44 -39 177 219 -45 41 2948 1398 4 MP PP +c0 + +44 -39 177 219 -45 41 2948 1398 4 MP DP +c59 + +-40 -14 213 223 37 24 3057 1844 4 MP PP +c0 + +-40 -14 213 223 37 24 3057 1844 4 MP DP +c60 + +-74 -3 40 -21 70 7 4633 2706 4 MP PP +c0 + +-74 -3 40 -21 70 7 4633 2706 4 MP DP +c60 + +51 -37 122 -37 -54 34 4859 3133 4 MP PP +c0 + +51 -37 122 -37 -54 34 4859 3133 4 MP DP +c7 + +-61 29 224 198 65 -28 3614 2054 4 MP PP +c0 + +-61 29 224 198 65 -28 3614 2054 4 MP DP +c7 + +-66 26 228 199 67 -21 3547 2075 4 MP PP +c0 + +-66 26 228 199 67 -21 3547 2075 4 MP DP +c58 + +66 -24 173 220 -67 21 3133 1313 4 MP PP +c0 + +66 -24 173 220 -67 21 3133 1313 4 MP DP +c58 + +54 -35 176 221 -55 35 3003 1363 4 MP PP +c0 + +54 -35 176 221 -55 35 3003 1363 4 MP DP +c7 + +-55 32 221 197 58 -31 3679 2026 4 MP PP +c0 + +-55 32 221 197 58 -31 3679 2026 4 MP DP +c58 + +61 -30 175 221 -63 29 3066 1334 4 MP PP +c0 + +61 -30 175 221 -63 29 3066 1334 4 MP DP +c60 + +-72 -13 46 -26 66 18 4703 2713 4 MP PP +c0 + +-72 -13 46 -26 66 18 4703 2713 4 MP DP +c60 + +39 -43 119 -40 -45 42 4904 3091 4 MP PP +c0 + +39 -43 119 -40 -45 42 4904 3091 4 MP DP +c7 + +-66 21 229 204 67 -15 3480 2090 4 MP PP +c0 + +-66 21 229 204 67 -15 3480 2090 4 MP DP +c59 + +14 27 186 210 -9 -35 3678 1621 4 MP PP +c0 + +14 27 186 210 -9 -35 3678 1621 4 MP DP +c60 + +-67 -24 53 -29 60 27 4769 2731 4 MP PP +c0 + +-67 -24 53 -29 60 27 4769 2731 4 MP DP +c60 + +25 -49 113 -41 -31 48 4935 3043 4 MP PP +c0 + +25 -49 113 -41 -31 48 4935 3043 4 MP DP +c7 + +-46 32 216 200 51 -35 3737 1995 4 MP PP +c0 + +-46 32 216 200 51 -35 3737 1995 4 MP DP +c60 + +-59 -33 61 -33 51 37 4829 2758 4 MP PP +c0 + +-59 -33 61 -33 51 37 4829 2758 4 MP DP +c60 + +9 -51 107 -42 -18 51 4953 2992 4 MP PP +c0 + +9 -51 107 -42 -18 51 4953 2992 4 MP DP +c7 + +-64 15 230 210 64 -8 3416 2098 4 MP PP +c0 + +-64 15 230 210 64 -8 3416 2098 4 MP DP +c60 + +-48 -40 70 -36 39 43 4880 2795 4 MP PP +c0 + +-48 -40 70 -36 39 43 4880 2795 4 MP DP +c60 + +-5 -52 98 -42 -3 53 4956 2939 4 MP PP +c0 + +-5 -52 98 -42 -3 53 4956 2939 4 MP DP +c60 + +-36 -46 80 -39 26 49 4919 2838 4 MP PP +c0 + +-36 -46 80 -39 26 49 4919 2838 4 MP DP +c60 + +-21 -50 90 -41 11 52 4945 2887 4 MP PP +c0 + +-21 -50 90 -41 11 52 4945 2887 4 MP DP +c59 + +-27 -22 210 233 23 31 3034 1813 4 MP PP +c0 + +-27 -22 210 233 23 31 3034 1813 4 MP DP +c7 + +-35 32 212 204 39 -36 3788 1960 4 MP PP +c0 + +-35 32 212 204 39 -36 3788 1960 4 MP DP +c59 + +28 21 182 220 -24 -31 3669 1586 4 MP PP +c0 + +28 21 182 220 -24 -31 3669 1586 4 MP DP +c7 + +-60 10 230 217 59 0 3357 2098 4 MP PP +c0 + +-60 10 230 217 59 0 3357 2098 4 MP DP +/c61 { 0.000000 0.531250 1.000000 sc} bdef +c61 + +-32 47 54 26 41 -44 4237 2844 4 MP PP +c0 + +-32 47 54 26 41 -44 4237 2844 4 MP DP +c61 + +-18 52 63 29 29 -48 4208 2892 4 MP PP +c0 + +-18 52 63 29 29 -48 4208 2892 4 MP DP +c61 + +-44 42 48 23 50 -39 4278 2800 4 MP PP +c0 + +-44 42 48 23 50 -39 4278 2800 4 MP DP +c61 + +-3 53 74 33 16 -48 4192 2940 4 MP PP +c0 + +-3 53 74 33 16 -48 4192 2940 4 MP DP +c61 + +-55 34 46 22 57 -33 4328 2761 4 MP PP +c0 + +-55 34 46 22 57 -33 4328 2761 4 MP DP +c59 + +-14 -26 206 242 10 35 3024 1778 4 MP PP +c0 + +-14 -26 206 242 10 35 3024 1778 4 MP DP +c61 + +12 51 87 38 3 -47 4189 2987 4 MP PP +c0 + +12 51 87 38 3 -47 4189 2987 4 MP DP +c61 + +-63 25 47 21 62 -24 4385 2728 4 MP PP +c0 + +-63 25 47 21 62 -24 4385 2728 4 MP DP +c7 + +-22 30 206 210 28 -36 3827 1924 4 MP PP +c0 + +-22 30 206 210 28 -36 3827 1924 4 MP DP +c7 + +-53 2 229 227 50 7 3307 2091 4 MP PP +c0 + +-53 2 229 227 50 7 3307 2091 4 MP DP +c59 + +39 15 179 229 -36 -24 3645 1555 4 MP PP +c0 + +39 15 179 229 -36 -24 3645 1555 4 MP DP +c61 + +25 49 102 42 -10 -44 4199 3031 4 MP PP +c0 + +25 49 102 42 -10 -44 4199 3031 4 MP DP +c61 + +-68 15 51 22 64 -16 4447 2704 4 MP PP +c0 + +-68 15 51 22 64 -16 4447 2704 4 MP DP +/c62 { 0.000000 0.906250 1.000000 sc} bdef +c62 + +-63 29 209 190 66 -26 3776 2279 4 MP PP +c0 + +-63 29 209 190 66 -26 3776 2279 4 MP DP +c62 + +-64 25 212 193 66 -21 3710 2300 4 MP PP +c0 + +-64 25 212 193 66 -21 3710 2300 4 MP DP +c62 + +-60 29 208 190 61 -29 3842 2253 4 MP PP +c0 + +-60 29 208 190 61 -29 3842 2253 4 MP DP +c59 + +0 -32 202 251 -5 39 3029 1739 4 MP PP +c0 + +0 -32 202 251 -5 39 3029 1739 4 MP DP +c61 + +40 44 117 47 -23 -39 4222 3070 4 MP PP +c0 + +40 44 117 47 -23 -39 4222 3070 4 MP DP +c61 + +-71 4 58 23 64 -5 4511 2688 4 MP PP +c0 + +-71 4 58 23 64 -5 4511 2688 4 MP DP +c7 + +-9 27 201 217 14 -34 3855 1888 4 MP PP +c0 + +-9 27 201 217 14 -34 3855 1888 4 MP DP +c62 + +-63 23 214 197 64 -15 3646 2315 4 MP PP +c0 + +-63 23 214 197 64 -15 3646 2315 4 MP DP +c62 + +-52 30 205 192 55 -32 3903 2224 4 MP PP +c0 + +-52 30 205 192 55 -32 3903 2224 4 MP DP +/c63 { 0.000000 0.625000 1.000000 sc} bdef +c63 + +-50 39 57 41 57 -35 4214 2755 4 MP PP +c0 + +-50 39 57 41 57 -35 4214 2755 4 MP DP +c63 + +-41 44 64 45 51 -36 4163 2791 4 MP PP +c0 + +-41 44 64 45 51 -36 4163 2791 4 MP DP +c59 + +50 7 177 239 -48 -17 3609 1531 4 MP PP +c0 + +50 7 177 239 -48 -17 3609 1531 4 MP DP +c7 + +-42 -4 226 236 40 14 3267 2077 4 MP PP +c0 + +-42 -4 226 236 40 14 3267 2077 4 MP DP +c63 + +-57 33 55 39 59 -31 4271 2720 4 MP PP +c0 + +-57 33 55 39 59 -31 4271 2720 4 MP DP +c61 + +50 36 134 52 -35 -32 4257 3102 4 MP PP +c0 + +50 36 134 52 -35 -32 4257 3102 4 MP DP +c63 + +-29 48 74 53 43 -38 4120 2829 4 MP PP +c0 + +-29 48 74 53 43 -38 4120 2829 4 MP DP +c61 + +-70 -7 68 26 60 4 4575 2683 4 MP PP +c0 + +-70 -7 68 26 60 4 4575 2683 4 MP DP +c63 + +-62 24 57 41 60 -26 4330 2689 4 MP PP +c0 + +-62 24 57 41 60 -26 4330 2689 4 MP DP +c62 + +-58 17 215 205 60 -10 3586 2325 4 MP PP +c0 + +-58 17 215 205 60 -10 3586 2325 4 MP DP +c62 + +-44 28 203 196 46 -32 3958 2192 4 MP PP +c0 + +-44 28 203 196 46 -32 3958 2192 4 MP DP +c59 + +14 -34 197 258 -19 40 3048 1699 4 MP PP +c0 + +14 -34 197 258 -19 40 3048 1699 4 MP DP +/c64 { 0.000000 0.812500 1.000000 sc} bdef +c64 + +-61 30 170 154 63 -29 3988 2472 4 MP PP +c0 + +-61 30 170 154 63 -29 3988 2472 4 MP DP +c64 + +-62 30 172 155 64 -25 3924 2497 4 MP PP +c0 + +-62 30 172 155 64 -25 3924 2497 4 MP DP +/c65 { 0.000000 0.718750 1.000000 sc} bdef +c65 + +-57 35 111 93 62 -30 4098 2657 4 MP PP +c0 + +-57 35 111 93 62 -30 4098 2657 4 MP DP +c65 + +-59 31 109 92 61 -30 4160 2627 4 MP PP +c0 + +-59 31 109 92 61 -30 4160 2627 4 MP DP +c63 + +-16 48 88 63 34 -36 4086 2865 4 MP PP +c0 + +-16 48 88 63 34 -36 4086 2865 4 MP DP +c61 + +60 28 149 56 -46 -24 4303 3126 4 MP PP +c0 + +60 28 149 56 -46 -24 4303 3126 4 MP DP +c63 + +-64 16 63 45 58 -20 4390 2663 4 MP PP +c0 + +-64 16 63 45 58 -20 4390 2663 4 MP DP +c7 + +5 22 196 226 0 -31 3869 1854 4 MP PP +c0 + +5 22 196 226 0 -31 3869 1854 4 MP DP +c59 + +59 0 174 247 -56 -8 3561 1514 4 MP PP +c0 + +59 0 174 247 -56 -8 3561 1514 4 MP DP +c65 + +-51 36 116 98 58 -28 4040 2685 4 MP PP +c0 + +-51 36 116 98 58 -28 4040 2685 4 MP DP +c64 + +-59 28 169 155 60 -29 4051 2443 4 MP PP +c0 + +-59 28 169 155 60 -29 4051 2443 4 MP DP +c61 + +-66 -18 80 29 54 15 4635 2687 4 MP PP +c0 + +-66 -18 80 29 54 15 4635 2687 4 MP DP +c64 + +-58 28 174 160 63 -23 3861 2520 4 MP PP +c0 + +-58 28 174 160 63 -23 3861 2520 4 MP DP +c65 + +-60 26 110 94 59 -28 4221 2597 4 MP PP +c0 + +-60 26 110 94 59 -28 4221 2597 4 MP DP +c7 + +-32 -10 224 246 27 22 3240 2055 4 MP PP +c0 + +-32 -10 224 246 27 22 3240 2055 4 MP DP +c62 + +-52 13 217 212 53 -2 3533 2327 4 MP PP +c0 + +-52 13 217 212 53 -2 3533 2327 4 MP DP +c62 + +-33 25 201 203 35 -32 4004 2160 4 MP PP +c0 + +-33 25 201 203 35 -32 4004 2160 4 MP DP +c65 + +-43 38 123 106 54 -27 3986 2712 4 MP PP +c0 + +-43 38 123 106 54 -27 3986 2712 4 MP DP +c59 + +28 -36 192 264 -32 41 3080 1658 4 MP PP +c0 + +28 -36 192 264 -32 41 3080 1658 4 MP DP +c64 + +-53 26 170 159 52 -30 4111 2414 4 MP PP +c0 + +-53 26 170 159 52 -30 4111 2414 4 MP DP +c61 + +66 18 163 60 -54 -14 4357 3140 4 MP PP +c0 + +66 18 163 60 -54 -14 4357 3140 4 MP DP +c63 + +-3 47 106 75 22 -33 4064 2898 4 MP PP +c0 + +-3 47 106 75 22 -33 4064 2898 4 MP DP +c64 + +-54 27 179 165 58 -17 3803 2537 4 MP PP +c0 + +-54 27 179 165 58 -17 3803 2537 4 MP DP +c63 + +-64 5 74 53 53 -13 4448 2643 4 MP PP +c0 + +-64 5 74 53 53 -13 4448 2643 4 MP DP +c61 + +-60 -27 94 32 46 24 4689 2702 4 MP PP +c0 + +-60 -27 94 32 46 24 4689 2702 4 MP DP +c65 + +-58 20 115 100 53 -26 4280 2569 4 MP PP +c0 + +-58 20 115 100 53 -26 4280 2569 4 MP DP +c59 + +64 -8 174 255 -64 0 3505 1506 4 MP PP +c0 + +64 -8 174 255 -64 0 3505 1506 4 MP DP +c7 + +18 17 192 236 -14 -27 3869 1823 4 MP PP +c0 + +18 17 192 236 -14 -27 3869 1823 4 MP DP +c59 + +39 -36 188 269 -44 39 3124 1619 4 MP PP +c0 + +39 -36 188 269 -44 39 3124 1619 4 MP DP +c65 + +-34 36 134 117 46 -23 3940 2735 4 MP PP +c0 + +-34 36 134 117 46 -23 3940 2735 4 MP DP +c61 + +70 7 175 64 -61 -5 4418 3145 4 MP PP +c0 + +70 7 175 64 -61 -5 4418 3145 4 MP DP +c64 + +-46 21 172 166 44 -28 4163 2384 4 MP PP +c0 + +-46 21 172 166 44 -28 4163 2384 4 MP DP +c61 + +-51 -37 110 37 35 32 4735 2726 4 MP PP +c0 + +-51 -37 110 37 35 32 4735 2726 4 MP DP +c59 + +67 -15 174 262 -67 8 3441 1506 4 MP PP +c0 + +67 -15 174 262 -67 8 3441 1506 4 MP DP +c7 + +-18 -17 219 258 14 26 3226 2029 4 MP PP +c0 + +-18 -17 219 258 14 26 3226 2029 4 MP DP +c62 + +-42 6 218 223 42 4 3491 2323 4 MP PP +c0 + +-42 6 218 223 42 4 3491 2323 4 MP DP +c62 + +-20 22 199 211 22 -30 4039 2128 4 MP PP +c0 + +-20 22 199 211 22 -30 4039 2128 4 MP DP +c64 + +-46 23 183 175 52 -13 3751 2550 4 MP PP +c0 + +-46 23 183 175 52 -13 3751 2550 4 MP DP +c63 + +10 44 125 89 10 -29 4054 2927 4 MP PP +c0 + +10 44 125 89 10 -29 4054 2927 4 MP DP +c65 + +-53 13 122 108 46 -21 4333 2543 4 MP PP +c0 + +-53 13 122 108 46 -21 4333 2543 4 MP DP +c63 + +-60 -4 88 63 46 -6 4501 2630 4 MP PP +c0 + +-60 -4 88 63 46 -6 4501 2630 4 MP DP +c59 + +51 -35 183 272 -54 35 3178 1584 4 MP PP +c0 + +51 -35 183 272 -54 35 3178 1584 4 MP DP +c59 + +68 -22 175 268 -69 16 3374 1514 4 MP PP +c0 + +68 -22 175 268 -69 16 3374 1514 4 MP DP +c61 + +71 -4 184 66 -63 6 4481 3139 4 MP PP +c0 + +71 -4 184 66 -63 6 4481 3139 4 MP DP +c61 + +-39 -43 125 41 24 39 4770 2758 4 MP PP +c0 + +-39 -43 125 41 24 39 4770 2758 4 MP DP +c59 + +58 -31 180 272 -61 30 3239 1554 4 MP PP +c0 + +58 -31 180 272 -61 30 3239 1554 4 MP DP +c59 + +64 -27 177 271 -66 24 3305 1530 4 MP PP +c0 + +64 -27 177 271 -66 24 3305 1530 4 MP DP +c65 + +-22 33 146 130 36 -19 3904 2754 4 MP PP +c0 + +-22 33 146 130 36 -19 3904 2754 4 MP DP +c64 + +-36 17 175 174 33 -25 4207 2356 4 MP PP +c0 + +-36 17 175 174 33 -25 4207 2356 4 MP DP +c7 + +31 11 189 246 -28 -21 3855 1796 4 MP PP +c0 + +31 11 189 246 -28 -21 3855 1796 4 MP DP +c61 + +69 -15 192 68 -64 15 4545 3124 4 MP PP +c0 + +69 -15 192 68 -64 15 4545 3124 4 MP DP +c61 + +-26 -49 141 46 10 44 4794 2797 4 MP PP +c0 + +-26 -49 141 46 10 44 4794 2797 4 MP DP +c63 + +23 39 145 104 -2 -24 4056 2951 4 MP PP +c0 + +23 39 145 104 -2 -24 4056 2951 4 MP DP +c64 + +-36 19 189 185 42 -6 3709 2556 4 MP PP +c0 + +-36 19 189 185 42 -6 3709 2556 4 MP DP +c63 + +-54 -15 105 75 37 3 4547 2624 4 MP PP +c0 + +-54 -15 105 75 37 3 4547 2624 4 MP DP +c65 + +-46 6 132 119 36 -17 4379 2522 4 MP PP +c0 + +-46 6 132 119 36 -17 4379 2522 4 MP DP +c7 + +-5 -22 215 267 0 32 3226 1997 4 MP PP +c0 + +-5 -22 215 267 0 32 3226 1997 4 MP DP +c62 + +-32 1 218 233 32 10 3459 2313 4 MP PP +c0 + +-32 1 218 233 32 10 3459 2313 4 MP DP +c62 + +-8 17 198 221 9 -27 4061 2098 4 MP PP +c0 + +-8 17 198 221 9 -27 4061 2098 4 MP DP +c61 + +63 -25 197 68 -63 24 4608 3100 4 MP PP +c0 + +63 -25 197 68 -63 24 4608 3100 4 MP DP +c61 + +-11 -52 155 51 -3 47 4804 2841 4 MP PP +c0 + +-11 -52 155 51 -3 47 4804 2841 4 MP DP +c61 + +54 -34 197 67 -57 33 4665 3067 4 MP PP +c0 + +54 -34 197 67 -57 33 4665 3067 4 MP DP +c61 + +3 -53 169 56 -17 48 4801 2888 4 MP PP +c0 + +3 -53 169 56 -17 48 4801 2888 4 MP DP +c65 + +-10 29 160 144 26 -13 3878 2767 4 MP PP +c0 + +-10 29 160 144 26 -13 3878 2767 4 MP DP +c61 + +45 -42 194 66 -50 39 4715 3028 4 MP PP +c0 + +45 -42 194 66 -50 39 4715 3028 4 MP DP +c61 + +18 -51 180 60 -29 47 4784 2936 4 MP PP +c0 + +18 -51 180 60 -29 47 4784 2936 4 MP DP +c61 + +31 -48 189 63 -40 45 4755 2983 4 MP PP +c0 + +31 -48 189 63 -40 45 4755 2983 4 MP DP +c64 + +-25 11 180 185 20 -22 4240 2331 4 MP PP +c0 + +-25 11 180 185 20 -22 4240 2331 4 MP DP +c7 + +43 4 185 257 -39 -15 3827 1775 4 MP PP +c0 + +43 4 185 257 -39 -15 3827 1775 4 MP DP +c63 + +35 32 166 119 -14 -17 4070 2968 4 MP PP +c0 + +35 32 166 119 -14 -17 4070 2968 4 MP DP +c63 + +-46 -24 124 89 27 10 4584 2627 4 MP PP +c0 + +-46 -24 124 89 27 10 4584 2627 4 MP DP +c64 + +-26 13 195 198 32 -1 3677 2557 4 MP PP +c0 + +-26 13 195 198 32 -1 3677 2557 4 MP DP +c65 + +-37 -3 144 133 25 -11 4415 2505 4 MP PP +c0 + +-37 -3 144 133 25 -11 4415 2505 4 MP DP +c7 + +9 -27 210 277 -14 34 3240 1963 4 MP PP +c0 + +9 -27 210 277 -14 34 3240 1963 4 MP DP +c62 + +-19 -6 218 244 18 17 3441 2296 4 MP PP +c0 + +-19 -6 218 244 18 17 3441 2296 4 MP DP +c62 + +6 12 197 231 -5 -22 4070 2071 4 MP PP +c0 + +6 12 197 231 -5 -22 4070 2071 4 MP DP +c65 + +2 24 176 160 13 -7 3865 2774 4 MP PP +c0 + +2 24 176 160 13 -7 3865 2774 4 MP DP +c7 + +53 -3 182 267 -50 -7 3788 1760 4 MP PP +c0 + +53 -3 182 267 -50 -7 3788 1760 4 MP DP +c63 + +46 24 187 134 -27 -11 4097 2979 4 MP PP +c0 + +46 24 187 134 -27 -11 4097 2979 4 MP DP +c63 + +-35 -32 145 104 14 17 4611 2637 4 MP PP +c0 + +-35 -32 145 104 14 17 4611 2637 4 MP DP +c64 + +-12 5 184 197 8 -17 4260 2309 4 MP PP +c0 + +-12 5 184 197 8 -17 4260 2309 4 MP DP +c7 + +23 -30 205 284 -28 36 3268 1927 4 MP PP +c0 + +23 -30 205 284 -28 36 3268 1927 4 MP DP +c64 + +-13 7 201 210 19 6 3658 2551 4 MP PP +c0 + +-13 7 201 210 19 6 3658 2551 4 MP DP +c65 + +-27 -10 159 148 12 -5 4440 2494 4 MP PP +c0 + +-27 -10 159 148 12 -5 4440 2494 4 MP DP +c62 + +-6 -12 217 255 5 22 3436 2274 4 MP PP +c0 + +-6 -12 217 255 5 22 3436 2274 4 MP DP +c62 + +19 6 196 242 -18 -17 4065 2049 4 MP PP +c0 + +19 6 196 242 -18 -17 4065 2049 4 MP DP +c7 + +59 -9 182 276 -59 0 3738 1753 4 MP PP +c0 + +59 -9 182 276 -59 0 3738 1753 4 MP DP +c7 + +35 -32 200 290 -39 36 3307 1891 4 MP PP +c0 + +35 -32 200 290 -39 36 3307 1891 4 MP DP +c63 + +54 14 206 147 -37 -2 4134 2981 4 MP PP +c0 + +54 14 206 147 -37 -2 4134 2981 4 MP DP +c63 + +-24 -39 167 119 2 24 4625 2654 4 MP PP +c0 + +-24 -39 167 119 2 24 4625 2654 4 MP DP +c65 + +14 17 191 177 0 -1 3865 2775 4 MP PP +c0 + +14 17 191 177 0 -1 3865 2775 4 MP DP +c64 + +0 -1 190 210 -6 -12 4268 2292 4 MP PP +c0 + +0 -1 190 210 -6 -12 4268 2292 4 MP DP +c7 + +65 -16 181 284 -64 8 3679 1753 4 MP PP +c0 + +65 -16 181 284 -64 8 3679 1753 4 MP DP +c64 + +0 1 207 223 6 12 3652 2539 4 MP PP +c0 + +0 1 207 223 6 12 3652 2539 4 MP DP +c65 + +-14 -17 173 164 0 1 4452 2489 4 MP PP +c0 + +-14 -17 173 164 0 1 4452 2489 4 MP DP +c7 + +46 -32 196 294 -51 35 3358 1856 4 MP PP +c0 + +46 -32 196 294 -51 35 3358 1856 4 MP DP +c62 + +7 -17 216 265 -9 27 3445 2247 4 MP PP +c0 + +7 -17 216 265 -9 27 3445 2247 4 MP DP +c62 + +32 -1 195 254 -31 -11 4047 2032 4 MP PP +c0 + +32 -1 195 254 -31 -11 4047 2032 4 MP DP +c63 + +61 5 223 159 -46 5 4180 2976 4 MP PP +c0 + +61 5 223 159 -46 5 4180 2976 4 MP DP +c63 + +-10 -44 187 134 -10 29 4627 2678 4 MP PP +c0 + +-10 -44 187 134 -10 29 4627 2678 4 MP DP +c7 + +66 -21 182 290 -67 15 3615 1761 4 MP PP +c0 + +66 -21 182 290 -67 15 3615 1761 4 MP DP +c7 + +54 -32 191 297 -58 31 3416 1825 4 MP PP +c0 + +54 -32 191 297 -58 31 3416 1825 4 MP DP +c7 + +65 -26 185 294 -68 22 3548 1776 4 MP PP +c0 + +65 -26 185 294 -68 22 3548 1776 4 MP DP +c7 + +62 -29 187 296 -64 27 3480 1798 4 MP PP +c0 + +62 -29 187 296 -64 27 3480 1798 4 MP DP +c65 + +27 11 205 193 -13 5 3878 2770 4 MP PP +c0 + +27 11 205 193 -13 5 3878 2770 4 MP DP +c64 + +13 -7 196 223 -19 -6 4262 2280 4 MP PP +c0 + +13 -7 196 223 -19 -6 4262 2280 4 MP DP +c63 + +63 -6 238 169 -53 13 4233 2963 4 MP PP +c0 + +63 -6 238 169 -53 13 4233 2963 4 MP DP +c63 + +3 -47 207 147 -23 34 4617 2707 4 MP PP +c0 + +3 -47 207 147 -23 34 4617 2707 4 MP DP +c62 + +21 -22 214 275 -23 30 3468 2217 4 MP PP +c0 + +21 -22 214 275 -23 30 3468 2217 4 MP DP +c65 + +-2 -24 188 181 -13 7 4452 2490 4 MP PP +c0 + +-2 -24 188 181 -13 7 4452 2490 4 MP DP +c62 + +42 -6 196 264 -43 -4 4016 2021 4 MP PP +c0 + +42 -6 196 264 -43 -4 4016 2021 4 MP DP +c64 + +13 -5 213 236 -7 17 3659 2522 4 MP PP +c0 + +13 -5 213 236 -7 17 3659 2522 4 MP DP +c63 + +64 -15 248 176 -58 20 4291 2943 4 MP PP +c0 + +64 -15 248 176 -58 20 4291 2943 4 MP DP +c63 + +17 -48 223 159 -33 36 4594 2741 4 MP PP +c0 + +17 -48 223 159 -33 36 4594 2741 4 MP DP +c65 + +37 2 219 209 -25 11 3903 2759 4 MP PP +c0 + +37 2 219 209 -25 11 3903 2759 4 MP DP +c62 + +33 -25 212 283 -35 32 3503 2185 4 MP PP +c0 + +33 -25 212 283 -35 32 3503 2185 4 MP DP +c62 + +52 -13 197 274 -53 3 3973 2017 4 MP PP +c0 + +52 -13 197 274 -53 3 3973 2017 4 MP DP +c64 + +25 -13 203 235 -32 1 4243 2274 4 MP PP +c0 + +25 -13 203 235 -32 1 4243 2274 4 MP DP +c63 + +63 -24 254 181 -60 26 4351 2917 4 MP PP +c0 + +63 -24 254 181 -60 26 4351 2917 4 MP DP +c63 + +29 -47 237 169 -43 37 4561 2777 4 MP PP +c0 + +29 -47 237 169 -43 37 4561 2777 4 MP DP +c65 + +10 -29 203 197 -25 13 4439 2497 4 MP PP +c0 + +10 -29 203 197 -25 13 4439 2497 4 MP DP +c64 + +25 -11 219 248 -21 22 3680 2500 4 MP PP +c0 + +25 -11 219 248 -21 22 3680 2500 4 MP DP +c63 + +57 -33 257 183 -59 31 4410 2886 4 MP PP +c0 + +57 -33 257 183 -59 31 4410 2886 4 MP DP +c63 + +40 -45 248 177 -51 37 4518 2814 4 MP PP +c0 + +40 -45 248 177 -51 37 4518 2814 4 MP DP +c63 + +50 -39 255 181 -57 35 4467 2851 4 MP PP +c0 + +50 -39 255 181 -57 35 4467 2851 4 MP DP +c62 + +44 -28 210 290 -46 32 3549 2153 4 MP PP +c0 + +44 -28 210 290 -46 32 3549 2153 4 MP DP +c62 + +58 -17 198 282 -59 9 3920 2020 4 MP PP +c0 + +58 -17 198 282 -59 9 3920 2020 4 MP DP +c65 + +46 -5 231 222 -36 17 3939 2742 4 MP PP +c0 + +46 -5 231 222 -36 17 3939 2742 4 MP DP +c64 + +37 -19 208 248 -42 6 4211 2275 4 MP PP +c0 + +37 -19 208 248 -42 6 4211 2275 4 MP DP +c65 + +23 -34 217 212 -37 19 4414 2510 4 MP PP +c0 + +23 -34 217 212 -37 19 4414 2510 4 MP DP +c64 + +36 -17 223 259 -33 25 3713 2475 4 MP PP +c0 + +36 -17 223 259 -33 25 3713 2475 4 MP DP +c62 + +52 -30 208 294 -54 32 3603 2121 4 MP PP +c0 + +52 -30 208 294 -54 32 3603 2121 4 MP DP +c62 + +63 -23 200 289 -65 16 3861 2029 4 MP PP +c0 + +63 -23 200 289 -65 16 3861 2029 4 MP DP +c62 + +59 -29 206 296 -62 29 3665 2092 4 MP PP +c0 + +59 -29 206 296 -62 29 3665 2092 4 MP DP +c62 + +65 -25 201 293 -66 21 3796 2045 4 MP PP +c0 + +65 -25 201 293 -66 21 3796 2045 4 MP DP +c65 + +53 -13 241 234 -45 21 3984 2721 4 MP PP +c0 + +53 -13 241 234 -45 21 3984 2721 4 MP DP +c62 + +63 -29 203 296 -65 26 3730 2066 4 MP PP +c0 + +63 -29 203 296 -65 26 3730 2066 4 MP DP +c64 + +46 -23 214 258 -52 13 4169 2281 4 MP PP +c0 + +46 -23 214 258 -52 13 4169 2281 4 MP DP +c65 + +33 -36 230 225 -46 23 4377 2529 4 MP PP +c0 + +33 -36 230 225 -46 23 4377 2529 4 MP DP +c64 + +45 -21 226 267 -44 28 3757 2447 4 MP PP +c0 + +45 -21 226 267 -44 28 3757 2447 4 MP DP +c65 + +58 -20 249 242 -54 26 4038 2695 4 MP PP +c0 + +58 -20 249 242 -54 26 4038 2695 4 MP DP +c65 + +43 -37 240 235 -53 27 4331 2552 4 MP PP +c0 + +43 -37 240 235 -53 27 4331 2552 4 MP DP +c64 + +53 -27 219 268 -58 17 4117 2294 4 MP PP +c0 + +53 -27 219 268 -58 17 4117 2294 4 MP DP +c64 + +54 -26 227 274 -52 30 3809 2417 4 MP PP +c0 + +54 -26 227 274 -52 30 3809 2417 4 MP DP +c65 + +60 -26 253 248 -58 28 4096 2667 4 MP PP +c0 + +60 -26 253 248 -58 28 4096 2667 4 MP DP +c65 + +51 -37 248 244 -59 28 4278 2579 4 MP PP +c0 + +51 -37 248 244 -59 28 4278 2579 4 MP DP +c64 + +59 -28 223 273 -63 23 4059 2311 4 MP PP +c0 + +59 -28 223 273 -63 23 4059 2311 4 MP DP +c65 + +59 -31 255 250 -62 30 4158 2637 4 MP PP +c0 + +59 -31 255 250 -62 30 4158 2637 4 MP DP +c64 + +58 -28 229 278 -59 29 3868 2388 4 MP PP +c0 + +58 -28 229 278 -59 29 3868 2388 4 MP DP +c65 + +57 -35 252 249 -61 30 4219 2607 4 MP PP +c0 + +57 -35 252 249 -61 30 4219 2607 4 MP DP +c64 + +61 -30 227 278 -65 25 3996 2334 4 MP PP +c0 + +61 -30 227 278 -65 25 3996 2334 4 MP DP +c64 + +62 -30 228 279 -63 29 3931 2359 4 MP PP +c0 + +62 -30 228 279 -63 29 3931 2359 4 MP DP +gr +gs 0 0 0 0 MR c np + +end + +eplot +%%EndObject graph 1 + +epage +end + +showpage + +%%Trailer +%%BoundingBox: 74 209 558 583 +%%Pages: 001 +%%EOF diff --git a/Build/source/texk/windvi/Examples/f5.ps b/Build/source/texk/windvi/Examples/f5.ps new file mode 100644 index 00000000000..5cd715090b4 --- /dev/null +++ b/Build/source/texk/windvi/Examples/f5.ps @@ -0,0 +1,4614 @@ +%!PS-Adobe-2.0 EPSF-1.2 +%%DocumentFonts: Courier +%%Pages: 1 +%%BoundingBox: 100 83 545 712 +%%EndComments + +50 dict begin + +/arrowHeight 8 def +/arrowWidth 4 def +/none null def +/numGraphicParameters 17 def +/stringLimit 65535 def + +/Begin { +save +numGraphicParameters dict begin +} def + +/End { +end +restore +} def + +/SetB { +dup type /nulltype eq { +pop +false /brushRightArrow idef +false /brushLeftArrow idef +true /brushNone idef +} { +/brushDashOffset idef +/brushDashArray idef +0 ne /brushRightArrow idef +0 ne /brushLeftArrow idef +/brushWidth idef +false /brushNone idef +} ifelse +} def + +/SetCFg { +/fgblue idef +/fggreen idef +/fgred idef +} def + +/SetCBg { +/bgblue idef +/bggreen idef +/bgred idef +} def + +/SetF { +/printSize idef +/printFont idef +} def + +/SetP { +dup type /nulltype eq { +pop true /patternNone idef +} { +/patternGrayLevel idef +patternGrayLevel -1 eq { +/patternString idef +} if +false /patternNone idef +} ifelse +} def + +/BSpl { +0 begin +storexyn +newpath +n 1 gt { +0 0 0 0 0 0 1 1 true subspline +n 2 gt { +0 0 0 0 1 1 2 2 false subspline +1 1 n 3 sub { +/i exch def +i 1 sub dup i dup i 1 add dup i 2 add dup false subspline +} for +n 3 sub dup n 2 sub dup n 1 sub dup 2 copy false subspline +} if +n 2 sub dup n 1 sub dup 2 copy 2 copy false subspline +patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if +brushNone not { istroke } if +0 0 1 1 leftarrow +n 2 sub dup n 1 sub dup rightarrow +} if +end +} dup 0 4 dict put def + +/Circ { +newpath +0 360 arc +patternNone not { ifill } if +brushNone not { istroke } if +} def + +/CBSpl { +0 begin +dup 2 gt { +storexyn +newpath +n 1 sub dup 0 0 1 1 2 2 true subspline +1 1 n 3 sub { +/i exch def +i 1 sub dup i dup i 1 add dup i 2 add dup false subspline +} for +n 3 sub dup n 2 sub dup n 1 sub dup 0 0 false subspline +n 2 sub dup n 1 sub dup 0 0 1 1 false subspline +patternNone not { ifill } if +brushNone not { istroke } if +} { +Poly +} ifelse +end +} dup 0 4 dict put def + +/Elli { +0 begin +newpath +4 2 roll +translate +scale +0 0 1 0 360 arc +patternNone not { ifill } if +brushNone not { istroke } if +end +} dup 0 1 dict put def + +/Line { +0 begin +2 storexyn +newpath +x 0 get y 0 get moveto +x 1 get y 1 get lineto +brushNone not { istroke } if +0 0 1 1 leftarrow +0 0 1 1 rightarrow +end +} dup 0 4 dict put def + +/MLine { +0 begin +storexyn +newpath +n 1 gt { +x 0 get y 0 get moveto +1 1 n 1 sub { +/i exch def +x i get y i get lineto +} for +patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if +brushNone not { istroke } if +0 0 1 1 leftarrow +n 2 sub dup n 1 sub dup rightarrow +} if +end +} dup 0 4 dict put def + +/Poly { +3 1 roll +newpath +moveto +-1 add +{ lineto } repeat +closepath +patternNone not { ifill } if +brushNone not { istroke } if +} def + +/Rect { +0 begin +/t exch def +/r exch def +/b exch def +/l exch def +newpath +l b moveto +l t lineto +r t lineto +r b lineto +closepath +patternNone not { ifill } if +brushNone not { istroke } if +end +} dup 0 4 dict put def + +/Text { +ishow +} def + +/idef { +dup where { pop pop pop } { exch def } ifelse +} def + +/ifill { +0 begin +gsave +patternGrayLevel -1 ne { +fgred bgred fgred sub patternGrayLevel mul add +fggreen bggreen fggreen sub patternGrayLevel mul add +fgblue bgblue fgblue sub patternGrayLevel mul add setrgbcolor +eofill +} { +eoclip +originalCTM setmatrix +pathbbox /t exch def /r exch def /b exch def /l exch def +/w r l sub ceiling cvi def +/h t b sub ceiling cvi def +/imageByteWidth w 8 div ceiling cvi def +/imageHeight h def +bgred bggreen bgblue setrgbcolor +eofill +fgred fggreen fgblue setrgbcolor +w 0 gt h 0 gt and { +l b translate w h scale +w h true [w 0 0 h neg 0 h] { patternproc } imagemask +} if +} ifelse +grestore +end +} dup 0 8 dict put def + +/istroke { +gsave +brushDashOffset -1 eq { +[] 0 setdash +1 setgray +} { +brushDashArray brushDashOffset setdash +fgred fggreen fgblue setrgbcolor +} ifelse +brushWidth setlinewidth +originalCTM setmatrix +stroke +grestore +} def + +/ishow { +0 begin +gsave +fgred fggreen fgblue setrgbcolor +/fontDict printFont findfont printSize scalefont dup setfont def +/descender fontDict begin 0 [FontBBox] 1 get FontMatrix end +transform exch pop def +/vertoffset 0 descender sub printSize sub printFont /Courier ne +printFont /Courier-Bold ne and { 1 add } if def { +0 vertoffset moveto show +/vertoffset vertoffset printSize sub def +} forall +grestore +end +} dup 0 3 dict put def + +/patternproc { +0 begin +/patternByteLength patternString length def +/patternHeight patternByteLength 8 mul sqrt cvi def +/patternWidth patternHeight def +/patternByteWidth patternWidth 8 idiv def +/imageByteMaxLength imageByteWidth imageHeight mul +stringLimit patternByteWidth sub min def +/imageMaxHeight imageByteMaxLength imageByteWidth idiv patternHeight idiv +patternHeight mul patternHeight max def +/imageHeight imageHeight imageMaxHeight sub store +/imageString imageByteWidth imageMaxHeight mul patternByteWidth add string def +0 1 imageMaxHeight 1 sub { +/y exch def +/patternRow y patternByteWidth mul patternByteLength mod def +/patternRowString patternString patternRow patternByteWidth getinterval def +/imageRow y imageByteWidth mul def +0 patternByteWidth imageByteWidth 1 sub { +/x exch def +imageString imageRow x add patternRowString putinterval +} for +} for +imageString +end +} dup 0 12 dict put def + +/min { +dup 3 2 roll dup 4 3 roll lt { exch } if pop +} def + +/max { +dup 3 2 roll dup 4 3 roll gt { exch } if pop +} def + +/arrowhead { +0 begin +transform originalCTM itransform +/taily exch def +/tailx exch def +transform originalCTM itransform +/tipy exch def +/tipx exch def +/dy tipy taily sub def +/dx tipx tailx sub def +/angle dx 0 ne dy 0 ne or { dy dx atan } { 90 } ifelse def +gsave +originalCTM setmatrix +tipx tipy translate +angle rotate +newpath +0 0 moveto +arrowHeight neg arrowWidth 2 div lineto +arrowHeight neg arrowWidth 2 div neg lineto +closepath +patternNone not { +originalCTM setmatrix +/padtip arrowHeight 2 exp 0.25 arrowWidth 2 exp mul add sqrt brushWidth mul +arrowWidth div def +/padtail brushWidth 2 div def +tipx tipy translate +angle rotate +padtip 0 translate +arrowHeight padtip add padtail add arrowHeight div dup scale +arrowheadpath +ifill +} if +brushNone not { +originalCTM setmatrix +tipx tipy translate +angle rotate +arrowheadpath +istroke +} if +grestore +end +} dup 0 9 dict put def + +/arrowheadpath { +newpath +0 0 moveto +arrowHeight neg arrowWidth 2 div lineto +arrowHeight neg arrowWidth 2 div neg lineto +closepath +} def + +/leftarrow { +0 begin +y exch get /taily exch def +x exch get /tailx exch def +y exch get /tipy exch def +x exch get /tipx exch def +brushLeftArrow { tipx tipy tailx taily arrowhead } if +end +} dup 0 4 dict put def + +/rightarrow { +0 begin +y exch get /tipy exch def +x exch get /tipx exch def +y exch get /taily exch def +x exch get /tailx exch def +brushRightArrow { tipx tipy tailx taily arrowhead } if +end +} dup 0 4 dict put def + +/midpoint { +0 begin +/y1 exch def +/x1 exch def +/y0 exch def +/x0 exch def +x0 x1 add 2 div +y0 y1 add 2 div +end +} dup 0 4 dict put def + +/thirdpoint { +0 begin +/y1 exch def +/x1 exch def +/y0 exch def +/x0 exch def +x0 2 mul x1 add 3 div +y0 2 mul y1 add 3 div +end +} dup 0 4 dict put def + +/subspline { +0 begin +/movetoNeeded exch def +y exch get /y3 exch def +x exch get /x3 exch def +y exch get /y2 exch def +x exch get /x2 exch def +y exch get /y1 exch def +x exch get /x1 exch def +y exch get /y0 exch def +x exch get /x0 exch def +x1 y1 x2 y2 thirdpoint +/p1y exch def +/p1x exch def +x2 y2 x1 y1 thirdpoint +/p2y exch def +/p2x exch def +x1 y1 x0 y0 thirdpoint +p1x p1y midpoint +/p0y exch def +/p0x exch def +x2 y2 x3 y3 thirdpoint +p2x p2y midpoint +/p3y exch def +/p3x exch def +movetoNeeded { p0x p0y moveto } if +p1x p1y p2x p2y p3x p3y curveto +end +} dup 0 17 dict put def + +/storexyn { +/n exch def +/y n array def +/x n array def +n 1 sub -1 0 { +/i exch def +y i 3 2 roll put +x i 3 2 roll put +} for +} def + +%%EndProlog + +%I Idraw 7 Grid 3.70615 + +%%Page: 1 1 + +Begin +%I b u +%I cfg u +%I cbg u +%I f u +%I p u +%I t +[ 0.923077 0 0 0.923077 0 0 ] concat +/originalCTM matrix currentmatrix def + +Begin %I Pict +%I b u +%I cfg u +%I cbg u +%I f u +%I p u +%I t +[ 1 0 0 1 84 -136 ] concat + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I +64 468 128 500 Rect +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I 3 +64 492 +72 484 +64 476 +3 MLine +End + +End %I eop + +Begin %I Pict +%I b u +%I cfg u +%I cbg u +%I f u +%I p u +%I t +[ 1 0 0 1 140 -136 ] concat + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I +64 468 128 500 Rect +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I 3 +64 492 +72 484 +64 476 +3 MLine +End + +End %I eop + +Begin %I Pict +%I b u +%I cfg u +%I cbg u +%I f u +%I p u +%I t +[ 1 0 0 1 196 -136 ] concat + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I +64 468 128 500 Rect +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I 3 +64 492 +72 484 +64 476 +3 MLine +End + +End %I eop + +Begin %I Pict +%I b u +%I cfg u +%I cbg u +%I f u +%I p u +%I t +[ 1 0 0 1 252 -136 ] concat + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I +64 468 128 500 Rect +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I 3 +64 492 +72 484 +64 476 +3 MLine +End + +End %I eop + +Begin %I Pict +%I b u +%I cfg u +%I cbg u +%I f u +%I p u +%I t +[ 1 0 0 1 -76 -136 ] concat + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I +64 468 128 500 Rect +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I 3 +64 492 +72 484 +64 476 +3 MLine +End + +End %I eop + +Begin %I Pict +%I b u +%I cfg u +%I cbg u +%I f u +%I p u +%I t +[ 1 0 0 1 -4 -136 ] concat + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I +64 468 128 500 Rect +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I 3 +64 492 +72 484 +64 476 +3 MLine +End + +End %I eop + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 140.25 185.25 ] concat +%I 5 +88 534 +200 534 +184 502 +104 502 +88 534 +5 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 212.25 185.25 ] concat +%I 5 +88 534 +200 534 +184 502 +104 502 +88 534 +5 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 344.25 185.25 ] concat +%I 5 +88 534 +200 534 +184 502 +104 502 +88 534 +5 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 416.25 185.25 ] concat +%I 5 +88 534 +200 534 +184 502 +104 502 +88 534 +5 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 184.25 189.25 ] concat +%I 2 +56 494 +56 430 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 184.25 189.25 ] concat +%I 2 +200 494 +200 430 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 184.25 189.25 ] concat +%I 2 +376 454 +376 430 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 184.25 189.25 ] concat +%I 2 +600 454 +600 430 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 184.25 189.25 ] concat +%I 2 +488 470 +488 430 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 184.25 189.25 ] concat +%I 2 +712 470 +712 430 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 184.25 189.25 ] concat +%I 2 +600 454 +376 454 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 184.25 189.25 ] concat +%I 2 +464 494 +464 454 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 184.25 189.25 ] concat +%I 2 +488 470 +712 470 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 180.25 189.25 ] concat +%I 2 +616 494 +616 470 +2 MLine +End + +Begin %I Pict +%I b u +%I cfg u +%I cbg u +%I f u +%I p u +%I t +[ 1 0 0 1 12 -116 ] concat + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 168.25 297.25 ] concat +%I 3 +48 342 +120 342 +136 326 +3 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ -0.5 0 0 0.5 304.25 297.25 ] concat +%I 3 +48 342 +120 342 +136 326 +3 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 168.25 297.25 ] concat +%I 4 +48 342 +80 286 +192 286 +224 342 +4 MLine +End + +End %I eop + +Begin %I Pict +%I b u +%I cfg u +%I cbg u +%I f u +%I p u +%I t +[ 1 0 0 1 164 -116 ] concat + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 168.25 297.25 ] concat +%I 3 +48 342 +120 342 +136 326 +3 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ -0.5 0 0 0.5 304.25 297.25 ] concat +%I 3 +48 342 +120 342 +136 326 +3 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 168.25 297.25 ] concat +%I 4 +48 342 +80 286 +192 286 +224 342 +4 MLine +End + +End %I eop + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 184.25 189.25 ] concat +%I 2 +376 390 +376 334 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 184.25 189.25 ] concat +%I 2 +488 390 +488 334 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 184.25 189.25 ] concat +%I 4 +200 390 +200 366 +184 366 +184 334 +4 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 184.25 189.25 ] concat +%I 4 +56 390 +56 366 +72 366 +72 334 +4 MLine +End + +Begin %I Elli +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 184.25 185.25 ] concat +%I +656 294 40 40 Elli +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 184.25 189.25 ] concat +%I 3 +600 390 +600 366 +632 326 +3 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 184.25 189.25 ] concat +%I 3 +712 390 +712 366 +680 326 +3 MLine +End + +Begin %I Pict +%I b u +%I cfg u +%I cbg u +%I f u +%I p u +%I t +[ 1 0 0 1 52 -228 ] concat + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I +64 468 128 500 Rect +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I 3 +64 492 +72 484 +64 476 +3 MLine +End + +End %I eop + +Begin %I Pict +%I b u +%I cfg u +%I cbg u +%I f u +%I p u +%I t +[ 1 0 0 1 180 -228 ] concat + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I +64 468 128 500 Rect +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I 3 +64 492 +72 484 +64 476 +3 MLine +End + +End %I eop + +Begin %I Pict +%I b u +%I cfg u +%I cbg u +%I f u +%I p u +%I t +[ 1 0 0 1 -100 -228 ] concat + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I +64 468 128 500 Rect +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I 3 +64 492 +72 484 +64 476 +3 MLine +End + +End %I eop + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 184.25 185.25 ] concat +%I 3 +8 246 +8 294 +56 294 +3 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 184.25 189.25 ] concat +%I 3 +312 238 +312 286 +360 286 +3 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 184.25 189.25 ] concat +%I 3 +568 238 +568 286 +608 286 +3 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 137.25 185.25 ] concat +%I 2 +101 69 +101 205 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 289.25 185.25 ] concat +%I 2 +102 166 +102 206 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 417.25 185.25 ] concat +%I 2 +102 166 +102 206 +2 MLine +End + +Begin %I Pict +%I b u +%I cfg u +%I cbg u +%I f u +%I p u +%I t +[ 1 0 0 1 64 -4 ] concat + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I +64 468 128 500 Rect +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I 3 +64 492 +72 484 +64 476 +3 MLine +End + +End %I eop + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 280.25 301.25 ] concat +%I 5 +88 534 +200 534 +184 502 +104 502 +88 534 +5 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 137.25 273.25 ] concat +%I 2 +110 398 +110 366 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 337.25 273.25 ] concat +%I 2 +110 398 +110 366 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 137.25 273.25 ] concat +%I 2 +134 430 +134 366 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 341.25 273.25 ] concat +%I 2 +134 430 +134 366 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 209.25 273.25 ] concat +%I 2 +134 430 +134 366 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 413.25 273.25 ] concat +%I 2 +134 430 +134 366 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 137.25 273.25 ] concat +%I 2 +166 446 +166 366 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 209.25 273.25 ] concat +%I 2 +166 446 +166 366 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 341.25 273.25 ] concat +%I 2 +166 446 +166 366 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 413.25 273.25 ] concat +%I 2 +166 446 +166 366 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 141.25 273.25 ] concat +%I 2 +190 462 +190 366 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 213.25 273.25 ] concat +%I 2 +190 462 +190 366 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 345.25 273.25 ] concat +%I 2 +190 462 +190 366 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 417.25 273.25 ] concat +%I 2 +190 462 +190 366 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 137.25 273.25 ] concat +%I 2 +246 414 +246 366 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 341.25 273.25 ] concat +%I 2 +246 414 +246 366 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 137.25 273.25 ] concat +%I 2 +134 430 +686 430 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 137.25 273.25 ] concat +%I 2 +430 486 +430 430 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 137.25 273.25 ] concat +%I 2 +110 398 +510 398 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 137.25 273.25 ] concat +%I 2 +246 414 +654 414 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 137.25 273.25 ] concat +%I 2 +166 446 +718 446 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 137.25 273.25 ] concat +%I 2 +198 462 +750 462 +2 MLine +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 254.75 358.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 314.75 350.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 238.75 350.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 370.75 350.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 386.75 358.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 402.75 366.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 270.75 366.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 182.75 358.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 474.75 366.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 426.75 342.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 154.75 334.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I MLine +%I b 65535 +1 1 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 137.25 273.25 ] concat +%I 5 +478 598 +478 630 +598 630 +606 630 +606 462 +5 MLine +End + +Begin %I MLine +%I b 65535 +1 1 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 137.25 273.25 ] concat +%I 2 +430 526 +430 558 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 1 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 137.25 273.25 ] concat +%I 4 +446 598 +446 630 +310 630 +310 446 +4 MLine +End + +Begin %I MLine +%I b 65535 +1 1 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 137.25 273.25 ] concat +%I 4 +382 598 +382 646 +110 646 +110 670 +4 MLine +End + +Begin %I MLine +%I b 65535 +1 1 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 137.25 273.25 ] concat +%I 4 +414 598 +414 646 +654 646 +654 670 +4 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 137.25 273.25 ] concat +%I 2 +654 414 +654 646 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 137.25 273.25 ] concat +%I 2 +110 646 +110 398 +2 MLine +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 154.75 458.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 426.75 458.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 137.25 231.25 ] concat +%I 2 +661 73 +101 73 +2 MLine +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 150.75 130.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 302.75 130.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 137.25 231.25 ] concat +%I 5 +222 186 +222 34 +-50 34 +-50 530 +166 530 +5 MLine +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 450.75 286.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 378.75 278.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 384.25 -26.75 ] concat +%I 5 +88 534 +200 534 +184 502 +104 502 +88 534 +5 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 231.25 147.25 ] concat +%I 4 +338 354 +338 226 +426 226 +426 194 +4 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 231.25 147.25 ] concat +%I 4 +562 330 +562 226 +474 226 +474 194 +4 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 231.25 189.25 ] concat +%I 5 +450 70 +450 38 +714 38 +714 630 +562 630 +5 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 276.25 -82.75 ] concat +%I 5 +88 534 +200 534 +184 502 +104 502 +88 534 +5 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 197.75 99.75 ] concat +%I 3 +517 217 +325 217 +325 177 +3 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 197.75 99.75 ] concat +%I 4 +101 297 +101 217 +277 217 +277 177 +4 MLine +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 418.75 70.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I Elli +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.25 0 0 0.25 210.75 110.75 ] concat +%I +150 550 8 8 Elli +End + +Begin %I Pict +%I b u +%I cfg u +%I cbg u +%I f u +%I p u +%I t +[ 1 0 0 1 60 -396 ] concat + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I +64 468 128 500 Rect +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I 3 +64 492 +72 484 +64 476 +3 MLine +End + +End %I eop + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 197.75 99.75 ] concat +%I 2 +301 137 +301 89 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 197.75 99.75 ] concat +%I 2 +301 49 +301 17 +2 MLine +End + +Begin %I Pict +%I b u +%I cfg u +%I cbg u +%I f u +%I p u +%I t +[ 1 0 0 1 -8 -396 ] concat + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I +64 468 128 500 Rect +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 240.25 286.25 ] concat +%I 3 +64 492 +72 484 +64 476 +3 MLine +End + +End %I eop + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 208.25 -82.75 ] concat +%I 5 +88 534 +200 534 +184 502 +104 502 +88 534 +5 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 197.75 99.75 ] concat +%I 2 +165 137 +165 89 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 197.75 99.75 ] concat +%I 5 +165 465 +189 433 +189 265 +141 265 +141 177 +5 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 460.25 -26.75 ] concat +%I 5 +88 534 +200 534 +184 502 +104 502 +88 534 +5 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 197.75 99.75 ] concat +%I 4 +669 249 +669 233 +189 233 +189 177 +4 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 129.75 99.75 ] concat +%I 2 +301 49 +301 17 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 197.75 99.75 ] concat +%I 5 +469 465 +493 441 +493 353 +645 353 +645 289 +5 MLine +End + +Begin %I MLine +%I b 65535 +1 0 1 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +%I p +0 SetP +%I t +[ 0.5 0 0 0.5 244.75 99.75 ] concat +%I 3 +575 449 +599 433 +599 289 +3 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 56.75 183.75 ] concat +%I 2 +311 505 +311 441 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 56.75 183.75 ] concat +%I 2 +455 505 +455 441 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 56.75 183.75 ] concat +%I 4 +455 401 +455 377 +439 377 +439 345 +4 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 56.75 183.75 ] concat +%I 4 +311 401 +311 377 +327 377 +327 345 +4 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 56.75 183.75 ] concat +%I 4 +383 281 +383 49 +559 49 +559 9 +4 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 56.75 183.75 ] concat +%I 4 +383 129 +111 129 +111 625 +735 625 +4 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 56.75 183.75 ] concat +%I 2 +631 401 +631 345 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 56.75 183.75 ] concat +%I 2 +743 401 +743 345 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 103.75 183.75 ] concat +%I 4 +593 281 +593 153 +681 153 +681 121 +4 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 103.75 183.75 ] concat +%I 4 +705 81 +705 49 +513 49 +513 9 +4 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 291.75 183.75 ] concat +%I 4 +249 505 +249 465 +385 465 +385 441 +4 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 291.75 183.75 ] concat +%I 3 +161 441 +161 465 +249 465 +3 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 291.75 183.75 ] concat +%I 4 +393 505 +393 481 +497 481 +497 441 +4 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 291.75 183.75 ] concat +%I 3 +273 441 +273 481 +393 481 +3 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 291.75 183.75 ] concat +%I 3 +273 625 +409 625 +409 545 +3 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 291.75 183.75 ] concat +%I 3 +120 608 +377 609 +377 545 +3 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 291.75 183.75 ] concat +%I 4 +441 641 +593 641 +593 49 +337 49 +4 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 291.75 183.75 ] concat +%I 3 +385 401 +385 377 +417 337 +3 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 291.75 183.75 ] concat +%I 3 +497 401 +497 377 +465 337 +3 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 291.75 183.75 ] concat +%I 4 +441 257 +441 153 +353 153 +353 121 +4 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 291.75 183.75 ] concat +%I 2 +33 641 +441 641 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 291.75 183.75 ] concat +%I 2 +121 593 +345 593 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 183.75 ] concat +%I 3 +83 577 +483 577 +483 545 +3 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 183.75 ] concat +%I 3 +403 593 +219 593 +219 545 +3 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 183.75 ] concat +%I 2 +107 609 +107 545 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 183.75 ] concat +%I 2 +107 609 +251 609 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 183.75 ] concat +%I 3 +315 641 +171 641 +171 545 +3 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 183.75 ] concat +%I 2 +139 625 +139 545 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 183.75 ] concat +%I 2 +251 609 +251 545 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 183.75 ] concat +%I 2 +283 625 +283 545 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 183.75 ] concat +%I 2 +315 641 +315 545 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 183.75 ] concat +%I 2 +515 609 +515 545 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 183.75 ] concat +%I 2 +547 625 +547 545 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 183.75 ] concat +%I 2 +579 641 +579 545 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 183.75 ] concat +%I 2 +627 593 +627 545 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 183.75 ] concat +%I 2 +723 641 +723 545 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 183.75 ] concat +%I 2 +403 665 +403 609 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 183.75 ] concat +%I 2 +403 609 +251 609 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 309.75 ] concat +%I 2 +83 597 +83 325 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 309.75 ] concat +%I 3 +387 525 +387 573 +627 573 +3 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 309.75 ] concat +%I 2 +627 597 +627 341 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 309.75 ] concat +%I 4 +579 389 +579 557 +451 557 +451 525 +4 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 309.75 ] concat +%I 4 +283 373 +283 557 +419 557 +419 525 +4 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 309.75 ] concat +%I 3 +91 573 +355 573 +355 525 +3 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 225.75 ] concat +%I 2 +403 653 +403 621 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 57.75 ] concat +%I 2 +395 221 +395 173 +2 MLine +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 150.75 57.75 ] concat +%I 2 +395 133 +395 101 +2 MLine +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 345.75 102.75 ] concat +%I +[ +(z) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 277.75 102.75 ] concat +%I +[ +(f) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 278.25 136.75 ] concat +%I +[ +(F) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 344.25 136.75 ] concat +%I +[ +(Z) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 180.25 304.25 ] concat +%I +[ +(Aop) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 331.25 304.25 ] concat +%I +[ +(Mop) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 460.25 304.25 ] concat +%I +[ +(Dop) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 239.25 340.25 ] concat +%I +[ +(ALU) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 392.25 339.75 ] concat +%I +[ +(MUL) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 499.75 341.25 ] concat +%I +[ +(DIV/) +(SQRT) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 206.25 396.75 ] concat +%I +[ +(Ax) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 277.75 396.75 ] concat +%I +[ +(Ay) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 366.25 396.75 ] concat +%I +[ +(Mx) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 421.75 396.75 ] concat +%I +[ +(My) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 478.25 396.75 ] concat +%I +[ +(Dx) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 533.75 396.75 ] concat +%I +[ +(Dy) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 342.25 528.25 ] concat +%I +[ +(Areg) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 189.25 620.75 ] concat +%I +[ +(x) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 461.25 621.25 ] concat +%I +[ +(y) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 155.25 216.75 ] concat +%I +[ +(Instruction) +] Text +End + +Begin %I MLine +%I b 65535 +2 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 9.75 225.75 ] concat +%I 2 +365 493 +365 461 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 9.75 309.75 ] concat +%I 2 +357 269 +341 269 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 137.75 309.75 ] concat +%I 2 +357 269 +341 269 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 213.75 309.75 ] concat +%I 2 +357 269 +341 269 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 341.75 309.75 ] concat +%I 2 +357 269 +341 269 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 205.75 425.75 ] concat +%I 2 +357 269 +341 269 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 385.75 97.75 ] concat +%I 2 +357 269 +341 269 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 253.75 97.75 ] concat +%I 2 +357 269 +341 269 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 201.75 41.75 ] concat +%I 2 +357 269 +341 269 +2 MLine +End + +Begin %I MLine +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 77.75 41.75 ] concat +%I 2 +357 269 +341 269 +2 MLine +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 151.25 446.75 ] concat +%I +[ +(Axsel) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 319.25 447.25 ] concat +%I +[ +(Aysel) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 355.75 447.25 ] concat +%I +[ +(Mxsel) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 523.75 446.75 ] concat +%I +[ +(Mysel) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 387.25 562.75 ] concat +%I +[ +(Asel) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 401.75 234.75 ] concat +%I +[ +(Msel) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 566.25 234.25 ] concat +%I +[ +(Msel) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 384.25 178.75 ] concat +%I +[ +(Tsel) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 223.75 178.75 ] concat +%I +[ +(Tsel) +] Text +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 124.25 493.25 ] concat +%I +504 518 552 550 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 164.25 469.25 ] concat +%I +568 566 664 598 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 116.25 469.25 ] concat +%I +568 566 664 598 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 100.25 493.25 ] concat +%I +504 518 552 550 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 76.25 493.25 ] concat +%I +504 518 552 550 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 124.25 461.25 ] concat +%I +504 518 552 550 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 164.25 437.25 ] concat +%I +568 566 664 598 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 116.25 437.25 ] concat +%I +568 566 664 598 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 100.25 461.25 ] concat +%I +504 518 552 550 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 76.25 461.25 ] concat +%I +504 518 552 550 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 52.25 461.25 ] concat +%I +504 518 552 550 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 172.25 493.25 ] concat +%I +264 390 648 422 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 164.25 373.25 ] concat +%I +568 566 664 598 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 172.25 397.25 ] concat +%I +504 518 552 550 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 148.25 397.25 ] concat +%I +504 518 552 550 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 124.25 397.25 ] concat +%I +504 518 552 550 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 100.25 397.25 ] concat +%I +504 518 552 550 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 76.25 397.25 ] concat +%I +504 518 552 550 Rect +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 52.25 397.25 ] concat +%I +504 518 552 550 Rect +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 460.25 763.25 ] concat +%I +[ +(Axsel) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 411.25 763.25 ] concat +%I +[ +(Aysel) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 380.75 763.25 ] concat +%I +[ +(Xen) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 357.75 763.25 ] concat +%I +[ +(Yen) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 333.25 763.25 ] concat +%I +[ +(Ien) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 460.25 731.25 ] concat +%I +[ +(Mxsel) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 412.25 731.25 ] concat +%I +[ +(Mysel) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 380.75 731.25 ] concat +%I +[ +(Xen) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 356.75 731.25 ] concat +%I +[ +(Yen) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 331.75 731.25 ] concat +%I +[ +(Ien) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 306.75 731.25 ] concat +%I +[ +(D/M') +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 373.25 699.25 ] concat +%I +[ +(Instruction) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 465.25 667.25 ] concat +%I +[ +(Asel) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 428.25 667.25 ] concat +%I +[ +(Aen) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 402.25 667.25 ] concat +%I +[ +(Msel) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 379.75 667.25 ] concat +%I +[ +(Tsel) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 357.25 667.25 ] concat +%I +[ +(Zld) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 309.25 667.25 ] concat +%I +[ +(Zen) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 334.25 667.25 ] concat +%I +[ +(Fld) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 269.75 765.25 ] concat +%I +[ +(Aluc) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 269.75 733.25 ] concat +%I +[ +(Mulc) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 275.75 669.25 ] concat +%I +[ +(Azc) +] Text +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-100-* +/Courier 10 SetF +%I t +[ 1 0 0 1 263.75 701.25 ] concat +%I +[ +(Instr) +] Text +End + +Begin %I Rect +%I b 65535 +1 0 0 [] 0 SetB +%I cfg Black +0 0 0 SetCFg +%I cbg White +1 1 1 SetCBg +none SetP %I p n +%I t +[ 0.5 0 0 0.5 52.25 493.25 ] concat +%I +504 518 552 550 Rect +End + +Begin %I Text +%I cfg Black +0 0 0 SetCFg +%I f *-courier-medium-r-*-80-* +/Courier 8 SetF +%I t +[ 1 0 0 1 309.25 763.25 ] concat +%I +[ +(Lhx) +] Text +End + +End %I eop + +showpage + +%%Trailer + +end diff --git a/Build/source/texk/windvi/Examples/f6.ps b/Build/source/texk/windvi/Examples/f6.ps new file mode 100644 index 00000000000..9dce1189942 --- /dev/null +++ b/Build/source/texk/windvi/Examples/f6.ps @@ -0,0 +1,23 @@ +%!PS +%%BoundingBox: 0 0 180 180 +/box {newpath +0 0 moveto +0 1 lineto +1 1 lineto +1 0 lineto +closepath +} def + +/circle {newpath +0 0 moveto +0 0 0.5 0 360 arc +closepath +} def + +gsave + +72 72 scale +box fill +2 2 translate +circle fill +grestore diff --git a/Build/source/texk/windvi/Examples/f7.ps b/Build/source/texk/windvi/Examples/f7.ps new file mode 100644 index 00000000000..8e938421c97 --- /dev/null +++ b/Build/source/texk/windvi/Examples/f7.ps @@ -0,0 +1,24 @@ +%!PS +%%BoundingBox: -72 -72 108 108 +/box {newpath +0 0 moveto +0 1 lineto +1 1 lineto +1 0 lineto +closepath +} def + +/circle {newpath +0 0 moveto +0 0 0.5 0 360 arc +closepath +} def + +gsave + +72 72 scale +-1 -1 translate +box fill +2 2 translate +circle fill +grestore diff --git a/Build/source/texk/windvi/Examples/fab.eps b/Build/source/texk/windvi/Examples/fab.eps new file mode 100644 index 00000000000..80b44ea0346 --- /dev/null +++ b/Build/source/texk/windvi/Examples/fab.eps @@ -0,0 +1,301 @@ +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: jpeg2ps V1.5 by Thomas Merz +%%Title: fab.jpg +%%CreationDate: Mon Sep 21 14:13:31 1998 +%%BoundingBox: 20 20 572 822 +%%DocumentData: Clean7Bit +%%LanguageLevel: 2 +%%EndComments +%%BeginProlog +%%EndProlog +%%Page: 1 1 +/languagelevel where {pop languagelevel 2 lt}{true} ifelse { + (JPEG file 'fab.jpg' needs PostScript Level 2!\n) dup print flush + /Helvetica findfont 20 scalefont setfont 100 100 moveto show showpage stop +} if +save +/RawData currentfile /ASCIIHexDecode filter def +/Data RawData << >> /DCTDecode filter def +20 20 translate +551.37 802.00 scale +/DeviceRGB setcolorspace +{ << /ImageType 1 + /Width 110 + /Height 160 + /ImageMatrix [ 110 0 0 -160 0 160 ] + /DataSource Data + /BitsPerComponent 8 + /Decode [0 1 0 1 0 1] + >> image + Data closefile + RawData flushfile + showpage + restore +} exec +FFD8FFE000104A46494600010102000000000000FFDB00430003020203020203 +03030304030304050805050404050A070706080C0A0C0C0B0A0B0B0D0E12100D +0E110E0B0B1016101113141515150C0F171816141812141514FFDB0043010304 +0405040509050509140D0B0D1414141414141414141414141414141414141414 +141414141414141414141414141414141414141414141414141414141414FFC0 +00110800A0006E03011100021101031101FFC4001E0000010403010101000000 +000000000000060507080900030402010AFFC4003E1000010302040404030604 +0407010000000102030405110006122107314151081322611471810915324291 +A152C1D1F02372B1E1161762748292C2F1FFC4001C0100010501010100000000 +000000000000050002030406070108FFC4003311000202010204030704030100 +030000000102000311042105123141132251061432617191A181B1C1D142E1F0 +230743F1FFDA000C03010002110311003F00B53C28A66145330A2998514E5A85 +5615259F3674B621B57B79921C084DFB5CED88DAC55386388A71D3B3750AB0E1 +6E056A9F35C06C511E521C23E80E10B10F431BCC222D778C191B2C85FDE99BA8 +D0D48BEA6D739BD62DCFD20DFF006C34DD5AF531F83E91BFAB78D6E0BD16688D +2B3BC60BBE9529B8CFAD09F9A8208B7BE22F7A4CE3788AB0FF00131C2C95C5DC +93C466D0BCB19AA935CD69D494429685AC8EFA6F7FDB130B51BA18CE610BB12C +74CC28A66145330A2998514CC28A661453E72C2E91467FC43789ACA7E1F32FAD +EABCAF3EB4FB4A543A5B1EA79D3636247E54DFA9FA5F00F59AFE4CD757C5FB49 +AA4E76F9094FFC68F10B9AF8C1587EA95F9F266A56A296D9F89506994DF925B4 +9D23F4C0441CC799C64C2FC898C0023631EA7320494C9875275A57E64ADD4DC5 +FAEF6187BA87D80C4F574C877C09D4F6755B89B3D3172DE04A9CD2D04691DD4A +17C3069D86E3F79210883689D2F35B8521319A4D858124955CF7BAAF7C48B513 +DE2039A29653CDF2038DFC3487A04964EB6DE6565B71A23AA48C4A00A8F9A44F +A64B063024DBF0BBF68F54B285629D96388B3DCAAD0D452C8A9BE4AE44604D82 +D440BAD23AF502F83546A171D7681AED3D941DB712CF69157855FA646A8D3653 +5360C96C3ACC861614871245C104731826082322440823227663D9ECCC28A661 +45330A29985146F78EFC5EA7704786D54CD1501E6A984688D1C1B17DE3F811F5 +3CFD81C0CD75DE1A7229C1324AD799809499C57E2D56B89F9BEA7986B75053B5 +09720BCEB6847A1B0792137DF4A46C05F60319A4A8A0E5249F9FAFCE14A6BE45 +0234D3F30175C52F50BEAB0EA08FAFFA1DB1716A18960B95D844A5C813377468 +08F55C1EDF3C4C1793E1EF232D99F66CE6A1D35CD094EB2764A91B0F7279F3C3 +ABACB36F3C2D0665D45F52C2838DAD26E411DBF9609254A063121F18AF439843 +96ABA5A714DBA34B853E9501CBDC7CF9606EAB4F9195E92DA585BA89B2A551F2 +1F6FCF68589D497077C2A6B207967AE108DE4A8F07FE3C2B9E1FEB5129324BD5 +BC9D21567A96A70028FF00AD852B642AFBD89D27DB98215B15EB01DF5721E649 +6FDC1CE38651E3B6566EBB94AA425C7BE97A3BA343F1D7FC2E20EE0FEC7A1C11 +5756E865756076EF0F70F8F998514CC28A7C51D2093C8618EDC83314A97FB453 +C4DBB9FB88EBCA94194E269196D6A41750A294B9286CB5743E92348E63D248E7 +8C8A33EB58EA3B1E9F4EC7F5EBFAE0F49734A55AB16750DD3E9DBEFD7E8467A4 +8192EAD2BCF5053BA977B12372A1EF7C5C14FCA5ECE7A44C9331C5A8A96E16D0 +4EFB2411FB62C0AC81D3F7919698C2CC8900A56556D82DC16481DF0D6000DC47 +80C7A4E6AB559A60069290BF9EF61DF13D5516DE78DE51BCFB1A4C5A93696951 +D8D4146EEA4292E11FADB6F97EB86B87AF70678006EA278A8B51E03C90CB9769 +47D2BFE03D4118757CD60F3758E002ED36C8A8B32A384387414D937E63E63AE2 +35AD91B224C6B389E5890EB372D865EBF5362156EE2FFD30F001233B4672EDD2 +3B7E1BFC47660F0F9C53A466AA617FE110EA1BA9416569299514A87988295733 +6B949E840C5F55E5DC1104EA29EEBD65F5F0A38B196F8D192A0E67CAF506E7D3 +A4A77D27D6D2FAA169E6950EA0E2C83912BAB7308638F63A6614523BF8E2E3AB +1C16E0A5552C4B2C661AC32B874F4A0D9409165B97E8129277EE47CC01E21A96 +522843B9EBF4FF00727A579DF6EDBFF5F9FE651BD46B299121DD4F79AB3CCA8F +337C5340FD610DFB4189B3F41BA480B3EA2398F7B6082298B360EA2277C7BCA5 +904950BEE4FF005C592A08DE4EA73D44EF4A9C521494EC9573B733F2C5538CE6 +4A40ED131D8322538A70B66C91CBA6DD062D8B154633213513B898DB0EC774E8 +46A49DBA8FA7CF08B061BC70AD87413DC8624A8EA536B2950DCA93CFFDF0D564 +1B6638D67AE273BB06432805285A85F716C48B6231DCCAEEB628F2CDAC797A82 +9D25ABEDE9B9513FBE1AD9C61779E7D62B52DF099016D35A92CFAFD491752473 +17B6220590E657B2A2FB032C77ECA6E2E8A0714AB1916438A6A0D763ADF8CD28 +DD2892D0D440F9A02CFD3176B627AC16E86B704F7DA5ACE2C492661452B5BED5 +FE24E5CA949A064E8CB6E4E62A7A1D9129C4907E150EA404A09BECA3606C4722 +0F5C66AD55BF52CCABD3627E63FACFDF32DE98EEC47C87DB3FDFDF23B4AD2814 +854E75A8B1CEA79D5696907652FBED8958F26E615AE967DC4EDA970CAA74C064 +3F4E3262E8D65D6AE5200E77208D27117BE29D9584B3EE8E7B4451932A939654 +8A53F1509504A1AD0A2A26D7DFAE24F7A45DB9B264A9A273DA1C640C80DCDAD4 +BA6CB8EA6E645590E0526E6D7EB7ED80DAED6595A864E866834BA245F8C49054 +4E0D52DD82754649241B829BEDEF8CF7BE5E5B26113A7ABB2CEFA6F870A53F39 +0E2A07E6B84802DF3C5D4D6DBDE4274C9D961E65FF000A140A8A8BB2A96DA90A +55FCB0926C6F898EB148D8EF3C3A42DD14432ABF84BC8D1E005AA9109A710825 +448D8EDCC83EF6C0EB388DB59DA2F7318C30917F8CBE1CA0D1E2AEA54F88A4AD +83A92DB6D94A6D7EA317F4BC51DB63DE07D56880DD448E0C476E32DE4A5012EE +A5252DDCEF73FD71A4F119B101B54778F570373AB3C35E35642CCB11D486D8A9 +C36DC748B59975C4B4F13F26D6B3F4C18A932013339AB42A0E7B7F1BCBED8EEA +5F61B7506E85A4281EE08C5E8D1B89B31E19ECA46FB42B3546CD1E25B387C2AF +CF662484450BD247ADA4250B17205ECA4A87D3AE32757300CC7604B11F4E638F +B8C421A2E71580E3B9F9EC49C7DC7FB8D57876CAD1F347129A69E3A531DB2A04 +8DD4797D37EB8A3C46E15D3E63B19B0D28071B49873B80D1259F898CCC56D481 +A96E38C82AF9F504FD3191362FFF005E61D181B72CF54CE01457A6466612DC2E +05F9AF4B5A826C39EEA57337EBB0C56176A036419313CC3188DE53386C9A6F1A +24BEDB8E3EC4F4BAA4EB209290E5B513EE3B6089BEC6AB948DF31FB67223E941 +CA2863D200BFBDBF7C56E66EFB4BE880F687943CA6A0BF5B685A750E56562317 +F6CC90A22F58794CA33909093A0247B8B624C13B894DEC43B2CF95C8F0E7321A +90D9524286C4F3F6386B862379E548C607664CA50EBB12A4DA186DB6F48B0527 +6201E5F2276C5155B11F6322BABDB7953FC76CA2AC81C4BAB420D910FCE2E35A +D3CC13B0C74BD03F8D40F598BD556A8E7783F4696ECFA67C3A5E287005A1B739 +942B9A4FED6C1B472BB4CFEA114FD27E827C3867E1C4FE0664ACCE10968D4298 +CBAA42557093A6C477E9D70481C881EACF2E0F68E41B91B6C7098123024B2903 +C7F70E2ABC38F107989153A844A8FDF2FBB5969C8CD16C36D3EEB852DA9249F5 +26C45C1B1E7B5F6CC57CDE6A9CE4A601F99E50723E5BC23A0B56F253BA10A7B6 +FCA0EDB9DB7837E0AA90F54B3B556A6956CC2420ED716270178D2E512B1F59B7 +D1A0CEF2C1696CE961205CFB81B5BDF19315BAF49A35543D62AB7F0C223AD865 +B7AFF8D0850055F3ED8B0871D449455593D60F7DC9424CB5C8F83F877C803520 +8DEDCAFB76C26BF1B6D2DA6947F8C50349842436FB528595F892AB9BFF00438A +CEC1BE232D2AB2ED88434C08608BACEDD6FF00B63C54A86E6476824748BCC661 +69B6BCAF3879BDD448FDF13175030A60C7D292DCC46D348754E7AFCE0A0773B9 +24FF00BE2AB358075CC90A85DB138AB124334F5ADE2942517515293D3DBDF036 +CB1B38208905B803695AFE333C8A86606A5148438EA5401EA0037BFED8DCF046 +7EBBCC76BBE291C72DBAA60C9B9F50F501D14472B5F6BE3795856333D7E48E92 +E57ECA5CD68AE786E7E962421D551EA8F47F293F89B41374DFE763822060404A +7CEC3FEDE4CF3CB1E364038924A94FB589A66A3C5E85323B692FD3698D3329C4 +2F50DD4A5252BD86955977B6F7046FD065130D6D8DDC9FC8007F18FF00B30C70 +FD338CBA8EA73F803F882DE02728A23E48A9D61CF4FC44C536164724A763CBDC +602F19726D1B769AFD20619CC907987354E82EAD3016A69A50B26E00BFB6320F +7907198692B67EF1A0AB711F315067BAE25D65C2157D1E704127A5C28E1B866F +F284174CE37CCDF45F10AAAC10DD420BF1966DEB3BA4FD7BFCB105953AFA112D +D65EB87C9CF6B9F446A5425A9C415841D42C6F7B6FEF88857839265B1666763F +C42954A871FE2BD017604EADBFFDC4C2DAC6C630B1EB35C4E254553A56FCF69A +6D3B9F308B8EFD6F7C5806AEB9903DB8EB0BF2FF001A32EBAE3319339725CBD9 +4EA6C40EE4E1C533F09955AE53B42FADCF8F5DA43BF0EF3525B282A494ABDB60 +47F238A1657606CCAAECA46D2B77C6734E53F34D363EA23FC23607A1ED8DE702 +04A1E61325C453241064763314DC77472D600494F4371BDFF9E35F4AF9C4CCDC +5954E659CFD8BF3642A3F13A3F94A44553B15CD412749584A873E57B13B60C60 +080F989B7F4966E70C7240C8934ADDF160B6B32E62E2854012B65942E1BCDAF4 +9D3E5B41049493B8BA4D88DC73B639A53A9B72DCFDD98FDC923F13A470DD31AF +4D587EB8CFE84923F060F7842A4A297C06A5BFA08129E7E57ABB29648BFB58E2 +8714BAC3614F4DBED09E96A1927D4C0FE2D3D99B3155FE069854CD354AD2B701 +D36F727ADBB0E7DFA628E968ADCE5C665CD43F86BE4EB184E2C655AE65CCDABA +452D87825010E479454EAD52EE3F094EE8363B91A536EF8D4574E9D53CC9F894 +F4F6EA0B6F3B852DCA0D504269C42D6A48BA51BA544F4BF2B8C03B139CE4CD31 +6C28CC961E13E8EFD72833A3556314A038A5210E732907AE07EA154F944A2F62 +A64C42F16C8391ABF4E871D2A024DC5AC4E8B7CB99EA0628D5A4058E4F497B4D +60BA9160EF22956D75694DCF9C92E18B11A53CEEB5A89D23A6C799E561FB634F +A5D2A1C28128EA754951C149E387FC64A732FA132680EFF82DEB5C98AF294529 +E6544137F99BE2E6A386B20CA907F4C4A496D77FC3B4959C31E2245AA2E34A84 +F075A3E9D27627A58F638CCDD4B0383B48AC460363190F1F340723AE8F9863B2 +A5452B0C9591B02524DB1ACE04149284F51333AFCF2E7D243A90E6B6A312B035 +120DCFF4FE78DBD3E57200996B89C7496E7F63255694EF09F3AD3E39B5599AA2 +1C94837BE8295683DB976FAE2F1F9C0E062C39EF2C48E237E926902FC52E4466 +3D6F88CC84A986EA118BED1D44025C6FD4A0799057ABEB7E56C72C7ADEBBAC5C +83863F6CE47E313A9F0722ED1A333648C83F2C741F6C7EF11BC3F505FA3F05F2 +94092C161E6E9B1C3CD38085215A06A0477BE20D51F12F76EC498468A48AC087 +73F28409519E64C56D697137F50BDCF4C44A817753892F8447511B5CE7935C62 +1D8CC790DA469421D7D4A03D929B9B63D0F7B1F8B693A582AED02B2E704E64B9 +CDD52A41D8F4FD576DA78695C83DC83D2F891DD40C1EB233635A7692038574C6 +A973A7961B096DA8E494E9BE28385691DBD94F73387C4E70BD9CF755954FF3BC +89D1528723CDB6CDBA500EFDC106C47627080A92C233D363FA47709BC3699588 +D8E7F790D3FE515632D57DF8353A62234A7D05A57949B21E42858D8725020EE3 +DF059359E18C24B9A944B37DA11503C38B298531BA453DF872E6B462A9E79D53 +8B0D916D080B4FA47CB131D5DD60FF00D3A4A14A555373622E64CF0E198F8715 +2459D6DD8CE0B80D5EE93EE7BE01EAEE361391BCB2FCAFD04F5E3568CB3C0960 +BE801C6EA0D0D8126C76FD77C5FE0A596F07EBFB401A9A39C15FA7EF21CE45E1 +7A2AD975EABC96BCE82D3BA7F1587A415117FA63A0D7ABB12CD8417A9E1F5A54 +4E65DBF838F0ED41F0FBC2B618A536E8A856B44FA838EAAF7708D92916164A41 +B0BEFEE70779CB004CC0607316F58FCE1A7A4748E5E2AB2A226BB066BC857C34 +F60D35D710827CA55C9428F71B9FD31CE38CD0F5EA0D8831CDFB8DBF6026E380 +5EBE1BD27A839FE0FDB68D9B122547A4B5F1AD86A583A1E1620150E76D86DDB1 +9E06DCEF36B530C6276D3EA721E425842410764A966F61D312786ED2D72E44ED +3476E1A44B7994C85821492EF2E7EFCF0E657419918AD58E3304733D69EFBCD9 +65C905E92537090B240FA62B273336F1E5028D843EE113294C89321F0032FA9A +65C56E0849705EE7A1B609AD6A7AC09AE0DD57A8048FAE0CD5C4E2ED2F3154DF +96A716842CEB71DFC41006CA27FCB6C0CB557C43B773FEE12E1C12CD2D6500C6 +3B7E7F3125FA2C1CED4861AA834898DD82A3BE002B6FB6E37C59AF024EF5F2EE +268A250A4D05419549742790246BC3EC398953B88BEE53D2B66EA5DD5A6E6C9B +0E5D303ACCE30278DF4916FC79D51707877061A5175BF27D294EE6E126DF5BF2 +C17E18ADCE39BA41FCAE72D89BBC377876FF008B328E4ECAAB48BCB71B935150 +4923CA1EA7813D0A901491D2EA18D8E9C35D6EC36999E2979A74DC87A9969916 +3A22466586C59B6901091EC0586350369829B71EC50278BF4A9353C9528C3A62 +AAD2E3AD0FB715B235A8050D5A6FCCE82AB0E6790C67B8BE9EDBAB06A5C907F5 +85F85EA469B52ACC70A720FF00DF5C48A8FBB3971419B47AAD1DE5282846A942 +7A3900A7F2EB48D407B723B639DDBE354DCAEB8FACE8D46A92EDEB6047CA6315 +14C55A494AB972388CDD91D44375389CB9A33BF914DBA52A1CC253DF151ED6EE +65B5E5198D8D473B0C9AAFBF6A301F94E3CA480508042124DF493D3F9E189A97 +070822F01DB71D212646F113166D39D619516A9AF3F7512749D605BD7B731873 +EBAD4F2B2C8FDCEA2FE2B2F986D3BF39F89BA03957522A84BAB7C240414F985C +1B245C0E8761F2C346A6CB58B049E53A64D2D62BAF61107867C4A6B2EE679B42 +6D6E08497966189608506AF709DFADB1712FC8E9892BA0B07298F8BB5C8B528C +8371BA4ABCC045EF8792CC36958506A39CC48935A5216101414DA8902E2C476D +FBE3C1593BB0956EB17A0817C4CCBB1B37A922A496C52E224B921D080E3C2DBA +5286FF0011528D86C3AE0C695133B488B9AEB9203C2864E112872F332E22E289 +A911A121D165A5849B926DB10A212411DB1BED0D7C89CDEB396F14D478F7903A +08FF00609C0D330A2998F08C88A321E275853745A34C48052DC85B4A04FF0012 +09FF00E71CF7DA055565661D8FEFFEE693835DC96327AEFF006FFF0064649756 +2D020A8A557EA39FE98E7AC55BE113A650C4888ADBE9A94E2ECA36851D572951 +B6B5F6B0C3AB0BDCC95ECC453CCF54CBB3E88FD3E4B299315F416DC65439FBEF +D47318215647C06475EAEC5385123BE63A240CB6EB0DC02B0C3EE84A50EA8A94 +07BDFDB12780EED96844EAB95725613F0DF22437330C5ADD5545C7187038D36B +04E950DC5C5B723171AB289E5C41CDAB67309B8B9424333919869EA52BC9B07D +206E072D7F2EF80AED6038388412C0EB91D610E51CE8A910E3D9EF41481CB61F +DF7C5AA9C8ED2A5B6377868C55D329B69095EAB2C6E4DEFBE082AD967419812C +BD01F39C42FE18526167BCF8FD1BEE49AECB8A4B1519AF30F34D36C7323CC290 +2EB02C92937DEE0DB7C69387686C6B073260403C4F88D62B2B53F98C983060C7 +A643662446511E3329086DA6D3A52948E400C6F800A30260BACDF8F62998514C +C28A339E242B743195514A95538CCD616F21E8D0D4B05C5EF626DD058AB73DAD +8C4F1F6ADEBC67CC0F4857863F2DFB7D0FCBBFF521DD414805494B89171E9B93 +BEDCB1C9ACF8BACEB1A41CC008D7664CE52E951511DA84E4B70004A11B1528FB +1B0E7EF825A7553DBEF0C2E99586E60B9E2B7DDC84A66D0EAD0C837066475A11 +FF00B8047B5F055B4F628E64C1FA1FE3ACB55F0F0DD0CD29E21D1AA85B972E34 +6986300E36B6E614F23F9B617FEF6C23EF2A318939E16CE3E2188A31F8D997E1 +AC7C5796C5F70634A4BB64FB8D8FD31EA2DE7AA13FA41B6F09753B18A54EE36E +5F9B350CC796CCD6D63438C6A16520EC410714F53A7B00CB2103E929A69DEB3B +4F7902721A8EFB6DAEEC30FADA656A3B100EDFB61D55796073D650D4B3264623 +DDC3B80ACE7986994A8E1C2E4D7131D7A372942B65A87F953A95F4C6E787E97A +60CC0713D530040961B163A62C669940012DA424585B90C6DC0C0C4CACDB8F62 +998514CC28A321E2578DEAE1A505C814C72D5779A2B53836F25163B83D147A76 +DCE3CF99E8266389F123559EED4F5EE7D3E529FF003C71AEB19973FD3EA0AA8C +8329539A750B538490BD62C493BABDEFCF01388AD2F4B2A81D216E0F4B7307F4 +929EB95154592E1372527723FD0E38F5CB52B6C2771D2B3728107A97995B6A7B +9252DDD69512091ABF6C4014E321B10CA06CE73333366113A32C10852D69B042 +CEC7DFE78B755D62EC0E66934FA8641868CAD7A0D1EA32097698B4B84D8A9B4A +493BF53B6F82F5EA9947497FC7A5BAF5841932914A6DC6DB894E43481B294EA1 +09D56EE06EA3F5B7B621D46A1D8679A09D45C46D59C438CC141CBB2E9A975A8A +84CB4A6DA9B1A4AADD6C0017C04F11DCE0181DF50F8F319A32FA98A741692848 +D0BF5587217E98B95A953924401AAB0B7787B9138D47877C49A3C7A52D891588 +C8F8879A72D60858B68573B15249DC72C74EE035597D1E2AF69C978EEA9749AA +15B1EBBCB29C959BA0E79CB50AB34F512C49405142ADA90AEA93EE31A9C11D65 +5AAC16A8611730A4B330A28D0F88BF12D963C3A65D8922AAEA26E60AA3A23522 +84DB9A5E9CE920763A509B82A59161B0DC900D7370368D3A6EE7F03D4FF1EBDB +A18335BAE4D1D6CC772A093F21EA7EB8DBD77F43887DC78CCEFE6F9754A94940 +42DE2A510D5F484DAC00279ED8B96546B4E53BCE5FA2D5FBC5E6DB4EE4E4FEA7 +F6F4903B81DC3393C44E33ADE94EAD14BA44CF885A00FC5A17E949F9DB188E31 +AFAF4741000CB6D3BE70DD32BA0F492E7880DBAC3AA79A04809B2D2ABDEDDFB1 +231CC17161E6137F43F26C202D39687DE5B8975684723622E13EF8215E992CF8 +8C2A2F603CB0EB29E59A6D71B5AA6484B09BDC249DFF006C111A2A9464349EBD +5DB99E6770528931CD4E549053CF4B6D90B3F4BF3F7C78C2B51B1968EAACC6C2 +7DA9709A35020B0FD366A9D42C5D6852C2B4DBA9EA3029D518EE6526D531D888 +273E9C2325DD6522FB585B63DBFBE78A86B00F96536B7313A8A83509AD44657B +9FC5A7F2FF002BE2C8F2FC4B04DD66FD221D6A8EED03C4E54901252CC9871A43 +5B6DA0A397BDBB63B1FB20EAFA5283D4ED3877B7AED55D55C076C493B3F8DD9D +3823C21A8666C9F22248934875A97269539BD71E6B05410E25447A9040515852 +083748BDC5C1D26A74CC879D41C407C178AF8C7C323071FB49A7C06E345138FD +C2EA1E74A12B4C6A8B095B9156A49723396F536BB120281F7C519B9ADF9C7CC7 +58E0E14967E7C73A71B33171CB8FF4ECED99E62DF972AA6C1698BDDB84C072E8 +61B03609483F53727724E2BF0BA8A5E18F73927D4FFDB0F4181D04C8719E43A4 +BF97BAB1FC7FC3F1D24D4ADAD354A7C846CA42D277E9CB1AAD4A649C62723D2B +721EB19AE00446F2B711737D3D612DBAF4812500ED7428DFB7BE3847B415B171 +CF8DB227D51C02FAEDD356C8720811DDCDACA1C86545295255BAB50BFD7193AE +B1EB89B9423D234158892A8AB79E8A0A926FA90A36DFA1BF7F9E2F8A7986C65C +4700F9A0E43E299A6C9F2D7A90B0ADC1569BFF00BE265D358067AC22BE138D8C +5C1C60F88AB34EB4EAD2CB6852B4AC93BF4C31A961B912421718067D99C6F60B +850DAD6E057A752B64DBDEFF00CF1E9D3D846CA204BFCA6275633CBF9974478A +54D8DB53F6B13F2B8FDF110A96AF3309403130EB8774944271A77469EBB8E679 +FEB885EC0FFE52375189D59E19454F8BF4C75290A5C2A7069C20FE1D6A4A937F +FC41C74EF62AB726C65E938A7FF235AA95D15FD61D66ED0384B9DE3A93A12E50 +27A6E3FED9C37001FAE3A0711D45B4A61672DE09614D42B01DE47FF079E20736 +70068D1DCA14D43F0644B2B7A933567E164A4EC791BA55BDC2C5EC45C850BA4E +33DFDBC5E533ABD1A8CB119C1FFBB4B5BE04F8A2C95C79A6BC29933EEACC10D3 +79F40A990D4C8DB8055A49F5A2E400B4DC6E3BE0CA58AE33986058BFE471280E +BCC3B96731A94D80865B5F9ACA827D2537D88F962B686F60C0C07704D4272E3A +CB06815544B6906E34389D40DF6B11718E8A6B475DC4E05CDCAD9CC6BF88B1E5 +659CC94FCD700287C2BA3E2D201FF123957A8D876DCE39E7B4FC2EBD4506C55D +C7FC3FA9D73D8CE2FEEF7FBAB3EC7A0F9C78E0CE66B9486DD43895871215CC7C +F7C70B7ACD27A19F46D167300440CCC908B3E62CD8DC5AC137E5DC61D5DE4741 +0AA8C88CF66CCBCC4C25E6015A169045D3622FD4E0BD3A87CEF2BB2E3A407934 +15B6484B6084FD36FEBED82A9616199E02DD2755172AA44942DF45BB5EE4620B +F5440C088D7CDB931D9C9D95590B6D4A45AFC8DB97E980565EBFE4233E1DA39A +2445CB90172A53A98F198495ADC51D92902E4E06874B1B0AB926517393D60DE4 +2724661AB4DAF4D6D4C39397A9283F89B6F92104F5B0C7D1FECB70FF0071D185 +2373BCF95BDB3E2ABC4B88B7867CABB0FD219E7F9CA8FC39CDC412B52A8B35A4 +A7F896B616902DEE48C5BE2EF85C1827831417A64E3790E23D5E1E5F89063BB2 +9A416128053A8158B6C7F4E7B8E9D71CAAC17BDA59019B6E5B18F38114337D21 +ACF34EA6D4E9D1A2D51FD3E53FADD68682397E3E44E0EE92E7230FB433A7D532 +272B406ABBF4FCCF4E0DB729BF896C5DAF30D94A3EF738ABA7F79A5F27388D52 +E8771247F08736B99838794395E6954965811DE3D7CC47A547F51D31D8342FE2 +52AD390F1BA069B596578C0CE47D0EE3F10E644A62A71B4BB62402ABDF7387EA +2836A907A182F4BAB34B02A7047489144AD3B925498EEA4AA956D40A012181D8 +9FE1F7E98E1BED0F05BF44FCE83287BFF73E96F65BDABA75E829B4E2C1DBD7E6 +2144E7A3D56379ECB89750B1BA93DBE98E7E0286F34EB94DE1C6C636D5A6C449 +2AB6C93DB716C5D5B6B4F865DE5E683F2E2C65DB4A5173755D36EBCF1612CF13 +E53D35903A4E8A6410F484EA404807F29BFF00670C7AD7D65460C3B472A94FC4 +A6C30E3CE25A693EA255B7EBEF818F59276942CB31B188D32439C457D96DA494 +5199703817727CF503B72E6906C7B1F718E89ECBFB3ED7DC3537A61474F9CE4D +ED97B4EBA0A1B47A56FF00D1B627D07F70F6146669711A4B5A6E816B5AD6FEA3 +1DDD2B08981B4F9A59DAD6C9DCC41E30C1A9D77873368B42694F4EA938D32087 +3421B6C2D2A595A8FE14E94917EE40DF9631FC5ED5D3D66DB37026DB82154B40 +71BFDE31507C3047662A5EADD5E417F7BB34B612117EC5C77DFA84E39A59C7AB +248A17EE2746AC330DBF31C6E1F7870A74965C146ACD4A9927482EB7396DB882 +3ADB484906F6EF88E9E26D6672B2ADA9CA7CC7ED3FFFD9> +%%EOF diff --git a/Build/source/texk/windvi/Examples/fab.jpg b/Build/source/texk/windvi/Examples/fab.jpg Binary files differnew file mode 100644 index 00000000000..770875ec4ef --- /dev/null +++ b/Build/source/texk/windvi/Examples/fab.jpg diff --git a/Build/source/texk/windvi/Examples/fab.jpg.bb b/Build/source/texk/windvi/Examples/fab.jpg.bb new file mode 100644 index 00000000000..28d5deb014d --- /dev/null +++ b/Build/source/texk/windvi/Examples/fab.jpg.bb @@ -0,0 +1 @@ +%%BoundingBox: 20 20 572 822 diff --git a/Build/source/texk/windvi/Examples/gzip.exe b/Build/source/texk/windvi/Examples/gzip.exe Binary files differnew file mode 100644 index 00000000000..6de99255de3 --- /dev/null +++ b/Build/source/texk/windvi/Examples/gzip.exe diff --git a/Build/source/texk/windvi/Examples/jpeg2ps.exe b/Build/source/texk/windvi/Examples/jpeg2ps.exe Binary files differnew file mode 100644 index 00000000000..26cecf18b55 --- /dev/null +++ b/Build/source/texk/windvi/Examples/jpeg2ps.exe diff --git a/Build/source/texk/windvi/Examples/missfont.log b/Build/source/texk/windvi/Examples/missfont.log new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Build/source/texk/windvi/Examples/missfont.log diff --git a/Build/source/texk/windvi/Examples/psheader.txt b/Build/source/texk/windvi/Examples/psheader.txt new file mode 100644 index 00000000000..3086aaf4353 --- /dev/null +++ b/Build/source/texk/windvi/Examples/psheader.txt @@ -0,0 +1,315 @@ +%% These are from tex.lpro +/TeXDict 250 dict def % define a working dictionary ( IBM: color - 200->250 ) +TeXDict begin % start using it. +/N {def} def +/B {bind def} N +/S {exch} N +/X { S N } B +/TR {translate} N +end % TeXDict + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% header for the \special command +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% The structure of the PostScript produced by dvips for \special is: +% @beginspecial +% - any number of @hsize, @hoffset, @hscale, etc., commands +% @setspecial +% - the user's file of PostScript commands +% @endspecial + +TeXDict begin +/SDict 200 dict N +SDict begin + +/@SpecialDefaults + { /hs 612 N + /vs 792 N + /ho 0 N + /vo 0 N + /hsc 1 N + /vsc 1 N + /ang 0 N + /CLIP 0 N + /rwiSeen false N + /rhiSeen false N + /letter {} N /note {} N /a4 {} N /legal {} N + } B + +% +% The following definition sets up the units that hscale/vscale are in. +% For certain sites this might require change, but it is +% recommended instead that any macro packages that require +% hscale/vscale set the units appropriately via +% +% \special{! /@scaleunit 1 def } +% +% if global, or +% +% \special{" /@scaleunit 1 def } +% +% before each instance if multiple macro packages with +% different requirements are being used. +% +/@scaleunit 100 N +% s @hscale - set scale factor +/@hscale {@scaleunit div /hsc X} B +/@vscale {@scaleunit div /vsc X} B + +% d @hsize - specify a horizontal clipping dimension +/@hsize {/hs X /CLIP 1 N} B +/@vsize {/vs X /CLIP 1 N} B + +/@clip {/CLIP 2 N} B + +% d @hoffset - specify a shift for the figure +/@hoffset {/ho X} B +/@voffset {/vo X} B + +% a @angle - set rotation angle +/@angle {/ang X} B + +% +% Here we handle bounding box calculations, if necessary. +% +/@rwi { 10 div /rwi X /rwiSeen true N } B % rwi will be real width after scaling +/@rhi { 10 div /rhi X /rhiSeen true N } B % rhi will be real height after scaling +/@llx { /llx X } B +/@lly { /lly X } B +/@urx { /urx X } B +/@ury { /ury X } B + +/magscale true def + +end % of SDict + +/@MacSetUp + { userdict /md known % if md is defined + { userdict /md get type /dicttype eq % and if it is a dictionary + { + userdict begin % expand it if necessary + md length 10 add md maxlength ge + {/md md dup length 20 add dict copy def}if + end + md begin % then redefine some stuff + /letter {} N + /note {} N + /legal {} N + /od{txpose + 1 0 mtx defaultmatrix dtransform S atan/pa X + newpath clippath mark + {transform{itransform moveto}} + {transform{itransform lineto}} + { 6 -2 roll transform + 6 -2 roll transform + 6 -2 roll transform + { itransform 6 2 roll + itransform 6 2 roll + itransform 6 2 roll + curveto + } + } + {{closepath}} + pathforall newpath counttomark array astore /gc xdf + pop ct 39 0 put + 10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack}if + }N + /txpose{ + pxs pys scale ppr aload pop + por { + noflips { + pop S neg S TR pop 1 -1 scale + }if + xflip yflip and { + pop S neg S TR 180 rotate 1 -1 scale + ppr 3 get ppr 1 get neg sub neg ppr 2 get + ppr 0 get neg sub neg TR + }if + xflip yflip not and { + pop S neg S TR pop 180 rotate + ppr 3 get ppr 1 get neg sub neg 0 TR + }if + yflip xflip not and { + ppr 1 get neg ppr 0 get neg TR + }if + } + { + noflips { + TR pop pop 270 rotate 1 -1 scale + }if + xflip yflip and { + TR pop pop 90 rotate 1 -1 scale + ppr 3 get ppr 1 get neg sub neg ppr 2 get + ppr 0 get neg sub neg TR + }if + xflip yflip not and { + TR pop pop 90 rotate ppr 3 get + ppr 1 get neg sub neg 0 TR + }if + yflip xflip not and { + TR pop pop 270 rotate ppr 2 get + ppr 0 get neg sub neg 0 S TR + }if + }ifelse + scaleby96 { + ppr aload pop 4 -1 roll add 2 div 3 1 roll add 2 div 2 copy + TR .96 dup scale neg S neg S TR + }if + }N + /cp {pop pop showpage pm restore}N + end + }if + } if + } N + +% +% The following procedure brings us back to PostScript size. It takes +% into account the current global dvi magnification, so graphics +% scale with the document. +% +/normalscale { + Resolution 72 div VResolution 72 div scale + magscale { DVImag dup scale } if + 0 setgray +} N +% +% We need the psfig macros. +% +% All software, documentation, and related files in this distribution of +% psfig/tex are Copyright (c) 1987 Trevor J. Darrell +% +% Permission is granted for use and non-profit distribution of psfig/tex +% providing that this notice be clearly maintained, but the right to +% distribute any portion of psfig/tex for profit or as part of any commercial +% product is specifically reserved for the author. +% +% +% psfigTeX PostScript Prolog +% $Header: /usr/local/src/TeX/Dvips-5.0.2/RCS/special.lpro,v 1.1 90/03/10 20:32:57 grunwald Exp $ +% +/psfts { S 65781.76 div N } N + +% x y bb-llx bb-lly bb-urx bb-ury startTexFig - +/startTexFig { + /psf$SavedState save N + userdict maxlength dict begin + + /magscale true def + normalscale + currentpoint TR %set the current point as the user's origin + + /psf$ury psfts + /psf$urx psfts + /psf$lly psfts + /psf$llx psfts + /psf$y psfts + /psf$x psfts + + /psf$sx psf$x psf$urx psf$llx sub div N % scaling for x + /psf$sy psf$y psf$ury psf$lly sub div N % scaling for y + + psf$sx psf$sy scale % scale by (sx,sy) + + psf$llx neg psf$ury neg TR + + /showpage { + } N + /erasepage { + } N + /copypage { + } N + /p 3 def % necessary to get around a bug in Adobe Illustrator + @MacSetUp +} N + +% llx lly urx ury doclip - (args in figure coordinates) +/doclip { + psf$llx psf$lly psf$urx psf$ury + currentpoint 6 2 roll + newpath 4 copy + 4 2 roll moveto + 6 -1 roll S lineto + S lineto + S lineto + closepath clip + newpath + moveto +} N +% - endTexFig - +/endTexFig { end psf$SavedState restore } N + +% this will be invoked as the result of a \special command (for the +% inclusion of PostScript graphics). The basic idea is to change all +% scaling and graphics back to defaults, but to shift the origin +% to the current position on the page. + +/@beginspecial % - @beginspecial - -- enter special mode + { + /SpecialSave save N + SDict begin + gsave + normalscale + currentpoint TR %set the current point as the user's origin + @SpecialDefaults % setup default offsets, scales, sizes, and angle + count /ocount X /dcount countdictstack N + } N + +/@setspecial % to setup user specified offsets, scales, sizes (for clipping) + { + CLIP 1 eq + { newpath 0 0 moveto hs 0 rlineto 0 vs rlineto hs neg 0 rlineto + closepath clip } + if + ho vo TR + hsc vsc scale + ang rotate + rwiSeen { + rwi urx llx sub div + rhiSeen { rhi ury lly sub div} { dup } ifelse + scale + llx neg lly neg TR + } { + rhiSeen { rhi ury lly sub div dup scale + llx neg lly neg TR + } if + } ifelse + CLIP 2 eq + { newpath llx lly moveto urx lly lineto urx ury lineto llx ury lineto + closepath clip } + if + /showpage {} N + /erasepage {} N + /copypage {} N + newpath + } N + +/@endspecial % - @endspecial - -- leave special mode + { count ocount sub {pop} repeat + countdictstack dcount sub {end} repeat + grestore SpecialSave restore + end + } N + +% xdvik special treatment for saving definitions made in SDict (while using +% the bang special; try to guarantee that the dictionary stack is ok! +% xdvik should not systematically bracket code within save/restore pairs, +% anyway: such bracketing breaks a lot of code (many packages do change +% TeXDict from with ps: specials for instance) and we should only guarantee +% that bracketing is done within @beginspecial and @endspecial. -- YA + +/@xdvisavestate + { + userdict /xdvi$sav save put + } N + +/@defspecial + { + SDict begin + } N + +/@fedspecial + { + end + @xdvisavestate + } B +end % revert to previous dictionary diff --git a/Build/source/texk/windvi/Examples/pspicture.ps b/Build/source/texk/windvi/Examples/pspicture.ps new file mode 100644 index 00000000000..92ca0c22b80 --- /dev/null +++ b/Build/source/texk/windvi/Examples/pspicture.ps @@ -0,0 +1,176 @@ +%! +%% +%% This is file `pspicture.ps', generated +%% on <1995/6/4> with the docstrip utility (2.2i). +%% +%% The original source files were: +%% +%% pspicture.doc (with options: `ps') +%% +%% Do not distribute the stripped version of this file. +%% The checksum in the header refers to the documented version. +%% +%%% ==================================================================== +%%% @LaTeX-style-file{ +%%% author = "David Carlisle", +%%% version = "2.01", +%%% date = "16 June 1992", +%%% time = "18:30:53 BST", +%%% filename = "pspicture.sty", +%%% address = "Computer Science Department +%%% Manchester University +%%% Oxford Road +%%% Manchester +%%% England +%%% M13 9PL", +%%% telephone = "+44 61 275 6139", +%%% FAX = "+44 61 275 6236", +%%% checksum = "56975 755 2882 22245", +%%% email = "carlisle@cs.man.ac.uk (Internet)", +%%% codetable = "ISO/ASCII", +%%% keywords = "LaTeX, pictures, PostScript", +%%% supported = "yes", +%%% docstring = " +%%% +%%% pspicture.sty +%%% +%%% A LaTeX style option that reimplements most of the picture +%%% environment commands to use PostScript \special's, rather than +%%% the line and circle fonts. This allows lines to have arbitrary +%%% slope and thickness, and circles to be any size. +%%% +%%% The checksum field above was produced by +%%% Robert Solovay's checksum utility.", +%%% } +%%% ==================================================================== + + + +/!BP{ + 72 72.27 div dup scale + }def +/!A{ + newpath + 0 0 moveto + dup neg dup .4 mul rlineto + .8 mul 0 exch rlineto + closepath + fill + } def +/!V{ + !BP + /!X exch def + /!y exch def + /!x exch def + newpath + 0 0 moveto + !x 0 eq {0 !y 0 lt {!X neg}{!X} ifelse} + {!x 0 lt {!X neg}{!X}ifelse !X !y mul !x abs div} ifelse + lineto + setlinewidth % @wholewidth + currentpoint + stroke + translate + !y !x atan + rotate + !A % @arrowlength + }def +/!L{ + !BP + /!X exch def + /!y exch def + /!x exch def + newpath + 0 0 moveto + !x 0 eq {0 !y 0 lt {!X neg}{!X} ifelse} + {!x 0 lt {!X neg}{!X}ifelse !X !y mul !x abs div} ifelse + lineto + setlinewidth % @wholewidth + stroke + }def +/!C{ + !BP + 0 0 3 2 roll + 2 div 0 360 arc + setlinewidth % @wholewidth + stroke + }def +/!D{ + !BP + 0 0 3 2 roll + 2 div 0 360 arc fill + }def +/!O{ + !BP + /!y exch 2 div def + /!x exch 2 div def + /!r exch !x !y + 2 copy gt {exch} if pop + 2 copy gt {exch} if pop + def + setlinewidth % @wholewidth + 1 eq + {newpath + !x neg 0 moveto + !x neg !y 0 !y !r arcto 4 {pop} repeat + 0 !y lineto + stroke}if + 1 eq + {newpath + !x 0 moveto + !x !y 0 !y !r arcto 4 {pop} repeat + 0 !y lineto + stroke}if + 1 eq + {newpath + !x neg 0 moveto + !x neg !y neg 0 !y neg !r arcto 4 {pop} repeat + 0 !y neg lineto + stroke}if + 1 eq + {newpath + !x 0 moveto + !x !y neg 0 !y neg !r arcto 4 {pop} repeat + 0 !y neg lineto + stroke}if + }def +/!V2{ + !BP + 2 copy exch + atan + /a exch def + 2 copy + newpath + 0 0 moveto + lineto % <x*unitlength> <y*unitlength> + 3 2 roll + setlinewidth % @wholewidth + stroke + translate % <x*unitlength> <y*unitlength> + a rotate + !A % @arrowlength + }def +/!L2{ + !BP + newpath + 0 0 moveto + lineto % <x*unitlength> <y*unitlength> + setlinewidth % @wholewidth + stroke + }def +/!C2{ + !BP + /!s exch def + /!y exch def + /!x exch def + newpath + 0 0 moveto + 0 0 + !x 2 div !y 10 div !s mul add + !y 2 div !x 10 div !s mul sub + !x !y + curveto + setlinewidth % @wholewidth + stroke + }def +%% End of pspicture.ps diff --git a/Build/source/texk/windvi/Examples/rotest.aux b/Build/source/texk/windvi/Examples/rotest.aux new file mode 100644 index 00000000000..f23e54680b7 --- /dev/null +++ b/Build/source/texk/windvi/Examples/rotest.aux @@ -0,0 +1 @@ +\relax diff --git a/Build/source/texk/windvi/Examples/rotest.dvi b/Build/source/texk/windvi/Examples/rotest.dvi Binary files differnew file mode 100644 index 00000000000..0c5455ab47d --- /dev/null +++ b/Build/source/texk/windvi/Examples/rotest.dvi diff --git a/Build/source/texk/windvi/Examples/rotest.log b/Build/source/texk/windvi/Examples/rotest.log new file mode 100644 index 00000000000..a6eadab9882 --- /dev/null +++ b/Build/source/texk/windvi/Examples/rotest.log @@ -0,0 +1,87 @@ +This is TeX, Version 3.14159 (Web2c 7.3.1) (format=latex 1999.6.8) 8 JUL 1999 10:13 +**\nonstopmode\input{rotest.tex} +(rotest.tex (d:/Local/TeX/texmf/tex/latex/base/article.cls +Document Class: article 1999/01/07 v1.4a Standard LaTeX document class +(d:/Local/TeX/texmf/tex/latex/base/size10.clo +File: size10.clo 1999/01/07 v1.4a Standard LaTeX file (size option) +) +\c@part=\count79 +\c@section=\count80 +\c@subsection=\count81 +\c@subsubsection=\count82 +\c@paragraph=\count83 +\c@subparagraph=\count84 +\c@figure=\count85 +\c@table=\count86 +\abovecaptionskip=\skip41 +\belowcaptionskip=\skip42 +\bibindent=\dimen102 +) +(d:/Local/TeX/texmf/tex/latex/graphics/graphics.sty +Package: graphics 1999/02/16 v1.0l Standard LaTeX Graphics (DPC,SPQR) + +(d:/Local/TeX/texmf/tex/latex/graphics/trig.sty +Package: trig 1999/03/16 v1.09 sin cos tan (DPC) +) +(d:/Local/TeX/texmf/tex/latex/config/graphics.cfg) +Package graphics Info: Driver file: dvips.def on input line 80. + +(d:/Local/TeX/texmf/tex/latex/graphics/dvips.def +File: dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR) +)) +(d:/Local/TeX/texmf/tex/latex/misc/rotating.sty +Package: rotating 1997/09/26, v2.13 Rotation package + +(d:/Local/TeX/texmf/tex/latex/graphics/graphicx.sty +Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR) + +(d:/Local/TeX/texmf/tex/latex/graphics/keyval.sty +Package: keyval 1999/03/16 v1.13 key=value parser (DPC) +\KV@toks@=\toks14 +) +\Gin@req@height=\dimen103 +\Gin@req@width=\dimen104 +) +(d:/Local/TeX/texmf/tex/latex/base/ifthen.sty +Package: ifthen 1999/01/07 v1.1a Standard LaTeX ifthen package (DPC) +) +\c@r@tfl@t=\count87 +\rot@float@box=\box26 +) +(d:/Local/TeX/texmf/tex/latex/graphics/color.sty +Package: color 1999/02/16 v1.0i Standard LaTeX Color (DPC) + +(d:/Local/TeX/texmf/tex/latex/config/color.cfg) +Package color Info: Driver file: dvips.def on input line 125. + +(d:/Local/TeX/texmf/tex/latex/graphics/dvipsnam.def +File: dvipsnam.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR) +)) (rotest.aux) +\openout1 = `rotest.aux'. + +LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 9. +LaTeX Font Info: ... okay on input line 9. +LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 9. +LaTeX Font Info: ... okay on input line 9. +LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 9. +LaTeX Font Info: ... okay on input line 9. +LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 9. +LaTeX Font Info: ... okay on input line 9. +LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 9. +LaTeX Font Info: ... okay on input line 9. +LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 9. +LaTeX Font Info: ... okay on input line 9. + [1 + +] +(rotest.aux) ) +Here is how much of TeX's memory you used: + 771 strings out of 10904 + 9281 string characters out of 72560 + 53648 words of memory out of 263001 + 3751 multiletter control sequences out of 10000+0 + 4333 words of font info for 16 fonts, out of 200000 for 1000 + 14 hyphenation exceptions out of 1000 + 31i,5n,21p,225b,167s stack positions out of 300i,100n,500p,50000b,4000s + +Output written on rotest.dvi (1 page, 1000 bytes). diff --git a/Build/source/texk/windvi/Examples/rotest.tex b/Build/source/texk/windvi/Examples/rotest.tex new file mode 100644 index 00000000000..e071d4fdf2c --- /dev/null +++ b/Build/source/texk/windvi/Examples/rotest.tex @@ -0,0 +1,30 @@ +\documentclass{article} +\usepackage[dvips]{graphics} +\usepackage{rotating} +\usepackage{color} +\def\foo{\textcolor{red}{\emph{\Large Ralf}}} +%\def\foo{\emph{\Large Ralf}} +\pagestyle{empty} +\thispagestyle{empty} +\begin{document} +\begin{rotate}{0} + \foo +\end{rotate} +\hspace*{1cm} +\begin{rotate}{15} + \foo +\end{rotate} +\hspace*{1cm} +\begin{rotate}{45} + \foo +\end{rotate} +\hspace*{1cm} +\begin{rotate}{90} + \foo +\end{rotate} +\end{document} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: diff --git a/Build/source/texk/windvi/Examples/rotsample.aux b/Build/source/texk/windvi/Examples/rotsample.aux new file mode 100644 index 00000000000..f23e54680b7 --- /dev/null +++ b/Build/source/texk/windvi/Examples/rotsample.aux @@ -0,0 +1 @@ +\relax diff --git a/Build/source/texk/windvi/Examples/rotsample.dvi b/Build/source/texk/windvi/Examples/rotsample.dvi Binary files differnew file mode 100644 index 00000000000..256bafa96c6 --- /dev/null +++ b/Build/source/texk/windvi/Examples/rotsample.dvi diff --git a/Build/source/texk/windvi/Examples/rotsample.log b/Build/source/texk/windvi/Examples/rotsample.log new file mode 100644 index 00000000000..4302947a708 --- /dev/null +++ b/Build/source/texk/windvi/Examples/rotsample.log @@ -0,0 +1,82 @@ +This is TeX, Version 3.14159 (Web2c 7.3.1) (format=latex 1999.7.23) 18 AUG 1999 18:08 +**rotsample +(rotsample.tex +LaTeX2e <1998/12/01> patch level 1 +Babel <v3.6x> and hyphenation patterns for american, french, german, ngerman, n +ohyphenation, loaded. +(d:/Local/TeX/texmf/tex/latex/base/article.cls +Document Class: article 1999/01/07 v1.4a Standard LaTeX document class +(d:/Local/TeX/texmf/tex/latex/base/size10.clo +File: size10.clo 1999/01/07 v1.4a Standard LaTeX file (size option) +) +\c@part=\count79 +\c@section=\count80 +\c@subsection=\count81 +\c@subsubsection=\count82 +\c@paragraph=\count83 +\c@subparagraph=\count84 +\c@figure=\count85 +\c@table=\count86 +\abovecaptionskip=\skip41 +\belowcaptionskip=\skip42 +\bibindent=\dimen102 +) +(d:/Local/TeX/texmf/tex/latex/graphics/graphicx.sty +Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR) + +(d:/Local/TeX/texmf/tex/latex/graphics/keyval.sty +Package: keyval 1999/03/16 v1.13 key=value parser (DPC) +\KV@toks@=\toks14 +) +(d:/Local/TeX/texmf/tex/latex/graphics/graphics.sty +Package: graphics 1999/02/16 v1.0l Standard LaTeX Graphics (DPC,SPQR) + +(d:/Local/TeX/texmf/tex/latex/graphics/trig.sty +Package: trig 1999/03/16 v1.09 sin cos tan (DPC) +) +(d:/Local/TeX/texmf/tex/latex/config/graphics.cfg) +Package graphics Info: Driver file: dvips.def on input line 80. + +(d:/Local/TeX/texmf/tex/latex/graphics/dvips.def +File: dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR) +)) +\Gin@req@height=\dimen103 +\Gin@req@width=\dimen104 +) +(d:/Local/TeX/texmf/tex/latex/misc/rotating.sty +Package: rotating 1997/09/26, v2.13 Rotation package + +(d:/Local/TeX/texmf/tex/latex/base/ifthen.sty +Package: ifthen 1999/01/07 v1.1a Standard LaTeX ifthen package (DPC) +) +\c@r@tfl@t=\count87 +\rot@float@box=\box26 +) (rotsample.aux) +\openout1 = `rotsample.aux'. + +LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 7. +LaTeX Font Info: ... okay on input line 7. +LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 7. +LaTeX Font Info: ... okay on input line 7. +LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 7. +LaTeX Font Info: ... okay on input line 7. +LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 7. +LaTeX Font Info: ... okay on input line 7. +LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 7. +LaTeX Font Info: ... okay on input line 7. +LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 7. +LaTeX Font Info: ... okay on input line 7. + [1 + +] +(rotsample.aux) ) +Here is how much of TeX's memory you used: + 588 strings out of 10904 + 6460 string characters out of 72559 + 51603 words of memory out of 263001 + 3574 multiletter control sequences out of 10000+0 + 3939 words of font info for 15 fonts, out of 200000 for 1000 + 14 hyphenation exceptions out of 1000 + 25i,4n,21p,210b,160s stack positions out of 300i,100n,500p,50000b,4000s + +Output written on rotsample.dvi (1 page, 796 bytes). diff --git a/Build/source/texk/windvi/Examples/rotsample.tex b/Build/source/texk/windvi/Examples/rotsample.tex new file mode 100644 index 00000000000..1a7c67dd16e --- /dev/null +++ b/Build/source/texk/windvi/Examples/rotsample.tex @@ -0,0 +1,32 @@ +\documentclass{article} +\usepackage[dvips]{graphicx} +\usepackage[dvips]{rotating} + +\def\foo{\Huge A} + +\begin{document} + +\foo +\hfill +\begin{rotate}{30} + \foo +\end{rotate} +\hfill +\begin{rotate}{60} + \foo +\end{rotate} +\hfill +\begin{rotate}{90} + \foo +\end{rotate} +\hfill +\begin{rotate}{180} + \foo +\end{rotate} + +\end{document} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: diff --git a/Build/source/texk/windvi/Examples/sample2e.aux b/Build/source/texk/windvi/Examples/sample2e.aux new file mode 100644 index 00000000000..f36de969905 --- /dev/null +++ b/Build/source/texk/windvi/Examples/sample2e.aux @@ -0,0 +1,3 @@ +\relax +\@writefile{toc}{\contentsline {section}{\numberline {1}Ordinary Text}{1}} +\@writefile{toc}{\contentsline {section}{\numberline {2}Displayed Text}{2}} diff --git a/Build/source/texk/windvi/Examples/sample2e.dvi b/Build/source/texk/windvi/Examples/sample2e.dvi Binary files differnew file mode 100644 index 00000000000..b52f50d36c8 --- /dev/null +++ b/Build/source/texk/windvi/Examples/sample2e.dvi diff --git a/Build/source/texk/windvi/Examples/sample2e.log b/Build/source/texk/windvi/Examples/sample2e.log new file mode 100644 index 00000000000..da7739ea895 --- /dev/null +++ b/Build/source/texk/windvi/Examples/sample2e.log @@ -0,0 +1,67 @@ +This is TeX, Version 3.14159 (Web2c 7.3.1) (format=latex 1999.6.29) 12 JUL 1999 17:53 +**sample2e +(g:/TeX/texmf/tex/latex/base/sample2e.tex +LaTeX2e <1998/12/01> patch level 1 +Babel <v3.6x> and hyphenation patterns for american, french, german, ngerman, n +ohyphenation, loaded. +(g:/TeX/texmf/tex/latex/base/article.cls +Document Class: article 1999/01/07 v1.4a Standard LaTeX document class +(g:/TeX/texmf/tex/latex/base/size10.clo +File: size10.clo 1999/01/07 v1.4a Standard LaTeX file (size option) +) +\c@part=\count79 +\c@section=\count80 +\c@subsection=\count81 +\c@subsubsection=\count82 +\c@paragraph=\count83 +\c@subparagraph=\count84 +\c@figure=\count85 +\c@table=\count86 +\abovecaptionskip=\skip41 +\belowcaptionskip=\skip42 +\bibindent=\dimen102 +) +No file sample2e.aux. +\openout1 = `sample2e.aux'. + +LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 21. +LaTeX Font Info: ... okay on input line 21. +LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 21. +LaTeX Font Info: ... okay on input line 21. +LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 21. +LaTeX Font Info: ... okay on input line 21. +LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 21. +LaTeX Font Info: ... okay on input line 21. +LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 21. +LaTeX Font Info: ... okay on input line 21. +LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 21. +LaTeX Font Info: ... okay on input line 21. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <12> on input line 23. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <8> on input line 23. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <6> on input line 23. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <7> on input line 44. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <5> on input line 44. +LaTeX Font Info: Try loading font information for OMS+cmr on input line 98. +(g:/TeX/texmf/tex/latex/base/omscmr.fd +File: omscmr.fd 1998/03/27 v2.5g Standard LaTeX font definitions +) +LaTeX Font Info: Font shape `OMS/cmr/m/n' in size <10> not available +(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 98. + [1 + +] [2] [3] (sample2e.aux) ) +Here is how much of TeX's memory you used: + 244 strings out of 10904 + 2494 string characters out of 72745 + 48175 words of memory out of 263001 + 3236 multiletter control sequences out of 10000+0 + 7626 words of font info for 27 fonts, out of 200000 for 1000 + 14 hyphenation exceptions out of 1000 + 23i,8n,17p,141b,244s stack positions out of 300i,100n,500p,50000b,4000s + +Output written on sample2e.dvi (3 pages, 7256 bytes). diff --git a/Build/source/texk/windvi/Examples/test.dvi b/Build/source/texk/windvi/Examples/test.dvi Binary files differnew file mode 100644 index 00000000000..44566cbb4c2 --- /dev/null +++ b/Build/source/texk/windvi/Examples/test.dvi diff --git a/Build/source/texk/windvi/Examples/test.tex b/Build/source/texk/windvi/Examples/test.tex new file mode 100644 index 00000000000..e8b4ead12ea --- /dev/null +++ b/Build/source/texk/windvi/Examples/test.tex @@ -0,0 +1,138 @@ +%% -*- Mode: LaTeX -*- +%% -*- Module: test.tex + +%% set the documentstyle +\documentclass{article} +\usepackage{epsfig} +\usepackage{times} + +%% we will get a new page for each example so make pages high enough +\textheight=10in + +\def\illpref/{} +% \def\illpref{/u/vojta/Xdvi/xdvi-examples} + +\begin{document} + +Here we go with some tests. We want to make sure we have examples for +all possibilities. For instance, we believe that xdvi should be able to +show a figure that has a bounding box and is included via psfig. Here +is an attempt, which we call Fig.~\ref{fig:f1}. + +\begin{figure}[h] + \centerline{\psfig{figure=\illpref/f1.ps,width=5in}} + \caption{Figure with bounding box included with psfig.} + \label{fig:f1} +\end{figure} + +This figure is a crude postscript figure created with an in-house program. + +\newpage + +This next figure is created with matlab. +Also included courtesy of psfig. + +\begin{figure}[h] + \centerline{\psfig{figure=\illpref/f2.ps,height=5in}} + \caption{Figure with bounding box included with psfig. More robust + postscript.} + \label{fig:f2} +\end{figure} + +You will no doubt notice the figure does not seem to be centered. It +is in fact centered as you can check by clicking on the {\em ``View PS''} +option and checking out its bounding box. It just so happens +that the program that generated this figure comes out with weird bb's. + +\newpage + +Now, we might want to try figures that are somewhat different. For +instance Fig.~\ref{fig:f3} has no bounding box. We wish to include it +by means of a special. Here we go... + +\begin{figure}[h] + \vspace{2in} + \special{psfile=\illpref/f3.ps.gz hoffset=-10 vscale=200 hscale=200} + \caption{Figure without a bounding box included with special.} + \label{fig:f3} +\end{figure} + +You no doubt noticed that the figure is not centered, either horizontally +or vertically. With a {\em special} command you would have to do +that on your own by specifying the hoffset, voffset, etc. In contrast +{\em psfig} or {\em epsf} will do that for you automagically. + +Also, you will notice that since the figure is included with a +{\em special}, it is impossible to know its bounding box (even if it +had one---see next example). Therefore it cannot be shown. + +\newpage + +Now the following figure, Fig.~\ref{fig:f4}, does have a bounding box +but we still include it with a simple special. Plus it is color! + +\begin{figure}[h] + \vspace{5.5in} + \special{psfile=\illpref/f4.ps hoffset=-100 voffset=-200} + \caption{Figure with a bounding box included with special.} + \label{fig:f4} +\end{figure} + +Even though the figure does have a bounding box we cannot show it +since it was included with a {\em special} which does no filtering +of the file whatsoever. + +\newpage + +The following figure, Fig.~\ref{fig:f5}, is included with {\em epsf}. + +\begin{figure}[h] + \epsfysize=5in + \epsffile{f5.ps} + \caption{Postscript code directly from an {\em epsf} command.} + \label{fig:f5} +\end{figure} + +\begin{figure}[h] + \epsffile{f6.ps} + \caption{Postscript code directly from an {\em epsf} command (FP).} + \label{fig:f5} +\end{figure} + +\newpage + +The following figure, Fig.~\ref{fig:f6}, is included with {\em epsf}. +It is the same figure as above but a Bounding box is provided. + +\begin{figure}[h] + \epsfysize=2in + \epsffile[100 100 400 500]{f5.ps} + \caption{Postscript code directly from an {\em epsf} command.} + \label{fig:f6} +\end{figure} + +This example is interesting because it shows that if you are not +careful with either the dimensions you think the picture has or the +bounding box you use for it (assuming it does not have one), then you +may have strange things happen to you. + +\newpage + +The following figure, Fig.~\ref{fig:f7}, is an example of raw +postscript being sent to the driver. It was taken from the +{\em dvips} manual. + +\begin{figure}[h] + \vspace{2in} + \vbox to 100bp{ + \special{" newpath 000 000 moveto 100 100 lineto 394 0 lineto + closepath gsave 0.8 setgray fill grestore stroke}\vfil} + \caption{Postscript code directly from a {\em special} command.} + \label{fig:f7} +\end{figure} + +It may come as a bit of a surprise, but this was the last type of +{\em special} command to be implemented. But it has now been implemented. +It has no bounding box. + +\end{document} diff --git a/Build/source/texk/windvi/Examples/tpic2.dvi b/Build/source/texk/windvi/Examples/tpic2.dvi Binary files differnew file mode 100644 index 00000000000..b7cf1e17a56 --- /dev/null +++ b/Build/source/texk/windvi/Examples/tpic2.dvi diff --git a/Build/source/texk/windvi/Examples/tpic2.log b/Build/source/texk/windvi/Examples/tpic2.log new file mode 100644 index 00000000000..1ab30746e6f --- /dev/null +++ b/Build/source/texk/windvi/Examples/tpic2.log @@ -0,0 +1,7 @@ +This is TeX, Version 3.14159 (Web2c 7.3.1) (format=tex 1999.6.29) 13 JUL 1999 01:11 +**tpic2 +(tpic2.tex +\graph=\box16 +\graphtemp=\dimen16 + [1] ) +Output written on tpic2.dvi (1 page, 3028 bytes). diff --git a/Build/source/texk/windvi/Examples/tpic2.tex b/Build/source/texk/windvi/Examples/tpic2.tex new file mode 100644 index 00000000000..90d67523152 --- /dev/null +++ b/Build/source/texk/windvi/Examples/tpic2.tex @@ -0,0 +1,284 @@ +\expandafter\ifx\csname graph\endcsname\relax \newbox\graph\fi +\expandafter\ifx\csname graphtemp\endcsname\relax \newdimen\graphtemp\fi +\setbox\graph=\vtop{\vskip 0pt\hbox{% + \special{pn 7}% + \special{pa 100 3000}% + \special{pa 4100 3000}% + \special{fp}% + \special{pa 100 3000}% + \special{pa 100 0}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 3.417in + \rlap{\kern 2.100in\lower\graphtemp\hbox to 0pt{\hss Male and female burials per decade ($n \approx 4300$)\hss}}% + \special{pa 100 2487}% + \special{pa 0 2487}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 2.487in + \rlap{\kern 0.000in\lower\graphtemp\hbox to 0pt{\hss 50 }}% + \special{pa 100 2158}% + \special{pa 0 2158}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 2.158in + \rlap{\kern 0.000in\lower\graphtemp\hbox to 0pt{\hss 100 }}% + \special{pa 100 1829}% + \special{pa 0 1829}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 1.829in + \rlap{\kern 0.000in\lower\graphtemp\hbox to 0pt{\hss 150 }}% + \special{pa 100 1500}% + \special{pa 0 1500}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 1.500in + \rlap{\kern 0.000in\lower\graphtemp\hbox to 0pt{\hss 200 }}% + \special{pa 100 1171}% + \special{pa 0 1171}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 1.171in + \rlap{\kern 0.000in\lower\graphtemp\hbox to 0pt{\hss 250 }}% + \special{pa 100 842}% + \special{pa 0 842}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 0.842in + \rlap{\kern 0.000in\lower\graphtemp\hbox to 0pt{\hss 300 }}% + \special{pa 100 513}% + \special{pa 0 513}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 0.513in + \rlap{\kern 0.000in\lower\graphtemp\hbox to 0pt{\hss 350 }}% + \special{pa 100 184}% + \special{pa 0 184}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 0.184in + \rlap{\kern 0.000in\lower\graphtemp\hbox to 0pt{\hss 400 }}% + \special{pa 346 3000}% + \special{pa 346 3100}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 3.225in + \rlap{\kern 0.346in\lower\graphtemp\hbox to 0pt{\hss 1800\hss}}% + \special{pa 715 3000}% + \special{pa 715 3100}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 3.225in + \rlap{\kern 0.715in\lower\graphtemp\hbox to 0pt{\hss 1820\hss}}% + \special{pa 1084 3000}% + \special{pa 1084 3100}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 3.225in + \rlap{\kern 1.084in\lower\graphtemp\hbox to 0pt{\hss 1840\hss}}% + \special{pa 1454 3000}% + \special{pa 1454 3100}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 3.225in + \rlap{\kern 1.454in\lower\graphtemp\hbox to 0pt{\hss 1860\hss}}% + \special{pa 1823 3000}% + \special{pa 1823 3100}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 3.225in + \rlap{\kern 1.823in\lower\graphtemp\hbox to 0pt{\hss 1880\hss}}% + \special{pa 2192 3000}% + \special{pa 2192 3100}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 3.225in + \rlap{\kern 2.192in\lower\graphtemp\hbox to 0pt{\hss 1900\hss}}% + \special{pa 2562 3000}% + \special{pa 2562 3100}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 3.225in + \rlap{\kern 2.562in\lower\graphtemp\hbox to 0pt{\hss 1920\hss}}% + \special{pa 2931 3000}% + \special{pa 2931 3100}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 3.225in + \rlap{\kern 2.931in\lower\graphtemp\hbox to 0pt{\hss 1940\hss}}% + \special{pa 3300 3000}% + \special{pa 3300 3100}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 3.225in + \rlap{\kern 3.300in\lower\graphtemp\hbox to 0pt{\hss 1960\hss}}% + \special{pa 3670 3000}% + \special{pa 3670 3100}% + \special{fp}% + \graphtemp=.5ex\advance\graphtemp by 3.225in + \rlap{\kern 3.670in\lower\graphtemp\hbox to 0pt{\hss 1980\hss}}% + \special{pa 346 2816}% + \special{pa 346 2757}% + \special{fp}% + \special{pa 346 2757}% + \special{pa 530 2757}% + \special{fp}% + \special{pa 530 2757}% + \special{pa 530 2816}% + \special{fp}% + \special{pa 530 2816}% + \special{pa 530 2658}% + \special{fp}% + \special{pa 530 2658}% + \special{pa 715 2658}% + \special{fp}% + \special{pa 715 2658}% + \special{pa 715 2816}% + \special{fp}% + \special{pa 715 2816}% + \special{pa 715 2224}% + \special{fp}% + \special{pa 715 2224}% + \special{pa 900 2224}% + \special{fp}% + \special{pa 900 2224}% + \special{pa 900 2816}% + \special{fp}% + \special{pa 900 2816}% + \special{pa 900 2033}% + \special{fp}% + \special{pa 900 2033}% + \special{pa 1084 2033}% + \special{fp}% + \special{pa 1084 2033}% + \special{pa 1084 2816}% + \special{fp}% + \special{pa 1084 2816}% + \special{pa 1084 1592}% + \special{fp}% + \special{pa 1084 1592}% + \special{pa 1269 1592}% + \special{fp}% + \special{pa 1269 1592}% + \special{pa 1269 2816}% + \special{fp}% + \special{pa 1269 2816}% + \special{pa 1269 1836}% + \special{fp}% + \special{pa 1269 1836}% + \special{pa 1454 1836}% + \special{fp}% + \special{pa 1454 1836}% + \special{pa 1454 2816}% + \special{fp}% + \special{pa 1454 2816}% + \special{pa 1454 1467}% + \special{fp}% + \special{pa 1454 1467}% + \special{pa 1638 1467}% + \special{fp}% + \special{pa 1638 1467}% + \special{pa 1638 2816}% + \special{fp}% + \special{pa 1638 2816}% + \special{pa 1638 586}% + \special{fp}% + \special{pa 1638 586}% + \special{pa 1823 586}% + \special{fp}% + \special{pa 1823 586}% + \special{pa 1823 2816}% + \special{fp}% + \special{pa 1823 2816}% + \special{pa 1823 875}% + \special{fp}% + \special{pa 1823 875}% + \special{pa 2008 875}% + \special{fp}% + \special{pa 2008 875}% + \special{pa 2008 2816}% + \special{fp}% + \special{pa 2008 2816}% + \special{pa 2008 1408}% + \special{fp}% + \special{pa 2008 1408}% + \special{pa 2192 1408}% + \special{fp}% + \special{pa 2192 1408}% + \special{pa 2192 2816}% + \special{fp}% + \special{pa 2192 2816}% + \special{pa 2192 954}% + \special{fp}% + \special{pa 2192 954}% + \special{pa 2377 954}% + \special{fp}% + \special{pa 2377 954}% + \special{pa 2377 2816}% + \special{fp}% + \special{pa 2377 2816}% + \special{pa 2377 1289}% + \special{fp}% + \special{pa 2377 1289}% + \special{pa 2562 1289}% + \special{fp}% + \special{pa 2562 1289}% + \special{pa 2562 2816}% + \special{fp}% + \special{pa 2562 2816}% + \special{pa 2562 928}% + \special{fp}% + \special{pa 2562 928}% + \special{pa 2746 928}% + \special{fp}% + \special{pa 2746 928}% + \special{pa 2746 2816}% + \special{fp}% + \special{pa 2746 2816}% + \special{pa 2746 914}% + \special{fp}% + \special{pa 2746 914}% + \special{pa 2931 914}% + \special{fp}% + \special{pa 2931 914}% + \special{pa 2931 2816}% + \special{fp}% + \special{pa 2931 2816}% + \special{pa 2931 1217}% + \special{fp}% + \special{pa 2931 1217}% + \special{pa 3116 1217}% + \special{fp}% + \special{pa 3116 1217}% + \special{pa 3116 2816}% + \special{fp}% + \special{pa 3116 2816}% + \special{pa 3116 914}% + \special{fp}% + \special{pa 3116 914}% + \special{pa 3300 914}% + \special{fp}% + \special{pa 3300 914}% + \special{pa 3300 2816}% + \special{fp}% + \special{pa 3300 2816}% + \special{pa 3300 184}% + \special{fp}% + \special{pa 3300 184}% + \special{pa 3485 184}% + \special{fp}% + \special{pa 3485 184}% + \special{pa 3485 2816}% + \special{fp}% + \special{pa 3485 2816}% + \special{pa 3485 849}% + \special{fp}% + \special{pa 3485 849}% + \special{pa 3670 849}% + \special{fp}% + \special{pa 3670 849}% + \special{pa 3670 2816}% + \special{fp}% + \special{pa 3670 2816}% + \special{pa 3670 1625}% + \special{fp}% + \special{pa 3670 1625}% + \special{pa 3854 1625}% + \special{fp}% + \special{pa 3854 1625}% + \special{pa 3854 2816}% + \special{fp}% + \hbox{\vrule depth3.500in width0pt height 0pt}% + \kern 4.100in + }% +}% +\box\graph +\bye + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: diff --git a/Build/source/texk/windvi/Examples/tpictest.dvi b/Build/source/texk/windvi/Examples/tpictest.dvi Binary files differnew file mode 100644 index 00000000000..4c3ca84a6ba --- /dev/null +++ b/Build/source/texk/windvi/Examples/tpictest.dvi diff --git a/Build/source/texk/windvi/Examples/transform.txt b/Build/source/texk/windvi/Examples/transform.txt new file mode 100644 index 00000000000..210f5326269 --- /dev/null +++ b/Build/source/texk/windvi/Examples/transform.txt @@ -0,0 +1,3 @@ +%%TeXDict begin /Orientation 1 N end +[1 0 0 1 0 0] concat + diff --git a/Build/source/texk/windvi/Examples/world.emf b/Build/source/texk/windvi/Examples/world.emf Binary files differnew file mode 100644 index 00000000000..9807fbda424 --- /dev/null +++ b/Build/source/texk/windvi/Examples/world.emf diff --git a/Build/source/texk/windvi/Examples/ws_bzip2.ps.bb b/Build/source/texk/windvi/Examples/ws_bzip2.ps.bb new file mode 100644 index 00000000000..00a085d0e4f --- /dev/null +++ b/Build/source/texk/windvi/Examples/ws_bzip2.ps.bb @@ -0,0 +1 @@ +%%BoundingBox: 100 100 172 172 diff --git a/Build/source/texk/windvi/Examples/ws_bzip2.ps.bz2 b/Build/source/texk/windvi/Examples/ws_bzip2.ps.bz2 Binary files differnew file mode 100644 index 00000000000..85dfb7594da --- /dev/null +++ b/Build/source/texk/windvi/Examples/ws_bzip2.ps.bz2 diff --git a/Build/source/texk/windvi/Examples/ws_gzip.ps.bb b/Build/source/texk/windvi/Examples/ws_gzip.ps.bb new file mode 100644 index 00000000000..00a085d0e4f --- /dev/null +++ b/Build/source/texk/windvi/Examples/ws_gzip.ps.bb @@ -0,0 +1 @@ +%%BoundingBox: 100 100 172 172 diff --git a/Build/source/texk/windvi/Examples/ws_gzip.ps.gz b/Build/source/texk/windvi/Examples/ws_gzip.ps.gz Binary files differnew file mode 100644 index 00000000000..251e7afdb7a --- /dev/null +++ b/Build/source/texk/windvi/Examples/ws_gzip.ps.gz diff --git a/Build/source/texk/windvi/Examples/wsample.ps b/Build/source/texk/windvi/Examples/wsample.ps new file mode 100644 index 00000000000..740289943dc --- /dev/null +++ b/Build/source/texk/windvi/Examples/wsample.ps @@ -0,0 +1,13 @@ +%! A small Encapsulated Postscript image used in the examples +%%BoundingBox: 100 100 172 172 +100 100 translate + 0 0 moveto + 72 72 rlineto + 72 neg 0 rlineto + 72 72 neg rlineto +stroke + 0 0 moveto +/Times-Roman findfont + 72 scalefont + setfont +(W) show diff --git a/Build/source/texk/windvi/Examples/wtest.aux b/Build/source/texk/windvi/Examples/wtest.aux new file mode 100644 index 00000000000..a0e00b7b472 --- /dev/null +++ b/Build/source/texk/windvi/Examples/wtest.aux @@ -0,0 +1,29 @@ +\relax +\ifx\hyper@anchor\@undefined +\global \let \oldcontentsline\contentsline +\gdef \contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}} +\global \let \oldnewlabel\newlabel +\gdef \newlabel#1#2{\newlabelxx{#1}#2} +\gdef \newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}} +\AtEndDocument{\let \contentsline\oldcontentsline +\let \newlabel\oldnewlabel} +\else +\global \let \hyper@last\relax +\fi + +\@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{2}{section.1}} +\@writefile{toc}{\contentsline {section}{\numberline {2}Postscript inclusions}{3}{section.2}} +\@writefile{toc}{\contentsline {section}{\numberline {3}Arbitrary Postscript code}{4}{section.3}} +\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Postscript code directly from a {\em special} command.}}{4}{figure.1}} +\newlabel{figf7}{{1}{4}{Arbitrary Postscript code\relax }{figure.1}{}} +\@writefile{toc}{\contentsline {section}{\numberline {4}TPIC specials}{5}{section.4}} +\@writefile{toc}{\contentsline {section}{\numberline {5}Transformations}{6}{section.5}} +\@writefile{toc}{\contentsline {section}{\numberline {6}The world of color}{7}{section.6}} +\@writefile{toc}{\contentsline {section}{\numberline {7}The XY-Pic package}{8}{section.7}} +\@writefile{toc}{\contentsline {section}{\numberline {8}The PSTricks package}{9}{section.8}} +\@writefile{toc}{\contentsline {section}{\numberline {9}Is color correctly handled ?}{11}{section.9}} +\@writefile{toc}{\contentsline {section}{\numberline {10}Background color for the whole page}{13}{section.10}} +\@writefile{toc}{\contentsline {section}{\numberline {11}External commands and inclusions}{15}{section.11}} +\@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces The author.}}{15}{figure.2}} +\@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces Some \texttt {bmp} file.}}{15}{figure.3}} +\@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces Some \texttt {emf} file.}}{16}{figure.4}} diff --git a/Build/source/texk/windvi/Examples/wtest.dvi b/Build/source/texk/windvi/Examples/wtest.dvi Binary files differnew file mode 100644 index 00000000000..dca5ad45efc --- /dev/null +++ b/Build/source/texk/windvi/Examples/wtest.dvi diff --git a/Build/source/texk/windvi/Examples/wtest.log b/Build/source/texk/windvi/Examples/wtest.log new file mode 100644 index 00000000000..e9b2cdc660c --- /dev/null +++ b/Build/source/texk/windvi/Examples/wtest.log @@ -0,0 +1,368 @@ +This is TeX, Version 3.14159 (Web2c 7.3.1) (format=latex 1999.9.14) 19 SEP 1999 14:32 +**\nonstopmode\input{wtest.tex} +(wtest.tex (d:/Local/TeX/texmf/tex/latex/base/article.cls +Document Class: article 1999/01/07 v1.4a Standard LaTeX document class +(d:/Local/TeX/texmf/tex/latex/base/size11.clo +File: size11.clo 1999/01/07 v1.4a Standard LaTeX file (size option) +) +\c@part=\count79 +\c@section=\count80 +\c@subsection=\count81 +\c@subsubsection=\count82 +\c@paragraph=\count83 +\c@subparagraph=\count84 +\c@figure=\count85 +\c@table=\count86 +\abovecaptionskip=\skip41 +\belowcaptionskip=\skip42 +\bibindent=\dimen102 +) +(d:/Local/TeX/texmf/tex/latex/graphics/color.sty +Package: color 1999/02/16 v1.0i Standard LaTeX Color (DPC) + +(d:/Local/TeX/texmf/tex/latex/config/color.cfg) +Package color Info: Driver file: dvips.def on input line 125. + +(d:/Local/TeX/texmf/tex/latex/graphics/dvips.def +File: dvips.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR) +) +(d:/Local/TeX/texmf/tex/latex/graphics/dvipsnam.def +File: dvipsnam.def 1999/02/16 v3.0i Driver-dependant file (DPC,SPQR) +)) +(d:/Local/TeX/texmf/tex/latex/eepic/epic.sty +Enhancements to Picture Environment. Version 1.2 - Released June 1, 1986 +\@@multicnt=\count87 +\d@lta=\count88 +\@delta=\dimen103 +\@@delta=\dimen104 +\@gridcnt=\count89 +\@joinkind=\count90 +\@dotgap=\dimen105 +\@ddotgap=\dimen106 +\@x@diff=\count91 +\@y@diff=\count92 +\x@diff=\dimen107 +\y@diff=\dimen108 +\@dotbox=\box26 +\num@segments=\count93 +\num@segmentsi=\count94 +\@datafile=\read1 +) (d:/Local/TeX/texmf/tex/latex/eepic/eepic.sty +Extension to Epic and LaTeX. Version 1.1b - Released Febrary 7, 1988 +\@gphlinewidth=\count95 +\@eepictcnt=\count96 +\@tempdimc=\dimen109 +\maxovaldiam=\dimen110 +\@filltype=\box27 +) (d:/Local/TeX/texmf/tex/latex/carlisle/pspicture.sty +Package: pspicture 1999/04/11/ v2.02 Picture mode via PS specials (DPC) +\@arrowlength=\dimen111 +) +(d:/Local/TeX/texmf/tex/latex/graphics/pstcol.sty +Package: pstcol 1999/02/16 v1.0a PSTricks color colompatibility (DPC) + +(d:/Local/TeXLive/texmf/tex/latex/pstricks/pstricks.sty +Package: pstricks 1997/03/25 package wrapper for PSTricks pstricks.tex + +(d:/Local/TeX/texmf/tex/generic/pstricks/pstricks.tex +`PSTricks' v97 patch 10 <1999/03/24> (tvz) +\pst@dima=\dimen112 +\pst@dimb=\dimen113 +\pst@dimc=\dimen114 +\pst@dimd=\dimen115 +\pst@dimg=\dimen116 +\pst@dimh=\dimen117 +\pst@hbox=\box28 +\pst@boxg=\box29 +\pst@cnta=\count97 +\pst@cntb=\count98 +\pst@cntc=\count99 +\pst@cntd=\count100 +\pst@cntg=\count101 +\pst@cnth=\count102 +\pst@toks=\toks14 +(d:/Local/TeX/texmf/tex/generic/pstricks/pstricks.con) +\psunit=\dimen118 +\psxunit=\dimen119 +\psyunit=\dimen120 +\pslinewidth=\dimen121 +\pst@customdefs=\toks15 +\pslinearc=\dimen122 +\everypsbox=\toks16 +\psframesep=\dimen123 +\pslabelsep=\dimen124 +\theoverlaybox=\box30 +))) +(d:/Local/TeXLive/texmf/tex/latex/pstricks/pst-node.sty +Package: pst-node 1997/03/25 package wrapper for PSTricks pst-node.tex + +(d:/Local/TeX/texmf/tex/generic/pstricks/pst-node.tex v97 patch 9, 1999/04/14 +\psrow=\count103 +\pscol=\count104 +\psmatrixcnt=\count105 +\psrowsep=\skip43 +\pscolsep=\skip44 +)) (d:/Local/TeXLive/texmf/tex/latex/pstricks/pst-tree.sty +Package: pst-tree 1997/03/25 package wrapper for PSTricks pst-tree.tex + +(d:/Local/TeX/texmf/tex/generic/pstricks/pst-tree.tex v97 patch 3, 1997/09/24 +\pstree@rootbox=\box31 +\pstree@box=\box32 +\psnodecnt=\count106 +\pstreelevel=\count107 +\pstreecnt=\count108 +\pstree@cnt=\count109 +\pstree@stop=\count110 +)) (d:/Local/TeX/texmf/tex/latex/graphics/graphics.sty +Package: graphics 1999/02/16 v1.0l Standard LaTeX Graphics (DPC,SPQR) + +(d:/Local/TeX/texmf/tex/latex/graphics/trig.sty +Package: trig 1999/03/16 v1.09 sin cos tan (DPC) +) +(d:/Local/TeX/texmf/tex/latex/config/graphics.cfg) +Package graphics Info: Driver file: dvips.def on input line 80. +) +(d:/Local/TeX/texmf/tex/latex/graphics/graphicx.sty +Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR) + +(d:/Local/TeX/texmf/tex/latex/graphics/keyval.sty +Package: keyval 1999/03/16 v1.13 key=value parser (DPC) +\KV@toks@=\toks17 +) +\Gin@req@height=\dimen125 +\Gin@req@width=\dimen126 +) +(d:/Local/TeX/texmf/tex/latex/hyperref/hyperref.sty +Package: hyperref 1999/09/01 6.66 Hypertext links for LaTeX +\@linkdim=\dimen127 +\Hy@linkcounter=\count111 +\Hy@pagecounter=\count112 + +(d:/Local/TeX/texmf/tex/latex/hyperref/pd1enc.def +File: pd1enc.def 1999/08/16 v0.5 PDFDocEncoding (Heiko Oberdiek) +) +Package hyperref Info: option colorlinks set true on input line 1103. +Package hyperref Info: Bookmarks ON on input line 1133. +Package hyperref Info: Hyper figures OFF on input line 1151. +Package hyperref Info: Link nesting OFF on input line 1156. +Package hyperref Info: Hyper index ON on input line 1159. +Package hyperref Info: Plain pages ON on input line 1164. +Package hyperref Info: Backreferencing OFF on input line 1171. + +Implicit mode ON; LaTeX internals redefined +(d:/Local/TeX/texmf/tex/latex/misc/url.sty +Package: url 1999/03/02 ver 1.4 Verb mode for urls, email addresses, and file + names +) +\Fld@menulength=\count113 +\Field@Width=\dimen128 +\Fld@charsize=\dimen129 +\Choice@toks=\toks18 +\Field@toks=\toks19 +Package hyperref Info: Hyper figures OFF on input line 1751. +Package hyperref Info: Link nesting OFF on input line 1756. +Package hyperref Info: Hyper index ON on input line 1759. +Package hyperref Info: backreferencing OFF on input line 1766. +Package hyperref Info: Link coloring ON on input line 1769. +\c@Item=\count114 +\c@Hfootnote=\count115 +) +*hyperref using default driver hypertex* +(d:/Local/TeX/texmf/tex/latex/hyperref/hypertex.def) +(d:/Local/TeX/texmf/tex/generic/xypic/xy.sty +(d:/Local/TeX/texmf/tex/generic/xypic/xy.tex Bootstrap'ing: catcodes, docmode, +(d:/Local/TeX/texmf/tex/generic/xypic/xyrecat.tex) +(d:/Local/TeX/texmf/tex/generic/xypic/xyidioms.tex) + + Xy-pic version 3.7 <1999/02/16> + Copyright (c) 1991-1998 by Kristoffer H. Rose <krisrose@ens-lyon.fr> + Xy-pic is free software: see the User's Guide for details. + +Loading kernel: messages; fonts; allocations: state, +\X@c=\dimen130 +\Y@c=\dimen131 +\U@c=\dimen132 +\D@c=\dimen133 +\L@c=\dimen134 +\R@c=\dimen135 +\Edge@c=\toks20 +\X@p=\dimen136 +\Y@p=\dimen137 +\U@p=\dimen138 +\D@p=\dimen139 +\L@p=\dimen140 +\R@p=\dimen141 +\Edge@p=\toks21 +\X@origin=\dimen142 +\Y@origin=\dimen143 +\X@xbase=\dimen144 +\Y@xbase=\dimen145 +\X@ybase=\dimen146 +\Y@ybase=\dimen147 +\X@min=\dimen148 +\Y@min=\dimen149 +\X@max=\dimen150 +\Y@max=\dimen151 +\lastobjectbox@=\box33 +\zerodotbox@=\box34 +\almostz@=\dimen152 + direction, +\d@X=\dimen153 +\d@Y=\dimen154 +\K@=\count116 +\KK@=\count117 +\Direction=\count118 +\K@dXdY=\dimen155 +\K@dYdX=\dimen156 +\xyread@=\read2 +\xywrite@=\write3 +\csp@=\count119 +\quotPTK@=\dimen157 + +utility macros; pictures: \xy, positions, +\swaptoks@@=\toks22 +\connectobjectbox@@=\box35 + objects, +\styletoks@=\toks23 + decorations; +kernel objects: directionals, circles, text; options; algorithms: directions, +edges, connections; Xy-pic loaded) +Package: xy 1999/02/16 Xy-pic version 3.7 + +(d:/Local/TeX/texmf/tex/generic/xypic/xyall.tex + Xy-pic option: All features v.3.3 +(d:/Local/TeX/texmf/tex/generic/xypic/xycurve.tex + Xy-pic option: Curve and Spline extension v.3.7 curve, +\crv@cnt@=\count120 +\crvpts@=\toks24 +\splinebox@=\box36 +\splineval@=\dimen158 +\splinedepth@=\dimen159 +\splinetol@=\dimen160 +\splinelength@=\dimen161 + circles, +\L@=\dimen162 + loaded) +(d:/Local/TeX/texmf/tex/generic/xypic/xyframe.tex + Xy-pic option: Frame and Bracket extension v.3.7 loaded) +(d:/Local/TeX/texmf/tex/generic/xypic/xycmtip.tex + Xy-pic option: Computer Modern tip extension v.3.3 +(d:/Local/TeX/texmf/tex/generic/xypic/xytips.tex + Xy-pic option: More Tips extension v.3.3 loaded) loaded) +(d:/Local/TeX/texmf/tex/generic/xypic/xyline.tex + Xy-pic option: Line styles extension v.3.6 +\xylinethick@=\dimen163 + loaded) +(d:/Local/TeX/texmf/tex/generic/xypic/xyrotate.tex + Xy-pic option: Rotate and Scale extension v.3.3 loaded) +(d:/Local/TeX/texmf/tex/generic/xypic/xycolor.tex + Xy-pic option: Colour extension v.3.3 loaded) +(d:/Local/TeX/texmf/tex/generic/xypic/xymatrix.tex + Xy-pic option: Matrix feature v.3.4 +\Row=\count121 +\Col=\count122 +\queue@=\toks25 +\queue@@=\toks26 +\qcount@=\count123 +\qcount@@=\count124 +\matrixsize@=\count125 + loaded) +(d:/Local/TeX/texmf/tex/generic/xypic/xyarrow.tex + Xy-pic option: Arrow and Path feature v.3.5 path, \ar, loaded) +(d:/Local/TeX/texmf/tex/generic/xypic/xygraph.tex + Xy-pic option: Graph feature v.3.7 loaded) loaded) +(d:/Local/TeX/texmf/tex/generic/xypic/xypoly.tex + Xy-pic option: Polygon feature v.3.7 polygons, +\xypolynode@=\count126 + loaded)) (wtest.aux) +\openout1 = `wtest.aux'. + +LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 24. +LaTeX Font Info: ... okay on input line 24. +LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 24. +LaTeX Font Info: ... okay on input line 24. +LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 24. +LaTeX Font Info: ... okay on input line 24. +LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 24. +LaTeX Font Info: ... okay on input line 24. +LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 24. +LaTeX Font Info: ... okay on input line 24. +LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 24. +LaTeX Font Info: ... okay on input line 24. +LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 24. +LaTeX Font Info: ... okay on input line 24. +Package hyperref Info: Link coloring ON on input line 24. + +(d:/Local/TeX/texmf/tex/latex/hyperref/nameref.sty +Package: nameref 1999/06/28 Cross-referencing by name of section +\c@section@level=\count127 +) +LaTeX Info: Redefining \ref on input line 24. +LaTeX Info: Redefining \pageref on input line 24. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <12> on input line 25. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <8> on input line 25. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <6> on input line 25. + (wtest.toc) +\tf@toc=\write4 +\openout4 = `wtest.toc'. + + [1 + +] [2] +File: wsample.ps Graphic file (type eps) + +<wsample.ps> +File: wsample.ps Graphic file (type eps) + <wsample.ps> +File: wsample.ps Graphic file (type eps) + <wsample.ps> +File: wsample.ps Graphic file (type eps) + <wsample.ps> +File: ws_gzip.ps.gz Graphic file (type eps) + <ws_gzip.ps.gz> +File: ws_bzip2.ps.bz2 Graphic file (type eps) + +<ws_bzip2.ps.bz2> [3] +Overfull \hbox (13.6647pt too wide) in paragraph at lines 108--108 +[] \OT1/cmtt/m/n/10.95 \special{" newpath 000 000 moveto 100 100 lineto 394 +0 lineto[] + [] + +[4] +Overfull \hbox (40.9997pt too wide) in paragraph at lines 111--171 +[] + [] + +[5] +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <10.95> on input line 198. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <14.4> on input line 218. +LaTeX Font Info: External font `cmex10' loaded for size +(Font) <7> on input line 218. + [6] [7] [8] +Overfull \hbox (50.03862pt too wide) in paragraph at lines 286--287 +[] + [] + +[9] [10] [11] [12] [13] [14] +File: `jpeg2ps -r 0 -h fab.jpg Graphic file (type eps) + <`jpeg2ps -r 0 -h fab.jpg> +File: coffee_bean.bmp Graphic file (type bmp) + <coffee_bean.bmp> +[15] +File: world.emf Graphic file (type bmp) + <world.emf> [16] (wtest.aux) ) +Here is how much of TeX's memory you used: + 5795 strings out of 10905 + 69180 string characters out of 72579 + 181033 words of memory out of 263001 + 8678 multiletter control sequences out of 10000+0 + 11380 words of font info for 43 fonts, out of 400000 for 1000 + 14 hyphenation exceptions out of 1000 + 26i,7n,24p,209b,299s stack positions out of 300i,100n,500p,50000b,4000s + +Output written on wtest.dvi (16 pages, 34940 bytes). diff --git a/Build/source/texk/windvi/Examples/wtest.out b/Build/source/texk/windvi/Examples/wtest.out new file mode 100644 index 00000000000..29048b800bf --- /dev/null +++ b/Build/source/texk/windvi/Examples/wtest.out @@ -0,0 +1,10 @@ +\BOOKMARK [1]{section.1}{Introduction}{} +\BOOKMARK [1]{section.2}{Postscript inclusions}{} +\BOOKMARK [1]{section.3}{TPIC specials}{} +\BOOKMARK [1]{section.4}{Transformations}{} +\BOOKMARK [1]{section.5}{The world of color}{} +\BOOKMARK [1]{section.6}{The XY-Pic package}{} +\BOOKMARK [1]{section.7}{The PSTricks package}{} +\BOOKMARK [1]{section.8}{Is color correctly handled ?}{} +\BOOKMARK [1]{section.9}{Background color for the whole page}{} +\BOOKMARK [1]{section.10}{External commands and inclusions}{} diff --git a/Build/source/texk/windvi/Examples/wtest.pdf b/Build/source/texk/windvi/Examples/wtest.pdf Binary files differnew file mode 100644 index 00000000000..ee88fcb61da --- /dev/null +++ b/Build/source/texk/windvi/Examples/wtest.pdf diff --git a/Build/source/texk/windvi/Examples/wtest.ps b/Build/source/texk/windvi/Examples/wtest.ps new file mode 100644 index 00000000000..3f695b4f910 --- /dev/null +++ b/Build/source/texk/windvi/Examples/wtest.ps @@ -0,0 +1,2512 @@ +%!PS-Adobe-2.0 +%%Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software +%%Title: wtest.dvi +%%Pages: 14 +%%PageOrder: Ascend +%%BoundingBox: 0 0 596 842 +%%DocumentFonts: XYDASH10 +%%EndComments +%DVIPSWebPage: (www.radicaleye.com) +%DVIPSCommandLine: dvips -D 720 wtest -o +%DVIPSParameters: dpi=720, compressed +%DVIPSSource: TeX output 1999.07.12:2314 +%%BeginProcSet: texc.pro +%! +/TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S +N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72 +mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0 +0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{ +landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize +mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[ +matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round +exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{ +statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0] +N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin +/FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array +/BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2 +array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N +df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A +definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get +}B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub} +B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr +1 add N}if}B/id 0 N/rw 0 N/rc 0 N/gp 0 N/cp 0 N/G 0 N/CharBuilder{save 3 +1 roll S A/base get 2 index get S/BitMaps get S get/Cd X pop/ctr 0 N Cdx +0 Cx Cy Ch sub Cx Cw add Cy setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx +sub Cy .1 sub]/id Ci N/rw Cw 7 add 8 idiv string N/rc 0 N/gp 0 N/cp 0 N{ +rc 0 ne{rc 1 sub/rc X rw}{G}ifelse}imagemask restore}B/G{{id gp get/gp +gp 1 add N A 18 mod S 18 idiv pl S get exec}loop}B/adv{cp add/cp X}B +/chg{rw cp id gp 4 index getinterval putinterval A gp add/gp X adv}B/nd{ +/cp 0 N rw exit}B/lsh{rw cp 2 copy get A 0 eq{pop 1}{A 255 eq{pop 254}{ +A A add 255 and S 1 and or}ifelse}ifelse put 1 adv}B/rsh{rw cp 2 copy +get A 0 eq{pop 128}{A 255 eq{pop 127}{A 2 idiv S 128 and or}ifelse} +ifelse put 1 adv}B/clr{rw cp 2 index string putinterval adv}B/set{rw cp +fillstr 0 4 index getinterval putinterval adv}B/fillstr 18 string 0 1 17 +{2 copy 255 put pop}for N/pl[{adv 1 chg}{adv 1 chg nd}{1 add chg}{1 add +chg nd}{adv lsh}{adv lsh nd}{adv rsh}{adv rsh nd}{1 add adv}{/rc X nd}{ +1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]A{bind pop} +forall N/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn +/BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put +}if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{ +bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A +mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{ +SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{ +userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X +1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4 +index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N +/p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{ +/Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT) +(LaserWriter 16/600)]{A length product length le{A length product exch 0 +exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse +end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask +grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot} +imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round +exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto +fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p +delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M} +B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{ +p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S +rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end + +%%EndProcSet +%%BeginProcSet: pstricks.pro +%! +% PostScript prologue for pstricks.tex. +% Version 97 patch 3, 98/06/01 +% For distribution, see pstricks.tex. +% +/tx@Dict 200 dict def tx@Dict begin +/ADict 25 dict def +/CM { matrix currentmatrix } bind def +/SLW /setlinewidth load def +/CLW /currentlinewidth load def +/CP /currentpoint load def +/ED { exch def } bind def +/L /lineto load def +/T /translate load def +/TMatrix { } def +/RAngle { 0 } def +/Atan { /atan load stopped { pop pop 0 } if } def +/Div { dup 0 eq { pop } { div } ifelse } def +/NET { neg exch neg exch T } def +/Pyth { dup mul exch dup mul add sqrt } def +/PtoC { 2 copy cos mul 3 1 roll sin mul } def +/PathLength@ { /z z y y1 sub x x1 sub Pyth add def /y1 y def /x1 x def } +def +/PathLength { flattenpath /z 0 def { /y1 ED /x1 ED /y2 y1 def /x2 x1 def +} { /y ED /x ED PathLength@ } {} { /y y2 def /x x2 def PathLength@ } +/pathforall load stopped { pop pop pop pop } if z } def +/STP { .996264 dup scale } def +/STV { SDict begin normalscale end STP } def +/DashLine { dup 0 gt { /a .5 def PathLength exch div } { pop /a 1 def +PathLength } ifelse /b ED /x ED /y ED /z y x add def b a .5 sub 2 mul y +mul sub z Div round z mul a .5 sub 2 mul y mul add b exch Div dup y mul +/y ED x mul /x ED x 0 gt y 0 gt and { [ y x ] 1 a sub y mul } { [ 1 0 ] +0 } ifelse setdash stroke } def +/DotLine { /b PathLength def /a ED /z ED /y CLW def /z y z add def a 0 gt +{ /b b a div def } { a 0 eq { /b b y sub def } { a -3 eq { /b b y add +def } if } ifelse } ifelse [ 0 b b z Div round Div dup 0 le { pop 1 } if +] a 0 gt { 0 } { y 2 div a -2 gt { neg } if } ifelse setdash 1 +setlinecap stroke } def +/LineFill { gsave abs CLW add /a ED a 0 dtransform round exch round exch +2 copy idtransform exch Atan rotate idtransform pop /a ED .25 .25 +% DG/SR modification begin - Dec. 12, 1997 - Patch 2 +%itransform translate pathbbox /y2 ED a Div ceiling cvi /x2 ED /y1 ED a +itransform pathbbox /y2 ED a Div ceiling cvi /x2 ED /y1 ED a +% DG/SR modification end +Div cvi /x1 ED /y2 y2 y1 sub def clip newpath 2 setlinecap systemdict +/setstrokeadjust known { true setstrokeadjust } if x2 x1 sub 1 add { x1 +% DG/SR modification begin - Jun. 1, 1998 - Patch 3 (from Michael Vulis) +% a mul y1 moveto 0 y2 rlineto stroke /x1 x1 1 add def } repeat grestore } +% def +a mul y1 moveto 0 y2 rlineto stroke /x1 x1 1 add def } repeat grestore +pop pop } def +% DG/SR modification end +/BeginArrow { ADict begin /@mtrx CM def gsave 2 copy T 2 index sub neg +exch 3 index sub exch Atan rotate newpath } def +/EndArrow { @mtrx setmatrix CP grestore end } def +/Arrow { CLW mul add dup 2 div /w ED mul dup /h ED mul /a ED { 0 h T 1 -1 +scale } if w neg h moveto 0 0 L w h L w neg a neg rlineto gsave fill +grestore } def +/Tbar { CLW mul add /z ED z -2 div CLW 2 div moveto z 0 rlineto stroke 0 +CLW moveto } def +/Bracket { CLW mul add dup CLW sub 2 div /x ED mul CLW add /y ED /z CLW 2 +div def x neg y moveto x neg CLW 2 div L x CLW 2 div L x y L stroke 0 +CLW moveto } def +/RoundBracket { CLW mul add dup 2 div /x ED mul /y ED /mtrx CM def 0 CLW +2 div T x y mul 0 ne { x y scale } if 1 1 moveto .85 .5 .35 0 0 0 +curveto -.35 0 -.85 .5 -1 1 curveto mtrx setmatrix stroke 0 CLW moveto } +def +/SD { 0 360 arc fill } def +/EndDot { { /z DS def } { /z 0 def } ifelse /b ED 0 z DS SD b { 0 z DS +CLW sub SD } if 0 DS z add CLW 4 div sub moveto } def +/Shadow { [ { /moveto load } { /lineto load } { /curveto load } { +/closepath load } /pathforall load stopped { pop pop pop pop CP /moveto +load } if ] cvx newpath 3 1 roll T exec } def +/NArray { aload length 2 div dup dup cvi eq not { exch pop } if /n exch +cvi def } def +/NArray { /f ED counttomark 2 div dup cvi /n ED n eq not { exch pop } if +f { ] aload /Points ED } { n 2 mul 1 add -1 roll pop } ifelse } def +/Line { NArray n 0 eq not { n 1 eq { 0 0 /n 2 def } if ArrowA /n n 2 sub +def n { Lineto } repeat CP 4 2 roll ArrowB L pop pop } if } def +/Arcto { /a [ 6 -2 roll ] cvx def a r /arcto load stopped { 5 } { 4 } +ifelse { pop } repeat a } def +/CheckClosed { dup n 2 mul 1 sub index eq 2 index n 2 mul 1 add index eq +and { pop pop /n n 1 sub def } if } def +/Polygon { NArray n 2 eq { 0 0 /n 3 def } if n 3 lt { n { pop pop } +repeat } { n 3 gt { CheckClosed } if n 2 mul -2 roll /y0 ED /x0 ED /y1 +ED /x1 ED x1 y1 /x1 x0 x1 add 2 div def /y1 y0 y1 add 2 div def x1 y1 +moveto /n n 2 sub def n { Lineto } repeat x1 y1 x0 y0 6 4 roll Lineto +Lineto pop pop closepath } ifelse } def +/Diamond { /mtrx CM def T rotate /h ED /w ED dup 0 eq { pop } { CLW mul +neg /d ED /a w h Atan def /h d a sin Div h add def /w d a cos Div w add +def } ifelse mark w 2 div h 2 div w 0 0 h neg w neg 0 0 h w 2 div h 2 +div /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx +setmatrix } def +% DG modification begin - Jan. 15, 1997 +%/Triangle { /mtrx CM def translate rotate /h ED 2 div /w ED dup 0 eq { +%pop } { CLW mul /d ED /h h d w h Atan sin Div sub def /w w d h w Atan 2 +%div dup cos exch sin Div mul sub def } ifelse mark 0 d w neg d 0 h w d 0 +%d /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx +%setmatrix } def +/Triangle { /mtrx CM def translate rotate /h ED 2 div /w ED dup +CLW mul /d ED /h h d w h Atan sin Div sub def /w w d h w Atan 2 +div dup cos exch sin Div mul sub def mark 0 d w neg d 0 h w d 0 +d /ArrowA { moveto } def /ArrowB { } def false Line closepath mtrx +% DG/SR modification begin - Jun. 1, 1998 - Patch 3 (from Michael Vulis) +% setmatrix } def +setmatrix pop } def +% DG/SR modification end +/CCA { /y ED /x ED 2 copy y sub /dy1 ED x sub /dx1 ED /l1 dx1 dy1 Pyth +def } def +/CCA { /y ED /x ED 2 copy y sub /dy1 ED x sub /dx1 ED /l1 dx1 dy1 Pyth +def } def +/CC { /l0 l1 def /x1 x dx sub def /y1 y dy sub def /dx0 dx1 def /dy0 dy1 +def CCA /dx dx0 l1 c exp mul dx1 l0 c exp mul add def /dy dy0 l1 c exp +mul dy1 l0 c exp mul add def /m dx0 dy0 Atan dx1 dy1 Atan sub 2 div cos +abs b exp a mul dx dy Pyth Div 2 div def /x2 x l0 dx mul m mul sub def +/y2 y l0 dy mul m mul sub def /dx l1 dx mul m mul neg def /dy l1 dy mul +m mul neg def } def +/IC { /c c 1 add def c 0 lt { /c 0 def } { c 3 gt { /c 3 def } if } +ifelse /a a 2 mul 3 div 45 cos b exp div def CCA /dx 0 def /dy 0 def } +def +/BOC { IC CC x2 y2 x1 y1 ArrowA CP 4 2 roll x y curveto } def +/NC { CC x1 y1 x2 y2 x y curveto } def +/EOC { x dx sub y dy sub 4 2 roll ArrowB 2 copy curveto } def +/BAC { IC CC x y moveto CC x1 y1 CP ArrowA } def +/NAC { x2 y2 x y curveto CC x1 y1 } def +/EAC { x2 y2 x y ArrowB curveto pop pop } def +/OpenCurve { NArray n 3 lt { n { pop pop } repeat } { BOC /n n 3 sub def +n { NC } repeat EOC } ifelse } def +/AltCurve { { false NArray n 2 mul 2 roll [ n 2 mul 3 sub 1 roll ] aload +/Points ED n 2 mul -2 roll } { false NArray } ifelse n 4 lt { n { pop +pop } repeat } { BAC /n n 4 sub def n { NAC } repeat EAC } ifelse } def +/ClosedCurve { NArray n 3 lt { n { pop pop } repeat } { n 3 gt { +CheckClosed } if 6 copy n 2 mul 6 add 6 roll IC CC x y moveto n { NC } +repeat closepath pop pop } ifelse } def +/SQ { /r ED r r moveto r r neg L r neg r neg L r neg r L fill } def +/ST { /y ED /x ED x y moveto x neg y L 0 x L fill } def +/SP { /r ED gsave 0 r moveto 4 { 72 rotate 0 r L } repeat fill grestore } +def +/FontDot { DS 2 mul dup matrix scale matrix concatmatrix exch matrix +rotate matrix concatmatrix exch findfont exch makefont setfont } def +/Rect { x1 y1 y2 add 2 div moveto x1 y2 lineto x2 y2 lineto x2 y1 lineto +x1 y1 lineto closepath } def +/OvalFrame { x1 x2 eq y1 y2 eq or { pop pop x1 y1 moveto x2 y2 L } { y1 +y2 sub abs x1 x2 sub abs 2 copy gt { exch pop } { pop } ifelse 2 div +exch { dup 3 1 roll mul exch } if 2 copy lt { pop } { exch pop } ifelse +/b ED x1 y1 y2 add 2 div moveto x1 y2 x2 y2 b arcto x2 y2 x2 y1 b arcto +x2 y1 x1 y1 b arcto x1 y1 x1 y2 b arcto 16 { pop } repeat closepath } +ifelse } def +/Frame { CLW mul /a ED 3 -1 roll 2 copy gt { exch } if a sub /y2 ED a add +/y1 ED 2 copy gt { exch } if a sub /x2 ED a add /x1 ED 1 index 0 eq { +pop pop Rect } { OvalFrame } ifelse } def +/BezierNArray { /f ED counttomark 2 div dup cvi /n ED n eq not { exch pop +} if n 1 sub neg 3 mod 3 add 3 mod { 0 0 /n n 1 add def } repeat f { ] +aload /Points ED } { n 2 mul 1 add -1 roll pop } ifelse } def +/OpenBezier { BezierNArray n 1 eq { pop pop } { ArrowA n 4 sub 3 idiv { 6 +2 roll 4 2 roll curveto } repeat 6 2 roll 4 2 roll ArrowB curveto } +ifelse } def +/ClosedBezier { BezierNArray n 1 eq { pop pop } { moveto n 1 sub 3 idiv { +6 2 roll 4 2 roll curveto } repeat closepath } ifelse } def +/BezierShowPoints { gsave Points aload length 2 div cvi /n ED moveto n 1 +sub { lineto } repeat CLW 2 div SLW [ 4 4 ] 0 setdash stroke grestore } +def +/Parab { /y0 exch def /x0 exch def /y1 exch def /x1 exch def /dx x0 x1 +sub 3 div def /dy y0 y1 sub 3 div def x0 dx sub y0 dy add x1 y1 ArrowA +x0 dx add y0 dy add x0 2 mul x1 sub y1 ArrowB curveto /Points [ x1 y1 x0 +y0 x0 2 mul x1 sub y1 ] def } def +/Grid { newpath /a 4 string def /b ED /c ED /n ED cvi dup 1 lt { pop 1 } +if /s ED s div dup 0 eq { pop 1 } if /dy ED s div dup 0 eq { pop 1 } if +/dx ED dy div round dy mul /y0 ED dx div round dx mul /x0 ED dy div +round cvi /y2 ED dx div round cvi /x2 ED dy div round cvi /y1 ED dx div +round cvi /x1 ED /h y2 y1 sub 0 gt { 1 } { -1 } ifelse def /w x2 x1 sub +0 gt { 1 } { -1 } ifelse def b 0 gt { /z1 b 4 div CLW 2 div add def +/Helvetica findfont b scalefont setfont /b b .95 mul CLW 2 div add def } +if systemdict /setstrokeadjust known { true setstrokeadjust /t { } def } +{ /t { transform 0.25 sub round 0.25 add exch 0.25 sub round 0.25 add +exch itransform } bind def } ifelse gsave n 0 gt { 1 setlinecap [ 0 dy n +div ] dy n div 2 div setdash } { 2 setlinecap } ifelse /i x1 def /f y1 +dy mul n 0 gt { dy n div 2 div h mul sub } if def /g y2 dy mul n 0 gt { +dy n div 2 div h mul add } if def x2 x1 sub w mul 1 add dup 1000 gt { +pop 1000 } if { i dx mul dup y0 moveto b 0 gt { gsave c i a cvs dup +stringwidth pop /z2 ED w 0 gt {z1} {z1 z2 add neg} ifelse h 0 gt {b neg} +{z1} ifelse rmoveto show grestore } if dup t f moveto g t L stroke /i i +w add def } repeat grestore gsave n 0 gt +% DG/SR modification begin - Nov. 7, 1997 - Patch 1 +%{ 1 setlinecap [ 0 dx n div ] dy n div 2 div setdash } +{ 1 setlinecap [ 0 dx n div ] dx n div 2 div setdash } +% DG/SR modification end +{ 2 setlinecap } ifelse /i y1 def /f x1 dx mul +n 0 gt { dx n div 2 div w mul sub } if def /g x2 dx mul n 0 gt { dx n +div 2 div w mul add } if def y2 y1 sub h mul 1 add dup 1000 gt { pop +1000 } if { newpath i dy mul dup x0 exch moveto b 0 gt { gsave c i a cvs +dup stringwidth pop /z2 ED w 0 gt {z1 z2 add neg} {z1} ifelse h 0 gt +{z1} {b neg} ifelse rmoveto show grestore } if dup f exch t moveto g +exch t L stroke /i i h add def } repeat grestore } def +/ArcArrow { /d ED /b ED /a ED gsave newpath 0 -1000 moveto clip newpath 0 +1 0 0 b grestore c mul /e ED pop pop pop r a e d PtoC y add exch x add +exch r a PtoC y add exch x add exch b pop pop pop pop a e d CLW 8 div c +mul neg d } def +/Ellipse { /mtrx CM def T scale 0 0 1 5 3 roll arc mtrx setmatrix } def +/Rot { CP CP translate 3 -1 roll neg rotate NET } def +/RotBegin { tx@Dict /TMatrix known not { /TMatrix { } def /RAngle { 0 } +def } if /TMatrix [ TMatrix CM ] cvx def /a ED a Rot /RAngle [ RAngle +dup a add ] cvx def } def +/RotEnd { /TMatrix [ TMatrix setmatrix ] cvx def /RAngle [ RAngle pop ] +cvx def } def +/PutCoor { gsave CP T CM STV exch exec moveto setmatrix CP grestore } def +/PutBegin { /TMatrix [ TMatrix CM ] cvx def CP 4 2 roll T moveto } def +/PutEnd { CP /TMatrix [ TMatrix setmatrix ] cvx def moveto } def +/Uput { /a ED add 2 div /h ED 2 div /w ED /s a sin def /c a cos def /b s +abs c abs 2 copy gt dup /q ED { pop } { exch pop } ifelse def /w1 c b +div w mul def /h1 s b div h mul def q { w1 abs w sub dup c mul abs } { +h1 abs h sub dup s mul abs } ifelse } def +/UUput { /z ED abs /y ED /x ED q { x s div c mul abs y gt } { x c div s +mul abs y gt } ifelse { x x mul y y mul sub z z mul add sqrt z add } { q +{ x s div } { x c div } ifelse abs } ifelse a PtoC h1 add exch w1 add +exch } def +/BeginOL { dup (all) eq exch TheOL eq or { IfVisible not { Visible +/IfVisible true def } if } { IfVisible { Invisible /IfVisible false def +} if } ifelse } def +/InitOL { /OLUnit [ 3000 3000 matrix defaultmatrix dtransform ] cvx def +/Visible { CP OLUnit idtransform T moveto } def /Invisible { CP OLUnit +neg exch neg exch idtransform T moveto } def /BOL { BeginOL } def +/IfVisible true def } def +end +% END pstricks.pro + +%%EndProcSet +%%BeginProcSet: pst-dots.pro +%!PS-Adobe-2.0 +%%Title: Dot Font for PSTricks 97 - Version 97, 93/05/07. +%%Creator: Timothy Van Zandt <tvz@Princeton.EDU> +%%Creation Date: May 7, 1993 +10 dict dup begin + /FontType 3 def + /FontMatrix [ .001 0 0 .001 0 0 ] def + /FontBBox [ 0 0 0 0 ] def + /Encoding 256 array def + 0 1 255 { Encoding exch /.notdef put } for + Encoding + dup (b) 0 get /Bullet put + dup (c) 0 get /Circle put + dup (C) 0 get /BoldCircle put + dup (u) 0 get /SolidTriangle put + dup (t) 0 get /Triangle put + dup (T) 0 get /BoldTriangle put + dup (r) 0 get /SolidSquare put + dup (s) 0 get /Square put + dup (S) 0 get /BoldSquare put + dup (q) 0 get /SolidPentagon put + dup (p) 0 get /Pentagon put + (P) 0 get /BoldPentagon put + /Metrics 13 dict def + Metrics begin + /Bullet 1000 def + /Circle 1000 def + /BoldCircle 1000 def + /SolidTriangle 1344 def + /Triangle 1344 def + /BoldTriangle 1344 def + /SolidSquare 886 def + /Square 886 def + /BoldSquare 886 def + /SolidPentagon 1093.2 def + /Pentagon 1093.2 def + /BoldPentagon 1093.2 def + /.notdef 0 def + end + /BBoxes 13 dict def + BBoxes begin + /Circle { -550 -550 550 550 } def + /BoldCircle /Circle load def + /Bullet /Circle load def + /Triangle { -571.5 -330 571.5 660 } def + /BoldTriangle /Triangle load def + /SolidTriangle /Triangle load def + /Square { -450 -450 450 450 } def + /BoldSquare /Square load def + /SolidSquare /Square load def + /Pentagon { -546.6 -465 546.6 574.7 } def + /BoldPentagon /Pentagon load def + /SolidPentagon /Pentagon load def + /.notdef { 0 0 0 0 } def + end + /CharProcs 20 dict def + CharProcs begin + /Adjust { + 2 copy dtransform floor .5 add exch floor .5 add exch idtransform + 3 -1 roll div 3 1 roll exch div exch scale + } def + /CirclePath { 0 0 500 0 360 arc closepath } def + /Bullet { 500 500 Adjust CirclePath fill } def + /Circle { 500 500 Adjust CirclePath .9 .9 scale CirclePath eofill } def + /BoldCircle { 500 500 Adjust CirclePath .8 .8 scale CirclePath eofill } def + /BoldCircle { CirclePath .8 .8 scale CirclePath eofill } def + /TrianglePath { + 0 660 moveto -571.5 -330 lineto 571.5 -330 lineto closepath + } def + /SolidTriangle { TrianglePath fill } def + /Triangle { TrianglePath .85 .85 scale TrianglePath eofill } def + /BoldTriangle { TrianglePath .7 .7 scale TrianglePath eofill } def + /SquarePath { + -450 450 moveto 450 450 lineto 450 -450 lineto -450 -450 lineto + closepath + } def + /SolidSquare { SquarePath fill } def + /Square { SquarePath .89 .89 scale SquarePath eofill } def + /BoldSquare { SquarePath .78 .78 scale SquarePath eofill } def + /PentagonPath { + -337.8 -465 moveto + 337.8 -465 lineto + 546.6 177.6 lineto + 0 574.7 lineto + -546.6 177.6 lineto + closepath + } def + /SolidPentagon { PentagonPath fill } def + /Pentagon { PentagonPath .89 .89 scale PentagonPath eofill } def + /BoldPentagon { PentagonPath .78 .78 scale PentagonPath eofill } def + /.notdef { } def + end + /BuildGlyph { + exch + begin + Metrics 1 index get exec 0 + BBoxes 3 index get exec + setcachedevice + CharProcs begin load exec end + end + } def + /BuildChar { + 1 index /Encoding get exch get + 1 index /BuildGlyph get exec + } bind def +end +/PSTricksDotFont exch definefont pop +% END pst-dots.pro + +%%EndProcSet +%%BeginProcSet: pst-node.pro +%! +% PostScript prologue for pst-node.tex. +% Version 97 patch 1, 97/05/09. +% For distribution, see pstricks.tex. +% +/tx@NodeDict 400 dict def tx@NodeDict begin +tx@Dict begin /T /translate load def end +/NewNode { gsave /next ED dict dup 3 1 roll def exch { dup 3 1 roll def } +if begin tx@Dict begin STV CP T exec end /NodeMtrx CM def next end +grestore } def +/InitPnode { /Y ED /X ED /NodePos { NodeSep Cos mul NodeSep Sin mul } def +} def +/InitCnode { /r ED /Y ED /X ED /NodePos { NodeSep r add dup Cos mul exch +Sin mul } def } def +/GetRnodePos { Cos 0 gt { /dx r NodeSep add def } { /dx l NodeSep sub def +} ifelse Sin 0 gt { /dy u NodeSep add def } { /dy d NodeSep sub def } +ifelse dx Sin mul abs dy Cos mul abs gt { dy Cos mul Sin div dy } { dx +dup Sin mul Cos Div } ifelse } def +/InitRnode { /Y ED /X ED X sub /r ED /l X neg def Y add neg /d ED Y sub +/u ED /NodePos { GetRnodePos } def } def +/DiaNodePos { w h mul w Sin mul abs h Cos mul abs add Div NodeSep add dup +Cos mul exch Sin mul } def +/TriNodePos { Sin s lt { d NodeSep sub dup Cos mul Sin Div exch } { w h +mul w Sin mul h Cos abs mul add Div NodeSep add dup Cos mul exch Sin mul +} ifelse } def +/InitTriNode { sub 2 div exch 2 div exch 2 copy T 2 copy 4 index index /d +ED pop pop pop pop -90 mul rotate /NodeMtrx CM def /X 0 def /Y 0 def d +sub abs neg /d ED d add /h ED 2 div h mul h d sub Div /w ED /s d w Atan +sin def /NodePos { TriNodePos } def } def +/OvalNodePos { /ww w NodeSep add def /hh h NodeSep add def Sin ww mul Cos +hh mul Atan dup cos ww mul exch sin hh mul } def +/GetCenter { begin X Y NodeMtrx transform CM itransform end } def +/XYPos { dup sin exch cos Do /Cos ED /Sin ED /Dist ED Cos 0 gt { Dist +Dist Sin mul Cos div } { Cos 0 lt { Dist neg Dist Sin mul Cos div neg } +{ 0 Dist Sin mul } ifelse } ifelse Do } def +/GetEdge { dup 0 eq { pop begin 1 0 NodeMtrx dtransform CM idtransform +exch atan sub dup sin /Sin ED cos /Cos ED /NodeSep ED NodePos NodeMtrx +dtransform CM idtransform end } { 1 eq {{exch}} {{}} ifelse /Do ED pop +XYPos } ifelse } def +/AddOffset { 1 index 0 eq { pop pop } { 2 copy 5 2 roll cos mul add 4 1 +roll sin mul sub exch } ifelse } def +/GetEdgeA { NodeSepA AngleA NodeA NodeSepTypeA GetEdge OffsetA AngleA +AddOffset yA add /yA1 ED xA add /xA1 ED } def +/GetEdgeB { NodeSepB AngleB NodeB NodeSepTypeB GetEdge OffsetB AngleB +AddOffset yB add /yB1 ED xB add /xB1 ED } def +/GetArmA { ArmTypeA 0 eq { /xA2 ArmA AngleA cos mul xA1 add def /yA2 ArmA +AngleA sin mul yA1 add def } { ArmTypeA 1 eq {{exch}} {{}} ifelse /Do ED +ArmA AngleA XYPos OffsetA AngleA AddOffset yA add /yA2 ED xA add /xA2 ED +} ifelse } def +/GetArmB { ArmTypeB 0 eq { /xB2 ArmB AngleB cos mul xB1 add def /yB2 ArmB +AngleB sin mul yB1 add def } { ArmTypeB 1 eq {{exch}} {{}} ifelse /Do ED +ArmB AngleB XYPos OffsetB AngleB AddOffset yB add /yB2 ED xB add /xB2 ED +} ifelse } def +/InitNC { /b ED /a ED /NodeSepTypeB ED /NodeSepTypeA ED /NodeSepB ED +/NodeSepA ED /OffsetB ED /OffsetA ED tx@NodeDict a known tx@NodeDict b +known and dup { /NodeA a load def /NodeB b load def NodeA GetCenter /yA +ED /xA ED NodeB GetCenter /yB ED /xB ED } if } def +/LPutLine { 4 copy 3 -1 roll sub neg 3 1 roll sub Atan /NAngle ED 1 t sub +mul 3 1 roll 1 t sub mul 4 1 roll t mul add /Y ED t mul add /X ED } def +/LPutLines { mark LPutVar counttomark 2 div 1 sub /n ED t floor dup n gt +{ pop n 1 sub /t 1 def } { dup t sub neg /t ED } ifelse cvi 2 mul { pop +} repeat LPutLine cleartomark } def +/BezierMidpoint { /y3 ED /x3 ED /y2 ED /x2 ED /y1 ED /x1 ED /y0 ED /x0 ED +/t ED /cx x1 x0 sub 3 mul def /cy y1 y0 sub 3 mul def /bx x2 x1 sub 3 +mul cx sub def /by y2 y1 sub 3 mul cy sub def /ax x3 x0 sub cx sub bx +sub def /ay y3 y0 sub cy sub by sub def ax t 3 exp mul bx t t mul mul +add cx t mul add x0 add ay t 3 exp mul by t t mul mul add cy t mul add +y0 add 3 ay t t mul mul mul 2 by t mul mul add cy add 3 ax t t mul mul +mul 2 bx t mul mul add cx add atan /NAngle ED /Y ED /X ED } def +/HPosBegin { yB yA ge { /t 1 t sub def } if /Y yB yA sub t mul yA add def +} def +/HPosEnd { /X Y yyA sub yyB yyA sub Div xxB xxA sub mul xxA add def +/NAngle yyB yyA sub xxB xxA sub Atan def } def +/HPutLine { HPosBegin /yyA ED /xxA ED /yyB ED /xxB ED HPosEnd } def +/HPutLines { HPosBegin yB yA ge { /check { le } def } { /check { ge } def +} ifelse /xxA xA def /yyA yA def mark xB yB LPutVar { dup Y check { exit +} { /yyA ED /xxA ED } ifelse } loop /yyB ED /xxB ED cleartomark HPosEnd +} def +/VPosBegin { xB xA lt { /t 1 t sub def } if /X xB xA sub t mul xA add def +} def +/VPosEnd { /Y X xxA sub xxB xxA sub Div yyB yyA sub mul yyA add def +/NAngle yyB yyA sub xxB xxA sub Atan def } def +/VPutLine { VPosBegin /yyA ED /xxA ED /yyB ED /xxB ED VPosEnd } def +/VPutLines { VPosBegin xB xA ge { /check { le } def } { /check { ge } def +} ifelse /xxA xA def /yyA yA def mark xB yB LPutVar { 1 index X check { +exit } { /yyA ED /xxA ED } ifelse } loop /yyB ED /xxB ED cleartomark +VPosEnd } def +/HPutCurve { gsave newpath /SaveLPutVar /LPutVar load def LPutVar 8 -2 +roll moveto curveto flattenpath /LPutVar [ {} {} {} {} pathforall ] cvx +def grestore exec /LPutVar /SaveLPutVar load def } def +/NCCoor { /AngleA yB yA sub xB xA sub Atan def /AngleB AngleA 180 add def +GetEdgeA GetEdgeB /LPutVar [ xB1 yB1 xA1 yA1 ] cvx def /LPutPos { +LPutVar LPutLine } def /HPutPos { LPutVar HPutLine } def /VPutPos { +LPutVar VPutLine } def LPutVar } def +/NCLine { NCCoor tx@Dict begin ArrowA CP 4 2 roll ArrowB lineto pop pop +end } def +/NCLines { false NArray n 0 eq { NCLine } { 2 copy yA sub exch xA sub +Atan /AngleA ED n 2 mul dup index exch index yB sub exch xB sub Atan +/AngleB ED GetEdgeA GetEdgeB /LPutVar [ xB1 yB1 n 2 mul 4 add 4 roll xA1 +yA1 ] cvx def mark LPutVar tx@Dict begin false Line end /LPutPos { +LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } +ifelse } def +/NCCurve { GetEdgeA GetEdgeB xA1 xB1 sub yA1 yB1 sub Pyth 2 div dup 3 -1 +roll mul /ArmA ED mul /ArmB ED /ArmTypeA 0 def /ArmTypeB 0 def GetArmA +GetArmB xA2 yA2 xA1 yA1 tx@Dict begin ArrowA end xB2 yB2 xB1 yB1 tx@Dict +begin ArrowB end curveto /LPutVar [ xA1 yA1 xA2 yA2 xB2 yB2 xB1 yB1 ] +cvx def /LPutPos { t LPutVar BezierMidpoint } def /HPutPos { { HPutLines +} HPutCurve } def /VPutPos { { VPutLines } HPutCurve } def } def +/NCAngles { GetEdgeA GetEdgeB GetArmA GetArmB /mtrx AngleA matrix rotate +def xA2 yA2 mtrx transform pop xB2 yB2 mtrx transform exch pop mtrx +itransform /y0 ED /x0 ED mark ArmB 0 ne { xB1 yB1 } if xB2 yB2 x0 y0 xA2 +yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin false Line end /LPutVar [ xB1 +yB1 xB2 yB2 x0 y0 xA2 yA2 xA1 yA1 ] cvx def /LPutPos { LPutLines } def +/HPutPos { HPutLines } def /VPutPos { VPutLines } def } def +/NCAngle { GetEdgeA GetEdgeB GetArmB /mtrx AngleA matrix rotate def xB2 +yB2 mtrx itransform pop xA1 yA1 mtrx itransform exch pop mtrx transform +/y0 ED /x0 ED mark ArmB 0 ne { xB1 yB1 } if xB2 yB2 x0 y0 xA1 yA1 +tx@Dict begin false Line end /LPutVar [ xB1 yB1 xB2 yB2 x0 y0 xA1 yA1 ] +cvx def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { +VPutLines } def } def +/NCBar { GetEdgeA GetEdgeB GetArmA GetArmB /mtrx AngleA matrix rotate def +xA2 yA2 mtrx itransform pop xB2 yB2 mtrx itransform pop sub dup 0 mtrx +transform 3 -1 roll 0 gt { /yB2 exch yB2 add def /xB2 exch xB2 add def } +{ /yA2 exch neg yA2 add def /xA2 exch neg xA2 add def } ifelse mark ArmB +0 ne { xB1 yB1 } if xB2 yB2 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict +begin false Line end /LPutVar [ xB1 yB1 xB2 yB2 xA2 yA2 xA1 yA1 ] cvx +def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { +VPutLines } def } def +/NCDiag { GetEdgeA GetEdgeB GetArmA GetArmB mark ArmB 0 ne { xB1 yB1 } if +xB2 yB2 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin false Line end +/LPutVar [ xB1 yB1 xB2 yB2 xA2 yA2 xA1 yA1 ] cvx def /LPutPos { +LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } +def +/NCDiagg { GetEdgeA GetArmA yB yA2 sub xB xA2 sub Atan 180 add /AngleB ED +GetEdgeB mark xB1 yB1 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin +false Line end /LPutVar [ xB1 yB1 xA2 yA2 xA1 yA1 ] cvx def /LPutPos { +LPutLines } def /HPutPos { HPutLines } def /VPutPos { VPutLines } def } +def +/NCLoop { GetEdgeA GetEdgeB GetArmA GetArmB /mtrx AngleA matrix rotate +def xA2 yA2 mtrx transform loopsize add /yA3 ED /xA3 ED /xB3 xB2 yB2 +mtrx transform pop def xB3 yA3 mtrx itransform /yB3 ED /xB3 ED xA3 yA3 +mtrx itransform /yA3 ED /xA3 ED mark ArmB 0 ne { xB1 yB1 } if xB2 yB2 +xB3 yB3 xA3 yA3 xA2 yA2 ArmA 0 ne { xA1 yA1 } if tx@Dict begin false +Line end /LPutVar [ xB1 yB1 xB2 yB2 xB3 yB3 xA3 yA3 xA2 yA2 xA1 yA1 ] +cvx def /LPutPos { LPutLines } def /HPutPos { HPutLines } def /VPutPos { +VPutLines } def } def +% DG/SR modification begin - May 9, 1997 - Patch 1 +%/NCCircle { 0 0 NodesepA nodeA \tx@GetEdge pop xA sub 2 div dup 2 exp r +%r mul sub abs sqrt atan 2 mul /a ED r AngleA 90 add PtoC yA add exch xA add +%exch 2 copy /LPutVar [ 4 2 roll r AngleA ] cvx def /LPutPos { LPutVar t 360 +%mul add dup 5 1 roll 90 sub \tx@PtoC 3 -1 roll add /Y ED add /X ED /NAngle ED +/NCCircle { NodeSepA 0 NodeA 0 GetEdge pop 2 div dup 2 exp r +r mul sub abs sqrt atan 2 mul /a ED r AngleA 90 add PtoC yA add exch xA add +exch 2 copy /LPutVar [ 4 2 roll r AngleA ] cvx def /LPutPos { LPutVar t 360 +mul add dup 5 1 roll 90 sub PtoC 3 -1 roll add /Y ED add /X ED /NAngle ED +% DG/SR modification end +} def /HPutPos { LPutPos } def /VPutPos { LPutPos } def r AngleA 90 sub a add +AngleA 270 add a sub tx@Dict begin /angleB ED /angleA ED /r ED /c 57.2957 r +Div def /y ED /x ED } def +/NCBox { /d ED /h ED /AngleB yB yA sub xB xA sub Atan def /AngleA AngleB +180 add def GetEdgeA GetEdgeB /dx d AngleB sin mul def /dy d AngleB cos +mul neg def /hx h AngleB sin mul neg def /hy h AngleB cos mul def +/LPutVar [ xA1 hx add yA1 hy add xB1 hx add yB1 hy add xB1 dx add yB1 dy +add xA1 dx add yA1 dy add ] cvx def /LPutPos { LPutLines } def /HPutPos +{ xB yB xA yA LPutLine } def /VPutPos { HPutPos } def mark LPutVar +tx@Dict begin false Polygon end } def +/NCArcBox { /l ED neg /d ED /h ED /a ED /AngleA yB yA sub xB xA sub Atan +def /AngleB AngleA 180 add def /tA AngleA a sub 90 add def /tB tA a 2 +mul add def /r xB xA sub tA cos tB cos sub Div dup 0 eq { pop 1 } if def +/x0 xA r tA cos mul add def /y0 yA r tA sin mul add def /c 57.2958 r div +def /AngleA AngleA a sub 180 add def /AngleB AngleB a add 180 add def +GetEdgeA GetEdgeB /AngleA tA 180 add yA yA1 sub xA xA1 sub Pyth c mul +sub def /AngleB tB 180 add yB yB1 sub xB xB1 sub Pyth c mul add def l 0 +eq { x0 y0 r h add AngleA AngleB arc x0 y0 r d add AngleB AngleA arcn } +{ x0 y0 translate /tA AngleA l c mul add def /tB AngleB l c mul sub def +0 0 r h add tA tB arc r h add AngleB PtoC r d add AngleB PtoC 2 copy 6 2 +roll l arcto 4 { pop } repeat r d add tB PtoC l arcto 4 { pop } repeat 0 +0 r d add tB tA arcn r d add AngleA PtoC r h add AngleA PtoC 2 copy 6 2 +roll l arcto 4 { pop } repeat r h add tA PtoC l arcto 4 { pop } repeat } +ifelse closepath /LPutVar [ x0 y0 r AngleA AngleB h d ] cvx def /LPutPos +{ LPutVar /d ED /h ED /AngleB ED /AngleA ED /r ED /y0 ED /x0 ED t 1 le { +r h add AngleA 1 t sub mul AngleB t mul add dup 90 add /NAngle ED PtoC } +{ t 2 lt { /NAngle AngleB 180 add def r 2 t sub h mul t 1 sub d mul add +add AngleB PtoC } { t 3 lt { r d add AngleB 3 t sub mul AngleA 2 t sub +mul add dup 90 sub /NAngle ED PtoC } { /NAngle AngleA 180 add def r 4 t +sub d mul t 3 sub h mul add add AngleA PtoC } ifelse } ifelse } ifelse +y0 add /Y ED x0 add /X ED } def /HPutPos { LPutPos } def /VPutPos { +LPutPos } def } def +/Tfan { /AngleA yB yA sub xB xA sub Atan def GetEdgeA w xA1 xB sub yA1 yB +sub Pyth Pyth w Div CLW 2 div mul 2 div dup AngleA sin mul yA1 add /yA1 +ED AngleA cos mul xA1 add /xA1 ED /LPutVar [ xA1 yA1 m { xB w add yB xB +w sub yB } { xB yB w sub xB yB w add } ifelse xA1 yA1 ] cvx def /LPutPos +{ LPutLines } def /VPutPos@ { LPutVar flag { 8 4 roll pop pop pop pop } +{ pop pop pop pop 4 2 roll } ifelse } def /VPutPos { VPutPos@ VPutLine } +def /HPutPos { VPutPos@ HPutLine } def mark LPutVar tx@Dict begin +/ArrowA { moveto } def /ArrowB { } def false Line closepath end } def +/LPutCoor { NAngle tx@Dict begin /NAngle ED end gsave CM STV CP Y sub neg +exch X sub neg exch moveto setmatrix CP grestore } def +/LPut { tx@NodeDict /LPutPos known { LPutPos } { CP /Y ED /X ED /NAngle 0 +def } ifelse LPutCoor } def +/HPutAdjust { Sin Cos mul 0 eq { 0 } { d Cos mul Sin div flag not { neg } +if h Cos mul Sin div flag { neg } if 2 copy gt { pop } { exch pop } +ifelse } ifelse s add flag { r add neg } { l add } ifelse X add /X ED } +def +/VPutAdjust { Sin Cos mul 0 eq { 0 } { l Sin mul Cos div flag { neg } if +r Sin mul Cos div flag not { neg } if 2 copy gt { pop } { exch pop } +ifelse } ifelse s add flag { d add } { h add neg } ifelse Y add /Y ED } +def +end +% END pst-node.pro + +%%EndProcSet +%%BeginProcSet: pspicture.ps +%! +%% +%% This is file `pspicture.ps', generated +%% on <1995/6/4> with the docstrip utility (2.2i). +%% +%% The original source files were: +%% +%% pspicture.doc (with options: `ps') +%% +%% Do not distribute the stripped version of this file. +%% The checksum in the header refers to the documented version. +%% +%%% ==================================================================== +%%% @LaTeX-style-file{ +%%% author = "David Carlisle", +%%% version = "2.01", +%%% date = "16 June 1992", +%%% time = "18:30:53 BST", +%%% filename = "pspicture.sty", +%%% address = "Computer Science Department +%%% Manchester University +%%% Oxford Road +%%% Manchester +%%% England +%%% M13 9PL", +%%% telephone = "+44 61 275 6139", +%%% FAX = "+44 61 275 6236", +%%% checksum = "56975 755 2882 22245", +%%% email = "carlisle@cs.man.ac.uk (Internet)", +%%% codetable = "ISO/ASCII", +%%% keywords = "LaTeX, pictures, PostScript", +%%% supported = "yes", +%%% docstring = " +%%% +%%% pspicture.sty +%%% +%%% A LaTeX style option that reimplements most of the picture +%%% environment commands to use PostScript \special's, rather than +%%% the line and circle fonts. This allows lines to have arbitrary +%%% slope and thickness, and circles to be any size. +%%% +%%% The checksum field above was produced by +%%% Robert Solovay's checksum utility.", +%%% } +%%% ==================================================================== + + + +/!BP{ + 72 72.27 div dup scale + }def +/!A{ + newpath + 0 0 moveto + dup neg dup .4 mul rlineto + .8 mul 0 exch rlineto + closepath + fill + } def +/!V{ + !BP + /!X exch def + /!y exch def + /!x exch def + newpath + 0 0 moveto + !x 0 eq {0 !y 0 lt {!X neg}{!X} ifelse} + {!x 0 lt {!X neg}{!X}ifelse !X !y mul !x abs div} ifelse + lineto + setlinewidth % @wholewidth + currentpoint + stroke + translate + !y !x atan + rotate + !A % @arrowlength + }def +/!L{ + !BP + /!X exch def + /!y exch def + /!x exch def + newpath + 0 0 moveto + !x 0 eq {0 !y 0 lt {!X neg}{!X} ifelse} + {!x 0 lt {!X neg}{!X}ifelse !X !y mul !x abs div} ifelse + lineto + setlinewidth % @wholewidth + stroke + }def +/!C{ + !BP + 0 0 3 2 roll + 2 div 0 360 arc + setlinewidth % @wholewidth + stroke + }def +/!D{ + !BP + 0 0 3 2 roll + 2 div 0 360 arc fill + }def +/!O{ + !BP + /!y exch 2 div def + /!x exch 2 div def + /!r exch !x !y + 2 copy gt {exch} if pop + 2 copy gt {exch} if pop + def + setlinewidth % @wholewidth + 1 eq + {newpath + !x neg 0 moveto + !x neg !y 0 !y !r arcto 4 {pop} repeat + 0 !y lineto + stroke}if + 1 eq + {newpath + !x 0 moveto + !x !y 0 !y !r arcto 4 {pop} repeat + 0 !y lineto + stroke}if + 1 eq + {newpath + !x neg 0 moveto + !x neg !y neg 0 !y neg !r arcto 4 {pop} repeat + 0 !y neg lineto + stroke}if + 1 eq + {newpath + !x 0 moveto + !x !y neg 0 !y neg !r arcto 4 {pop} repeat + 0 !y neg lineto + stroke}if + }def +/!V2{ + !BP + 2 copy exch + atan + /a exch def + 2 copy + newpath + 0 0 moveto + lineto % <x*unitlength> <y*unitlength> + 3 2 roll + setlinewidth % @wholewidth + stroke + translate % <x*unitlength> <y*unitlength> + a rotate + !A % @arrowlength + }def +/!L2{ + !BP + newpath + 0 0 moveto + lineto % <x*unitlength> <y*unitlength> + setlinewidth % @wholewidth + stroke + }def +/!C2{ + !BP + /!s exch def + /!y exch def + /!x exch def + newpath + 0 0 moveto + 0 0 + !x 2 div !y 10 div !s mul add + !y 2 div !x 10 div !s mul sub + !x !y + curveto + setlinewidth % @wholewidth + stroke + }def +%% End of pspicture.ps + +%%EndProcSet +%%BeginProcSet: texps.pro +%! +TeXDict begin/rf{findfont dup length 1 add dict begin{1 index/FID ne 2 +index/UniqueID ne and{def}{pop pop}ifelse}forall[1 index 0 6 -1 roll +exec 0 exch 5 -1 roll VResolution Resolution div mul neg 0 0]/Metrics +exch def dict begin Encoding{exch dup type/integertype ne{pop pop 1 sub +dup 0 le{pop}{[}ifelse}{FontMatrix 0 get div Metrics 0 get div def} +ifelse}forall Metrics/Metrics currentdict end def[2 index currentdict +end definefont 3 -1 roll makefont/setfont cvx]cvx def}def/ObliqueSlant{ +dup sin S cos div neg}B/SlantFont{4 index mul add}def/ExtendFont{3 -1 +roll mul exch}def/ReEncodeFont{CharStrings rcheck{/Encoding false def +dup[exch{dup CharStrings exch known not{pop/.notdef/Encoding true def} +if}forall Encoding{]exch pop}{cleartomark}ifelse}if/Encoding exch def} +def end + +%%EndProcSet +%%BeginProcSet: special.pro +%! +TeXDict begin/SDict 200 dict N SDict begin/@SpecialDefaults{/hs 612 N +/vs 792 N/ho 0 N/vo 0 N/hsc 1 N/vsc 1 N/ang 0 N/CLIP 0 N/rwiSeen false N +/rhiSeen false N/letter{}N/note{}N/a4{}N/legal{}N}B/@scaleunit 100 N +/@hscale{@scaleunit div/hsc X}B/@vscale{@scaleunit div/vsc X}B/@hsize{ +/hs X/CLIP 1 N}B/@vsize{/vs X/CLIP 1 N}B/@clip{/CLIP 2 N}B/@hoffset{/ho +X}B/@voffset{/vo X}B/@angle{/ang X}B/@rwi{10 div/rwi X/rwiSeen true N}B +/@rhi{10 div/rhi X/rhiSeen true N}B/@llx{/llx X}B/@lly{/lly X}B/@urx{ +/urx X}B/@ury{/ury X}B/magscale true def end/@MacSetUp{userdict/md known +{userdict/md get type/dicttype eq{userdict begin md length 10 add md +maxlength ge{/md md dup length 20 add dict copy def}if end md begin +/letter{}N/note{}N/legal{}N/od{txpose 1 0 mtx defaultmatrix dtransform S +atan/pa X newpath clippath mark{transform{itransform moveto}}{transform{ +itransform lineto}}{6 -2 roll transform 6 -2 roll transform 6 -2 roll +transform{itransform 6 2 roll itransform 6 2 roll itransform 6 2 roll +curveto}}{{closepath}}pathforall newpath counttomark array astore/gc xdf +pop ct 39 0 put 10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack} +if}N/txpose{pxs pys scale ppr aload pop por{noflips{pop S neg S TR pop 1 +-1 scale}if xflip yflip and{pop S neg S TR 180 rotate 1 -1 scale ppr 3 +get ppr 1 get neg sub neg ppr 2 get ppr 0 get neg sub neg TR}if xflip +yflip not and{pop S neg S TR pop 180 rotate ppr 3 get ppr 1 get neg sub +neg 0 TR}if yflip xflip not and{ppr 1 get neg ppr 0 get neg TR}if}{ +noflips{TR pop pop 270 rotate 1 -1 scale}if xflip yflip and{TR pop pop +90 rotate 1 -1 scale ppr 3 get ppr 1 get neg sub neg ppr 2 get ppr 0 get +neg sub neg TR}if xflip yflip not and{TR pop pop 90 rotate ppr 3 get ppr +1 get neg sub neg 0 TR}if yflip xflip not and{TR pop pop 270 rotate ppr +2 get ppr 0 get neg sub neg 0 S TR}if}ifelse scaleby96{ppr aload pop 4 +-1 roll add 2 div 3 1 roll add 2 div 2 copy TR .96 dup scale neg S neg S +TR}if}N/cp{pop pop showpage pm restore}N end}if}if}N/normalscale{ +Resolution 72 div VResolution 72 div neg scale magscale{DVImag dup scale +}if 0 setgray}N/psfts{S 65781.76 div N}N/startTexFig{/psf$SavedState +save N userdict maxlength dict begin/magscale true def normalscale +currentpoint TR/psf$ury psfts/psf$urx psfts/psf$lly psfts/psf$llx psfts +/psf$y psfts/psf$x psfts currentpoint/psf$cy X/psf$cx X/psf$sx psf$x +psf$urx psf$llx sub div N/psf$sy psf$y psf$ury psf$lly sub div N psf$sx +psf$sy scale psf$cx psf$sx div psf$llx sub psf$cy psf$sy div psf$ury sub +TR/showpage{}N/erasepage{}N/copypage{}N/p 3 def @MacSetUp}N/doclip{ +psf$llx psf$lly psf$urx psf$ury currentpoint 6 2 roll newpath 4 copy 4 2 +roll moveto 6 -1 roll S lineto S lineto S lineto closepath clip newpath +moveto}N/endTexFig{end psf$SavedState restore}N/@beginspecial{SDict +begin/SpecialSave save N gsave normalscale currentpoint TR +@SpecialDefaults count/ocount X/dcount countdictstack N}N/@setspecial{ +CLIP 1 eq{newpath 0 0 moveto hs 0 rlineto 0 vs rlineto hs neg 0 rlineto +closepath clip}if ho vo TR hsc vsc scale ang rotate rwiSeen{rwi urx llx +sub div rhiSeen{rhi ury lly sub div}{dup}ifelse scale llx neg lly neg TR +}{rhiSeen{rhi ury lly sub div dup scale llx neg lly neg TR}if}ifelse +CLIP 2 eq{newpath llx lly moveto urx lly lineto urx ury lineto llx ury +lineto closepath clip}if/showpage{}N/erasepage{}N/copypage{}N newpath}N +/@endspecial{count ocount sub{pop}repeat countdictstack dcount sub{end} +repeat grestore SpecialSave restore end}N/@defspecial{SDict begin}N +/@fedspecial{end}B/li{lineto}B/rl{rlineto}B/rc{rcurveto}B/np{/SaveX +currentpoint/SaveY X N 1 setlinecap newpath}N/st{stroke SaveX SaveY +moveto}N/fil{fill SaveX SaveY moveto}N/ellipse{/endangle X/startangle X +/yrad X/xrad X/savematrix matrix currentmatrix N TR xrad yrad scale 0 0 +1 startangle endangle arc savematrix setmatrix}N end + +%%EndProcSet +%%BeginProcSet: color.pro +%! +TeXDict begin/setcmykcolor where{pop}{/setcmykcolor{dup 10 eq{pop +setrgbcolor}{1 sub 4 1 roll 3{3 index add neg dup 0 lt{pop 0}if 3 1 roll +}repeat setrgbcolor pop}ifelse}B}ifelse/TeXcolorcmyk{setcmykcolor}def +/TeXcolorrgb{setrgbcolor}def/TeXcolorgrey{setgray}def/TeXcolorgray{ +setgray}def/TeXcolorhsb{sethsbcolor}def/currentcmykcolor where{pop}{ +/currentcmykcolor{currentrgbcolor 10}B}ifelse/DC{exch dup userdict exch +known{pop pop}{X}ifelse}B/GreenYellow{0.15 0 0.69 0 setcmykcolor}DC +/Yellow{0 0 1 0 setcmykcolor}DC/Goldenrod{0 0.10 0.84 0 setcmykcolor}DC +/Dandelion{0 0.29 0.84 0 setcmykcolor}DC/Apricot{0 0.32 0.52 0 +setcmykcolor}DC/Peach{0 0.50 0.70 0 setcmykcolor}DC/Melon{0 0.46 0.50 0 +setcmykcolor}DC/YellowOrange{0 0.42 1 0 setcmykcolor}DC/Orange{0 0.61 +0.87 0 setcmykcolor}DC/BurntOrange{0 0.51 1 0 setcmykcolor}DC +/Bittersweet{0 0.75 1 0.24 setcmykcolor}DC/RedOrange{0 0.77 0.87 0 +setcmykcolor}DC/Mahogany{0 0.85 0.87 0.35 setcmykcolor}DC/Maroon{0 0.87 +0.68 0.32 setcmykcolor}DC/BrickRed{0 0.89 0.94 0.28 setcmykcolor}DC/Red{ +0 1 1 0 setcmykcolor}DC/OrangeRed{0 1 0.50 0 setcmykcolor}DC/RubineRed{ +0 1 0.13 0 setcmykcolor}DC/WildStrawberry{0 0.96 0.39 0 setcmykcolor}DC +/Salmon{0 0.53 0.38 0 setcmykcolor}DC/CarnationPink{0 0.63 0 0 +setcmykcolor}DC/Magenta{0 1 0 0 setcmykcolor}DC/VioletRed{0 0.81 0 0 +setcmykcolor}DC/Rhodamine{0 0.82 0 0 setcmykcolor}DC/Mulberry{0.34 0.90 +0 0.02 setcmykcolor}DC/RedViolet{0.07 0.90 0 0.34 setcmykcolor}DC +/Fuchsia{0.47 0.91 0 0.08 setcmykcolor}DC/Lavender{0 0.48 0 0 +setcmykcolor}DC/Thistle{0.12 0.59 0 0 setcmykcolor}DC/Orchid{0.32 0.64 0 +0 setcmykcolor}DC/DarkOrchid{0.40 0.80 0.20 0 setcmykcolor}DC/Purple{ +0.45 0.86 0 0 setcmykcolor}DC/Plum{0.50 1 0 0 setcmykcolor}DC/Violet{ +0.79 0.88 0 0 setcmykcolor}DC/RoyalPurple{0.75 0.90 0 0 setcmykcolor}DC +/BlueViolet{0.86 0.91 0 0.04 setcmykcolor}DC/Periwinkle{0.57 0.55 0 0 +setcmykcolor}DC/CadetBlue{0.62 0.57 0.23 0 setcmykcolor}DC +/CornflowerBlue{0.65 0.13 0 0 setcmykcolor}DC/MidnightBlue{0.98 0.13 0 +0.43 setcmykcolor}DC/NavyBlue{0.94 0.54 0 0 setcmykcolor}DC/RoyalBlue{1 +0.50 0 0 setcmykcolor}DC/Blue{1 1 0 0 setcmykcolor}DC/Cerulean{0.94 0.11 +0 0 setcmykcolor}DC/Cyan{1 0 0 0 setcmykcolor}DC/ProcessBlue{0.96 0 0 0 +setcmykcolor}DC/SkyBlue{0.62 0 0.12 0 setcmykcolor}DC/Turquoise{0.85 0 +0.20 0 setcmykcolor}DC/TealBlue{0.86 0 0.34 0.02 setcmykcolor}DC +/Aquamarine{0.82 0 0.30 0 setcmykcolor}DC/BlueGreen{0.85 0 0.33 0 +setcmykcolor}DC/Emerald{1 0 0.50 0 setcmykcolor}DC/JungleGreen{0.99 0 +0.52 0 setcmykcolor}DC/SeaGreen{0.69 0 0.50 0 setcmykcolor}DC/Green{1 0 +1 0 setcmykcolor}DC/ForestGreen{0.91 0 0.88 0.12 setcmykcolor}DC +/PineGreen{0.92 0 0.59 0.25 setcmykcolor}DC/LimeGreen{0.50 0 1 0 +setcmykcolor}DC/YellowGreen{0.44 0 0.74 0 setcmykcolor}DC/SpringGreen{ +0.26 0 0.76 0 setcmykcolor}DC/OliveGreen{0.64 0 0.95 0.40 setcmykcolor} +DC/RawSienna{0 0.72 1 0.45 setcmykcolor}DC/Sepia{0 0.83 1 0.70 +setcmykcolor}DC/Brown{0 0.81 1 0.60 setcmykcolor}DC/Tan{0.14 0.42 0.56 0 +setcmykcolor}DC/Gray{0 0 0 0.50 setcmykcolor}DC/Black{0 0 0 1 +setcmykcolor}DC/White{0 0 0 0 setcmykcolor}DC end + +%%EndProcSet +%%BeginFont: XYDASH10 +%!PS-AdobeFont-1.1: XYDASH10 001.104 +%%CreationDate: 1997 Jul 20 21:19:18 +%%RevisionDate: 1997 Aug 28 05:34:12 +%%RevisionDate: 1997 Sep 18 10:23:31 +% +% XYDASH10: line segments for Xy-pic at 10 point +% +% Original Metafont design Copyright (C) 1991-1997 Kristoffer H. Rose. +% PostScript adaptation Copyright (C) 1994-1997 Ross Moore. +% Hinting and ATM compatibility Copyright (C) 1997 Y&Y, Inc. +% +% This file is part of the Xy-pic macro package. +% Xy-pic Copyright (c) 1991-1997 Kristoffer H. Rose <krisrose@brics.dk> +% +% The Xy-pic macro package is free software; you can redistribute it +% and/or modify it under the terms of the GNU General Public License +% as published by the Free Software Foundation; either version 2 +% of the License, or (at your option) any later version. +% +% The Xy-pic macro package 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 macro package; if not, write to the +% Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +11 dict begin +/FontInfo 9 dict dup begin +/version (001.104) readonly def +/Notice (Copyright (C) 1996, 1997 Ross Moore and Y&Y, Inc.) readonly def +/FullName (XYDASH10) readonly def +/FamilyName (XYDASH) readonly def +/Weight (Medium) readonly def +/ItalicAngle 0 def +/isFixedPitch false def +/UnderlinePosition -300 def +/UnderlineThickness 150 def +end readonly def +/FontName /XYDASH10 def +/PaintType 0 def +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0] readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 0 /d0 put +dup 15 /d15 put +dup 26 /d26 put +dup 30 /d30 put +dup 32 /d32 put +dup 42 /d42 put +dup 43 /d43 put +dup 48 /d48 put +dup 56 /d56 put +dup 72 /d72 put +dup 77 /d77 put +dup 81 /d81 put +dup 86 /d86 put +dup 89 /d89 put +dup 92 /d92 put +dup 101 /d101 put +dup 105 /d105 put +dup 109 /d109 put +dup 113 /d113 put +dup 121 /d121 put +readonly def +/FontBBox{-40 -520 503 520}readonly def +/UniqueXX 5092844 def +currentdict end +currentfile eexec +80347982ab3942d930e069a70d0d48311d743b8793c40476b99911a1be6c93ca +a7ffc9533764a6a2a3ebcf0bebc6668e399d80ad8b0e5e21d556d8fa71b95a1e +01e6689c74f977a4bbec6795aec114d8507f237839f414ee4fbf8162c865260f +923a63721852c7bff69703f7e0ab99c3b85e83c62c13ea99442890e370376cce +7133ce8f3de2f4c1dc78fb55dff4eb737c195d266281adef5d56fbbc3b785b1b +59d6efeab3b93e713f4b9105cf1594c83472177c0f2b04c840760c92c094a0b9 +2a720e4c7b03708d225531ac69324547d65009965f1c52d2be3112c67b6002b1 +3d5f2c82505b7f0136cc926ff2bda0b53691b13e816817e913048ad033e0ff31 +9d18776c4be80936c7449f316ff7f9026e5eeb9984867fc558bb18773e9a5390 +d4490fb8e63a0ce175f52732043cba9d379d01ef25fc4be056d3206186b53195 +63ee3d03fa580efa0ad7d3162f77878d348a841432fabedfebc8559530f6cbc1 +59df0a77aacfa9f0974542a736680e064ac101c646442b0ca133c4701c206de9 +6b70d341f9558a800520c2d32be3628b6df05a19538ec2596d2334f05d54e742 +a1a18ebbc12f04c45b899f667d9e6f3a4eaa1854562506d0da4057c4bbfbbacc +c1c208cc47b76226ef6d4d3da7d976b7a21a2cc7aa7cf0602fbd2a46022f7894 +c0667e19a31cc10ca33811f882ca5cc140bd49eb62545ffe3f418e8cb9b223e3 +b2630b486a3b948c74751c414e84334424a1eee8f20b1bd4eab9a0e0545c9bf2 +f8cda548feb88b89e369f29f5318ee43b25672b275b05016b635dc656bca5b14 +a28e91c516e3f5e99609f5a37a696fbb39379b8374a044e2fe6d4a193d5360d4 +31229d74455ff8645ba7462da11460be68629c6a2b1b4b4f409c806cdaec4d3f +941ec5e5a1a6aaaf2c72de027d73b6d446b29f4a0504dfa9e100f273e0b8f54f +707a5a7e1e5f5f3734783960d641ff957f220cdff18bb2d536a406abc54e557f +a1e9728df44ca1a17c233e052e050fcd4d771fc5fa346a74e295d908bc3dc99e +e64a8d0b7ffcb84a8f8b6a51786f24df6085cf2da56608e86c6b39df0d4c5866 +6e4d7b60c5a6407b44d34dd7fd9af114afb31ab028bf8ed6a07dd09037f7cadd +339529e55526c4c196e9b0e7e268c935e83623c087c153d434bad3da2f2fd426 +7b33be987281555c23d0ca447a33897d82c9d3066e05afe9795ae24c40ce2379 +e14c079904d44bd1be50c040f453fabe66904b4964f61f2e43ff667defd4f8b7 +f061816ff08930a5a3c0b747ee1d18a97a19f090abd89e02eb3eb7f467716ea7 +8e5624873968610e0530390fab9d8814485699c5e2376e6aacd1fe4051998061 +047595230979f92343954c7ff9a1e662d43dd5a8659c425551a84307694b294a +91445d8aea7d71b12128bd82df1a9f2fd744714f683b5a7645a380852b76581a +e77886595e5f855cdb19218e9c5095a10e71acd8cea17f77afccede36945edc3 +f996b1dc1e7657cee3aa47ea01b9ae44f252d506ff7ba9651b987ada4f110b0b +00fc13e6e945efd844bb53836b22db686a5df40ef8b8f15cbed7b50c8ad90024 +a2d613c1d0308e4e103af318de0118d8583eed130c09a42cb1939bc951496aa4 +a164da9d791c2e99d4c6166c0b43fcf9018d756c7cfff5373d6d4b3f977757df +2f0c2f87cb8fb4b3fb8d2d446b1b4ca1a8acd35239427aa560f94aaf1354f2ed +9019cf6fcf1bc927476e7a8d42f52cef3d20c72dcdd7bdb6e8e3ad703cfb6516 +14fb4fdc152ac444c7efe600af70b126b818c9decb4ca1bdd9e8f111f6b0b0ea +7cd103ce2386462ad22e091dbe02f910afd288b46d9924258822b94701ff6135 +471358c85e6a908272fefa50ec89aa6c541e7d20dcbc33a723de8572ca0b6ad0 +5b095540af1096005df363c57bde09b8987df56f1007a4731c7729f35603120c +3a6303f80f9d43990b95dff374f10ee0aad0f3289eff0e7b2a1ca1cb0c07db21 +cba34e75abc11cd3bf9aac08657250c0fd176e20b0008717d0fa819cc2924531 +0e5b005050a3e3fbad5239a785a68483ec7f3e7104c962603112f8cf7590972c +a03032d53fe0ed16c345c30695b3a3da35e3f1171cea0faf4ef2311f25c57a5a +78d48a8d6242821f288eb618106b5beed3887831a98871239d46123cd5598cb2 +ef56346657202c6d44d9304c549328e9db0b3f13adf0df405fa968d1bd8874f3 +c1e39a1b32018782664b8aa5b673c8f389902349a43b194d54e25bebab783d47 +c4458ee1e53ff0e3e12ef58077e011e84eb915bf4c0b910935e2ebb955758f58 +9d4020863b12f6034d58e1ee64344508c95f53cc8b7f181e2a265f5c573d8253 +82c4bef5376dbe867d2c6fcd5541906df65cb7cd4c378e8770ecf0908421fb6e +77b6aa58797ff31ffee30ceb0cedbf967811856b76510f40d1349975db7f34a2 +9af2bfb9870ef73275c3ec94c439d9ea9e5bee35e9205171a891df8c0f0cc9a2 +d04b6c66255dec3d10a12c6cfddb8050ede66206a3f456903a01dffc14552cc4 +2c2df109deb7bd722f8fd601ffccb91b3f47ec9a42dd613c08a3ebb1dad2cc0d +1e755af0c9ab9e816e9ba650ba1ddb8bc6a83cd5c14b4375325dd841a45abd30 +aec06892a4e9bb7296f2e78f7ed78802c9e43d86cc7842a16c4f54af09c719c9 +395e9ae58dabdec2b183024d272112431142a5e8eb2b1aec94f7015c09ae965d +ae21b750a62c0e4f16f0d46abeaa1a80fb5d17125210f2003dfe4db399966779 +fdfa53883de81e92188f080269eba8c56649f04ec7dc2760ccc23abeebee22f7 +7ea11f1c16f2b06f74486ecd4663a1e7b11b23a344b4f2a3ca202a5f2980a09d +874a79cfcca3c775103628cd49863de9c8532293cddb1aab213a11166ce1ee9c +560b6188991b82fa98aef99fc445c3b5b823d33b1942f4b83035c73d6f4e31bd +6c7a5af56cd0cec6bb006e297a90d867a1ee9c81e315f57c58f703652e77260c +b6e25fb38f83150f00b8059305fbe346e8231337cc313d5e53c6ce42189849df +3f6f1b64aea5bf8f8ff220c37bed395bf05c2dd72a3ede1b337d5c340c305c62 +0c2646348db0794b89167fdbebe687edf37ade25a8a2c116e5c63e5f91306be6 +1b912fe548dd0c6dc377c5d28c83af504da8fd5d4e0b8d0b78628143d72f9042 +b5a69f0f16922d444578fa202be1b9644e089d41d1d52cfd62820cd421fb186e +21488e2806fb74a28244b414564cb469b00cf2d77d1688cd00bf89a647098ca9 +5721477da88537d82918df6d8d8a5c3fe592cc86456fad5ff0a7878c805c5088 +86a45800a29e8ebf0b89f64645b42b08a191830499b1663d4ae944a9ffe6d459 +a012177582143e4ca1d723e7549a1b05e9dd6c7e8df796535334f417e3e7da57 +b03ff6818f5f8b4fdb8a196640a2bcae6b7ceea81f4f8757eb101768ffd1a564 +bb47d1e7323995289aaa70ae84220e4aa605ba2ecbdae522f9c565a11942509d +cb51ba5c3565e2b0b8c81f7a22c8e74eb6fb33353e9ed713f9b78a988bae500d +b3fcb0c4d0fe01498a031a56bf67760f86fe8d8f38c73f27aac6b933eae324f6 +e1cf50d7422d5e95646d89ecbe1c9eb9e9479b77401f47898491441996061755 +9f2eb22819113b461c8b5fad8bc51eb5a613d54135b059af320149579ad13c70 +7606cb3067fb6de059583f0bceafefec2eb7a6ff3d9c9564af9c526bbed4cd5f +929b6f59ae1795bbcd7fdc6bc2e2135743b18b1aa7995dd37ce9e94307ea395b +ba195525900e0d0a44b687e227c96ffc00ddbd84d00dacfe10b286236dde6e08 +b9c4f25cff29d7142530dba1b569f47ff67d3a3b955933bb8b90dcfcbbb6c977 +21aa5d27876b0fd46525c151707cc0e17836ceb19a3dc07c9c490f24843d5ddc +1166c10570b4895b83dbdd5b84e815c2521a458c1da60195d91afe22a558d8e7 +d27cdcb3d9 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark + +%%EndFont +TeXDict begin 39158280 55380996 1000 720 720 (wtest.dvi) +@start +%DVIPSBitmapFont: Fa cmtt10 10.95 16 +/Fa 16 126 df<EA0FC0EA3FF0EA7FF8EAFFFCEA7FF8EA3FF0EA0FC00E076B8639>46 +D<903803FFF0013FEBFF8048B612F03A07FE001FFCD81FE0EB00FFD83F80EC3F80007FED +1FE012FF6DEC0FF06C5A001EC8FCC9FCEE1FE0A2EE3FC0EE7F80923801FE004B5AED0FF0 +ED3FC003FFC7FCEC03FCEC1FF0EC7FC0D901FEC8FCEB07F8EB3FE001FFC7EA07E0D803FC +EC0FF0EA0FF0003FB7FCB8FC003F16E02C217AA039>50 D<123C127EB4FC6C7E6C7E6C7E +6C7E6C7E6C7E6C7E6C7E6D7E6D7E6D7E6D7EA26D7E6D7E6D7E6D7E6E7E6E7E6E7E6E7E6E +7E6E7E6E7E6E7EA26F7E6F7E6F7E6F7E6F7E6F7E6F7E6F7EEE7F80EE3FC0EE1FE0EE0FF0 +EE07E0EE03C02C2B7AA539>92 D<90387FFFC00003B512FE000FECFFC03A1FF8003FF06C +48EB07F86C48EB01FEC97EA30207B5FC0107B6FC90B7FC0007EBFC00D81FFCC7FCEA3FC0 +485A48C8FCA36C6C5BD81FF8133F0007B81280C6DAFE3F13C0010FD9C007138032187A97 +39>97 D<91383FFFF00107B512FE013FECFF809026FFC00013C0D803FCC7EA7F80D807F0 +EC3F00D81FE091C7FC485A485AA248CAFCA46C7EA26C7E6C6CEC0FC0D807F0EC1FE0D803 +FCEC3FC03B00FFC001FF80013FB5EAFE00010714F0D9003F90C7FC2B18799739>99 +D<EC7FF80107B57E013F14F09039FFC007FCD803FCC77ED80FF0EC7F804848EC3FC04848 +EC1FE0485AEE0FF048C8FC90B7FCA217E0D87F80C9FCA26C7E6C6CEC07E0D807F0EC0FF0 +D803FEEC1FE03B00FFE001FF80013FB61200010314F8D9003F13802C187A9739>101 +D<91397FE003FE903B07FFFE3FFFC0013F90B612E0903BFF801FFC1FC03C01FE0007F80F +80D803F8D901FCC7FC00078148486D7EA46C6C495A00035DD801FEEB07F83A00FF801FE0 +4890B55AD803F749C8FC9038F07FE091CAFCA26C7E6CB612F0EEFFC0000716F8D81FE0C7 +EA0FFC48C9123F007EEE1F8048EE0FC0A3007EEE1F806C6CED7F00D80FF8EC07FC0003B7 +12F0C66C1580010702F8C7FC33247D9739>103 D<ED3F80EDFFE0A2ED7FC0ED1F0092C7 +FCA4013FB512C04914E07F90C7121FB3A8ED3FC0003FEC7F80D8FFC0EBFF00EC03FC6CB5 +12F0001F14C0000301FCC7FC232D7BA039>106 D<007FB57EB67E7EC7123FB3A9007FB7 +12E0B812F06C16E02C217AA039>108 D<ECFFF0011FEBFF80017F14E03A03FF801FFC3A +07FC0003FED81FF0903800FF804848EC7FC049143F4848EC1FE048C8EA0FF0A56D141F00 +7F16E06C6CEC3FC06D147FD81FF8903801FF80D807FC903803FE003A03FFC03FFCC66CB5 +12E0011F1480010001F0C7FC2C187A9739>111 D<D87FFFEBFFE0B5008713FE6C01BFEB +FFC03B007FFF001FF002F8EB03FC02E0EB00FE4A147F4A1580EF3FC0171F18E0A418C017 +3F6EEC7F806EECFF006E495A6EEB07F802FFEB3FF002BFB512C0028F49C7FC028013E092 +C9FCA9007FB57EB67E6C5C33247F9739>I<263FFFF0EB7FF0B539F807FFFE003F023F7F +D80007D9FF801380913AFBF8007F00DAFFE0131C038090C7FC92C9FC5C5CA25CAA003FB6 +12F0B77E003F5D31187D9739>114 D<90391FFFF07848B612FC120F393FF0001F48C712 +0700FE1403A26C6E5AD87FE090C8FC381FFFF00007EBFFF8C6ECFF80010314F090C7EA7F +FCED01FF003E9138007F80B4153F7F6D15006D147E01FCEB07FC90B612F0486C1480D878 +0701F8C7FC2918789739>I<3B3FFFF007FFFEB56C48EBFF80003F496CEBFE0028007F80 +007FC7FC90391FC001FC6D6C485A903903F80FE06D6C485A9026007F3FC8FCEC1FFEEC0F +F8EC03F0EC0FF8EC1FFEEC3F3F9138FC1FC0903901F807E0903907F003F890390FC001FC +90393F80007F49C76C7E277FFFE001B51280B5D8F80714C06CD9E001148032187D9739> +120 D<923803FFE0037F13F00203B512E0020F90C7FCEC1FE04A5AAD4A5AD90FFFC8FC38 +7FFFFCB512E06C13FC38000FFF9038007F806E7EAD6E7E6EB4FC0203EBFFE0DA007F13F0 +030313E02C2B7AA539>123 D<EA3FFCB512E06C13FC38000FFF9038007F806E7EAD6E7E +6EB4FC0203EBFFE0DA007F13F00203B512E0020F90C7FCEC1FE04A5AAD4A5AD90FFFC8FC +387FFFFCB512E0D83FFCC9FC2C2B7AA539>125 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fb cmss10 10.95 5 +/Fb 5 119 df<B46CDB0FFEEE1FC01D3F6C6C4B6CEE7F806C6C4B1800726C5D6C6CDB7F +3F5E057E6D14016C6C9226FE1FE05D05FC16036C6C02016D6C4A5A6C6C03F85F04036D6C +140F6C6CDA07F05F726C141F6C6DD90FE05F4D6C6C143F6D6C011F6E4A5A013F4B6C93C7 +FC6E013F6E6C5B011F92C75D6E4991383FC0016D6C017E5F04FE91381FE0036D6C48485F +01034A6E6C485AECFE0301014A6E6C485ADAFF0715036D4A6F485A190191267F8FC06F48 +5A023F040091C8FCDBDF806F5A021F90C9EA7F7E03FFEE3FFE6E485F1A1F6E485F62267E +A567>87 D<EE3FC0AE903803FFC0013F13FE90B7FC1203000FEB0003D81FF8EB007FD83F +E0143F485A5B12FF90C8FCA56C7E7F6C6C147FD81FF814FFD80FFE13070003B7FC6C153F +D8003F13FC010713802A267CA538>100 D<EAFFC0A5C7FCA9EA7F80B3A60A2678A51B> +105 D<00FEEB7FF8010FB5FC013F14C090B612E03AFFF8003FF001E0EB0FF84913075B90 +C7FCB02518779738>110 D<B4ED07F86C6CEC0FF07F003FED1FE06C6CEC3FC06C6CEC7F +807F0007EDFF006C6C495A6C6C495A7F6C4A5A6D6C485AD93FC05B011F495AECE03FD90F +F05B010749C7FC903803F8FE14FC903801FDFC6DB45A6E5AA22D187E9732>118 +D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fc cmsy10 10.95 1 +/Fc 1 9 df<92380FFFF00203B612C0913A3FF01C0FFCDAFC00EB003FD907C0ED03E001 +1FC7EC00F80178171E01E01707D80380EF01C048C8ED00E0000E197048193848191CA248 +190EA2481907BCFCA200E0C8001CC81207A20070190EA26C191CA26C19386C19706C19E0 +6C6CEF01C0D800E0EF07000178171E011F17F8D907C0ED03E0D900FC033FC7FCDA3FF0EB +0FFC0203B612C0DA000F01F0C8FC48257A9F55>8 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fd cmmi10 10.95 2 +/Fd 2 84 df<023FB712F8F1FFC09126000FF8C7EA3FFCF103FF4B48020013C0F27FE04B +5A1BF04B5AA24B48EDFFE01BC04A90C84813804F13004A48ED0FF8F13FE04A48DA01FEC7 +FCF03FE04AB600F0C8FC03F8C712FE4A48EC1F80F00FE04A486E7E854A4881A24A48140F +A24990C8485AA24948153F1B18494818381B70010FDC0FFC13E0007FB60203EB0780B648 +9139003FFC004D257CA453>82 D<DC7FFE1306030FB5EAE01E923AFF8003F87CDA03F8C7 +EA3FFCDA0FC0EC07F8023FC81203027EED01F0495A494816E0A2010717C06E92C7FCA214 +FF6D13F86DEBFFF86DECFFF0023F14FE0207ECFFC0DA001F80DB003F7F9338007FF8EF0F +FC170717035A00075FA2484C5A4D5A484C5A6D4BC7FCD83FE015FC01F8EC07F0267C3FE0 +EB7FC0D87807B500FEC8FC26E0003F13C03F257AA443>I E +%EndDVIPSBitmapFont +/Fe 134[50 7[50 3[50 3[50 3[50 8[50 2[50 2[50 4[50 3[50 +4[50 15[39 7[26 4[19 17 9[2 1[2 3[8 10[25 14[48{}20 99.6264 +/XYDASH10 rf +%DVIPSBitmapFont: Ff cmr12 14.4 12 +/Ff 12 117 df<EC01F04A7EA24A7E6E5AAA007CEE07C0007F6D48131FD8FF80ED3FE001 +C0157F01F0EC01FF01F85CD87FFC4A13C0D81FFF021F130000070181EB3FFC000101C1EB +7FF026007FE1EBFFC090261FF9F390C7FC903907FCE7FC903901FEEFF09039007FFFC002 +1F90C8FCEC07FCA2EC1FFF027F13C0903901FEEFF0903907FCE7FC90391FF9F3FF90267F +E1F013C02601FFC1EB7FF000070181EB3FFC001F01016DB4FCD87FFC020713C0D8FFF86E +13E001F08001C0EC007F0180153FD87F00ED1FC0007C496C1307C792C7FCAA4A7E6E5AA2 +6E5A333E77EB46>42 D<153815F814011403140F143F14FF1307137FB6FC143F13F81380 +C7FCB3B3B3B3A34A7E4A7E0107EBFFC0007FB712FCA42E5F74DE46>49 +D<EC07FF027F13F049B512FC010714FF90261FF00F13C090263F000113F0017E6D6C7E01 +F8EC1FFE48486E7E48486E1380485A496E13C0000F6F13E048C8FC001E6F13F0003E17F8 +003C167FA2007C17FC0078163FA2EAFFC06D16FE6D151F7FA66C5A173FEA1FC00007C913 +FCCAFCA2177F18F8A2EFFFF0A218E05E18C05E18804C13004C5A5F161F5F4C5A4C5A4C5A +5F4B90C7FC4B5A4B5A5EED0FE04B5A4B5A4BC8FC15FE4A5A5D4A5A4A5A4A5A4A5A4AC812 +0E147E5C4A151C495A495A495A495A49C9123C013E1638133C4916785B484816F848B8FC +5A4817F05AA25A5AB9FC18E0A3375F79DE46>I<913803FFC0021F13F891B6FC902603FE +0113C0903A0FE0003FF049C76C7E013EEC0FFE01786E7E496E7F4848824848808448486E +7F13F813FE486C82A280177FA217FFA26C90C8FCA26C5AD800F85E90C9FCA24C5BA260A2 +4C5BA24C90C7FC5F4C5A5F4C5A4C5A4C5A4CC8FCED03FEEDFFF8027F13C05E16FC913800 +01FF9238003FC0EE1FF0EE0FFC707E706C7E707F84707F177F8484173F84A28483A21980 +A21203EA1FE0487E487E487EA519005B5F6C5A01C05E007CC9FC4D5A7E606C4C5A6C7E6D +4A5B6C6C4A5B6C6C4A5BD801FC4A90C7FC6CB44A5AD93FC0EB3FF8903A1FFC01FFF00107 +B612C0010192C8FCD9003F13F80203138039627ADE46>I<170F5FA25F5FA25FA25E5EA2 +5E5EA25E5E163B167B16F316E31501ED03C316831507ED0F03150E151E153C1538157815 +F015E0140115C0EC0380140715005C141E141C143C5C147014F0495A5C1303495A91C7FC +5B131E131C133C5B137013F05B485A12035B48C8FC5A120E121E5A123812785ABA12F8A4 +C9000790C7FCB14C7FA2047F13F092B712F8A43D607CDF46>I<EF03C04D7EA34D7EA34D +7EA34D7EA34D7EA394B5FCA24C8017E7A204038017C3A20407801781A2040F801700A24C +80041E137FA2043E80043C133FA24C80181FA24C8084A24B4881840303824C7FA2030782 +4C7FA2030F8293C8FCA24B82031E157FA2033E82033C153FA2037C820378151FA24B8285 +A24AB97EA34A8403C0C812030207844B81A2020F8492CAFCA24A84021E177FA2023E8402 +3C173FA2027C840278171FA202F8844A83A249488586130388010784496C85131F496C4D +7FD9FFFE4D7F00076D6C043F13FEB600F8031FB7FCA460667CE569>65 +D<B912FEF0FFE019FCF1FF80C66C01C0C700077F010F49020113F092C96C7E6DEF3FFE73 +7E737F737F85737F878587A2747EA3871A3FA61A7FA263A21AFF63A24F5B63614F5B4F5B +4F90C7FC4F5AF17FF84F5A060313C0061F90C8FC943803FFFC92B712E019FCF1FF8092C9 +13F0F13FFCF10FFE736C7E737F737F737F747E87747E1A1F87A2741380A21CC086A21CE0 +A91CC0A262A21C80621C006263505A1AFF4F5B4F5B4F5B4F5B49053F5B6FDBFFFEC7FC01 +7F6D02075BBB12F01AC04FC8FC19E0536279E163>I<DD3FFC15700407B512C0043F02F0 +14F04BB600FC130103079038F001FF031F90C7381FC003DB7FF8913807E007912601FFE0 +EC01F84A0180913800FC0F020F90C9EA3E1FDA1FFC161F4A48EE0FBF4A48EE07FF4A4882 +494982495B4990CBFC4948187F131F4948183F5C017F191F495A1B0F485B1B07485BA248 +1A035C5A1B014890CCFCA35A491900A3127F1C00A25BA212FFB0127FA27FA3123F1C70A2 +7F7EA36C7F1CF06C1BE0807E1B016C6D19C0A26C6D18031C806D6C1807013F1A006E606D +6C180E010F191E6D6C606D6D5F6D7F6D6D5F6E6C4C5A6E6C4C5A6E6C4C5A6EB4041FC7FC +02036D153E6E01E015FC9126007FF8EC03F0DB1FFFEC0FE0030701F0EBFF80030190B548 +C8FCDB003F14F8040714C09326003FFCC9FC546878E465>I<DA03FFEC0380023F13F091 +B500FE13070103ECFF8090260FFE00EBE00FD91FF090380FF01FD97FC0EB01F849C8EAFC +3F4848153E4848ED1F7F49ED0FFF0007824848814981001F82A24848167FA2007F173F5B +181FA200FF170FA418077FA36D1603A27F127F7F6D93C7FCA26C7E6D7E6C7F14F06C13FE +ECFFE06C14FE6CECFFE016FE6CEDFFC06C16F86D15FE011F816D16C0010382010082023F +81020381DA003F80030380ED003F04071480EE007F051F13C0837113E0837113F083A218 +7F19F800E0173FA2181FA4180F7EA47E19F0A27E181F6C18E0A26CEF3FC07F19806D167F +6DEEFF007F6D4B5A017E4B5A486C4B5AD91FC04A5A26FC0FF04A5AD903FEEC7FC029F800 +FFF003FFC7FC48013FB55A020F14F848010114E09126000FFEC8FC3D6878E44E>83 +D<EC1FFC91B512C0010714F090391FE00FFC90393F0001FF01FC6D7FD801F0EC7FE0496E +7E48486E7E486C140F01FC81486C6E7E7F707EA3707FA26C5AA2EA01F8C9FCA60303B5FC +92B6FC140F027F1381903901FFF00101071300EB1FFCEB7FF0EBFFC000035B4890C7FC48 +5A5B485A123F5B007F181C5BA212FF5BA25EA35E7F007F5D161E6C6C91391C7FC0386D14 +3C6C6C14786C6C903A01F03FE070D803FF903A03E01FF9F06C9026E01F80EBFFE029007F +FFFE000713C0010F01F86D1300010001C0EB00FC3E417ABF46>97 +D<D901F0EB7F80D807FF903801FFE0B5010713F892381F81FC92383E03FEED7C07000191 +38F00FFFEA007F90383FF1E090381FF3C0158014F792380007FEEE03FC02FFEB00F04A14 +00A35CA55CB3AF80133F90B57EB712E0A4303F7DBE37>114 D<1438A71478A414F8A313 +01A31303A21307130F131FA2137F13FF1203000F90B61280B8FCA326001FF8C8FCB3AE17 +E0AE6D6CEB01C0A3010714036E1480010314076E14006D6D5A6DEBC01E91383FF07C6EB4 +5A020713E09138007F802B597DD737>116 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fg cmti10 10.95 20 +/Fg 20 122 df<932607FFF013064BB6131E923B1FFE0007E07C912601FFC090380079FC +DA07FCC8EA1FF8DA3FE0150F02FFC9EA07F0D903FC1603D90FF817E0EB3FE04948EE01C0 +48484816034890CA1380484894C7FC485A485A485AA2485AA2485AA519E0007F4D5A4E5A +6C6C4CC7FC001F170E6C6C163CD807FC16F0D801FEED03C026007FC0023EC8FCD91FFEEB +07F00103B61280D9000F01E0C9FC472570A44E>67 D<932607FFE0130C4BB500FE133C92 +3B3FFE000FC0F8912601FF80EB00F3DA0FF8C8EA3FF0DA3FE0151F02FFC9EA0FE0D903FC +1607D90FF017C0EB3FE04948EE038048484816074848CA1300000795C7FC485A485A485A +A2485AA2485AA20403B612C0A293C7387FC000A2007F4D5AA26C6C4B90C7FC121F6C6C4B +5A6C6C1507D801FE4B5A26007FC0147DD91FFE903807E1F80103B6EA0078D9001F01E013 +30462570A454>71 D<023FB612C0609126001FF8C8FC5E4B5AA24B5AA24B5AA24A90C9FC +A24A5AA24A5AA24A5AA24A5AA24A5AA24A5A19704A4815E0F001C04990C8EA0380A24948 +ED0700181E4948153E6049484A5AEF0FF04948EB01FF007FB85AB95A3C2579A444>76 +D<90BA12E0A24890C7903880003FD803F0EF07C001C04990C7FC4848170348C748481580 +120E484A4814074819004B5A5A484A48140EC893C7FC4B5AA24B5AA24B5AA24A90CAFCA2 +4A5AA24A5AA24A5AA24A5AA24A5AA24A5AA2EB01FF007FB612FEA243256DA44E>84 +D<020FB500FE0107B512F04A4A5BDA000F90C8387FF0006F48037EC7FC6F6C15706F4B5A +71EB07806F6D010EC8FC706C1338043F14F09438F003C0706C48C9FC93380FFC1C187893 +3807FFE07013807090CAFC84707F4C7F160793381E3FF09338781FF8EEE00FDB03C07F92 +390F0007FE033C6D7E03707F4A4881DA07806D7F020EC86C7E143802F06F7ED907E06F7E +D97FF0ED7FFC007FB5020FB512FEB64A5C54257BA451>88 D<91381FF00F903A01F80E3F +80903907C003BF903A1F0001FF00017E7FD801F85C12034848495A485A4848495A123F48 +48495AA248C7485AA24891381FC010173892383F8070007E147F9238FF00E06C903903BF +01C0000FD90E1F13803B07C0780F87003A00FF8001FC2D18749738>97 +D<EC07FF91387C00F0D903E0131890391F8001FC90397E0007FE49EB0FFCD803F814F848 +48EB03E0484890C7FC485A123F485AA248C9FCA35A007E151816386C15E06CEC0380D807 +80EB1E003901E003F026003FFCC7FC2718749732>99 D<EF7F8093B51200A2EE00FEA24C +5AA24C5AA24C5AA24C5AA24C5AEC1FF0903A01F80E3F80903907C003BF90271F0001FFC7 +FC017E7FD801F85C12034848495A485A4848495A123F4848495AA248C7485AA24891381F +C01017384B485A007E147F4B485A6C903903BF01C0000FD90E1F5B2807C0780F87C7FC3A +00FF8001FC312674A538>I<EC0FFE903901F803C090390FC000E0013EC712F001FC1470 +D803F814F0EA0FF04848EB03C04848EB0F803A7F8001FC0090B512C048C9FCA25AA41630 +007E1570ED01C0001FEC07006C6C133C3903E007E026007FF8C7FC2418739732>I<EC7F +8090B5C8FCA2EB00FEA2495AA2495AA2495AA2495AA2495AED7FF090393F87803C91389C +003FD97F60EB1F804A14C049C7FC5B4848EC3F80A24848EC7F00A2484814FE4B5A485A4B +5A4848903807F0021707484890380FE00E92381FC00C48C7141CEE803800FE020F136092 +380781800078913801FE00302677A538>104 D<EC3F80ECFFC04913806D130091C7FCA8 +137F380383E0380603F0121C1238EA300738700FE012E0C6485A495AA249C7FC13FE485A +A23803F8023807F007140E380FE00CEBC01C5C14603807C1C0D800FEC7FC1A2476A321> +I<EB01FE3801FFFC5A380003F8A2EB07F0A2EB0FE0A2EB1FC0A2EB3F80A2EB7F00A213FE +A2485AA2485AA2485AA2485AA2485AA2485AA2387F004014E038FE01C0A238FC0380EB07 +00EA7C0E6C5AEA07F0172676A51C>108 D<D801FCD907FFEC7FF03E070F807C03E00780 +3C3E0C07C1C001F81C003F001C01E7C7D8FC60EB1F80003801FCDAFDC014C048484802FF +C7FC02E05C4848484948EC3F80120049484948EC7F00A249C7484814FE4F5A01FE4A5A4F +5A48484A48903807F0021B0748484A4890380FE00E96381FC00C48484AC7141CF2803848 +4802FE020F13609638078180D807800278913801FE005018769759>I<D801FCEB07FF3B +070F807803C0270C07C1C013F0001C9039E60001F8003801FC8038700FF05C484848495A +12004948495AA249C7485A4C5A13FE4C5A484891387F00201870484802FE13E04B4813C0 +484815019338F8038048480100EB0600EE7818D80780EC1FE0341876973D>I<913807FF +8091387E01F0903903E0007CD91F80131F017EC7138049EC0FC0EA03F8484815E0484814 +1F485A123F4848EC3FC0A248C8EA7F80170016FE484A5A007E4A5AED07E06C4A5A6C023F +C7FCD807C013F83901F00FC026003FFCC8FC2B18749738>I<02FEEB07FC903B0387C078 +0F80903B0603E1C003C0010ED9F70013F0011C01FCEB01F849485A4B14FC49485A13004A +481303A24A48EB07F8A24AC7EA0FF018E002FEEC1FC0EF3F804948EC7F00177E0103EC01 +F86EEB03E0D907F7EB0F809126F1C07EC7FC90390FE03FE092C9FC495AA2495AA249CAFC +A213FEA2387FFFFEB5FC36237F9738>I<D801FCEB1FF83A070F81E00F3B0C07C7001F80 +001C01ECEB7FC0003801F813FF48484814804AEB7E0048484890C7FC1200495AA249C9FC +A213FEA2485AA2485AA2485AA2485AA2EA07802A1876972E>114 +D<EC3FFC903901E003C0010FC71260011EEB01F0017CEB07F849EB0FF0ED07E0486C90C7 +FC6CB47EECFF806D13F0011F13FC010313FFD900031380EC007F151FEA3F80B46C140015 +1E90C75A00E05C0070EB01E0001F011FC7FC3801FFF0251877972D>I<D97F80130F2601 +81E0EB3FC0260601F0137F001C6D131FD83803140F00301507387007F048484814801200 +49481400495A49C7120EA201FE5C5E485A5E5E4B5A4B5A00000206C7FC017E131C011F13 +F0903803FF802A18769732>118 D<D97F8014F0260181E0EB03F8380601F0001C6DEB07 +F0EA38030030ED0FE0387007F0484848EB1FC012004948EB3F80495A49C7EA7F00A201FE +14FEA24848495AA24B5A5B4B5A6C6C130F017CEB3FE090381E01EF903903FF1FC090C7FC +4B5A4BC7FCD81F80137ED87FC05B00FF495A90388003E039FE000F800070013EC8FC381C +01F0D803FFC9FC2D23769735>121 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fh cmr10 10.95 59 +/Fh 59 122 df<EDFFFE91391FE003E0D901FCC71238D907F0EB01FCD91FE0EB07FE495A +49486D5AEE00F094C7FCA6B812FEA23A007F8000031601B2496C497E007FD9FF81B512FE +A237267EA53D>12 D<EA1F80EA7FE0EAFFF0A4EA7FE0A5EA3FC0A5EA1F80A5EA0F00A57E +C7FCA5EA1F80EA7FE0EAFFF0A2EA7FE0EA1F800C2677A51E>33 D<EA1F80EA7FE0EAFFF0 +13F8127FEA1F98EA0018A31330A2136013C0EA0180EA06005A12300D1177A51E>39 +D<1403140C143814E0EB03C0EB0780EB1E005B5B13F8485A485A1207485A5B121FA248C7 +FCA25A127EA312FEA9127EA3127F7EA26C7EA2120F7F6C7E12036C7E6C7E13787F7FEB07 +80EB03C0EB00E01438140C1403183775A82A>I<12C01230121C1207EA03C06C7EEA0078 +7F7F131FEB0F80EB07C014E0EB03F0130114F8A2EB00FCA214FE147EA3147FA9147EA314 +FE14FCA2EB01F8A214F01303EB07E014C0EB0F80EB1F00131E5B5BEA01E0485A48C7FC12 +1C123012C018377AA82A>I<EA1F80EA7FE0EAFFF013F8127FEA1F98EA0018A31330A213 +6013C0EA0180EA06005A12300D1177851E>44 D<B612F0A31C037F8D24>I<EA1F80EA7F +E0EAFFF0A2EA7FE0EA1F800C0677851E>I<140E147EEB07FEB5FC13FBEA0003B3A9497E +007FB612F8A2252376A237>49 D<903803FFF8017FEBFFC03A01F0007FF80007C7EA07FE +001C913801FF80486E13C0007FED7FE0D8FFC0EC3FF07FA26C5A000EC813E0C9127F17C0 +EEFF804B1300ED03FC4B5AED1FE0ED3F8003FCC7FCEC03F0EC07C0021EC8FC1478EB01E0 +D907801470011EC812E01370EA01C048C8EA01C0000FB7FC123FB81280A22C237BA237> +I<913803FFE0023F13FE903A03FE001F80D90FE0EB03C0D93F80EB3FE001FEC7127F485A +D807F8EC3FC0484891C7FC485A123FA2485AEC1FFE00FF9038E007E001C3C712FC01CC14 +7F01D8EC1FC001F015E049EC0FF017F84915FC127FA36C7E17F8121F6C6CEC1FF0000716 +E06C6CEC3F80D800FEECFE0090393FC007F80107B512C09026007FFCC7FC2E237CA237> +54 D<ECFFFC010FEBFFC090397F800FF03A01FC0001FCD807F0EB007FD81FE0EC3F8000 +3FED1FC0484815E017F000FF150F17F8A317FC007F151F123F6C6C143F000F156FD803F8 +14CFC66CEB030F90381F801C902601FFE013F890C8FCEE1FF0A217E0EE3FC0D80FF0EC7F +80486C1500ED01FC49495A6CC7EA0FE0D803E001FFC7FCC6B512F8010F13802E237CA237 +>57 D<EA1F80EA7FE0EAFFF0A2EA7FE0EA1F80C7FCACEA1F80EA7FE0EAFFF0A2EA7FE0EA +1F800C1877971E>I<90381FFFE03901F0007F000FC7EA0FE00018EC07F80070EC03FCB4 +6C14FE7FA26C5AC8EA07FCED0FF8ED1FE0ED7F0015F8EC03E04A5A4AC7FC141E5C14385C +A791C8FCA5EB01F8EB07FE497EA26D5AEB01F827267AA534>63 D<160E161F4C7E4C7EA2 +4C7E4B7F4B7F169F9238070FFC030E7F92381E07FFED1C034B6C7F037080824B6D7E4A48 +6D7E0203814B131F4AC76C7E020E6E7E021E81021C80023FB77E4A8202F0C87F4A157F49 +486F7E494882181F49C96C7E010E707E013F832601FFC04B7FB500FE0207B612E0A24B25 +7DA452>65 D<B812FEEFFFF026003FF0C7EA0FFE011F923801FFC09438007FF0F01FF872 +7E851807A2180F614E5A4E5AF07FC04D48C7FCEF1FF891B7C8FC02F0C7EA0FF8943800FF +80F01FF0F00FFC727E727E7213801AC0A44E13801A00F00FFE4E5AF07FF0013F923807FF +C0B948C7FC18C042257CA44D>I<922607FFF814C04AB6EAC003021F90390001FC0FDAFF +E09038000F1FD903FEC8EA01FFD91FF0ED007FD97FC0163F4948160F000390CA12074848 +1703485A48481701485A007F95C7FCA25B12FFA5127F7FA2123F6C6CEF01C06C7E6C7E6C +6CEF0380C66DEE07006D6C160ED91FF8163CD903FE16F0902600FFE0EC07C0DA1FFF02FE +C7FC020190B512F0DA000701FCC8FC42257AA44F>I<B812FEEFFFF026003FF8C7EA0FFF +011F030013C0F01FF8F007FCF001FF9538007F80F13FE0F11FF01AF8190F1AFCF107FEA3 +1AFFA61AFEA2F10FFCA21AF8F11FF0F13FE0F17FC0F1FF00F003FEF00FF8F07FE0013FDB +0FFFC7FCB912F04DC8FC48257CA453>I<BA12F0A226003FF8C87F011F16071801180019 +7885191CA305707FA296C7FC17F01601160791B6FCA29138F80007160116001770F101C0 +A294C7EA0380A219071A00616161197EF003FE013F163FBA5AA242257CA44A>I<BA12E0 +A226003FF8C813F0011F160F18031801180019781938A30570131CA2190017F016011607 +91B6FCA29138F80007160116001770A394C8FCA9497EB712E0A23E257CA447>I<922607 +FFF814C04AB6EAC003021F90390001FC0FDAFFE09038000F1FD903FEC8EA01FFD91FF0ED +007FD97FC0163F4948160F000390CA120748481703485A48481701485A007F95C8FCA25B +12FFA5127F6D033FB61280A2003FDC0001EBE0006C6C705B6C7E6C7E6C7EC67FEB7FE0EB +1FF8D903FE5D902600FFE0EC07BF91261FFF80EBFE0F020190B5EAF003DA000749C7FC49 +257AA456>I<B7017FB61280A226003FFCC8D81FFEC7FC6D486F5AAE91B8FCA202F8C812 +0FAF496C4B7EB7017FB61280A249257CA452>I<B7FCA239003FFC006D5AB3AD497EB7FC +A220257DA427>I<B712E0A226003FFCCAFC6D5AB3A219E0A2F001C0A318031807F00F80 +181F187FEF01FF013F153FBA1200A23B257CA444>76 D<B500FC0507B512E06E5FD8003F +F28000D91DFF051D90C7FC011C6D16396E6C16716E6C16E1A26E6CED01C16E6CED03816E +6CED0701A26E6C150E6E6C151C6E6D1438A26F6C14706F6C14E06F6CEB01C06F6CEB0380 +A26F6CEB07006F6C130E6F6C5BA26F6D5A706C5A706C5AA293381FF1C093380FFB8070B4 +C7FC705A133E2601FFC06D484A7FB66C6C48010FB612E017705B257CA464>I<B500FC92 +B612808026001FFF0301EBC000011D01C0DA003EC7FC011C6D151CEC3FF0EC1FFC6E7EEC +03FF6E13C06E7FED3FF0ED1FFC6F7EED03FF6F13C06F7FEE3FF0EE1FFC707EEE03FF7013 +C07013E0EF3FF0EF1FFCEF0FFEEF03FF7113DC7113FC183F181F180F1803013E16012601 +FFC01500B66C153C191C49257CA452>I<92380FFFF0913A03FC003FC0DA3F80EB01FCD9 +01FCC8EA3F80D907F0ED0FE0D93FC0ED03FC49486F7E4848CAEAFF804848EF7FC04848EF +3FE04848EF1FF04848EF0FF8003F19FC007F19FE491707A200FF19FFA66C6CEF0FFEA200 +3F19FC6C6CEF1FF8A26C6CEF3FF0D803FEEF7FC06C6CEFFF806C6C6C923801FE00D93FE0 +ED07FCD90FF8ED1FF0D901FEED7F809026003FC0D903FCC7FCDA03FCEB3FC09127000FFF +F0C8FC48257AA455>I<B812FCEFFFE026003FF8C7EA1FFE011F923801FF809438007FE0 +F01FF019F8F00FFC19FEA419FCF01FF8F03FF0F07FC0943801FF00EF1FF891B7128002F8 +CAFCAF497EB7FCA23F257CA44A>I<B812E0EFFF8026003FF8C7EA7FF0011FED07FE9438 +00FF80F07FE0727E727E85A4614E5AF07FC04D48C8FCEF07F8EFFF8091B600E0C9FC9139 +F80001FE9338003FE0EF0FF8EF07FE717E717FA485A31B40716D13E0187F496C92393FF0 +01C0B7913907FC07009538007FF84B257CA450>82 D<902601FFF81318013F9038FF8078 +3B01FE0007F0F8D807F0EB007FD80F80140F003FC81203007E1501160000FE167817387E +6D1500EA7FE013FC383FFFF0000FEBFFF00003ECFFE0C615FE011FECFF80010115E090C7 +14F0030113FC9238000FFE1603EE01FF00408100E0167FA27E177E6C16FC00FEED01F86C +6CEC03F001F0EC0FC026F87FC0EBFF00D8F00FB512F826C0003F138030257AA43D>I<00 +3FBA12F0A29026F0000390C7123F48C7EE03F8007C180000781978A200701938A348191C +A3C81700B3A34B7F0103B8FCA246257CA44F>I<B791B61280A226003FFCC80001EBC000 +6D48DB003EC7FC191CB3A5010F5F8001075F6D6C5ED900FFED03C0DA3F804AC8FCDA0FF0 +143CDA03FFEB07F0DA007FB51280030101F8C9FC49257CA452>I<B600F84AB512F8A226 +007FFCC9380FFE006D48EE03E06D6C5F010F606D6C4CC7FC6D6C160E6F151E6D6D151C6D +5F6E6C5D6E6C5D6F14016E6C5D020F4B5A6E6C4AC8FC6E6C140E70131E6E6D131C6E5D6F +6C5B7013F06F6C5B031F495A6F6C485A6F6C48C9FC705A6F138E6F139C6F13F8705AA270 +5A705A705AA24D257EA452>I<B600F890B600F8010FB512E0A2C601F8C8D87FF8C8383F +F800D93FF06F48ED07C0726C6F5A6D6C704BC7FC6E030F5E010F4C6C150E6D6C705D6E03 +3B163C6D04716D14386D6D616F02E06D14F06D4B486C6C5C6E6C4E5A6F49486C6C130302 +3F4A486C6C5C6E6C4EC8FC6F010E6D6C5B020F4A6D6C130E6E6C606F496D6C133C6E4A6D +EB80386E01805F70486DEBC0F06ED9C1C06E6C5ADB7FE1EEE1C0DCF380EC3FF3DB3FF7C8 +381FFB806FB404FFC9FC4C816F486F5A03075F4C150303035F6F486F5A4C15006B257EA4 +70>I<B600FC92387FFFFEA2D8003F90C900071300D90FFEEE01F06D6C17C06D01C0ED07 +8001006D4BC7FC6E6C151C6E6C5DDA1FFE15F0DA07FF4A5A6E6D495A6E6D49C8FC6E01F0 +130E6F6C133CDB1FFC5B6F6C5B923907FF81C06FEBC380030001EFC9FCEE7FFE705A705A +AC4C7E92B7FCA24F257FA452>89 D<903807FFE090387C007ED803C0EB0FC0D807F0EB07 +F0D80FFC6D7E6F7E6C4880EA01E0C8FCA2EC1FFF90380FFC01EBFF00EA07F8EA1FE0485A +4848ED038048C7FCA215036C6C1306D81FC09039187F0700D807F89038E03FFE3B003FFF +0007F031187C9737>97 D<13FFB5FCA212017EAAEDFFF091390F001F800238EB03F002C0 +EB00FC4A147F91C8EA3F80EF1FC018E0EF0FF0A218F8A418F0A2EF1FE018C0EF3F806EEC +7E00496C14F8D9FC70EB07E0D9F80F013FC7FC9039F001FFF035267DA53D>I<EC7FFE90 +390FC003E0017EC7123CD801F814FED807F0EB03FF485A48486D5A003FEC0078484891C7 +FCA212FFA4127F7F123F6C6CEC0380000FED07006C6C140ED801F85CD8007E147090390F +C007C09026007FFCC7FC29187C9731>I<EE07F8ED07FFA2ED000F1607AAEC7FFC903907 +E007C7013FC7127701F8141FD803F0140FD80FE01407485A123F485AA212FFA4127FA26C +7E121F6C7E6C6C140FD801F8143FD8007EECE7FC903B0FC00787FFF89039007FF8073526 +7CA53D>I<ECFFF890390FC01FC090397E0003F0D801F8EB00FCD807F0147E4848804848 +1580123F4848EC1FC0A2B8FC0180C9FCA3127FA26C7E001FED01C06C6CEC0380D803F0EC +07006C6C140ED8003E1438903907E003C09026007FFCC7FC2A187D9731>I<EC0FFE9138 +FC03C0903903F01FE090390FE03FF0EB1FC090393F801FE0017F90C7FCA8B612F0A22600 +7F80C7FCB3497E007FEBFFE0A224267DA521>I<903A01FFE001FF903B1F807E1E0FC090 +39FC000FE0D803F8903907F0070048486D6CC7FC48486D7E001F81A4000F5D6C6C495A6C +6C495AC66CEB0FC027019F807EC8FC390301FFE048CBFCA37F13E06CB612E0C6EDFF806D +15E0D807E0C7EA1FF8001FC8EA01FC007EED007E4882A3007E167E6C5ED80FC0EC03F0D8 +01FCEC3F80D8001FB500F8C7FC32237D9737>I<13FFB5FCA212017EAAED3FFC913903C0 +1F8091390C000FE00230EB07F84A13034A805C91C7FCAE486D497EB60003B512FCA23626 +7CA53D>I<EA03FCEA0FFFA3EA03FCC8FCA713FFB5FCA212017EB1481380B512FEA21724 +7CA31F>I<EC7F80903801FFE0A39038007F8091C7FCA7EC1FE0EB3FFFA2EB007F141FB3 +A7003F14C039FFC03F801500387F807E383E01F03803FF801B2F85A321>I<13FFB5FCA2 +12017EAA0303B512C0A29239007FF000047EC7FC1670ED01C0030FC8FC153C15E0EC03F0 +EC0FF8EC79FEECE0FF9138807FC09039FE001FE06F7EED03FC6F7E6F7EEE3FC083486C15 +FCB5D8FE01B512F0A234267DA53A>I<13FFB5FCA212017EB3AD481380B6FCA218267CA5 +1F>I<D801FED93FFCECFFF000FF903C03C01F800F007E91280C000FE0306D7E00010130 +902607F8C0EB1FE0000049902603F980130F4A02FFC77F6D485C91C75BAE486D496C4A7E +B60003B5D8FC0FB512F0A254187C975B>I<D801FEEB3FFC00FF903903C01F8091390C00 +0FE000010130EB07F800004913034A806D5A91C7FCAE486D497EB60003B512FCA236187C +973D>I<EC7FFE90390FE007F0017EC7127ED801F8EC1F80D807F0EC0FE04848EC07F048 +48EC03F8003F16FC4848EC01FEA200FF16FFA5007F16FE6C6CEC03FC001F16F86C6CEC07 +F06C6CEC0FE0D801F8EC1F80D8007EEC7E0090390FE007F09026007FFEC7FC30187D9737 +>I<01FFEBFFF0B5390F003F800238EB07F0000101C0EB01FC6C496DB4FC91C8EA7F80EF +3FC0EF1FE018F0170F18F8A418F0171F18E0EF3FC0EF7F806EECFE006EEB01F80270EB07 +E0020F013FC7FC913801FFF091CAFCA8487FB6FCA235237D973D>I<D801FEEBFF8000FF +90380703E09138180FF800011330000090386007F09138C001C06D48C7FCA291C8FCAD48 +7FB612C0A225187D972B>114 D<90383FFE033907C003DF001EC7123F4880488000F880 +7EB4FCD87FF090C7FC383FFFF8000FEBFFC0000314F8C66C13FE9038003FFF0200138000 +E0EC1FC0150F6C14077E6C15806CEC0F006C141CD8F0F013F026C01FFFC7FC22187C972B +>I<EB0380A31307A2130FA2131F137F13FF0007EBFFFEB6FC26007F80C7FCACED0380A5 +133F9138C0070090380FE00E903803F0189038007FE021227EA12A>I<01FFEC03FCB5EB +03FFA20001EC00076C1503AD1607A26D140F161BD91F80EB63FE903B07E00383FFFC9039 +007FFC0336187C973D>I<B500FE90381FFFF8A20001018001011300D8007FEC00F86E5C +013F5D6D6C495A6D6C495A6D6C49C7FC6E5B0103140E6D6C5B6D6C5B6E6C5AEDC0F0023F +5B91381FE1C091380FF3806EB4C8FCA26E5A6E5A6E5AA235187E973A>I<B527FC3FFFFE +90B512C0A20001902780007FC090380FF8006C90C76C48EB03E06D6C6D6C1480836D6C4C +C7FC6D6C496C130E6E496C131E010F0273141C6D6CD9E1FC5B902803FC01C0FE5BA29028 +01FE03807F5B903C00FF07003F81C0038F14C3DA7F8E011F5BDA3FDCD90FE7C8FC03F86D +B4FC021F5D6E486D5A6E486D5AA26E486D5A4A187E974F>I<267FFFFE90387FFFF8A226 +007FF090380FFC00D91FE0EB07C0D907F849C7FC6D6C131C6DB413789039007F80E09138 +3FE3C0DA0FF7C8FCEC07FE14016E6C7E02037F9138079FF091381E07F891383C03FE9138 +F000FFD901C0EB7FC0D90780EB1FE0011FEC0FF8D801FF81B500F090B512FEA237187F97 +3A>I<B500FE90381FFFF8A20001018001011300D8007FEC00F86E5C013F5D6D6C495A6D +6C495A6D6C49C7FC6E5B0103140E6D6C5B6D6C5B6E6C5AEDC0F0023F5B91381FE1C09138 +0FF3806EB4C8FCA26E5A6E5A6E5AA25D5D4A5A4A5A1407007F49C9FC38FF800E143C387F +0070383C03C0D807FECAFC35237E973A>I E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fi cmr12 12 15 +/Fi 15 119 df<EA1F80EA7FE0EAFFF0A2EA7FE0EA1F800C06768521>46 +D<1710177C17F8A2EE01F0EE03E0EE07C0A2EE0F80EE1F00A2163E5E5EA24B5A4B5A4B5A +A24B5A4BC7FCA2153E5D5DA24A5A4A5AA24A5A4A5A4AC8FCA2143E5CA25C495A495AA249 +5A495AA249C9FC133E5BA25B485A485AA2485A485AA248CAFC123E5AA25A12202E3C7AAC +3B>I<EC3FFC903907E007E0013FC712FC01FC143F4848EC1F80D807F0EC0FE04848EC07 +F0491403001F16F8003F16FCA24848EC01FEA300FF16FFAB007F16FEA36C6CEC03FCA200 +1F16F86D1407000F16F06C6CEC0FE0D801F8EC1F806C6CEC3F00013F14FC903907E007E0 +9026007FFEC7FC30277BA63B>I<1407143F49B4FC90B5FCB6FC13011200B3AC497FB712 +FEA2272775A63B>I<903801FFF8011FEBFFE09039FC003FFCD803C0EB03FF000EC813C0 +48ED3FE048ED1FF0007416F8B46CEC0FFC13E0A26C5A001FC8FCC9EA1FF817F0163FEE7F +C01780923801FF00ED03FCED07F0ED0FC0033FC7FC15FCEC01F0EC07C0021FC8FC143C14 +F0D903C0141C010FC8FC011C15381370D801C015780007C912F048B7FC123FB812E0A22E +277AA63B>I<160F5E167F5E5D1507150E15385D15C0EC03804A5A141C5C14E0495A49C7 +FC130E5B13705BEA038048C8FC120E12385AB912F0A2C8000190C7FCA84B7F020FB612E0 +A234277DA63B>52 D<D80380EC01C001FEEC7F0090B612FE16F016C001BF01FCC7FC0180 +C9FCA9ECFFFC90399F0007E001E0EB01F80180EB007EC9EA3F80EE1FE017F0160F17F817 +FCA2121FEA7FC0487E4915F849141F0070C813F06CED3FE0003CED7FC0000FEDFF00D807 +C0EB03FCD800FCEB3FF0013FB51280010301F0C7FC2E277AA63B>I<121EEA1F8090B812 +C0A2481780EFFE00003CC9121C48167000705EEE0380484BC7FC160EC912385EED01C04B +5A4BC8FC151E5D5D5D14014A5A1407140F5D141F143FA24A5AA214FFA35BA6D9007EC9FC +32297AA83B>55 D<EC7FFE0107B512F090393F8003FE01F8C7EA3F80D803E0EC0FE04848 +EC03F0485A001FED01F8A27F6DEC03F0D80FFC15E001FFEC07C06C01E0EB1F00000101FC +133C3A007FFF81F0011F01FFC7FC01035B9039007FFFC0D903EF13F8D91F0113FF9026F8 +003F13C0D803E0010713F0D80FC0010013F848C8EA1FFC003EED03FE007EED00FF48167F +173FA2173E127E007F167C6C6C15F8D80FC0EC03E0D803F8EC0F803B00FF8001FE00011F +B512F0010049C7FC30277BA63B>I<EC7FFC0107B512E090393FC007F801FEC712FED803 +F8EC3F80D80FF0EC1FC04848EC0FE0003FED07F0484815F817FC12FFEE03FEA317FF007F +5DA26C6C5C120F6C6C141BD801F81463D8007E14C390390FC00F03902600FFF013FE91C7 +FCA2EE07FC17F8A2EE0FF0EE1FE0D80FF015C0486CEC7F0016FE49EB01F86CC7EA0FE0D8 +03E0EB7F80C6B500FCC7FC010F138030277BA63B>I<B600F8010FB66C010FB512E0A2C6 +01FCC8000F01C0C8387FF800D93FF0030390C9EA0FC06E716F5A011F7095C7FC6D6C6F6D +150E866D6C4B5F6D6C922603BFF05DA26D6D9126071FF85D6F91260E0FFC15F06D646E6C +4A6C6C4A5A6F023C6D1403023FDB38035E6E6C4A6C6D49C8FC6F02F06E5B020F4B6C150E +6E6C49486D6C5B6F836E4A48013F5C6E6D48C76C6C5B876ED9C00E020F5C6F6C486E6C48 +5AA26F6C486E6C485A70486E1387031F96C9FC6F6C486E13CE04FF17FE6F496F5A6F496F +5AA26F90C96C5A6F48705AA2047C705A0438705A73297EA878>87 +D<17FF4BB5FCA2ED00031600ACEC1FFF903903F800F0D91F80131C017EC71207D801F814 +01D807F080485A485A123F485AA212FFA5127F6C7EA26C7ED807F05C6C6C5CC66C140601 +1F023813C0902703F001E0EBFF809039003FFE00392A7CA941>100 +D<EA01FE3807FF80A3D801FEC7FCC9FCA9EB7F80B5FCA21201EA007FB3497EB61280A219 +287CA721>105 D<01FFEB0FFFB59038F007F09139030001FC0001010C6D7E26007F3014 +7F4A815CA25CAF496C4A7EB600C0B612C0A23A1A7C9941>110 D<B60103B51280A2C601 +C09039003FF0006D48EC1F806D6C020EC7FC6D6C5C6E143C6D6C5C010715706D6C5C6D6C +495A6E13036D01805B027F49C8FC91383FC00E6E6C5AEDF03C020F13386E6C5A6E6C5A6E +B45AA26E5B6FC9FC153EA2391A7E993E>118 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fj cmr17 17.28 12 +/Fj 12 119 df<BD12F8A2D8000F01C0C9003F7F6D4916006D190F1B031B001C7E1C3E1C +1EA21C0E1C0F88A4F40380191C99C7FCA4193CA219FC1801181F92B7FCA20380C7121F18 +011800193CA2191CA596CAFCAF497F4913F0B812C0A2593B78BA68>70 +D<B700C04AB76C030FB512FEA2C66C01C0CA0280CA6C13C0011F90CBD83FFECB380FFC00 +6D487248F003F06E73616D070F735A6D6D716C4E5A6F856D734FC7FC6D6D4D6D170E896E +6C050E616F4D6C6C173C023F20386E6C4D6C6C5F6F05786D17F0020FDE701F606E6C4D6C +6C4C5A700301806E4E6C4D5A6E6D4B486C6D4BC8FC8A6E6D4B486C170E70030E6D6D151E +037F1E1C6F6C4B6E6C5D70033C81031F0438023F5E6F6C4B6E6C5D7003F0816F4C020F4B +5A6F6D49486E6C4A5A8B6F6D49486E4BC9FC7149C86C6D5B6F1D0E706C010E6F6D5B7101 +1E83043F021C047F5C706C49706C5B077883706C0170041F5C706C49706C485A1FFF70D9 +81C070495ADEC3807013877099CAFC7001E7CA6C13CE06FF19EE71487113FC7148725AA2 +7148725A7148725AA27148725A4E18070503629F3B7EBAA4>87 D<913807FFE09139F800 +7F80D90780EB07F0011CC812FE0170ED7F80496F7E4848ED1FF0D803F86F7E48B415076E +81A26C90C8FC6C5ACAFCA2EE07FF92387FFE0791381FF80049B4C7FCEB1FF0EB7FC04848 +C8FCEA07FCEA1FF8485A4848180EA2485A170FA2171B6C6C15336C6CDBC1FE131CD80FF8 +91260180FF1338D803FE913A0E007F807026003FE001F090381FFFC00100B5C73803FE00 +472579A44F>97 D<F003FF051FB5FCA2EF000F180384B292381FFF80913907F8007C023F +C7EA0381D901F8EC00E1D90FE01519D93FC0150F49C97ED801FE82484882485A120F485A +123F127F5B12FFA7127F7F123F121F7F120F6C7ED801FE5E6C6C5ED93F80151DD90FE015 +31D903F0DA01C17FD9007EDA0F0113E0DA0FE001F8ECFFF09139003FFF004C3C7ABB58> +100 D<ED7FFF91391FC003F802FCC7EA3F80D903F0EC0FE0D91FC0EC03F8D97F80EC01FE +01FEC97E0003EF7F804848EE3FC0484817E0001FEF1FF0485AA2484817F8180F12FF90B9 +FC01E0CBFCA5127F7F123F121F7F000F1838D803FC17706C6C17E06C6CEE01C0D93F80ED +0380D90FE0ED0E00D903F81538D9007FEC03E0DA07F0017EC7FC9139003FFFC03D257BA4 +46>I<EB7F803801FFE0487FA26C5B38007F8090C8FCADEB3FF0B5FCA2C6FC133F131FB3 +ABEB7FFCB612FCA21E387AB72A>105 D<D93FF0903807FFF0B59138F800FF0303C7EA0F +E0D8007F010CEC07F8011F01306E7E010F01C06E7EDAF1808102F3C9FC02F68314FCA25C +B3A5D93FFE030313E0B7D8800FB612F8A24D257AA458>110 D<D97FE0EB3FF8B5903803 +C00F92390C007FC0C691393001FFE0013F13C090381FE18002E3C7EA7F8002E6EC1E0002 +EC91C7FCA214F8A35CB3A280EB7FFEB712C0A233257AA43D>114 +D<91B538C00380903A1F80003C07D801F0C7EA039FD80780EC007F001FC9123F003E161F +48160F170712FC6C16037E7FD87FF092C7FC6CB4FC000F13FE000390B57EC615FE011FEC +FFE0010015F8DA007F13FE9239003FFF80040113C000E09238003FE0EF0FF06CEE07F817 +036C16017E18F07E6CEE03E06D16C001E0ED0780D8FE30ED1E00D8F80E15F826F001F0EB +1FC028E0001FFFF0C7FC35257CA43E>I<1407A45CA35CA25C5C5C5B5B130F133F0003B7 +12FEB8FCD8000190C9FCB3EF01C0A86D16806F1303027F15006E6C5B6E6C130CDA07F05B +DA00FE13E0DB0FFFC7FC32357EB43D>I<D91FF84BB47EB5030FB5FCA2D8007FED000701 +1F1601010F82B3A360A260130718066D6C5D010116306D6C4B7FDA3F80D9038013F0DA07 +F8D93C00EBFFF89139003FFFC04D257AA458>I<B600F84AB512FCA2C649C9001F1380D9 +3FF8933807FC00011FEF03F06D6C17C00107606D6C4CC7FC6D6C160E6F151E6D6D151C02 +7F5E6E6C5D6E6C5D6F14016E6C5D02074B5A6E6C4AC8FC6E6C140E70131E6E6D131C037F +5C6F6C5B6F6C5BEEF801DB0FFC5B0307495A6F6C48C9FC923801FF0E179E6F13DCEE7FF8 +705A705AA2705A705A4E257EA453>I E +%EndDVIPSBitmapFont +end +%%EndProlog +%%BeginSetup +%%Feature: *Resolution 720dpi +TeXDict begin +%%PaperSize: A4 + +%%EndSetup +%%Page: 1 1 +1 0 bop Black Black Black Black 1 0 0 TeXcolorrgb 1 0 0 +TeXcolorrgb 1650 1125 1203 180 v 1 0 0 TeXcolorrgb Black +0 0 1 0 TeXcolorcmyk 1680 1095 a Fj(Windvi)55 b(F)-13 +b(eatures)p Black 1 0 0 TeXcolorrgb Black 1939 1398 a +Fi(Windvi)39 b(0.54)p 0 0 1 TeXcolorrgb 1959 1643 a(21/07/1998)p +Black 458 2061 a Fh(Man)m(y)c(of)i(these)e(examples)e(are)i(tak)m(en)g +(from)h(the)g Fg(L)-6 b(aT)e(eX)40 b(Gr)-6 b(aphics)39 +b(Comp)-6 b(anion)p Fh(.)458 2197 y(First,)37 b(w)m(e)e(c)m(hec)m(k)f +(the)i(color)e(text)i(b)s(eha)m(vior:)p 0 1 0 TeXcolorrgb +Black 0 1 0 TeXcolorrgb 458 2452 a(green)e(text)p Black +1 0 0 TeXcolorrgb 458 2587 a(red)h(text)p Black 0 0 1 0 +TeXcolorcmyk 458 2723 a(y)m(ello)m(w)f(text)p Black 0 1 0 0 +TeXcolorcmyk 458 2858 a(magen)m(ta)h(text)p Black 1 0 0 0 +TeXcolorcmyk 458 2994 a(cy)m(an)g(text)p Black 628 3249 +a(This)g(is)g(the)h(default)f(text.)p Black 2224 6783 +a(1)p Black eop +%%Page: 2 2 +2 1 bop Black Black 458 658 a Fh(Next,)36 b(some)g(P)m(ostScript)e +(inclusions)e(:)628 1413 y(left)p 783 1413 110 4 v 891 +693 728 4 v 891 1413 4 720 v 112 w @beginspecial 100 +@llx 100 @lly 172 @urx 172 @ury 720 @rwi @setspecial +%%BeginDocument: wsample.ps +%! A small Encapsulated Postscript image used in the examples +%%BoundingBox: 100 100 172 172 +100 100 translate + 0 0 moveto + 72 72 rlineto + 72 neg 0 rlineto + 72 72 neg rlineto +stroke + 0 0 moveto +/Times-Roman findfont + 72 scalefont + setfont +(W) show + +%%EndDocument + @endspecial 1615 1413 V 891 1417 728 4 v 1619 1413 110 +4 v 833 w(righ)m(t)628 2248 y(left)p 819 2248 V 928 1448 +308 4 v 928 2248 4 801 v 149 w @beginspecial 120 @llx +120 @lly 150 @urx 200 @ury 300 @rwi @setspecial +%%BeginDocument: wsample.ps +%! A small Encapsulated Postscript image used in the examples +%%BoundingBox: 100 100 172 172 +100 100 translate + 0 0 moveto + 72 72 rlineto + 72 neg 0 rlineto + 72 72 neg rlineto +stroke + 0 0 moveto +/Times-Roman findfont + 72 scalefont + setfont +(W) show + +%%EndDocument + @endspecial 1232 2248 V 928 2252 308 4 v 1236 2248 110 +4 v 413 w(righ)m(t)144 b(left)p 1909 2248 V 2018 1448 +308 4 v 2018 2248 4 801 v 149 w @beginspecial 120 @llx +120 @lly 150 @urx 200 @ury 300 @rwi @clip @setspecial +%%BeginDocument: wsample.ps +%! A small Encapsulated Postscript image used in the examples +%%BoundingBox: 100 100 172 172 +100 100 translate + 0 0 moveto + 72 72 rlineto + 72 neg 0 rlineto + 72 72 neg rlineto +stroke + 0 0 moveto +/Times-Roman findfont + 72 scalefont + setfont +(W) show + +%%EndDocument + @endspecial 2322 2248 V 2018 2252 308 4 v 2326 2248 +110 4 v 413 w(righ)m(t)628 3301 y(left)p 783 3301 V 891 +2283 1027 4 v 891 3301 4 1019 v 1404 3301 a + gsave currentpoint currentpoint translate 45 neg rotate neg exch neg +exch translate + 1404 3301 +a @beginspecial 100 @llx 100 @lly 172 @urx 172 @ury 720 +@rwi @setspecial +%%BeginDocument: wsample.ps +%! A small Encapsulated Postscript image used in the examples +%%BoundingBox: 100 100 172 172 +100 100 translate + 0 0 moveto + 72 72 rlineto + 72 neg 0 rlineto + 72 72 neg rlineto +stroke + 0 0 moveto +/Times-Roman findfont + 72 scalefont + setfont +(W) show + +%%EndDocument + @endspecial 2124 3301 a + currentpoint grestore moveto + 2124 3301 a 1913 3301 4 1019 +v 891 3305 1027 4 v 1917 3301 110 4 v -97 w Fh(righ)m(t)p +Black Black eop +%%Page: 3 3 +3 2 bop Black Black 458 658 a Fh(Y)-9 b(ou)36 b(can)f(include)d(the)k +(compressed)d(v)m(ersion)h(to)s(o:)628 1711 y(left)p +783 1711 110 4 v 891 693 1027 4 v 891 1711 4 1019 v 1404 +1711 a + gsave currentpoint currentpoint translate 45 neg rotate neg exch neg +exch translate + 1404 1711 a @beginspecial 100 @llx 100 @lly 172 +@urx 172 @ury 720 @rwi @setspecial +%%BeginDocument: ws_gzip.ps.gz +%! A small Encapsulated Postscript image used in the examples +%%BoundingBox: 100 100 172 172 +100 100 translate + 0 0 moveto + 72 72 rlineto + 72 neg 0 rlineto + 72 72 neg rlineto +stroke + 0 0 moveto +/Times-Roman findfont + 72 scalefont + setfont +(W) show + +%%EndDocument + @endspecial 2124 1711 a + currentpoint grestore moveto + 2124 1711 a 1913 1711 4 1019 +v 891 1715 1027 4 v 1917 1711 110 4 v -97 w Fh(righ)m(t)628 +1846 y(or)45 b(ev)m(en)f(some)h(ra)m(w)g(P)m(ostScript)f(co)s(de.)76 +b(The)44 b(follo)m(wing)e(\014gure,)47 b(Fig.)e(1,)j(is)e(an)458 +1982 y(example)39 b(of)j(ra)m(w)f(p)s(ostscript)f(b)s(eing)f(sen)m(t)j +(to)f(the)h(driv)m(er.)63 b(It)42 b(w)m(as)f(tak)m(en)g(from)g(the)458 +2117 y Fg(dvips)36 b Fh(man)m(ual.)p Black 458 3698 a +@beginspecial @setspecial + newpath 000 000 moveto 100 100 lineto 394 0 lineto closepath gsave +0.8 setgray fill grestore stroke + +@endspecial Black 839 4933 +a(Figure)f(1:)48 b(P)m(ostscript)35 b(co)s(de)g(directly)e(from)j(a)g +Fg(sp)-6 b(e)g(cial)37 b Fh(command.)p Black Black Black +Black eop +%%Page: 4 4 +4 3 bop Black Black 628 658 a Fh(A)36 b(TPiC)f(trial:)p +8 setlinewidth np 3196 1466 a 3184 1424 li st 8 setlinewidth +np 3184 1424 a 3175 1466 li st 8 setlinewidth np 3264 +1421 79 277.78 538.25 arc st 8 setlinewidth np 1886 1101 +a 1906 1136 li st 8 setlinewidth np 1906 1136 a 1905 +1096 li st 8 setlinewidth np 1976 1115 72 163.26 425.63 +arc st 8 setlinewidth np 1748 1224 a 1780 1216 li st +8 setlinewidth np 1780 1216 a 1748 1207 li st 8 setlinewidth +np 1783 1156 60 92.12 357.88 arc st 764 1288 a @beginspecial +@setspecial +1 1 1 1 0.79999 16383.18573 61.41437 23.48196 !O + +@endspecial 8 setlinewidth np 1925 1288 +98 0.00 360.00 arc st 8 setlinewidth np 2537 1288 98 +0.00 360.00 arc st 8 setlinewidth np 3149 1288 98 0.00 +360.00 arc st 8 setlinewidth np 3751 1288 98 0.00 360.00 +arc st 8 setlinewidth np 4354 1288 98 0.00 360.00 arc +st 8 setlinewidth np 1114 1288 a 1772 1288 li st 8 setlinewidth +np 1700 1306 a 1772 1288 li st 8 setlinewidth np 1772 +1288 a 1700 1270 li st 8 setlinewidth np 2086 1288 a +2384 1288 li st 8 setlinewidth np 2312 1306 a 2384 1288 +li st 8 setlinewidth np 2384 1288 a 2312 1270 li st 8 +setlinewidth np 2680 1288 a 2995 1288 li st 8 setlinewidth +np 2923 1306 a 2995 1288 li st 8 setlinewidth np 2995 +1288 a 2923 1270 li st 8 setlinewidth np 3292 1288 a +3598 1288 li st 8 setlinewidth np 3526 1306 a 3598 1288 +li st 8 setlinewidth np 3598 1288 a 3526 1270 li st 8 +setlinewidth np 3904 1288 a 4201 1288 li st 8 setlinewidth +np 4129 1306 a 4201 1288 li st 8 setlinewidth np 4201 +1288 a 4129 1270 li st 8 setlinewidth np 3103 1396 a +-180 134 rl -120 90 -269 142 -449 156 rc -179 14 -314 +0 -404 -45 rc -90 -44 -142 -88 -157 -133 rc 1888 1442 +li st 8 setlinewidth np 1928 1504 a 1888 1442 li st 8 +setlinewidth np 1888 1442 a 1894 1515 li st 8 setlinewidth +np 2518 1396 a -90 67 rl -60 45 -127 67 -202 67 rc -74 +0 -134 -22 -179 -67 rc 1978 1396 li st 8 setlinewidth +np 2042 1435 a 1978 1396 li st 8 setlinewidth np 1978 +1396 a 2016 1460 li st 8 setlinewidth np 2446 1388 a +-98 26 rl -66 18 -135 18 -207 0 rc 2032 1388 li st 8 +setlinewidth np 2106 1388 a 2032 1388 li st 8 setlinewidth +np 2032 1388 a 2098 1422 li st 8 setlinewidth np 3643 +1172 a -270 -90 rl -180 -60 -345 -60 -495 0 rc 2653 1172 +li st 8 setlinewidth np 2713 1128 a 2653 1172 li st 8 +setlinewidth np 2653 1172 a 2727 1162 li st 8 setlinewidth +np 3688 1126 a -184 -126 rl -123 -84 -325 -114 -607 -90 +rc -282 24 -490 79 -625 166 rc 2068 1208 li st 8 setlinewidth +np 2119 1153 a 2068 1208 li st 8 setlinewidth np 2068 +1208 a 2139 1183 li st 3967 1234 a Ff(C)3365 1252 y(B)3140 +856 y(B)2888 1036 y(A)3347 1558 y(A)2798 1540 y(C)2780 +1243 y(A)2447 1558 y(C)2222 1387 y(B)2186 1252 y(A)1961 +1009 y(C)1619 1126 y(B)629 1324 y(Start)974 b(1)524 b(2)560 +b(3)514 b(4)551 b(*)628 1928 y Fh(End)35 b(of)i(TPic)e(test.)1053 +2505 y @beginspecial @setspecial +0.39998 56.90521 !C + +@endspecial 1761 2505 +a + currentpoint currentpoint translate 1 2 scale neg exch neg exch translate + 1761 2505 a @beginspecial @setspecial +0.39998 56.90521 !C + +@endspecial +1761 2505 a + currentpoint currentpoint translate 1 1 div 1 2 div scale neg exch +neg exch translate + 1761 2505 a 1761 2505 a + currentpoint currentpoint translate 1 .5 scale neg exch neg exch translate + 1761 2505 a 0 setgray +@beginspecial @setspecial +0.39998 56.90521 !C + +@endspecial 1761 2505 a + currentpoint currentpoint translate 1 1 div 1 .5 div scale neg exch +neg exch translate + 1761 +2505 a 458 3207 a Fh(Here)27 b(the)g(text)h(should)e(b)s(e)h(rotated,)i +(but)e(giv)m(en)f(this)h(is)h(text,)h(and)e(that)h(this)g(material)458 +3343 y(is)36 b(not)g(pro)s(cessed)d(b)m(y)j(ghostscript,)e(the)i(text)g +(is)g(not)g(rotated.)p 628 3378 1426 4 v 628 4079 4 702 +v 632 3945 a + currentpoint currentpoint translate 1.36647 0.67609 scale neg exch +neg exch translate + 632 3945 a 869 3945 a + gsave currentpoint currentpoint translate 45 neg rotate neg exch neg +exch translate + 869 3945 a -261 x +Fh(TUG96)f(in)g(Russia)869 3819 y(TUG96)g(in)g(Russia)869 +3955 y(TUG96)g(in)g(Russia)869 4090 y(TUG96)g(in)g(Russia)869 +4226 y(TUG96)g(in)g(Russia)1719 3945 y + currentpoint grestore moveto + 1719 3945 a 632 +3945 a + currentpoint currentpoint translate 1 1.36647 div 1 0.67609 div scale +neg exch neg exch translate + 632 3945 a 2049 4079 4 702 v 628 4083 1426 4 v +Black Black eop +%%Page: 5 5 +5 4 bop Black Black 458 658 a Fh(The)36 b(W)-9 b(orld)34 +b(of)i(Color)f(\(I\))i(:)p Black 592 913 a(1.)p Black +0 1 0 0 TeXcolorcmyk 54 w(magen)m(ta)d(cm)m(yk)p Black +35 w(blac)m(k)p 0.5 TeXcolorgray Black 592 1138 a(2.)p +0.5 TeXcolorgray 0 0 1 TeXcolorrgb 54 w(prede\014ned)f(blue)p +0.5 TeXcolorgray 34 w(gra)m(y)i(text)p Black Black Black +eop +%%Page: 6 6 +6 5 bop Black Black 458 658 a Fh(The)36 b(W)-9 b(orld)34 +b(of)i(Color)f(\(I)s(I\))j(:)p 1 0 0 TeXcolorrgb 458 +717 1881 4 v 458 814 4 97 v 0 0 1 TeXcolorrgb 0 0 1 TeXcolorrgb +462 814 1873 97 v 0 0 1 TeXcolorrgb Black 462 793 a(Blac)m(k)d(text,)h +(blue)f(bac)m(kground,)d(red)j(frame)p 0 0 1 TeXcolorrgb +1 0 0 TeXcolorrgb 2334 814 4 97 v 458 818 1881 4 v Black +1 0 0 TeXcolorrgb 458 853 1909 4 v 458 950 4 97 v 0 0 1 +TeXcolorrgb 0 0 1 TeXcolorrgb 462 950 1901 97 v 0 0 1 +TeXcolorrgb Black 1 TeXcolorgray 462 929 a(White)h(text,)g(blue)f(bac)m +(kground,)d(red)j(frame)p Black 0 0 1 TeXcolorrgb 1 0 0 +TeXcolorrgb 2363 950 4 97 v 458 954 1909 4 v Black 1 0 0 +TeXcolorrgb 458 988 1901 4 v 458 1085 4 97 v 0 0 1 TeXcolorrgb +0 0 1 TeXcolorrgb 462 1085 1893 97 v 0 0 1 TeXcolorrgb +Black 0 1 0 TeXcolorrgb 462 1064 a(Green)g(text,)h(blue)e(bac)m +(kground,)f(red)i(frame)p Black 0 0 1 TeXcolorrgb 1 0 0 +TeXcolorrgb 2355 1085 4 97 v 458 1089 1901 4 v Black +0 0 1 0 TeXcolorcmyk 0 0 1 0 TeXcolorcmyk 628 1434 899 +276 v 0 0 1 0 TeXcolorcmyk Black 727 1334 a(F)-9 b(un)36 +b(with)f(color)p 0 0 1 0 TeXcolorcmyk Black 1 0 0 TeXcolorrgb +1744 1159 1018 60 v 1744 1434 60 276 v 0 0 1 0 TeXcolorcmyk +0 0 1 0 TeXcolorcmyk 1804 1434 899 276 v 0 0 1 0 TeXcolorcmyk +Black 475 w(F)-9 b(un)36 b(with)f(color)p 0 0 1 0 TeXcolorcmyk +1 0 0 TeXcolorrgb 2702 1434 60 276 v 1744 1494 1018 60 +v Black 0 1 0 TeXcolorrgb 0 1 0 TeXcolorrgb 628 1908 +899 276 v 0 1 0 TeXcolorrgb Black 727 1809 a(F)-9 b(un)36 +b(with)f(color)p 0 1 0 TeXcolorrgb Black 1 0 0 TeXcolorrgb +1744 1633 918 10 v 1744 1908 10 276 v 0 1 0 TeXcolorrgb +0 1 0 TeXcolorrgb 1754 1908 899 276 v 0 1 0 TeXcolorrgb +Black 425 w(F)-9 b(un)36 b(with)g(color)p 0 1 0 TeXcolorrgb +1 0 0 TeXcolorrgb 2652 1908 10 276 v 1744 1918 918 10 +v Black Black Black eop +%%Page: 7 7 +7 6 bop Black Black 1819 1563 a Fe(\\)1778 1559 y(\\)1737 +1555 y(\\)1696 1551 y(\\)1655 1547 y(\\)1614 1542 y(\\)1703 +1503 y(m)1658 1523 y(m)1614 1542 y(m)1749 1482 y(H)1789 +1510 y(H)1828 1539 y(H)1493 1456 y(H)1533 1485 y(H)1573 +1513 y(H)1493 1457 y(\\)1535 1461 y(\\)1576 1465 y(\\)1617 +1469 y(\\)1658 1474 y(\\)1699 1478 y(\\)1359 1517 y(\\)1400 +1521 y(\\)1441 1525 y(\\)1482 1530 y(\\)1523 1534 y(\\)1564 +1538 y(\\)1359 1517 y(m)1403 1497 y(m)1448 1477 y(m)1479 +1602 y(m)1524 1583 y(m)1568 1563 y(m)1438 1574 y(H)1399 +1545 y(H)1359 1517 y(H)1694 1599 y(H)1654 1571 y(H)1614 +1542 y(H)1684 1623 y(\\)1643 1619 y(\\)1602 1615 y(\\)1561 +1611 y(\\)1520 1607 y(\\)1479 1603 y(\\)1823 1588 y(m)1779 +1608 y(m)1734 1628 y(m)1820 1073 y(Y)1779 1065 y(Y)1737 +1057 y(Y)1696 1049 y(Y)1655 1040 y(Y)1614 1032 y(Y)1720 +972 y(q)1685 992 y(q)1649 1012 y(q)1614 1032 y(q)1763 +947 y(8)1788 979 y(8)1813 1012 y(8)1838 1044 y(8)1508 +896 y(8)1533 928 y(8)1558 961 y(8)1583 993 y(8)1508 897 +y(Y)1550 905 y(Y)1591 913 y(Y)1632 922 y(Y)1673 930 y(Y)1714 +938 y(Y)1359 982 y(Y)1400 990 y(Y)1441 998 y(Y)1482 1007 +y(Y)1524 1015 y(Y)1565 1023 y(Y)1359 981 y(q)1394 961 +y(q)1429 941 y(q)1465 921 y(q)1464 1117 y(q)1500 1097 +y(q)1535 1077 y(q)1570 1057 y(q)1433 1078 y(8)1408 1046 +y(8)1383 1013 y(8)1358 981 y(8)1689 1129 y(8)1664 1097 +y(8)1639 1064 y(8)1614 1032 y(8)1670 1158 y(Y)1629 1150 +y(Y)1588 1142 y(Y)1547 1134 y(Y)1505 1125 y(Y)1464 1117 +y(Y)1825 1108 y(q)1790 1128 y(q)1755 1148 y(q)1719 1168 +y(q)2458 1501 y(e)2416 1509 y(e)2375 1518 y(e)2334 1526 +y(e)2293 1534 y(e)2252 1542 y(e)2344 1570 y(V)2298 1556 +y(V)2252 1542 y(V)2392 1584 y(y)2430 1553 y(y)2468 1523 +y(y)2137 1635 y(y)2175 1604 y(y)2213 1574 y(y)2137 1634 +y(e)2178 1625 y(e)2220 1617 y(e)2261 1609 y(e)2302 1601 +y(e)2343 1592 y(e)1996 1593 y(e)2038 1585 y(e)2079 1577 +y(e)2120 1568 y(e)2161 1560 y(e)2203 1552 y(e)1996 1594 +y(V)2043 1607 y(V)2089 1621 y(V)2111 1502 y(V)2157 1515 +y(V)2204 1529 y(V)2072 1533 y(y)2034 1563 y(y)1996 1593 +y(y)2327 1482 y(y)2289 1512 y(y)2252 1542 y(y)2317 1460 +y(e)2276 1469 y(e)2234 1477 y(e)2193 1485 y(e)2152 1493 +y(e)2111 1502 y(e)2459 1478 y(V)2412 1464 y(V)2366 1451 +y(V)2459 970 y(i)2418 982 y(i)2376 995 y(i)2335 1007 +y(i)2293 1020 y(i)2252 1032 y(i)2375 1102 y(M)2334 1079 +y(M)2293 1055 y(M)2252 1032 y(M)2419 1127 y(\017)2441 +1084 y(\017)2462 1042 y(\017)2484 1000 y(\017)2164 1203 +y(\017)2185 1161 y(\017)2207 1119 y(\017)2229 1077 y(\017)2164 +1204 y(i)2205 1191 y(i)2247 1179 y(i)2288 1166 y(i)2330 +1154 y(i)2371 1141 y(i)1996 1109 y(i)2038 1097 y(i)2079 +1084 y(i)2121 1072 y(i)2162 1060 y(i)2204 1047 y(i)1996 +1109 y(M)2038 1132 y(M)2079 1155 y(M)2120 1179 y(M)2084 +938 y(M)2126 961 y(M)2167 985 y(M)2208 1008 y(M)2062 +982 y(\017)2040 1025 y(\017)2019 1067 y(\017)1997 1109 +y(\017)2317 906 y(\017)2295 948 y(\017)2274 990 y(\017)2252 +1032 y(\017)2292 876 y(i)2250 888 y(i)2209 901 y(i)2167 +913 y(i)2126 925 y(i)2084 938 y(i)2463 931 y(M)2422 908 +y(M)2381 885 y(M)2339 861 y(M)2762 777 y(0)2784 819 y(0)2807 +861 y(0)2829 903 y(0)2852 945 y(0)2874 987 y(0)2896 1028 +y(0)2919 1070 y(0)2941 1112 y(0)2964 1154 y(0)2986 1196 +y(0)3009 1238 y(0)3031 1280 y(0)3054 1322 y(0)3076 1364 +y(0)3098 1406 y(0)3121 1447 y(0)2762 777 y(+)2779 824 +y(+)2796 870 y(+)2813 917 y(+)2830 963 y(+)2847 1010 +y(+)2864 1056 y(+)2880 1103 y(+)2897 1149 y(+)2914 1196 +y(+)2931 1242 y(+)2948 1289 y(+)2965 1335 y(+)2982 1382 +y(+)2999 1428 y(Q)3032 1443 y(Q)3066 1457 y(Q)3099 1471 +y(Q)2760 827 y(\036)2759 873 y(\036)2758 920 y(\036)2757 +967 y(\036)2756 1013 y(\036)2754 1060 y(\036)2753 1107 +y(\036)2752 1153 y(\036)2751 1200 y(\036)2750 1246 y(\036)2749 +1293 y(\036)2747 1340 y(\036)2746 1386 y(\036)2745 1433 +y(\036)2744 1480 y(\036)2744 1479 y(e)2785 1471 y(e)2827 +1462 y(e)2868 1454 y(e)2909 1446 y(e)2950 1438 y(e)2754 +826 y(\032)2747 874 y(\032)2739 922 y(\032)2732 970 y(\032)2724 +1018 y(\032)2717 1066 y(\032)2709 1114 y(\032)2702 1162 +y(\032)2694 1210 y(\032)2687 1258 y(\032)2679 1306 y(\032)2672 +1354 y(\032)2664 1402 y(\032)2657 1450 y(\032)2649 1498 +y(\032)2642 1546 y(\032)2634 1593 y(\032)-8 b(\000)2659 +1567 y(\000)2684 1541 y(\000)2710 1515 y(\000)2762 777 +y( )2763 826 y( )2764 875 y( )2765 923 y( )2766 972 y( )2767 +1021 y( )2768 1070 y( )2769 1119 y( )2770 1167 y( )2771 +1216 y( )2772 1265 y( )2773 1314 y( )2774 1363 y( )2775 +1411 y( )2776 1460 y( )2776 1509 y( )2777 1558 y( )2778 +1607 y( )2734 1637 y(Q)2701 1622 y(Q)2667 1608 y(Q)2634 +1593 y(Q)2762 777 y(*)2777 823 y(*)2792 869 y(*)2807 +915 y(*)2822 961 y(*)2837 1007 y(*)2853 1053 y(*)2868 +1099 y(*)2883 1145 y(*)2898 1191 y(*)2913 1237 y(*)2928 +1283 y(*)2943 1328 y(*)2959 1374 y(*)2974 1420 y(*)2989 +1466 y(*)3004 1512 y(*)3019 1558 y(*)2986 1615 y(e)2944 +1623 y(e)2903 1632 y(e)2862 1640 y(e)2821 1648 y(e)2779 +1656 y(e)3110 1527 y(\000)3085 1553 y(\000)3060 1579 +y(\000)3034 1605 y(\000)p Black Black eop +%%Page: 8 8 +8 7 bop Black Black 458 658 a Fh(PST)-9 b(ric)m(ks)34 +b(\(I\))2314 826 y + tx@Dict begin tx@NodeDict begin {7.48248 3.71083 41.36009 20.68004 +3.30017 } false /N@T-0 16 {InitRnode } NewNode end end + 2314 826 a Fd(R)2397 863 y Fh(AMSU)1504 +1393 y + tx@Dict begin tx@NodeDict begin {7.48248 3.71083 51.92702 25.9635 +3.30017 } false /N@T-0-0 16 {InitRnode } NewNode end end + 1504 1393 a Fd(S)1571 1430 y Fh(Ra)m(wData)1763 +1360 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0 /N@T-0-0 InitNC { NCLine } if end gsave 0.8 SLW 0 +setgray 0 setlinecap stroke grestore grestore end + 1763 1360 a 2234 1393 a + tx@Dict begin tx@NodeDict begin {7.48248 3.8325 46.45201 23.226 3.30017 +} false /N@T-0-1 16 {InitRnode } NewNode end end + 2234 1393 a Fd(S)2301 +1431 y Fh(com)m(bine)2465 1360 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0 /N@T-0-1 InitNC { NCLine } if end gsave 0.8 SLW 0 +setgray 0 setlinecap stroke grestore grestore end + 2465 1360 a 2465 1360 +a + tx@Dict begin tx@NodeDict begin /t 0.5 def tx@NodeDict /HPutPos known +{ HPutPos } { CP /Y ED /X ED /NAngle 0 def /NCLW 0 def } ifelse /Sin +NAngle sin def /Cos NAngle cos def /s 5.0 NCLW add def /l 4.25835 def +/r 4.25835 def /h 3.08733 def /d 4.21268 def /flag false def HPutAdjust +LPutCoor end PutBegin end + 2465 1360 a 2423 1393 a Fc(\010)2465 1360 y + tx@Dict begin PutEnd end + 2465 1360 +a 2465 1360 a + tx@Dict begin tx@NodeDict begin /t 0.5 def tx@NodeDict /HPutPos known +{ HPutPos } { CP /Y ED /X ED /NAngle 0 def /NCLW 0 def } ifelse /Sin +NAngle sin def /Cos NAngle cos def /s 5.0 NCLW add def /l 4.25835 def +/r 4.25835 def /h 3.08733 def /d 4.21268 def /flag true def HPutAdjust +LPutCoor end PutBegin end + 2465 1360 a 2423 1393 a Fc(\010)2465 1360 +y + tx@Dict begin PutEnd end + 2465 1360 a 628 1960 a + tx@Dict begin tx@NodeDict begin {7.48248 3.8325 39.90009 19.95004 +3.30017 } false /N@T-0-1-0 16 {InitRnode } NewNode end end + 628 1960 a Fd(R)711 1998 y Fh(Mo)s(des)826 +1927 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0-1 /N@T-0-1-0 InitNC { NCLine } if end gsave 0.8 SLW +0 setgray 5.0 3.0 0 0 add DashLine grestore grestore end + 826 1927 a 1238 1960 a + tx@Dict begin tx@NodeDict begin {7.48248 3.8325 44.43217 22.21608 +3.30017 } false /N@T-0-1-1 16 {InitRnode } NewNode end end + 1238 1960 a Fd(R)1321 1998 +y Fh(Normal)1459 1927 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0-1 /N@T-0-1-1 InitNC { NCLine } if end gsave 0.8 SLW +0 setgray 5.0 3.0 0 0 add DashLine grestore grestore end + 1459 1927 a 1893 1960 a + tx@Dict begin tx@NodeDict begin {7.48248 3.8325 45.95299 22.97649 +3.30017 } false /N@T-0-1-2 16 {InitRnode } NewNode end end + 1893 +1960 a Fd(R)1976 1998 y Fh(V)-9 b(ertical)2122 1927 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0-1 /N@T-0-1-2 InitNC { NCLine } if end gsave 0.8 SLW +0 setgray 5.0 3.0 0 0 add DashLine grestore grestore end + +2122 1927 a 2563 1960 a + tx@Dict begin tx@NodeDict begin {7.48248 3.8325 46.98717 23.49358 +3.30017 } false /N@T-0-1-3 16 {InitRnode } NewNode end end + 2563 1960 a Fd(R)2646 1998 y +Fh(Latc)m(hed)2797 1927 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0-1 /N@T-0-1-3 InitNC { NCLine } if end gsave 0.8 SLW +0 setgray 5.0 3.0 0 0 add DashLine grestore grestore end + 2797 1927 a 3244 1960 a + tx@Dict begin tx@NodeDict begin {7.48248 5.96167 46.56133 23.28065 +3.30017 } false /N@T-0-1-4 16 {InitRnode } NewNode end end + 3244 +1960 a Fd(R)3327 1998 y Fh(T)g(ripp)s(ed)3476 1927 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0-1 /N@T-0-1-4 InitNC { NCLine } if end gsave 0.8 SLW +0 setgray 5.0 3.0 0 0 add DashLine grestore grestore end + +3476 1927 a 3921 1960 a + tx@Dict begin tx@NodeDict begin {7.48248 3.8325 36.82802 18.414 3.30017 +} false /N@T-0-1-5 16 {InitRnode } NewNode end end + 3921 1960 a Fd(R)4004 1998 y +Fh(Other)4104 1927 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0-1 /N@T-0-1-5 InitNC { NCLine } if end gsave 0.8 SLW +0 setgray 5.0 3.0 0 0 add DashLine grestore grestore end + 4104 1927 a 2909 1393 a + tx@Dict begin tx@NodeDict begin {7.48248 3.71083 74.08562 37.0428 +3.30017 } false /N@T-0-2 16 {InitRnode } NewNode end end + 2909 1393 +a Fd(S)2976 1430 y Fh(GenerateData)3278 1360 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0 /N@T-0-2 InitNC { NCLine } if end gsave 0.8 SLW 0 +setgray 0 setlinecap stroke grestore grestore end + 3278 1360 +a Black Black eop +%%Page: 9 9 +9 8 bop Black Black 458 658 a Fh(PST)-9 b(ric)m(ks)34 +b(\(I)s(I\))628 793 y(Here,)h(only)f(the)i(PS)g(dra)m(wing)e(is)h +(rotated,)h(not)g(the)g(text)g(:)669 5018 y + gsave currentpoint currentpoint translate 90 neg rotate neg exch neg +exch translate + 669 5018 +a 2429 5051 a + tx@Dict begin tx@NodeDict begin {7.48248 3.71083 41.36009 20.68004 +3.30017 } false /N@T-0 16 {InitRnode } NewNode end end + 2429 5051 a Fd(R)2512 5088 y Fh(AMSU)1618 +5618 y + tx@Dict begin tx@NodeDict begin {7.48248 3.71083 51.92702 25.9635 +3.30017 } false /N@T-0-0 16 {InitRnode } NewNode end end + 1618 5618 a Fd(S)1685 5655 y Fh(Ra)m(wData)1877 +5585 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0 /N@T-0-0 InitNC { NCLine } if end gsave 0.8 SLW 0 +setgray 0 setlinecap stroke grestore grestore end + 1877 5585 a 2348 5618 a + tx@Dict begin tx@NodeDict begin {7.48248 3.8325 46.45201 23.226 3.30017 +} false /N@T-0-1 16 {InitRnode } NewNode end end + 2348 5618 a Fd(S)2415 +5656 y Fh(com)m(bine)2580 5585 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0 /N@T-0-1 InitNC { NCLine } if end gsave 0.8 SLW 0 +setgray 0 setlinecap stroke grestore grestore end + 2580 5585 a 2580 5585 +a + tx@Dict begin tx@NodeDict begin /t 0.5 def tx@NodeDict /HPutPos known +{ HPutPos } { CP /Y ED /X ED /NAngle 0 def /NCLW 0 def } ifelse /Sin +NAngle sin def /Cos NAngle cos def /s 5.0 NCLW add def /l 4.25835 def +/r 4.25835 def /h 3.08733 def /d 4.21268 def /flag false def HPutAdjust +LPutCoor end PutBegin end + 2580 5585 a 2538 5618 a Fc(\010)2580 5585 y + tx@Dict begin PutEnd end + 2580 5585 +a 2580 5585 a + tx@Dict begin tx@NodeDict begin /t 0.5 def tx@NodeDict /HPutPos known +{ HPutPos } { CP /Y ED /X ED /NAngle 0 def /NCLW 0 def } ifelse /Sin +NAngle sin def /Cos NAngle cos def /s 5.0 NCLW add def /l 4.25835 def +/r 4.25835 def /h 3.08733 def /d 4.21268 def /flag true def HPutAdjust +LPutCoor end PutBegin end + 2580 5585 a 2538 5618 a Fc(\010)2580 5585 +y + tx@Dict begin PutEnd end + 2580 5585 a 742 6185 a + tx@Dict begin tx@NodeDict begin {7.48248 3.8325 39.90009 19.95004 +3.30017 } false /N@T-0-1-0 16 {InitRnode } NewNode end end + 742 6185 a Fd(R)825 6223 y Fh(Mo)s(des)941 +6152 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0-1 /N@T-0-1-0 InitNC { NCLine } if end gsave 0.8 SLW +0 setgray 5.0 3.0 0 0 add DashLine grestore grestore end + 941 6152 a 1352 6185 a + tx@Dict begin tx@NodeDict begin {7.48248 3.8325 44.43217 22.21608 +3.30017 } false /N@T-0-1-1 16 {InitRnode } NewNode end end + 1352 6185 a Fd(R)1435 6223 +y Fh(Normal)1573 6152 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0-1 /N@T-0-1-1 InitNC { NCLine } if end gsave 0.8 SLW +0 setgray 5.0 3.0 0 0 add DashLine grestore grestore end + 1573 6152 a 2007 6185 a + tx@Dict begin tx@NodeDict begin {7.48248 3.8325 45.95299 22.97649 +3.30017 } false /N@T-0-1-2 16 {InitRnode } NewNode end end + 2007 +6185 a Fd(R)2090 6223 y Fh(V)-9 b(ertical)2236 6152 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0-1 /N@T-0-1-2 InitNC { NCLine } if end gsave 0.8 SLW +0 setgray 5.0 3.0 0 0 add DashLine grestore grestore end + +2236 6152 a 2678 6185 a + tx@Dict begin tx@NodeDict begin {7.48248 3.8325 46.98717 23.49358 +3.30017 } false /N@T-0-1-3 16 {InitRnode } NewNode end end + 2678 6185 a Fd(R)2761 6223 y +Fh(Latc)m(hed)2912 6152 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0-1 /N@T-0-1-3 InitNC { NCLine } if end gsave 0.8 SLW +0 setgray 5.0 3.0 0 0 add DashLine grestore grestore end + 2912 6152 a 3359 6185 a + tx@Dict begin tx@NodeDict begin {7.48248 5.96167 46.56133 23.28065 +3.30017 } false /N@T-0-1-4 16 {InitRnode } NewNode end end + 3359 +6185 a Fd(R)3442 6223 y Fh(T)g(ripp)s(ed)3590 6152 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0-1 /N@T-0-1-4 InitNC { NCLine } if end gsave 0.8 SLW +0 setgray 5.0 3.0 0 0 add DashLine grestore grestore end + +3590 6152 a 4035 6185 a + tx@Dict begin tx@NodeDict begin {7.48248 3.8325 36.82802 18.414 3.30017 +} false /N@T-0-1-5 16 {InitRnode } NewNode end end + 4035 6185 a Fd(R)4118 6223 y +Fh(Other)4218 6152 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0-1 /N@T-0-1-5 InitNC { NCLine } if end gsave 0.8 SLW +0 setgray 5.0 3.0 0 0 add DashLine grestore grestore end + 4218 6152 a 3024 5618 a + tx@Dict begin tx@NodeDict begin {7.48248 3.71083 74.08562 37.0428 +3.30017 } false /N@T-0-2 16 {InitRnode } NewNode end end + 3024 5618 +a Fd(S)3091 5655 y Fh(GenerateData)3393 5585 y + tx@Dict begin gsave STV newpath 0.8 SLW 0 setgray /ArrowA { moveto +} def /ArrowB { } def /NCLW CLW def tx@NodeDict begin 0.0 0.0 neg 2.0 +2.0 0 0 /N@T-0 /N@T-0-2 InitNC { NCLine } if end gsave 0.8 SLW 0 +setgray 0 setlinecap stroke grestore grestore end + 3393 5585 +a 4863 5018 a + currentpoint grestore moveto + 4863 5018 a Black Black eop +%%Page: 10 10 +10 9 bop Black Black 628 658 a Fh(Something)31 b(that)k(is)f(higly)e +(desirable)e(:)48 b(b)s(eing)33 b(able)f(to)j(jump)f(to)g +Fg(any)45 b Fh(page,)33 b(and)458 793 y(b)s(e)41 b(placed)d(in)j(the)g +(correct)e(color)h(stac)m(k)g(state.)64 b(This)41 b(is)f(p)s(ossible)f +(b)s(ecause)g Fb(Windvi)458 929 y Fh(do)s(es)c(pre-scanning)e(of)j(all) +e(sp)s(ecials.)628 1064 y(What)i(will)e(happ)s(en)g(if)i(w)m(e)p +0 0 1 TeXcolorrgb 35 w(break)f(some)p Black 0 0 1 TeXcolorrgb +eop +%%Page: 11 11 +11 10 bop 0 0 1 TeXcolorrgb Black 0 0 1 TeXcolorrgb 628 +658 a Fh(page)34 b(across)h(color)f(text)i(?)p Black +48 w(Will)f(w)m(e)g(get)h(the)g(exp)s(ected)d(result)i(?)p +Black Black eop +%%Page: 12 12 +12 11 bop gsave 0 0 1 0 TeXcolorcmyk clippath fill grestore +Black Black 628 658 a Fh(T)-9 b(est)36 b(of)g(the)g(bac)m(kground)c +(for)k(the)p 1 0 0 TeXcolorrgb 36 w(windvi)d(program)p +Black(.)p Black Black eop +%%Page: 13 13 +13 12 bop gsave 0 0 1 0 TeXcolorcmyk clippath fill grestore +Black Black 628 658 a Fh(Is)36 b(the)g(bac)m(kground)c(restored)j(to)h +(white)f(?)628 793 y(I)g(hop)s(e)f(not)g(!)49 b(Because)33 +b(the)h Fa(\\pagecolor{})39 b Fh(command)32 b(is)j(stic)m(ky)e(through) +g(out)458 929 y(the)j(do)s(cumen)m(t.)p Black Black eop +%%Page: 14 14 +14 13 bop gsave 1 TeXcolorgray clippath fill grestore +Black Black Black 1685 2195 a @beginspecial 20 @llx 20 +@lly 572 @urx 822 @ury 1133 @rwi @setspecial +%%BeginDocument: jpeg2ps -r 0 -h fab.jpg +%!PS-Adobe-3.0 EPSF-3.0 +%%Creator: jpeg2ps V1.5 by Thomas Merz +%%Title: fab.jpg +%%CreationDate: Tue Jul 13 10:29:56 1999 +%%BoundingBox: 20 20 572 822 +%%DocumentData: Clean7Bit +%%LanguageLevel: 2 +%%EndComments +%%BeginProlog +%%EndProlog +%%Page: 1 1 +/languagelevel where {pop languagelevel 2 lt}{true} ifelse { + (JPEG file 'fab.jpg' needs PostScript Level 2!\n) dup print flush + /Helvetica findfont 20 scalefont setfont 100 100 moveto show showpage stop +} if +save +/RawData currentfile /ASCIIHexDecode filter def +/Data RawData << >> /DCTDecode filter def +20 20 translate +551.37 802.00 scale +/DeviceRGB setcolorspace +{ << /ImageType 1 + /Width 110 + /Height 160 + /ImageMatrix [ 110 0 0 -160 0 160 ] + /DataSource Data + /BitsPerComponent 8 + /Decode [0 1 0 1 0 1] + >> image + Data closefile + RawData flushfile + showpage + restore +} exec +FFD8FFE000104A46494600010102000000000000FFDB00430003020203020203 +03030304030304050805050404050A070706080C0A0C0C0B0A0B0B0D0E12100D +0E110E0B0B1016101113141515150C0F171816141812141514FFDB0043010304 +0405040509050509140D0B0D1414141414141414141414141414141414141414 +141414141414141414141414141414141414141414141414141414141414FFC0 +00110800A0006E03011100021101031101FFC4001E0000010403010101000000 +000000000000060507080900030402010AFFC4003E1000010302040404030604 +0407010000000102030405110006122107314151081322611471810915324291 +A152C1D1F02372B1E1161762748292C2F1FFC4001C0100010501010100000000 +000000000000050002030406070108FFC4003311000202010204030704030100 +030000000102000311042105123141132251061432617191A181B1C1D142E1F0 +230743F1FFDA000C03010002110311003F00B53C28A66145330A2998514E5A85 +5615259F3674B621B57B79921C084DFB5CED88DAC55386388A71D3B3750AB0E1 +6E056A9F35C06C511E521C23E80E10B10F431BCC222D778C191B2C85FDE99BA8 +D0D48BEA6D739BD62DCFD20DFF006C34DD5AF531F83E91BFAB78D6E0BD16688D +2B3BC60BBE9529B8CFAD09F9A8208B7BE22F7A4CE3788AB0FF00131C2C95C5DC +93C466D0BCB19AA935CD69D494429685AC8EFA6F7FDB130B51BA18CE610BB12C +74CC28A66145330A2998514CC28A661453E72C2E91467FC43789ACA7E1F32FAD +EABCAF3EB4FB4A543A5B1EA79D3636247E54DFA9FA5F00F59AFE4CD757C5FB49 +AA4E76F9094FFC68F10B9AF8C1587EA95F9F266A56A296D9F89506994DF925B4 +9D23F4C0441CC799C64C2FC898C0023631EA7320494C9875275A57E64ADD4DC5 +FAEF6187BA87D80C4F574C877C09D4F6755B89B3D3172DE04A9CD2D04691DD4A +17C3069D86E3F79210883689D2F35B8521319A4D858124955CF7BAAF7C48B513 +DE2039A29653CDF2038DFC3487A04964EB6DE6565B71A23AA48C4A00A8F9A44F +A64B063024DBF0BBF68F54B285629D96388B3DCAAD0D452C8A9BE4AE44604D82 +D440BAD23AF502F83546A171D7681AED3D941DB712CF69157855FA646A8D3653 +5360C96C3ACC861614871245C104731826082322440823227663D9ECCC28A661 +45330A29985146F78EFC5EA7704786D54CD1501E6A984688D1C1B17DE3F811F5 +3CFD81C0CD75DE1A7229C1324AD799809499C57E2D56B89F9BEA7986B75053B5 +09720BCEB6847A1B0792137DF4A46C05F60319A4A8A0E5249F9FAFCE14A6BE45 +0234D3F30175C52F50BEAB0EA08FAFFA1DB1716A18960B95D844A5C813377468 +08F55C1EDF3C4C1793E1EF232D99F66CE6A1D35CD094EB2764A91B0F7279F3C3 +ABACB36F3C2D0665D45F52C2838DAD26E411DBF9609254A063121F18AF439843 +96ABA5A714DBA34B853E9501CBDC7CF9606EAB4F9195E92DA585BA89B2A551F2 +1F6FCF68589D497077C2A6B207967AE108DE4A8F07FE3C2B9E1FEB5129324BD5 +BC9D21567A96A70028FF00AD852B642AFBD89D27DB98215B15EB01DF5721E649 +6FDC1CE38651E3B6566EBB94AA425C7BE97A3BA343F1D7FC2E20EE0FEC7A1C11 +5756E865756076EF0F70F8F998514CC28A7C51D2093C8618EDC83314A97FB453 +C4DBB9FB88EBCA94194E269196D6A41750A294B9286CB5743E92348E63D248E7 +8C8A33EB58EA3B1E9F4EC7F5EBFAE0F49734A55AB16750DD3E9DBEFD7E8467A4 +8192EAD2BCF5053BA977B12372A1EF7C5C14FCA5ECE7A44C9331C5A8A96E16D0 +4EFB2411FB62C0AC81D3F7919698C2CC8900A56556D82DC16481DF0D6000DC47 +80C7A4E6AB559A60069290BF9EF61DF13D5516DE78DE51BCFB1A4C5A93696951 +D8D4146EEA4292E11FADB6F97EB86B87AF70678006EA278A8B51E03C90CB9769 +47D2BFE03D4118757CD60F3758E002ED36C8A8B32A384387414D937E63E63AE2 +35AD91B224C6B389E5890EB372D865EBF5362156EE2FFD30F001233B4672EDD2 +3B7E1BFC47660F0F9C53A466AA617FE110EA1BA9416569299514A87988295733 +6B949E840C5F55E5DC1104EA29EEBD65F5F0A38B196F8D192A0E67CAF506E7D3 +A4A77D27D6D2FAA169E6950EA0E2C83912BAB7308638F63A6614523BF8E2E3AB +1C16E0A5552C4B2C661AC32B874F4A0D9409165B97E8129277EE47CC01E21A96 +522843B9EBF4FF00727A579DF6EDBFF5F9FE651BD46B299121DD4F79AB3CCA8F +337C5340FD610DFB4189B3F41BA480B3EA2398F7B6082298B360EA2277C7BCA5 +904950BEE4FF005C592A08DE4EA73D44EF4A9C521494EC9573B733F2C5538CE6 +4A40ED131D8322538A70B66C91CBA6DD062D8B154633213513B898DB0EC774E8 +46A49DBA8FA7CF08B061BC70AD87413DC8624A8EA536B2950DCA93CFFDF0D564 +1B6638D67AE273BB06432805285A85F716C48B6231DCCAEEB628F2CDAC797A82 +9D25ABEDE9B9513FBE1AD9C61779E7D62B52DF099016D35A92CFAFD491752473 +17B6220590E657B2A2FB032C77ECA6E2E8A0714AB1916438A6A0D763ADF8CD28 +DD2892D0D440F9A02CFD3176B627AC16E86B704F7DA5ACE2C492661452B5BED5 +FE24E5CA949A064E8CB6E4E62A7A1D9129C4907E150EA404A09BECA3606C4722 +0F5C66AD55BF52CCABD3627E63FACFDF32DE98EEC47C87DB3FDFDF23B4AD2814 +854E75A8B1CEA79D5696907652FBED8958F26E615AE967DC4EDA970CAA74C064 +3F4E3262E8D65D6AE5200E77208D27117BE29D9584B3EE8E7B4451932A939654 +8A53F1509504A1AD0A2A26D7DFAE24F7A45DB9B264A9A273DA1C640C80DCDAD4 +BA6CB8EA6E645590E0526E6D7EB7ED80DAED6595A864E866834BA245F8C49054 +4E0D52DD82754649241B829BEDEF8CF7BE5E5B26113A7ABB2CEFA6F870A53F39 +0E2A07E6B84802DF3C5D4D6DBDE4274C9D961E65FF000A140A8A8BB2A96DA90A +55FCB0926C6F898EB148D8EF3C3A42DD14432ABF84BC8D1E005AA9109A710825 +448D8EDCC83EF6C0EB388DB59DA2F7318C30917F8CBE1CA0D1E2AEA54F88A4AD +83A92DB6D94A6D7EA317F4BC51DB63DE07D56880DD448E0C476E32DE4A5012EE +A5252DDCEF73FD71A4F119B101B54778F570373AB3C35E35642CCB11D486D8A9 +C36DC748B59975C4B4F13F26D6B3F4C18A932013339AB42A0E7B7F1BCBED8EEA +5F61B7506E85A4281EE08C5E8D1B89B31E19ECA46FB42B3546CD1E25B387C2AF +CF662484450BD247ADA4250B17205ECA4A87D3AE32757300CC7604B11F4E638F +B8C421A2E71580E3B9F9EC49C7DC7FB8D57876CAD1F347129A69E3A531DB2A04 +8DD4797D37EB8A3C46E15D3E63B19B0D28071B49873B80D1259F898CCC56D481 +A96E38C82AF9F504FD3191362FFF005E61D181B72CF54CE01457A6466612DC2E +05F9AF4B5A826C39EEA57337EBB0C56176A036419313CC3188DE53386C9A6F1A +24BEDB8E3EC4F4BAA4EB209290E5B513EE3B6089BEC6AB948DF31FB67223E941 +CA2863D200BFBDBF7C56E66EFB4BE880F687943CA6A0BF5B685A750E56562317 +F6CC90A22F58794CA33909093A0247B8B624C13B894DEC43B2CF95C8F0E7321A +90D9524286C4F3F6386B862379E548C607664CA50EBB12A4DA186DB6F48B0527 +6201E5F2276C5155B11F6322BABDB7953FC76CA2AC81C4BAB420D910FCE2E35A +D3CC13B0C74BD03F8D40F598BD556A8E7783F4696ECFA67C3A5E287005A1B739 +942B9A4FED6C1B472BB4CFEA114FD27E827C3867E1C4FE0664ACCE10968D4298 +CBAA42557093A6C477E9D70481C881EACF2E0F68E41B91B6C7098123024B2903 +C7F70E2ABC38F107989153A844A8FDF2FBB5969C8CD16C36D3EEB852DA9249F5 +26C45C1B1E7B5F6CC57CDE6A9CE4A601F99E50723E5BC23A0B56F253BA10A7B6 +FCA0EDB9DB7837E0AA90F54B3B556A6956CC2420ED716270178D2E512B1F59B7 +D1A0CEF2C1696CE961205CFB81B5BDF19315BAF49A35543D62AB7F0C223AD865 +B7AFF8D0850055F3ED8B0871D449455593D60F7DC9424CB5C8F83F877C803520 +8DEDCAFB76C26BF1B6D2DA6947F8C50349842436FB528595F892AB9BFF00438A +CEC1BE232D2AB2ED88434C08608BACEDD6FF00B63C54A86E6476824748BCC661 +69B6BCAF3879BDD448FDF13175030A60C7D292DCC46D348754E7AFCE0A0773B9 +24FF00BE2AB358075CC90A85DB138AB124334F5ADE2942517515293D3DBDF036 +CB1B38208905B803695AFE333C8A86606A5148438EA5401EA0037BFED8DCF046 +7EBBCC76BBE291C72DBAA60C9B9F50F501D14472B5F6BE3795856333D7E48E92 +E57ECA5CD68AE786E7E962421D551EA8F47F293F89B41374DFE763822060404A +7CEC3FEDE4CF3CB1E364038924A94FB589A66A3C5E85323B692FD3698D3329C4 +2F50DD4A5252BD86955977B6F7046FD065130D6D8DDC9FC8007F18FF00B30C70 +FD338CBA8EA73F803F882DE02728A23E48A9D61CF4FC44C536164724A763CBDC +602F19726D1B769AFD20619CC907987354E82EAD3016A69A50B26E00BFB6320F +7907198692B67EF1A0AB711F315067BAE25D65C2157D1E704127A5C28E1B866F +F284174CE37CCDF45F10AAAC10DD420BF1966DEB3BA4FD7BFCB105953AFA112D +D65EB87C9CF6B9F446A5425A9C415841D42C6F7B6FEF88857839265B1666763F +C42954A871FE2BD017604EADBFFDC4C2DAC6C630B1EB35C4E254553A56FCF69A +6D3B9F308B8EFD6F7C5806AEB9903DB8EB0BF2FF001A32EBAE3319339725CBD9 +4EA6C40EE4E1C533F09955AE53B42FADCF8F5DA43BF0EF3525B282A494ABDB60 +47F238A1657606CCAAECA46D2B77C6734E53F34D363EA23FC23607A1ED8DE702 +04A1E61325C453241064763314DC77472D600494F4371BDFF9E35F4AF9C4CCDC +5954E659CFD8BF3642A3F13A3F94A44553B15CD412749584A873E57B13B60C60 +080F989B7F4966E70C7240C8934ADDF160B6B32E62E2854012B65942E1BCDAF4 +9D3E5B41049493B8BA4D88DC73B639A53A9B72DCFDD98FDC923F13A470DD31AF +4D587EB8CFE84923F060F7842A4A297C06A5BFA08129E7E57ABB29648BFB58E2 +8714BAC3614F4DBED09E96A1927D4C0FE2D3D99B3155FE069854CD354AD2B701 +D36F727ADBB0E7DFA628E968ADCE5C665CD43F86BE4EB184E2C655AE65CCDABA +452D87825010E479454EAD52EE3F094EE8363B91A536EF8D4574E9D53CC9F894 +F4F6EA0B6F3B852DCA0D504269C42D6A48BA51BA544F4BF2B8C03B139CE4CD31 +6C28CC961E13E8EFD72833A3556314A038A5210E732907AE07EA154F944A2F62 +A64C42F16C8391ABF4E871D2A024DC5AC4E8B7CB99EA0628D5A4058E4F497B4D +60BA9160EF22956D75694DCF9C92E18B11A53CEEB5A89D23A6C799E561FB634F +A5D2A1C28128EA754951C149E387FC64A732FA132680EFF82DEB5C98AF294529 +E6544137F99BE2E6A386B20CA907F4C4A496D77FC3B4959C31E2245AA2E34A84 +F075A3E9D27627A58F638CCDD4B0383B48AC460363190F1F340723AE8F9863B2 +A5452B0C9591B02524DB1ACE04149284F51333AFCF2E7D243A90E6B6A312B035 +120DCFF4FE78DBD3E57200996B89C7496E7F63255694EF09F3AD3E39B5599AA2 +1C94837BE8295683DB976FAE2F1F9C0E062C39EF2C48E237E926902FC52E4466 +3D6F88CC84A986EA118BED1D44025C6FD4A0799057ABEB7E56C72C7ADEBBAC5C +83863F6CE47E313A9F0722ED1A333648C83F2C741F6C7EF11BC3F505FA3F05F2 +94092C161E6E9B1C3CD38085215A06A0477BE20D51F12F76EC498468A48AC087 +73F28409519E64C56D697137F50BDCF4C44A817753892F8447511B5CE7935C62 +1D8CC790DA469421D7D4A03D929B9B63D0F7B1F8B693A582AED02B2E704E64B9 +CDD52A41D8F4FD576DA78695C83DC83D2F891DD40C1EB233635A7692038574C6 +A973A7961B096DA8E494E9BE28385691DBD94F73387C4E70BD9CF755954FF3BC +89D1528723CDB6CDBA500EFDC106C47627080A92C233D363FA47709BC3699588 +D8E7F790D3FE515632D57DF8353A62234A7D05A57949B21E42858D8725020EE3 +DF059359E18C24B9A944B37DA11503C38B298531BA453DF872E6B462A9E79D53 +8B0D916D080B4FA47CB131D5DD60FF00D3A4A14A555373622E64CF0E198F8715 +2459D6DD8CE0B80D5EE93EE7BE01EAEE361391BCB2FCAFD04F5E3568CB3C0960 +BE801C6EA0D0D8126C76FD77C5FE0A596F07EBFB401A9A39C15FA7EF21CE45E1 +7A2AD975EABC96BCE82D3BA7F1587A415117FA63A0D7ABB12CD8417A9E1F5A54 +4E65DBF838F0ED41F0FBC2B618A536E8A856B44FA838EAAF7708D92916164A41 +B0BEFEE70779CB004CC0607316F58FCE1A7A4748E5E2AB2A226BB066BC857C34 +F60D35D710827CA55C9428F71B9FD31CE38CD0F5EA0D8831CDFB8DBF6026E380 +5EBE1BD27A839FE0FDB68D9B122547A4B5F1AD86A583A1E1620150E76D86DDB1 +9E06DCEF36B530C6276D3EA721E425842410764A966F61D312786ED2D72E44ED +3476E1A44B7994C85821492EF2E7EFCF0E657419918AD58E3304733D69EFBCD9 +65C905E92537090B240FA62B273336F1E5028D843EE113294C89321F0032FA9A +65C56E0849705EE7A1B609AD6A7AC09AE0DD57A8048FAE0CD5C4E2ED2F3154DF +96A716842CEB71DFC41006CA27FCB6C0CB557C43B773FEE12E1C12CD2D6500C6 +3B7E7F3125FA2C1CED4861AA834898DD82A3BE002B6FB6E37C59AF024EF5F2EE +268A250A4D05419549742790246BC3EC398953B88BEE53D2B66EA5DD5A6E6C9B +0E5D303ACCE30278DF4916FC79D51707877061A5175BF27D294EE6E126DF5BF2 +C17E18ADCE39BA41FCAE72D89BBC377876FF008B328E4ECAAB48BCB71B935150 +4923CA1EA7813D0A901491D2EA18D8E9C35D6EC36999E2979A74DC87A9969916 +3A22466586C59B6901091EC0586350369829B71EC50278BF4A9353C9528C3A62 +AAD2E3AD0FB715B235A8050D5A6FCCE82AB0E6790C67B8BE9EDBAB06A5C907F5 +85F85EA469B52ACC70A720FF00DF5C48A8FBB3971419B47AAD1DE5282846A942 +7A3900A7F2EB48D407B723B639DDBE354DCAEB8FACE8D46A92EDEB6047CA6315 +14C55A494AB972388CDD91D44375389CB9A33BF914DBA52A1CC253DF151ED6EE +65B5E5198D8D473B0C9AAFBF6A301F94E3CA480508042124DF493D3F9E189A97 +070822F01DB71D212646F113166D39D619516A9AF3F7512749D605BD7B731873 +EBAD4F2B2C8FDCEA2FE2B2F986D3BF39F89BA03957522A84BAB7C240414F985C +1B245C0E8761F2C346A6CB58B049E53A64D2D62BAF61107867C4A6B2EE679B42 +6D6E08497966189608506AF709DFADB1712FC8E9892BA0B07298F8BB5C8B528C +8371BA4ABCC045EF8792CC36958506A39CC48935A5216101414DA8902E2C476D +FBE3C1593BB0956EB17A0817C4CCBB1B37A922A496C52E224B921D080E3C2DBA +5286FF0011528D86C3AE0C695133B488B9AEB9203C2864E112872F332E22E289 +A911A121D165A5849B926DB10A212411DB1BED0D7C89CDEB396F14D478F7903A +08FF00609C0D330A2998F08C88A321E275853745A34C48052DC85B4A04FF0012 +09FF00E71CF7DA055565661D8FEFFEE693835DC96327AEFF006FFF0064649756 +2D020A8A557EA39FE98E7AC55BE113A650C4888ADBE9A94E2ECA36851D572951 +B6B5F6B0C3AB0BDCC95ECC453CCF54CBB3E88FD3E4B299315F416DC65439FBEF +D47318215647C06475EAEC5385123BE63A240CB6EB0DC02B0C3EE84A50EA8A94 +07BDFDB12780EED96844EAB95725613F0DF22437330C5ADD5545C7187038D36B +04E950DC5C5B723171AB289E5C41CDAB67309B8B9424333919869EA52BC9B07D +206E072D7F2EF80AED6038388412C0EB91D610E51CE8A910E3D9EF41481CB61F +DF7C5AA9C8ED2A5B6377868C55D329B69095EAB2C6E4DEFBE082AD967419812C +BD01F39C42FE18526167BCF8FD1BEE49AECB8A4B1519AF30F34D36C7323CC290 +2EB02C92937DEE0DB7C69387686C6B073260403C4F88D62B2B53F98C983060C7 +A643662446511E3329086DA6D3A52948E400C6F800A30260BACDF8F62998514C +C28A339E242B743195514A95538CCD616F21E8D0D4B05C5EF626DD058AB73DAD +8C4F1F6ADEBC67CC0F4857863F2DFB7D0FCBBFF521DD414805494B89171E9B93 +BEDCB1C9ACF8BACEB1A41CC008D7664CE52E951511DA84E4B70004A11B1528FB +1B0E7EF825A7553DBEF0C2E99586E60B9E2B7DDC84A66D0EAD0C837066475A11 +FF00B8047B5F055B4F628E64C1FA1FE3ACB55F0F0DD0CD29E21D1AA85B972E34 +6986300E36B6E614F23F9B617FEF6C23EF2A318939E16CE3E2188A31F8D997E1 +AC7C5796C5F70634A4BB64FB8D8FD31EA2DE7AA13FA41B6F09753B18A54EE36E +5F9B350CC796CCD6D63438C6A16520EC410714F53A7B00CB2103E929A69DEB3B +4F7902721A8EFB6DAEEC30FADA656A3B100EDFB61D55796073D650D4B3264623 +DDC3B80ACE7986994A8E1C2E4D7131D7A372942B65A87F953A95F4C6E787E97A +60CC0713D530040961B163A62C669940012DA424585B90C6DC0C0C4CACDB8F62 +998514CC28A321E2578DEAE1A505C814C72D5779A2B53836F25163B83D147A76 +DCE3CF99E8266389F123559EED4F5EE7D3E529FF003C71AEB19973FD3EA0AA8C +8329539A750B538490BD62C493BABDEFCF01388AD2F4B2A81D216E0F4B7307F4 +929EB95154592E1372527723FD0E38F5CB52B6C2771D2B3728107A97995B6A7B +9252DDD69512091ABF6C4014E321B10CA06CE73333366113A32C10852D69B042 +CEC7DFE78B755D62EC0E66934FA8641868CAD7A0D1EA32097698B4B84D8A9B4A +493BF53B6F82F5EA9947497FC7A5BAF5841932914A6DC6DB894E43481B294EA1 +09D56EE06EA3F5B7B621D46A1D8679A09D45C46D59C438CC141CBB2E9A975A8A +84CB4A6DA9B1A4AADD6C0017C04F11DCE0181DF50F8F319A32FA98A741692848 +D0BF5587217E98B95A953924401AAB0B7787B9138D47877C49A3C7A52D891588 +C8F8879A72D60858B68573B15249DC72C74EE035597D1E2AF69C978EEA9749AA +15B1EBBCB29C959BA0E79CB50AB34F512C49405142ADA90AEA93EE31A9C11D65 +5AAC16A8611730A4B330A28D0F88BF12D963C3A65D8922AAEA26E60AA3A23522 +84DB9A5E9CE920763A509B82A59161B0DC900D7370368D3A6EE7F03D4FF1EBDB +A18335BAE4D1D6CC772A093F21EA7EB8DBD77F43887DC78CCEFE6F9754A94940 +42DE2A510D5F484DAC00279ED8B96546B4E53BCE5FA2D5FBC5E6DB4EE4E4FEA7 +F6F4903B81DC3393C44E33ADE94EAD14BA44CF885A00FC5A17E949F9DB188E31 +AFAF4741000CB6D3BE70DD32BA0F492E7880DBAC3AA79A04809B2D2ABDEDDFB1 +231CC17161E6137F43F26C202D39687DE5B8975684723622E13EF8215E992CF8 +8C2A2F603CB0EB29E59A6D71B5AA6484B09BDC249DFF006C111A2A9464349EBD +5DB99E6770528931CD4E549053CF4B6D90B3F4BF3F7C78C2B51B1968EAACC6C2 +7DA9709A35020B0FD366A9D42C5D6852C2B4DBA9EA3029D518EE6526D531D888 +273E9C2325DD6522FB585B63DBFBE78A86B00F96536B7313A8A83509AD44657B +9FC5A7F2FF002BE2C8F2FC4B04DD66FD221D6A8EED03C4E54901252CC9871A43 +5B6DA0A397BDBB63B1FB20EAFA5283D4ED3877B7AED55D55C076C493B3F8DD9D +3823C21A8666C9F22248934875A97269539BD71E6B05410E25447A9040515852 +083748BDC5C1D26A74CC879D41C407C178AF8C7C323071FB49A7C06E345138FD +C2EA1E74A12B4C6A8B095B9156A49723396F536BB120281F7C519B9ADF9C7CC7 +58E0E14967E7C73A71B33171CB8FF4ECED99E62DF972AA6C1698BDDB84C072E8 +61B03609483F53727724E2BF0BA8A5E18F73927D4FFDB0F4181D04C8719E43A4 +BF97BAB1FC7FC3F1D24D4ADAD354A7C846CA42D277E9CB1AAD4A649C62723D2B +721EB19AE00446F2B711737D3D612DBAF4812500ED7428DFB7BE3847B415B171 +CF8DB227D51C02FAEDD356C8720811DDCDACA1C86545295255BAB50BFD7193AE +B1EB89B9423D234158892A8AB79E8A0A926FA90A36DFA1BF7F9E2F8A7986C65C +4700F9A0E43E299A6C9F2D7A90B0ADC1569BFF00BE265D358067AC22BE138D8C +5C1C60F88AB34EB4EAD2CB6852B4AC93BF4C31A961B912421718067D99C6F60B +850DAD6E057A752B64DBDEFF00CF1E9D3D846CA204BFCA6275633CBF9974478A +54D8DB53F6B13F2B8FDF110A96AF3309403130EB8774944271A77469EBB8E679 +FEB885EC0FFE52375189D59E19454F8BF4C75290A5C2A7069C20FE1D6A4A937F +FC41C74EF62AB726C65E938A7FF235AA95D15FD61D66ED0384B9DE3A93A12E50 +27A6E3FED9C37001FAE3A0711D45B4A61672DE09614D42B01DE47FF079E20736 +70068D1DCA14D43F0644B2B7A933567E164A4EC791BA55BDC2C5EC45C850BA4E +33DFDBC5E533ABD1A8CB119C1FFBB4B5BE04F8A2C95C79A6BC29933EEACC10D3 +79F40A990D4C8DB8055A49F5A2E400B4DC6E3BE0CA58AE33986058BFE471280E +BCC3B96731A94D80865B5F9ACA827D2537D88F962B686F60C0C07704D4272E3A +CB06815544B6906E34389D40DF6B11718E8A6B475DC4E05CDCAD9CC6BF88B1E5 +659CC94FCD700287C2BA3E2D201FF123957A8D876DCE39E7B4FC2EBD4506C55D +C7FC3FA9D73D8CE2FEEF7FBAB3EC7A0F9C78E0CE66B9486DD43895871215CC7C +F7C70B7ACD27A19F46D167300440CCC908B3E62CD8DC5AC137E5DC61D5DE4741 +0AA8C88CF66CCBCC4C25E6015A169045D3622FD4E0BD3A87CEF2BB2E3A407934 +15B6484B6084FD36FEBED82A9616199E02DD2755172AA44942DF45BB5EE4620B +F5440C088D7CDB931D9C9D95590B6D4A45AFC8DB97E980565EBFE4233E1DA39A +2445CB90172A53A98F198495ADC51D92902E4E06874B1B0AB926517393D60DE4 +2724661AB4DAF4D6D4C39397A9283F89B6F92104F5B0C7D1FECB70FF0071D185 +2373BCF95BDB3E2ABC4B88B7867CABB0FD219E7F9CA8FC39CDC412B52A8B35A4 +A7F896B616902DEE48C5BE2EF85C1827831417A64E3790E23D5E1E5F89063BB2 +9A416128053A8158B6C7F4E7B8E9D71CAAC17BDA59019B6E5B18F38114337D21 +ACF34EA6D4E9D1A2D51FD3E53FADD68682397E3E44E0EE92E7230FB433A7D532 +272B406ABBF4FCCF4E0DB729BF896C5DAF30D94A3EF738ABA7F79A5F27388D52 +E8771247F08736B99838794395E6954965811DE3D7CC47A547F51D31D8342FE2 +52AD390F1BA069B596578C0CE47D0EE3F10E644A62A71B4BB62402ABDF7387EA +2836A907A182F4BAB34B02A7047489144AD3B925498EEA4AA956D40A012181D8 +9FE1F7E98E1BED0F05BF44FCE83287BFF73E96F65BDABA75E829B4E2C1DBD7E6 +2144E7A3D56379ECB89750B1BA93DBE98E7E0286F34EB94DE1C6C636D5A6C449 +2AB6C93DB716C5D5B6B4F865DE5E683F2E2C65DB4A5173755D36EBCF1612CF13 +E53D35903A4E8A6410F484EA404807F29BFF00670C7AD7D65460C3B472A94FC4 +A6C30E3CE25A693EA255B7EBEF818F59276942CB31B188D32439C457D96DA494 +5199703817727CF503B72E6906C7B1F718E89ECBFB3ED7DC3537A61474F9CE4D +ED97B4EBA0A1B47A56FF00D1B627D07F70F6146669711A4B5A6E816B5AD6FEA3 +1DDD2B08981B4F9A59DAD6C9DCC41E30C1A9D77873368B42694F4EA938D32087 +3421B6C2D2A595A8FE14E94917EE40DF9631FC5ED5D3D66DB37026DB82154B40 +71BFDE31507C3047662A5EADD5E417F7BB34B612117EC5C77DFA84E39A59C7AB +248A17EE2746AC330DBF31C6E1F7870A74965C146ACD4A9927482EB7396DB882 +3ADB484906F6EF88E9E26D6672B2ADA9CA7CC7ED3FFFD9> +%%EOF + +%%EndDocument + @endspecial Black 1728 2430 a Fh(Figure)34 b(2:)48 b(The)36 +b(author.)p Black Black 458 2760 a(This)f(is)h(an)g(inclusion)c(of)k(a) +g Fa(.jpg)h Fh(image)d(thanks)i(to)g Fa(jpeg2ps.exe)p +Fh(.)458 2896 y(Oh)g(!)49 b(By)36 b(the)g(w)m(a)m(y)f(:)49 +b(that's)37 b(me.)48 b(This)35 b(w)m(as)h(the)g(easiest)e(jp)s(eg)i +(picture)e(to)i(\014nd.)p Black Black eop +%%Trailer +end +userdict /end-hook known{end-hook}if +%%EOF diff --git a/Build/source/texk/windvi/Examples/wtest.tex b/Build/source/texk/windvi/Examples/wtest.tex new file mode 100644 index 00000000000..c127cb4edc7 --- /dev/null +++ b/Build/source/texk/windvi/Examples/wtest.tex @@ -0,0 +1,388 @@ +\documentclass[a4paper, 11pt]{article} +\usepackage{color} +\usepackage{epic,eepic} +\usepackage{pspicture} +\usepackage{pstcol,pst-node,pst-tree,graphics} +\usepackage[dvips]{graphicx} +%\usepackage[dvips]{rotating} +\usepackage[colorlinks]{hyperref} +\usepackage[all,poly]{xy} + +\DeclareGraphicsRule{.jpg}{eps}{.jpg.bb}{`jpeg2ps -r 0 -h #1} +\DeclareGraphicsRule{.gif}{eps}{.gif.bb}{`convert #1 eps2:-} +\DeclareGraphicsRule{.tif}{eps}{.tif.bb}{`tiff2ps -e -2 #1} +\DeclareGraphicsRule{.ps.bz2}{eps}{.ps.bb}{} +\DeclareGraphicsRule{.emf}{bmp}{}{} + +\author{Fabrice Popineau} +\title{\colorbox{red}{\textcolor{yellow}{Windvi 0.65 Features}}} +\date{\textcolor{blue}{21/07/1998}} +\pagestyle{empty} + +\def\WDVI{\textsf{Windvi}} +\newcommand{\HR}{\rule{1em}{0.4pt}} +\begin{document} +\maketitle +\tableofcontents +\newpage +\section{Introduction} +\noindent +Many of these examples are taken from the \emph{LaTeX Graphics Companion}. + +\noindent First, we check the color text behavior: + +\begin{flushleft} +{\color{green} green text}\\ +{\color{red} red text}\\ +{\color{yellow} yellow text}\\ +{\color{magenta} magenta text}\\ +{\color{cyan} cyan text} +\end{flushleft} +% + +This is the default text. +\newpage +\section{Postscript inclusions} +Various effects: +\vspace*{2cm}\mbox{}\\ +\setlength\fboxsep{0pt} +left\HR +\fbox{\includegraphics{wsample.ps}}% +\HR right +\hfill +left \HR +\fbox{\includegraphics[120,120][150,200]{wsample.ps}}% +\HR right \hfill +left \HR +\fbox{\includegraphics*[120,120][150,200]{wsample.ps}}% +\HR right +\vspace*{1cm} + +\noindent +The same file, but in a rotated box: +\vspace*{1cm} + +left\HR +\fbox{\rotatebox{45}{\includegraphics{wsample.ps}}}% +\HR right +\vspace*{1cm} + +\noindent You can include the compressed versions too: +\vspace*{1cm} + +left\HR +\fbox{\rotatebox{30}{\includegraphics{ws_gzip.ps.gz}}}% +\HR right +\hfill +left\HR +\fbox{\rotatebox{60}{\includegraphics{ws_bzip2.ps.bz2}}}% +\HR right +\vspace*{1cm} + +The first one is GZip'ed, the second one is BZip2'ed. + +\newpage +\section{Arbitrary Postscript code} + +The following figure, Fig.~\ref{figf7}, is an example of raw +Postscript being sent to the driver. It has been taken from the +{\em dvips} manual. + +\begin{figure}[h] + \vspace{2in} + \vbox to 100bp{ + \special{" newpath 000 000 moveto 100 100 lineto 394 0 lineto + closepath gsave 0.8 setgray fill grestore stroke}\vfil} + \caption{Postscript code directly from a {\em special} command.} + \label{figf7} +\end{figure} + +\noindent +This code lead to the previous figure: + +\begin{verbatim} + \vspace{2in} + \vbox to 100bp{ + \special{" newpath 000 000 moveto 100 100 lineto 394 0 lineto + closepath gsave 0.8 setgray fill grestore stroke}\vfil} +\end{verbatim} +\newpage +\section{TPIC specials} +A TPiC trial:\\ +\setlength{\unitlength}{0.0125in} +\begin{picture}(444,125)(0,-10) +\thicklines +\drawline(304.318,26.338)(303.000,31.000)(301.969,26.267) +\put(311.808,31.269){\arc{17.624}{4.8481}{9.3942}} +\drawline(158.742,66.792)(161.000,63.000)(160.792,67.408) +\put(168.688,65.312){\arc{16.054}{2.8495}{7.4287}} +\drawline(143.367,53.233)(147.000,54.000)(143.433,55.033) +\put(147.250,60.750){\arc{13.509}{1.6078}{6.2462}} +\put(34,46){\oval(68,26)} +\put(163,46){\ellipse{22}{22}} +\put(231,46){\ellipse{22}{22}} +\put(299,46){\ellipse{22}{22}} +\put(366,46){\ellipse{22}{22}} +\put(433,46){\ellipse{22}{22}} +\drawline(73,46)(146,46) +\drawline(138.000,44.000)(146.000,46.000)(138.000,48.000) +\drawline(181,46)(214,46) +\drawline(206.000,44.000)(214.000,46.000)(206.000,48.000) +\drawline(247,46)(282,46) +\drawline(274.000,44.000)(282.000,46.000)(274.000,48.000) +\drawline(315,46)(349,46) +\drawline(341.000,44.000)(349.000,46.000)(341.000,48.000) +\drawline(383,46)(416,46) +\drawline(408.000,44.000)(416.000,46.000)(408.000,48.000) +\spline(294,34) +(254,4)(194,-1)(164,14)(159,29) +\drawline(163.427,22.043)(159.000,29.000)(159.632,20.778) +\spline(229,34) +(209,19)(184,19)(169,34) +\drawline(176.071,29.757)(169.000,34.000)(173.243,26.929) +\spline(221,35) +(199,29)(175,35) +\drawline(183.246,35.000)(175.000,35.000)(182.276,31.119) +\spline(354,59) +(294,79)(244,59) +\drawline(250.685,63.828)(244.000,59.000)(252.171,60.114) +\spline(359,64) +(318,92)(224,84)(179,55) +\drawline(184.641,61.015)(179.000,55.000)(186.808,57.652) +\put(390,52){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large C}}} +\put(323,50){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large B}}} +\put(298,94){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large B}}} +\put(270,74){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large A}}} +\put(321,16){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large A}}} +\put(260,18){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large C}}} +\put(258,51){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large A}}} +\put(221,16){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large C}}} +\put(196,35){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large B}}} +\put(192,50){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large A}}} +\put(167,77){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large C}}} +\put(129,64){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large B}}} +\put(19,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large Start}}} +\put(162,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large 1}}} +\put(228,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large 2}}} +\put(298,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large 3}}} +\put(363,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large 4}}} +\put(432,42){\makebox(0,0)[lb]{\raisebox{0pt}[0pt][0pt]{\Large *}}} +\end{picture} + +End of TPic test. + +\noindent +And the \texttt{pspicture} environment: +% pspicture +\setlength{\unitlength}{1mm} +\begin{picture}(50,40) +\put(15,20){\circle{20}} +\put(40,20){% +\scalebox{1}[2]{\circle{20}}} +\put(40,20){% +\scalebox{1}[.5]{\circle*{20}}} +\end{picture}\qquad + +\newpage +\section{Transformations} +\noindent +Here the text should be rotated, but given this is text, and that this +material is not processed by ghostscript, the text is not rotated. + +However, under Windows NT, there is an opportunity to render this and +this is done now. \textcolor{red}{So only NT users will see the actual + text. } + +\def\foo{\parbox{2cm}{\Huge A}} + +\foo \hfill \rotatebox{30}{\foo} \rotatebox{0}{} \hfill \rotatebox{60}{\foo} \hfill +\rotatebox{90}{\foo} \hfill \rotatebox{180}{\foo} +\vspace*{2cm}\mbox{}\\ +\fbox{\resizebox{5cm}{20mm}{% + \rotatebox{45}{\parbox{3cm}% +{\raggedright +TUG96 in Russia TUG96 in Russia +TUG96 in Russia TUG96 in Russia +TUG96 in Russia}}}} + +And with tables~:\\ +\rotatebox{90}{% + \Large + \begin{tabular}[ht]{|l|c|r|} + \hline + 1 & 2 & 3 \\ + \hline + a & b & c \\ + \hline + \end{tabular} +} +\newpage +\section{The world of color} + +\begin{enumerate} +\item \textcolor[cmyk]{0,1,0,0}{magenta cmyk} black +\item \color[gray]{0.5} + \textcolor{blue}{predefined blue} + gray text +\end{enumerate} + +\noindent +\fcolorbox{red}{blue}{Black text, blue background, red frame}\\ +\fcolorbox{red}{blue}{\color{white}White text, blue background, red + frame}\\ +\fcolorbox{red}{blue}{\color{green}Green text, blue background, red + frame} + +\setlength{\fboxrule}{6pt} +\setlength{\fboxsep}{10pt} +\colorbox{yellow}{Fun with color}\qquad +\fcolorbox{red}{yellow}{Fun with color} +\par\bigskip\par +\setlength{\fboxrule}{1pt}% +\colorbox{green}{Fun with color}\qquad +\fcolorbox{red}{green}{Fun with color} + +\newpage +\section{The XY-Pic package} +\[ +\begin{xy}/r9mm/: + (0,0),{\xypolygon6{% + ~:{(1,-.1):(0,.33)::}~<{-}}} + ,(0,2),{\xypolygon6{% + ~:{(1,-.2):(0,.5)::}~<{-}}} + ,(2.5,0),{\xypolygon6{% + ~:{(1,.2):(0,-.3)::}~<{-}}} + ,(2.5,2),{\xypolygon6{% + ~:{(1,.3):(0,-.6)::}~<{-}}} + ,(5,0)="O", +(-.5,3)="T","O" + ,{\xypolygon6{~:{(1,0.2):(0,.4)::}% + ~<>{;"T"**@{-}}}} +\end{xy} +\] + +\newpage +\section{The PSTricks package} + +\psset{nodesep=2pt} +\newcommand{\XX}[2]{% +\TR{\ensuremath{#1_{\mbox{#2}}}}% +} +\pstree[xbbr=1.5cm]{\XX{R}{AMSU}} +{ +\XX{S}{RawData} +\pstree{\XX{S}{combine} + \trput{\ensuremath{\oplus}} +\tlput{\ensuremath{\oplus}}} +{ +\psset{linestyle=dashed} +\XX{R}{Modes} +\XX{R}{Normal} +\XX{R}{Vertical} +\XX{R}{Latched} +\XX{R}{Tripped} +\XX{R}{Other} +} +\XX{S}{GenerateData} +} + +\newpage +\noindent +This is the same tree, but rotated. Only NT users will see the glyphs +at the right place. Win9x will see the Postscript code at the right +place, but the glyphs displaced: + +\rotatebox{90}{ +\psset{nodesep=2pt} +\renewcommand{\XX}[2]{% +\TR{\ensuremath{#1_{\mbox{#2}}}}% +} +\pstree[xbbr=1.5cm]{\XX{R}{AMSU}} +{ +\XX{S}{RawData} +\pstree{\XX{S}{combine} + \trput{\ensuremath{\oplus}} +\tlput{\ensuremath{\oplus}}} +{ +\psset{linestyle=dashed} +\XX{R}{Modes} +\XX{R}{Normal} +\XX{R}{Vertical} +\XX{R}{Latched} +\XX{R}{Tripped} +\XX{R}{Other} +} +\XX{S}{GenerateData} +} +} +\newpage +\section{Is color correctly handled ?} +\vfill + +Something that is higly desirable : being able to jump to \emph{any} +page, and be placed in the correct color stack state. This is possible +because \WDVI{} does pre-scanning of all specials. + +What will happen if we {\color{blue} break some \newpage page across + color text ?} Will we get the expected result ? + +\newpage +\section{Background color for the whole page} +\pagecolor{yellow} + +Test of the background for the {\color{red} windvi program}. + +\newpage + +Is the background restored to white ? + +I hope not ! Because the \verb+\pagecolor{}+ command is sticky through +out the document. + +\newpage +\section{External commands and inclusions} +\pagecolor{white} + +\noindent +This is an inclusion of a \texttt{.jpg} image thanks to +\texttt{jpeg2ps.exe}. + +Beware ! By default, it is forbidden to call external programs. You +need to check the `allowShell' option in the menus `View', `Options' +and next `DVI File Configuration'. Only then \windvi will be able to +display the next picture. + +\begin{figure}[ht] + \centering\includegraphics[width=4cm]{fab.jpg} + \caption{The author.} +\end{figure} + +\noindent Oh ! By the way : that's me. This was the easiest jpeg picture to +find. + +\noindent +Now trying \texttt{.bmp} files: +\begin{figure}[ht] + \centering\includegraphics[width=6cm,height=6cm]{coffee_bean.bmp} + \caption{Some \texttt{bmp} file.} +\end{figure} + +\newpage +\noindent +And Windows Enhanced Metafiles: +\begin{figure}[ht] + \centering\includegraphics[width=79.34mm,height=40mm]{world.emf} + \caption{Some \texttt{emf} file.} +\end{figure} + +\end{document} +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: + +\end{document} + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: diff --git a/Build/source/texk/windvi/Examples/wtest.toc b/Build/source/texk/windvi/Examples/wtest.toc new file mode 100644 index 00000000000..27e04f93976 --- /dev/null +++ b/Build/source/texk/windvi/Examples/wtest.toc @@ -0,0 +1,11 @@ +\contentsline {section}{\numberline {1}Introduction}{2}{section.1} +\contentsline {section}{\numberline {2}Postscript inclusions}{3}{section.2} +\contentsline {section}{\numberline {3}Arbitrary Postscript code}{4}{section.3} +\contentsline {section}{\numberline {4}TPIC specials}{5}{section.4} +\contentsline {section}{\numberline {5}Transformations}{6}{section.5} +\contentsline {section}{\numberline {6}The world of color}{7}{section.6} +\contentsline {section}{\numberline {7}The XY-Pic package}{8}{section.7} +\contentsline {section}{\numberline {8}The PSTricks package}{9}{section.8} +\contentsline {section}{\numberline {9}Is color correctly handled ?}{11}{section.9} +\contentsline {section}{\numberline {10}Background color for the whole page}{13}{section.10} +\contentsline {section}{\numberline {11}External commands and inclusions}{15}{section.11} diff --git a/Build/source/texk/windvi/FAQ b/Build/source/texk/windvi/FAQ new file mode 100644 index 00000000000..5ed0f7884c7 --- /dev/null +++ b/Build/source/texk/windvi/FAQ @@ -0,0 +1,257 @@ +This file answers the following questions about installing xdvi: + + 1. Why do I get the message, ``Caution: overstrike characters may be + incorrect'' when running netscape and xdvi simultaneously, and why + does the screen output look so grainy? + 2. I have font files cmr10.tfm, etc. Why can't xdvi use them? + 3. I can't seem to set the font path correctly. Can you help me? + 4. xdvi claims to support virtual fonts, but I can't use PostScript + virtual fonts (such as helv.vf or phvr.vf) with xdvi. Why not? + 5. Why can't xdvi correctly display metapost files containing text? + 6. Why do I get weird vertical color stripes when using xdvi on my S3 + Virge video card? + 7. I am using gs 5.50 to render PostScript figures, and I find that + sometimes characters appear on the wrong page. Why is that? + 8. I am using gs 3.33 to render PostScript figures, but find that it + cuts some off below or to the right of a certain point, and others + are omitted entirely. + 9. I am trying to display PostScript specials with -DPS_GS, but + instead I get the message `gs: gs: Malformed ghostview color property.' + 10. What is this "_get_wmShellWidgetClass undefined" error? + +Last modified: 19 October 1998 +A current copy of this file can be viewed on the WWW at the URL +http://math.berkeley.edu/~vojta/xdvi_faq.txt + +---------- + +1. Why do I get the message, ``Caution: overstrike characters may be + incorrect'' when running netscape and xdvi simultaneously, and why + does the screen output look so grainy? + +This is because your video setup has only a limited number (typically 256) +of different colors that can be displayed at any given time, and netscape +is using most of them. There are several ways around this problem: + + o Start xdvi before netscape. This should eliminate the problem for + that copy of xdvi (only). + o Invoke netscape via "netscape -ncols 130" This limits netscape's + color usage to 130. Other numbers may be used as well. + o Invoke netscape via "netscape -install" This causes netscape to run + with its own colormap. A disadvantage of this approach is that + netscape's colors will be bizarre when the cursor is outside netscape's + window, and conversely all other colors on the screen will look funny + when the cursor is in the netscape window. + +The screen output looks so grainy because xdvi is not able to use its +anti-aliasing features without enough colors. + +---------- + +2. I have font files cmr10.tfm, etc. Why can't xdvi use them? + +tfm files contain only minimal information about the characters +in a font: just the height, width, depth, and kerning and ligature +information. To obtain information about the shapes of the +characters, xdvi needs pk or gf files. (pxl files also contain +this information, but are obsolete. There are utilities to convert +them to pk files though.) + +---------- + +3. I can't seem to set the font path correctly. Can you help me? + +Try + xdvi -debug 32 file.dvi +to find out where xdvi is looking for the fonts. + +---------- + +4. xdvi claims to support virtual fonts, but I can't use PostScript + virtual fonts (such as helv.vf or phvr.vf) with xdvi. Why not? + +The short answer is to quote the man page: + + Virtual fonts are also supported, although xdvi does not + have any built-in fonts to which they can refer. + +As further explanation, let me begin by pointing out: + + VIRTUAL FONTS ARE NOT FONTS. + +Virtual fonts are recipes for building fonts from other fonts. +In the case of PostScript fonts, those other fonts reside on +your printer. This is fine for dvi-to-PostScript programs +such as dvips, but it presents a problem for xdvi since it cannot +access your printer. + +There are some solutions, however. + +The first solution is to install gsftopk, which uses +ghostscript to approximate the fonts. It is made for sites that +use both xdvi and dvips, although if you just use xdvi it should +be useful, too. + +Another solution is to get these fonts pre-made in common sizes. +These were made by a program called gsrenderfont (part of the Gnu +font utilities). + +These are all available via anonymous ftp: + +gsftopk from math.berkeley.edu:pub/TeX/gsftopk.tar.Z +pre-made fonts from ftp.cs.umb.edu:pub/tex/psfonts.tar +gsrenderfont from prep.ai.mit.edu:pub/gnu/fontutils-0.6.tar.gz + +---------- + +5. Why can't xdvi correctly display metapost files containing text? + +The problem is that the PS files created by MP are (normally) not +self-contained. xdvi delegates the display of PS files to +ghostscript, which fails to handle those files. + +A solution is to instruct MP to create true EPS files, by including + prologues:=2; +at the top of the document. If you have the CM postscript fonts +installed so that ghostscript can find them, you can continue to use +the CM fonts, otherwise you'll have to switch to Times or such for the +illustrations. + +Switching the fonts can be done setting 'defaultfont' to something +like "ptmr8r" (for Times). For the TeX material in 'btex .. etex' +blocks, it is best to set up the fonts once in a 'verbatimtex .. etex' +block. (And same for LaTeX of course.) + +This answer courtesy of Olaf Weber. + +---------- + +6. Why do I get weird vertical color stripes when using xdvi on my + S3 Virge video card? + +This is a bug in the XF86_S3V X server. It has been reported to XFree86. +The response from them is that the XF86_S3V server is being phased out +and that users should use the XF86_SVGA server instead (which also, as of +XFree86 3.3.3, supports the S3 Virge chipset). + +---------- + +7. I am using gs 5.50 to render PostScript figures, and I find that + sometimes characters appear on the wrong page. Why is that? + +This is a bug in ghostscript 5.50. The following patch will fix it: + +*** gdevx.c.orig Fri Jul 17 07:31:27 1998 +--- gdevx.c Sat Oct 17 23:42:50 1998 +*************** +*** 59,65 **** + ((gx_device_X *)(dev))->up_area = 0,\ + ((gx_device_X *)(dev))->up_count = 0 + #define update_flush(dev)\ +! if ( ((gx_device_X *)(dev))->up_area != 0 ) update_do_flush(dev) + private void update_do_flush(P1(gx_device *)); + + #define flush_text(dev)\ +--- 59,66 ---- + ((gx_device_X *)(dev))->up_area = 0,\ + ((gx_device_X *)(dev))->up_count = 0 + #define update_flush(dev)\ +! if ( ((gx_device_X *)(dev))->up_area != 0 || IN_TEXT((gx_device_X *)(dev)) )\ +! update_do_flush(dev) + private void update_do_flush(P1(gx_device *)); + + #define flush_text(dev)\ + +---------- + +8. I am using gs 3.33 to render PostScript figures, but find that it + cuts some off below or to the right of a certain point, and others + are omitted entirely. + +You should apply the following patch. This will also fix similar errors +with ghostview. This patch supersedes a previous patch I have suggested +to some people. + +*** gdevxini.c.orig Sun Nov 6 13:46:42 1994 +--- gdevxini.c Mon Jun 5 15:40:18 1995 +*************** +*** 319,344 **** + + /* The following sets the imageable area according to the */ + /* bounding box and margins sent by ghostview. */ +! { float m[4]; +! m[0] = (llx - left_margin) / 72.0; /* left */ +! m[1] = (lly - bottom_margin) / 72.0; /* bottom */ +! m[2] = xdev->width / xdev->x_pixels_per_inch - +! (urx + right_margin) / 72.0; /* right */ +! m[3] = xdev->height / xdev->y_pixels_per_inch - +! (ury + top_margin) / 72.0; /* top */ +! +! /****** +! ****** For reasons I don't understand, +! ****** we have to set the margins to zero here +! ****** in order for Ghostview to do landscape display right. +! ******/ +! #if 0 +! m[0] = m[1] = m[2] = m[3] = 0; +! #endif +! +! gx_device_set_margins((gx_device *)xdev, m, false); +! } +! + } else if (xdev->pwin == (Window)None) { + eprintf("gs: Cannot get ghostview property.\n"); + exit(1); +--- 319,329 ---- + + /* The following sets the imageable area according to the */ + /* bounding box and margins sent by ghostview. */ +! xdev->ImagingBBox[0] = llx - left_margin; +! xdev->ImagingBBox[1] = lly - bottom_margin; +! xdev->ImagingBBox[2] = urx + right_margin; +! xdev->ImagingBBox[3] = ury + top_margin; +! xdev->ImagingBBox_set = true; + } else if (xdev->pwin == (Window)None) { + eprintf("gs: Cannot get ghostview property.\n"); + exit(1); + +---------- + +9. I am trying to display PostScript specials with -DPS_GS, but + instead I get the message `gs: gs: Malformed ghostview color property.' + +xdvi needs at least version 2.6.2 of ghostscript. It will also run with +ghostscript 2.6.1, provided you have applied fixes 1-4. This particular +error message means that you are running gs 2.6.1 without fixes 1-4. +Probably you should get ghostscript 2.6.2 from prep.ai.mit.edu (or any of +its mirror sites). + +xdvi will also run with version 3 of ghostscript, but see question #5. + +---------- + +10. What is this "_get_wmShellWidgetClass undefined" error? + + In SunOS 4.1.2 Sun fixed a shared-library bug in ld which conflicts +with the way X builds the shared Xmu library, causing these symbols, notably, +to be undefined when building some X11 clients on SunOS 4.1.[23]: + _get_wmShellWidgetClass + _get_applicationShellWidgetClass +Compiling "-Bstatic -lXmu -Bdynamic" is overkill; be sure to set +OSTeenyVersion correctly in the config/sun.cf file and rebuild X11R5. + +To solve the problem if you are using OpenWindows 3.0 (X11R4-based Xt), please +contact your local Sun office and request the following patches: + +Patch i.d. Description +100512-02 4.1.x OpenWindows 3.0 libXt Jumbo patch +100573-04 OpenWindows 3.0: xstdcmap fails to set XStandardColomap for + 24-bit machines [this also fixes bug 1087332, "With patched + ld and libc, customer is getting undefined symbols"] + +[Greg Earle, earle@Sun.COM; 7/92] + +A source patch for use with the X11R4 libraries was developed by Conrad +Kimball (cek@sdc.boeing.com); it retrofits into R4 some fixes made in R5 to +get around this problem. The patch is on ftp.x.org in [1/93] + contrib/X11R4_sunos4.1.2_patch_version3.Z diff --git a/Build/source/texk/windvi/INSTALL b/Build/source/texk/windvi/INSTALL new file mode 100644 index 00000000000..ce57c0f4c1b --- /dev/null +++ b/Build/source/texk/windvi/INSTALL @@ -0,0 +1,126 @@ +THIS IS ALPHA QUALITY SOFTWARE! + +Did you read the README file? + +How to install: +1. ./configure --prefix=/texmf-prefix +2. make +3a. If you dare (I wouldn't): make install +3b. If you don't: + cp texk/xdvik/xdvi.bin libs/t1lib/type1afm/type1afm /path/for/bin +4. cp texk/xdvik/texmf/* /usr/local/texmf/share/lib/xdvi + That might not be the right path for you though ( + /usr/local/teTeX/share/texmf/xdvi is another likely path). + See point 5. + PLEASE NOTE that these enc files are different from the ones used + by dvips so they should not be in dvips' way. Please review xdvi.cfg + to see what font maps are appropriate for you. Update the texk + file database (teTeX users run 'texhash'). +5. Ensure that you have a XDVIINPUTS variable in your texmf.cnf or + environment which names the directory you installed the above files + in so xdvi can find them. +6. Read XDVIFONTS to install type1 fonts for xdvi. Probably not needed + in a recent teTeX installation. + +Here is the normal INSTALL file: +------------- + +Installing xdvik is essentially the same as installing any other +Kpathsea-using program. Therefore, for the basic steps involved, the +file `kpathsea/INSTALL'. + +For common problems and information on how to report a bug, see +`kpathsea/BUGS'. + +xdvi-specific items and a terse summary of the steps: + +0.1. If you want the hypertext support (recognition of url specials and +clicking on links), install the W3C reference library and header files +if necessary: http://www.w3.org/pub/WWW/Library/w3c-libwww.tar.gz. The +.h files must be visible to the compiler, so you may have to set the +environment variable CPPFLAGS=-I/usr/local/include/wwwherever. (You may +also be interested in the Java previewer IDVI, available at +@url{http://www.win.tue.nl/~dickie/idvi}.) + +0.2. If you have Aladdin Ghostscript 4.0 or 4.01, get 4.02. Otherwise, +xdvi will not be able to run gs to show included eps files. (You can +fix this bug by adding a line + .clearerror +before the `% Close up systemdict.' comment.) + +1. Run `configure' (in the top-level directory, the one with +subdirectories `kpathsea' and `xdvi'). This guesses system +dependencies. configure --help lists all available options. See +../kpathsea/CONFIGURE for options to the configure script; also run +configure --help. + +By default, Ghostscript is used to render PostScript specials. +To disable this, specify `--without-ps' to configure. +To use Display PostScript instead of gs, specify `--with-ps=dps'. +To use NeWS instead of gs, specify `--with-ps=news'. +(Naturally you must have the dps and news libraries for these to work!) +You can specify more than one --with-ps option if desired; then Ghostscript + is used last. + +To use only Xlib routines, specify `--with-x-toolkit=no' to configure. +Functionality is necessarily reduced. If you are using an HP, IBM, or +other system that does not include the Xaw library by default, consider +installing the freely available X11 distribution, available from +ftp://ftp.x.org and mirrors. + +2. If necessary, change the default paths or other definitions. +See kpathsea/INSTALL for details. + +Things you might want to add to the DEFS or CFLAGS or XCFLAGS Make variables: +-DA4 to get A4 size windows by default. +-DALTFONT=\"myfont\" to change the fallback font from cmr10. +-DBDPI=num to change default resolution to num from 600. +-DMFMODE=\"mode\" to set the default mode. +-DSHRINK=\"num\" to change the default shrink factor (yes, a string) from 6. +-DNOBUTTONS to disable radio buttons for common commands. +-DNOGREY to disable using grayscale to display shrunken bitmaps + (which also works on monochrome monitors). +-DNOQUERY if you have trouble compiling drawingWidgetClass? +-DNOSELFILE to disable SelFile widget support. +-DNOTEXXET to disable DVI opcodes 250 and 251. + +The following can be set according to what xdvi's CONTROL-P command +reports for `bitord' and `Unit' for your most common display: + bitord = 1 => -DMSBITFIRST + Unit = 32 => -DBMLONG + Unit = 16 => -DBMSHORT +If this makes any substantial performance difference in your +environment, please let me know. + +3. `make'. + +4. `make install' (by default, files will be installed under /usr/local). +(Or `make install-exec', to install just the executables, +or `make install-data', to install just the architecture-independent files.) + +5. `make distclean' (or `mostlyclean', or `clean', or `realclean', +depending on how clean you want to be). + +If you wish to preview documents using PostScript fonts, you may find +ftp://ftp.tug.org/tex/psfonts.tar.gz (Ghostscript-generated bitmaps for +the standard 35 PS fonts at multiples of 600dpi) useful. The gsftopk +program that comes with xdvik can generate such bitmaps on the fly; the +distributed MakeTeXPK attempts to do this. + +If problems: + +* See kpathsea/INSTALL for common system-dependent problems. + +* If you run out of file descriptors (``Too many open files''), +typically when MakeTeXPK is invoked, you may need to recompile the +kernel on your system (e.g., SunOS). Alternatively, the ulimit command +might allow you to increase this limit (e.g., Solaris). xdvi tries to +close files as necessary to avoid this, but if you use lots of fonts on +one page, it's unavoidable. + +* SCO: download libXaw from sosco.sco.com:/TLS/tls005.tar.Z. +--lieder@skyler.mavd.honeywell.com + +* Tadpole Sparcbook: Comes with obsolete X11 libraries in + /usr/openwin/lib. You must install more recent libraries. +--ato@bellcore.com diff --git a/Build/source/texk/windvi/MAKE-VMS.COM b/Build/source/texk/windvi/MAKE-VMS.COM new file mode 100644 index 00000000000..c76bfbf5703 --- /dev/null +++ b/Build/source/texk/windvi/MAKE-VMS.COM @@ -0,0 +1,219 @@ +$! MAKE-VMS.COM +$! A DCL `Make' procedure for compiling and linking XDVI. +$! +$! PLEASE NOTE, this file was inherided from plain Xdvi. It has not +$! been tested or reviewed for use with Xdvik. - janl@math.uio.no +$! +$! If you do want only the plain vanilla Xdvi just type @make_vms +$! +$! At the moment only support for DPS is really working to display inline +$! postscript. To compile with DPS invoke the com as @make_vms dps +$! You'll need a post-June 95 version of the xvmsutils installed at your +$! site (This package is available at +$! http://axp616.gsi.de:8080/www/vms/xvmsutils.html) +$! +$! If you want to compile using the Xaw lib to get buttons and scrollbars on +$! Xdvi you will have to invoke the build as @make_vms "" tool +$! (or @make_vms dps tool). In this case you need the Xaw3d lib installed, +$! which you might get from http://axp616.gsi.de:8080/www/vms/xaw.html. +$! Please edit the option file created during installation of the package +$! to remove all references to shareable image and copy it to the dire where +$! Xdvi resides with a name of xaw3dalpha.opt or xaw3dvax.opt. +$! +$! In case of problems with the install you might contact me at +$! m.zinser@gsi.de (preferred) or eurmpz@eur.sas.com +$! +$! +$ ON ERROR THEN GOTO EXIT +$ ON CONTROL_Y THEN GOTO EXIT +$ OLD_VERIFY = f$verify (0) +$! +$ MAY_USE_DECC = 1 +$! +$ IF F$GETSYI("HW_MODEL") .GE. 1024 +$ THEN +$ ARCH_NAME="Alpha" +$ ARCH_PREF="AXP_" +$ HAVE_DECC_VAX = 0 +$ USE_DECC_VAX = 0 +$ CC="CC/stand=VAX/ansi/ext=comm/obj=.''ARCH_PREF'obj" +$ WRITE SYS$OUTPUT "Compiling on Alpha AXP using DECC" +$ ELSE +$ ARCH_NAME="VAX" +$ ARCH_PREF="VAX_" +$ IF F$search("sys$system:DECC$compiler.exe") .NES. "" +$ THEN +$! DECC for VAX available (and maybe VAXC, too!) +$ HAVE_DECC_VAX = 1 +$ IF HAVE_DECC_VAX .AND. MAY_USE_DECC +$ THEN +$! We use DECC: +$ USE_DECC_VAX = 1 +$ CC="CC/DECC/stand=VAX/ext=comm/obj=.''ARCH_PREF'obj" +$ ELSE +$! We use VAXC: +$ USE_DECC_VAX = 0 +$ CC="CC/VAXC/obj=.''ARCH_PREF'obj" +$ ENDIF +$ ELSE +$! only VAXC available +$ HAVE_DECC_VAX = 0 +$ USE_DECC_VAX = 0 +$ CC="CC/obj=.''ARCH_PREF'obj" +$ ENDIF +$ IF USE_DECC_VAX +$ THEN +$ WRITE SYS$OUTPUT "Compiling on VAX using DECC" +$ ELSE +$ WRITE SYS$OUTPUT "Compiling on VAX using VAXC" +$ ENDIF +$ ENDIF +$ LDFLAGS = "" +$ if f$trnlnm("X11").eqs. "" then DEFINE X11 DECW$INCLUDE +$ if f$trnlnm("SYS").eqs "" +$ then +$ IF USE_DECC_VAX .AND. (F$TRNLNM("DECC$LIBRARY_INCLUDE") .NES. "") +$ THEN +$ DEFINE SYS DECC$LIBRARY_INCLUDE +$ ELSE +$ DEFINE SYS SYS$LIBRARY +$ ENDIF +$ endif +$ if f$trnlnm("DPS").eqs. "" then define dps xdps$include +$! +$ ps_dps = "" +$ ps_gs = "" +$ tool = "NOTOOL" +$ IF f$edit(p1,"UPCASE") .eqs. "DPS" THEN ps_dps = "PSDPS" +$ IF f$edit(p1,"UPCASE") .eqs. "GS" THEN ps_gs = "PSGS" +$ if f$edit(p2,"UPCASE") .eqs. "TOOL" then tool = "TOOL" +$! +$ ps_options = "" +$ ps_head = "" +$ varobjs = "" +$ IF ps_dps .EQS. "PSDPS" +$ THEN +$ ps_head = "PSHEADER" +$ ps_options = ps_options + ", VFORK, PS_DPS" +$ varobjs = varobjs + "PSDPS.''ARCH_PREF'OBJ, " +$ ENDIF +$ IF ps_gs .EQS. "PSGS" +$ THEN +$ ps_head = "PSHEADER" +$ ps_options = ps_options + ", PS_GS" +$ varobjs = varobjs + "PSGS.''ARCH_PREF'OBJ, " +$ ENDIF +$! +$ OPEN/WRITE optfile VMS_XDVI.'ARCH_PREF'OPT +$ if (tool.eqs."TOOL") .or. (ps_dps.EQS."PSDPS") +$ then +$! +$! Find out which X-Version we're running. This will fail for older +$! VMS versions (i.e., v5.5-1). Therefore, choose DECWindows XUI for +$! default. +$! +$ On Error Then GoTo XUI +$ @sys$update:decw$get_image_version sys$share:decw$xlibshr.exe decw$version +$ if f$extract(4,3,decw$version).eqs."1.0" +$ then +$ write optfile "Sys$share:DECW$DWTLIBSHR.EXE/Share" +$ endif +$ if f$extract(4,3,decw$version).eqs."1.1" +$ then +$ write optfile "sys$share:decw$xtshr.exe/share" +$ endif +$ if f$extract(4,3,decw$version).eqs."1.2" +$ then +$ write optfile "sys$share:decw$xtlibshrr5.exe/share" +$ endif +$ GoTo MAIN +$! +$ XUI: +$! +$ write optfile "Sys$share:DECW$DWTLIBSHR.EXE/Share" +$ MAIN: +$ endif +$ IF ps_dps .EQS. "PSDPS" +$ THEN +$ write optfile "x11vms:xvmsutils.olb/lib" +$! +$ WRITE optfile "sys$share:xdps$dpsclientshr/share" +$ WRITE optfile "sys$share:xdps$dpsbindingsshr/share" +$ WRITE optfile "sys$share:xdps$dpslibshr/share" +$ ENDIF +$ WRITE optfile "sys$share:decw$xlibshr/share" +$ if tool .eqs. "TOOL" +$ then +$ write optfile "XMULIBSHR/SHARE" +$ write optfile "XAW3DLIBSHR/SHARE" +$ endif +$ IF (ARCH_NAME .EQS. "VAX") .AND. (.NOT. USE_DECC_VAX) +$ THEN +$ WRITE optfile "sys$share:vaxcrtl/share" +$ option_file = "VMS_XDVI.''ARCH_PREF'OPT" ! for linking SQUEEZE +$ ELSE +$ option_file = "nl:" ! for linking SQUEEZE +$ ENDIF +$ CLOSE optfile +$ if (tool.eqs."TOOL") +$ then +$ copy/nolog xaw3d'arch_name'.opt,VMS_XDVI.'ARCH_PREF'OPT;-1 - + VMS_XDVI.'ARCH_PREF'OPT +$ tool = "TOOL, BUTTONS" +$ endif +$! +$ DEFS = "VMS, 'tool', USE_PK, USE_GF, TEXXET, GREY, MAKEPK'ps_options'" +$ CC /DEFINE = ('DEFS') DVI_INIT.C +$ CC /DEFINE = ('DEFS') DVI_DRAW.C +$ CC /DEFINE = ('DEFS') GF.C +$ CC /DEFINE = ('DEFS') PK.C +$ CC /DEFINE = ('DEFS') VF.C +$ CC /DEFINE = ('DEFS') UTIL.C +$ If ps_dps .EQS. "PSDPS" +$ then +$! +$! This definition of FIG_PATH and HEADER_PATH is site specific. You may +$! want to change it!!! +$! +$ CC /DEFINE = ('DEFS', "DEFAULT_FONT_PATH=""TEX_FONTS""", - + "DEFAULT_VF_PATH=""TEX_VFDIR""", - + "DEFAULT_FONT_SIZES=""300/329/360/432/518/622/746""",- + "DEFAULT_FIG_PATH=""TEX_INPUTS:,SYS$DISK:""",- + "DEFAULT_HEADER_PATH=""DVI_INPUTS:,TEX_INPUTS:,SYS$LOGIN:,SYS$DISK:[]""")- + FONT_OPEN.C +$ else +$ CC /DEFINE = ('DEFS', "DEFAULT_FONT_PATH=""TEX_FONTS""", - + "DEFAULT_VF_PATH=""TEX_VFDIR""", - + "DEFAULT_FONT_SIZES=""300/329/360/432/518/622/746""") FONT_OPEN.C +$ endif +$ CC /DEFINE = ('DEFS') SPECIAL.C +$ CC /DEFINE = ('DEFS') EVENTS.C +$ IF ps_dps .NES. "" +$ THEN +$ CC /DEFINE = ('DEFS') PSDPS.C +$ ENDIF +$ IF ps_gs .NES. "" +$ THEN +$ CC /DEFINE = ('DEFS') PSGS.C +$ ENDIF +$ IF ps_head .NES. "" +$ THEN +$ CC /DEFINE = ('DEFS') SQUEEZE.C +$ LINK /EXE=.'ARCH_PREF'EXE SQUEEZE.'ARCH_PREF'OBJ, 'option_file' /OPTION +$ SQUEEZE := $SYS$DISK:[]SQUEEZE.'ARCH_PREF'EXE +$ SQUEEZE PSHEADER.TXT PSHEADER.C +$ CC /DEFINE = ('DEFS') PSHEADER.C +$ varobjs = varobjs + "PSHEADER.''ARCH_PREF'OBJ," +$ ENDIF +$ CC /DEFINE = ('DEFS') XDVI.C +$! +$ LINK 'LDFLAGS'/EXE=.'ARCH_PREF'EXE XDVI.'ARCH_PREF'OBJ, - + DVI_INIT.'ARCH_PREF'OBJ, DVI_DRAW.'ARCH_PREF'OBJ, - + GF.'ARCH_PREF'OBJ, PK.'ARCH_PREF'OBJ, VF.'ARCH_PREF'OBJ, - + UTIL.'ARCH_PREF'OBJ, FONT_OPEN.'ARCH_PREF'OBJ, SPECIAL.'ARCH_PREF'OBJ, - + EVENTS.'ARCH_PREF'OBJ, 'varobjs' VMS_XDVI.'ARCH_PREF'OPT/OPTION +$ DELETE/NOLOG VMS_XDVI.'ARCH_PREF'OPT;* +$! +$EXIT: +$ dummy=f$verify ('old_verify') +$ EXIT diff --git a/Build/source/texk/windvi/MOTIF b/Build/source/texk/windvi/MOTIF new file mode 100644 index 00000000000..42354c79618 --- /dev/null +++ b/Build/source/texk/windvi/MOTIF @@ -0,0 +1,462 @@ + +This Motif patch does not apply to the current sources. If you make it +work, please send me the new patch. --kb@cs.umb.edu + + +Date: Wed, 9 Feb 94 16:29 MET +From: simon@lia.di.epfl.ch (Simon Leinen) +To: tex-k@cs.umb.edu +Subject: First hack at a Motif interface for xdvi + +If you find that xdvi isn't ugly enough yet, you can apply this patch +and recompile xdvi with -DHAVE_MOTIF (and preferably without +-DBUTTONS). You also need to link against -lXm. Tested only on IRIX +5.1 (X11R5/Motif 1.2.2). + +Have fun(???), +-- +Simon. + +*** xdvik/xdvi.c 1994/02/08 21:36:30 1.1 +--- xdvik/xdvi.c 1994/02/09 15:21:00 +*************** +*** 96,104 **** + #define XtSpecificationRelease 0 + #endif + #if XtSpecificationRelease >= 4 + #include <X11/Xaw/Viewport.h> + #ifdef BUTTONS + #include <X11/Xaw/Command.h> +! #endif + #else /* XtSpecificationRelease < 4 */ + #define XtPointer caddr_t +--- 96,113 ---- + #define XtSpecificationRelease 0 + #endif ++ #ifdef HAVE_MOTIF ++ #include <Xm/MainW.h> ++ #include <Xm/PushB.h> ++ #include <Xm/ToggleB.h> ++ #include <Xm/BulletinB.h> ++ #include <Xm/Form.h> ++ #include <Xm/RowColumn.h> ++ #include <Xm/MenuShell.h> ++ #else /* not HAVE_MOTIF */ + #if XtSpecificationRelease >= 4 + #include <X11/Xaw/Viewport.h> + #ifdef BUTTONS + #include <X11/Xaw/Command.h> +! #endif /* BUTTONS */ + #else /* XtSpecificationRelease < 4 */ + #define XtPointer caddr_t +*************** +*** 108,111 **** +--- 117,121 ---- + #endif + #endif /* XtSpecificationRelease */ ++ #endif /* not HAVE_MOTIF */ + #else /* !TOOLKIT */ + #define XtNumber(arr) (sizeof(arr)/sizeof(arr[0])) +*************** +*** 319,322 **** +--- 329,338 ---- + #ifdef TOOLKIT + static Widget top_level, vport_widget, draw_widget, clip_widget; ++ #ifdef HAVE_MOTIF ++ static Widget menubar; ++ static Widget scale_menu; ++ static Widget shrink_button[5]; ++ static unsigned max_shrink_button = 0; ++ #endif /* HAVE_MOTIF */ + #ifdef BUTTONS + static Widget form_widget, line_widget, panel_widget; +*************** +*** 325,328 **** +--- 341,347 ---- + + static Arg vport_args[] = { ++ #ifdef HAVE_MOTIF ++ {XmNscrollingPolicy, (XtArgVal) XmAUTOMATIC}, ++ #else /* not HAVE_MOTIF */ + #ifdef BUTTONS + {XtNborderWidth, (XtArgVal) 0}, +*************** +*** 334,337 **** +--- 353,357 ---- + {XtNallowHoriz, (XtArgVal) True}, + {XtNallowVert, (XtArgVal) True}, ++ #endif /* not HAVE_MOTIF */ + }; + +*************** +*** 351,362 **** + #ifdef BUTTONS + static Arg form_args[] = { + {XtNdefaultDistance, (XtArgVal) 0}, + }; + #define XTRA_WID 79 + + static Arg line_args[] = { +- {XtNbackground, (XtArgVal) 0}, +- {XtNwidth, (XtArgVal) 1}, + {XtNheight, (XtArgVal) 0}, + {XtNfromHoriz, (XtArgVal) NULL}, + {XtNborderWidth, (XtArgVal) 0}, +--- 371,390 ---- + #ifdef BUTTONS + static Arg form_args[] = { ++ #ifdef HAVE_MOTIF ++ {XmNhorizontalSpacing, (XtArgVal) 0}, ++ {XmNverticalSpacing, (XtArgVal) 0}, ++ #else /* not HAVE_MOTIF */ + {XtNdefaultDistance, (XtArgVal) 0}, ++ #endif /* not HAVE_MOTIF */ + }; + #define XTRA_WID 79 + + static Arg line_args[] = { + {XtNheight, (XtArgVal) 0}, ++ #ifdef HAVE_MOTIF ++ {XmNleftWidget, (XtArgVal) NULL}, ++ {XmNleftAttachment, (XtArgVal) XmATTACH_WIDGET}, ++ {XmNresizable, (XtArgVal) False}, ++ #else /* not HAVE_MOTIF */ + {XtNfromHoriz, (XtArgVal) NULL}, + {XtNborderWidth, (XtArgVal) 0}, +*************** +*** 365,371 **** +--- 393,410 ---- + {XtNleft, (XtArgVal) XtChainRight}, + {XtNright, (XtArgVal) XtChainRight}, ++ {XtNbackground, (XtArgVal) 0}, ++ {XtNwidth, (XtArgVal) 1}, ++ #endif /* not HAVE_MOTIF */ + }; + + static Arg panel_args[] = { ++ #ifdef HAVE_MOTIF ++ {XmNleftWidget, (XtArgVal) NULL}, ++ {XtNwidth, (XtArgVal) (XTRA_WID - 1)}, ++ {XtNheight, (XtArgVal) 0}, ++ {XtNborderWidth, (XtArgVal) 0}, ++ {XmNleftAttachment, (XtArgVal) XmATTACH_WIDGET}, ++ {XmNresizable, (XtArgVal) False}, ++ #else /* not HAVE_MOTIF */ + {XtNfromHoriz, (XtArgVal) NULL}, + {XtNwidth, (XtArgVal) (XTRA_WID - 1)}, +*************** +*** 376,379 **** +--- 415,419 ---- + {XtNleft, (XtArgVal) XtChainRight}, + {XtNright, (XtArgVal) XtChainRight}, ++ #endif /* not HAVE_MOTIF */ + }; + +*************** +*** 406,415 **** +--- 446,463 ---- + + static Arg command_args[] = { ++ #ifdef HAVE_MOTIF ++ {XmNlabelString, (XtArgVal) NULL}, ++ #else /* not HAVE_MOTIF */ + {XtNlabel, (XtArgVal) NULL}, ++ #endif /* not HAVE_MOTIF */ + {XtNx, (XtArgVal) 6}, + {XtNy, (XtArgVal) 0}, + {XtNwidth, (XtArgVal) 64}, + {XtNheight, (XtArgVal) 30}, ++ #ifdef HAVE_MOTIF ++ {XmNactivateCallback, (XtArgVal) command_call}, ++ #else /* not HAVE_MOTIF */ + {XtNcallback, (XtArgVal) command_call}, ++ #endif /* not HAVE_MOTIF */ + }; + +*************** +*** 420,434 **** + int i; + +! line_args[2].value = h; +! line_args[3].value = (XtArgVal) vport_widget; + line_widget = XtCreateManagedWidget("line", widgetClass, form_widget, + line_args, XtNumber(line_args)); + panel_args[0].value = (XtArgVal) line_widget; + panel_args[2].value = h; + panel_widget = XtCreateManagedWidget("panel", compositeWidgetClass, + form_widget, panel_args, XtNumber(panel_args)); + + command_args[2].value = (XtArgVal) vport_widget; + for (i = 0; i < XtNumber(command_table); ++i) { + command_args[0].value = (XtArgVal) command_table[i].label; + command_args[2].value = (XtArgVal) command_table[i].y_pos; +--- 468,498 ---- + int i; + +! line_args[0].value = h; +! line_args[1].value = (XtArgVal) vport_widget; + line_widget = XtCreateManagedWidget("line", widgetClass, form_widget, + line_args, XtNumber(line_args)); + panel_args[0].value = (XtArgVal) line_widget; + panel_args[2].value = h; ++ #ifdef HAVE_MOTIF ++ panel_widget = XtCreateManagedWidget("panel", xmBulletinBoardWidgetClass, ++ form_widget, panel_args, XtNumber(panel_args)); ++ #else /* not HAVE_MOTIF */ + panel_widget = XtCreateManagedWidget("panel", compositeWidgetClass, + form_widget, panel_args, XtNumber(panel_args)); ++ #endif /* not HAVE_MOTIF */ + + command_args[2].value = (XtArgVal) vport_widget; ++ #ifdef HAVE_MOTIF + for (i = 0; i < XtNumber(command_table); ++i) { ++ command_args[0].value = (XtArgVal) ++ XmCvtCTToXmString ((char *) command_table[i].label); ++ command_args[2].value = (XtArgVal) command_table[i].y_pos; ++ command_call[0].closure = (caddr_t) command_table[i].closure; ++ (void) XtCreateManagedWidget(command_table[i].name, ++ xmPushButtonWidgetClass, panel_widget, ++ command_args, XtNumber(command_args)); ++ } ++ #else /* not HAVE_MOTIF */ ++ for (i = 0; i < XtNumber(command_table); ++i) { + command_args[0].value = (XtArgVal) command_table[i].label; + command_args[2].value = (XtArgVal) command_table[i].y_pos; +*************** +*** 438,441 **** +--- 502,506 ---- + command_args, XtNumber(command_args)); + } ++ #endif /* not HAVE_MOTIF */ + } + #endif /* BUTTONS */ +*************** +*** 1036,1040 **** + } + +! #ifdef BUTTONS + /*ARGSUSED*/ + static void +--- 1101,1105 ---- + } + +! #if defined(BUTTONS) || defined(HAVE_MOTIF) + /*ARGSUSED*/ + static void +*************** +*** 1408,1411 **** +--- 1473,1498 ---- + } + ++ static void ++ set_shrink_factor(win, shrink) ++ struct WindowRec * win; ++ int shrink; ++ { ++ #ifdef HAVE_MOTIF ++ static Widget active_shrink_button = 0; ++ ++ if (win->shrinkfactor != shrink || !active_shrink_button) ++ { ++ if (active_shrink_button) ++ XmToggleButtonSetState (active_shrink_button, False, False); ++ win->shrinkfactor = shrink; ++ if (shrink <= max_shrink_button ++ && (active_shrink_button = shrink_button[shrink])) ++ XmToggleButtonSetState (active_shrink_button, True, False); ++ } ++ #else /* not HAVE_MOTIF */ ++ win->shrinkfactor = shrink; ++ #endif /* not HAVE_MOTIF */ ++ } ++ + #ifdef TOOLKIT + /*ARGSUSED*/ +*************** +*** 1648,1652 **** + if (number0 <= 0) goto bad; + if (number0 == mane.shrinkfactor) return; +! mane.shrinkfactor = number0; + init_page(); + if (number0 != 1 && number0 != bak_shrink) { +--- 1735,1739 ---- + if (number0 <= 0) goto bad; + if (number0 == mane.shrinkfactor) return; +! set_shrink_factor (&mane, number0); + init_page(); + if (number0 != 1 && number0 != bak_shrink) { +*************** +*** 2746,2749 **** +--- 2833,2902 ---- + */ + ++ static void ++ file_pulldown_callback (w, client_data, call_data) ++ Widget w; ++ XtPointer client_data; ++ XtPointer call_data; ++ { ++ switch ((int) client_data) { ++ case 0: ++ keystroke ('R', 0, False, 0); ++ break; ++ case 1: ++ keystroke ('q', 0, False, 0); ++ break; ++ } ++ } ++ ++ static void ++ navigate_pulldown_callback (w, client_data, call_data) ++ Widget w; ++ XtPointer client_data; ++ XtPointer call_data; ++ { ++ switch ((int) client_data) { ++ case 0: ++ keystroke ('p', 10, True, 0); ++ break; ++ case 1: ++ keystroke ('p', 5, True, 0); ++ break; ++ case 2: ++ keystroke ('p', 0, False, 0); ++ break; ++ case 5: ++ keystroke ('n', 10, True, 0); ++ break; ++ case 4: ++ keystroke ('n', 5, True, 0); ++ break; ++ case 3: ++ keystroke ('n', 0, False, 0); ++ break; ++ } ++ } ++ ++ static void ++ scale_pulldown_callback (w, client_data, call_data) ++ Widget w; ++ XtPointer client_data; ++ XtPointer call_data; ++ { ++ switch ((int) client_data) { ++ case 0: ++ keystroke ('s', 1, True, 0); ++ break; ++ case 1: ++ keystroke ('s', 2, True, 0); ++ break; ++ case 2: ++ keystroke ('s', 3, True, 0); ++ break; ++ case 3: ++ keystroke ('s', 4, True, 0); ++ break; ++ } ++ } ++ + int + main(argc, argv) +*************** +*** 2838,2842 **** + dvi_name == NULL) usage(); + if (shrink_factor != 1) bak_shrink = shrink_factor; +! mane.shrinkfactor = shrink_factor; + if (RESOURCE(debug_arg) != NULL) + debug = isdigit(*RESOURCE(debug_arg)) ? atoi(RESOURCE(debug_arg)) +--- 2991,2995 ---- + dvi_name == NULL) usage(); + if (shrink_factor != 1) bak_shrink = shrink_factor; +! set_shrink_factor (&mane, shrink_factor); + if (RESOURCE(debug_arg) != NULL) + debug = isdigit(*RESOURCE(debug_arg)) ? atoi(RESOURCE(debug_arg)) +*************** +*** 3012,3017 **** +--- 3165,3175 ---- + + #ifdef BUTTONS ++ #ifdef HAVE_MOTIF ++ form_widget = XtCreateManagedWidget("form", xmFormWidgetClass, ++ top_level, form_args, XtNumber(form_args)); ++ #else /* not HAVE_MOTIF */ + form_widget = XtCreateManagedWidget("form", formWidgetClass, + top_level, form_args, XtNumber(form_args)); ++ #endif /* not HAVE_MOTIF */ + + line_args[0].value = (XtArgVal) resource.high_color +*************** +*** 3020,3026 **** +--- 3178,3237 ---- + #define form_widget top_level /* for calls to XtAddEventHandler */ + #endif /* BUTTONS */ ++ #ifdef HAVE_MOTIF ++ vport_widget = XtCreateManagedWidget ++ ("vport", ++ xmMainWindowWidgetClass, form_widget, ++ vport_args, XtNumber(vport_args)); ++ XtVaGetValues (vport_widget, XmNclipWindow, &clip_widget, NULL); ++ menubar = XmVaCreateSimpleMenuBar ++ (vport_widget, "menubar", ++ XmVaCASCADEBUTTON, (XtArgVal) XmCvtCTToXmString("File"), 0, ++ XmVaCASCADEBUTTON, (XtArgVal) XmCvtCTToXmString("Navigate"), 0, ++ XmVaCASCADEBUTTON, (XtArgVal) XmCvtCTToXmString("Scale"), 0, ++ 0); ++ { ++ XmVaCreateSimplePulldownMenu ++ (menubar, "file_pulldown", 0, file_pulldown_callback, ++ XmNtearOffModel, (XtArgVal) XmTEAR_OFF_ENABLED, ++ XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Reload"), 0, 0, 0, ++ XmVaSEPARATOR, ++ XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Quit"), 0, 0, 0, ++ 0); ++ } ++ { ++ XmVaCreateSimplePulldownMenu ++ (menubar, "navigate_pulldown", 1, navigate_pulldown_callback, ++ XmNtearOffModel, (XtArgVal) XmTEAR_OFF_ENABLED, ++ XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Page-10"), 0, 0, 0, ++ XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Page-5"), 0, 0, 0, ++ XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Prev"), 0, 0, 0, ++ XmVaSEPARATOR, ++ XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Next"), 0, 0, 0, ++ XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Page+5"), 0, 0, 0, ++ XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Page+10"), 0, 0, 0, ++ 0); ++ } ++ { ++ scale_menu = XmVaCreateSimplePulldownMenu ++ (menubar, "scale_pulldown", 2, scale_pulldown_callback, ++ XmNradioBehavior, (XtArgVal) True, ++ XmNtearOffModel, (XtArgVal) XmTEAR_OFF_ENABLED, ++ XmVaRADIOBUTTON, (XtArgVal) XmCvtCTToXmString("Shrink1"), 0, 0, 0, ++ XmVaRADIOBUTTON, (XtArgVal) XmCvtCTToXmString("Shrink2"), 0, 0, 0, ++ XmVaRADIOBUTTON, (XtArgVal) XmCvtCTToXmString("Shrink3"), 0, 0, 0, ++ XmVaRADIOBUTTON, (XtArgVal) XmCvtCTToXmString("Shrink4"), 0, 0, 0, ++ 0); ++ shrink_button[1] = XtNameToWidget(scale_menu, "button_0"); ++ shrink_button[2] = XtNameToWidget(scale_menu, "button_1"); ++ shrink_button[3] = XtNameToWidget(scale_menu, "button_2"); ++ shrink_button[4] = XtNameToWidget(scale_menu, "button_3"); ++ max_shrink_button = 4; ++ set_shrink_factor (&mane, mane.shrinkfactor); ++ } ++ #else /* not HAVE_MOTIF */ + vport_widget = XtCreateManagedWidget("vport", viewportWidgetClass, + form_widget, vport_args, XtNumber(vport_args)); + clip_widget = XtNameToWidget(vport_widget, "clip"); ++ #endif /* not HAVE_MOTIF */ + draw_args[0].value = (XtArgVal) page_w; + draw_args[1].value = (XtArgVal) page_h; +*************** +*** 3030,3033 **** +--- 3241,3248 ---- + draw_widget = XtCreateManagedWidget("drawing", drawWidgetClass, + vport_widget, draw_args, XtNumber(draw_args)); ++ #ifdef HAVE_MOTIF ++ XmMainWindowSetAreas(vport_widget, menubar, 0, 0, 0, draw_widget); ++ XtManageChild(menubar); ++ #endif /* HAVE_MOTIF */ + { /* set default window size */ + #ifdef BUTTONS + diff --git a/Build/source/texk/windvi/Makefile.in b/Build/source/texk/windvi/Makefile.in new file mode 100644 index 00000000000..1b18f9a2ae8 --- /dev/null +++ b/Build/source/texk/windvi/Makefile.in @@ -0,0 +1,111 @@ +# Makefile for xdvik +# +# - 1999/05/08: janl: Removed submakes for libwww and kpathsea. That's what +# the top makefile is for! +# + +ac_include ../make/paths.mk +ac_include ../make/common.mk +ac_include ../make/programs.mk + +# Make `#include <X11/...>' and `-lX...' work. +# This matches web2c (needed only for Metafont). +x_cppflags = @X_CFLAGS@ +x_ldflags = @X_LIBS@ +x_pre_libs = @X_PRE_LIBS@ +x_extra_libs = @X_EXTRA_LIBS@ +x_tool_libs = @x_tool_libs@ +x_ext_lib = @x_ext_lib@ +# Follow the library order used in X11R6 itself: +# -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11 (some may not be present). +x_link = $(LDLIBWWW) $(LDT1LIB) $(x_ldflags) $(x_tool_libs) $(x_pre_libs) $(x_ext_lib) -lX11 $(x_extra_libs) + +LDLIBWWW=@LDLIBWWW@ +LIBWWWCPPFLAGS=@LIBWWWCPPFLAGS@ +LIBWWWDEP=@LIBWWWDEP@ +LIBWWWDIR = ../../libs/libwww +LIBWWWSRCDIR = $(srcdir)/../../libs/libwww + +# Here we disobey the --with-system-t1lib... +LDT1LIB=../../libs/t1lib/lib/.libs/libt1x.a ../../libs/t1lib/lib/.libs/libt1.a + +# Extra xdvi-specific compiler options. +ps_def = @PS_DEF@ +prog_cflags = $(LIBWWWCPPFLAGS) $(ps_def) -I../../libs/t1lib/lib -I../kpathsea $(x_cppflags) + +# We don't use alloca ourselves, but the X library might, and this way +# we avoid buggy versions in -lPW or -lucb. +ALLOCA = alloca.o + +objects = xdvi.o dvi-draw.o dvi-init.o events.o font-open.o \ + gf.o pk.o psdps.o psgs.o psheader.o psnews.o special.o util.o vf.o sfDir.o \ + sfDraw.o sfPath.o sfSelFile.o hypertex.o mime.o wwwfetch.o \ + $(ALLOCA) t1.o dvips.o tfmload.o + +program = xdvi.bin +programs = $(program) + +default all: $(programs) xdvi.1 + +$(program): $(kpathsea) $(objects) $(LIBWWWDEP) + $(kpathsea_link) $(objects) $(x_link) $(LOADLIBES) + +squeeze: squeeze.o + $(link_command) squeeze.o $(LIBS) $(XLOADLIBES) + +psheader.c: psheader.txt squeeze + ./squeeze $(srcdir)/psheader.txt $@ + +xdvi.1: xdvi.man sedscript + sed -f sedscript <$(srcdir)/xdvi.man >$@ + +sedscript: mksedscript + $(SHELL) $(srcdir)/mksedscript $(srcdir) pkpath sizes vfpath \ + figpath headerpath $(DEFS) $(prog_cflags) >$@ + +$(LIBWWWDIR)/libwww.a: + cd $(LIBWWWDIR); $(MAKE) $(makeargs) libwww.a + +ac_include ../make/tkpathsea.mk + +install: install-exec install-data +uninstall: uninstall-exec uninstall-data + +install-exec: $(programs) + $(SHELL) $(top_srcdir)/../mkinstalldirs $(bindir) + for p in $(programs); do $(INSTALL_LIBTOOL_PROG) $$p $(bindir); done + $(INSTALL_SCRIPT) $(srcdir)/xdvi-sh $(scriptdir)/xdvi +uninstall-exec: + for p in $(programs) xdvi; do rm -f $(bindir)/$$p; done + +install-data: xdvi.1 + $(SHELL) $(top_srcdir)/../mkinstalldirs $(mandir) + $(INSTALL_DATA) xdvi.1 $(mandir)/xdvi.$(manext) +uninstall-data: + rm -f $(mandir)/xdvi.$(manext) + + +distname = xdvik +program_files = *.man *.ac xdvi.icon xdvi.FAQ psheader.txt mksedscript \ + MOTIF +version_files = xdvi.c + +pre-dist-$(distname): +post-dist-$(distname): + cd $(top_distdir); rm -f xdvik/psheader.c + +ac_include ../make/dist.mk +ac_include ../make/config.mk + +info dvi check: + +ac_include ../make/clean.mk + +clean:: + rm -f *.flc + +distclean:: + rm -f psheader.c sedscript xdvi.1 *.flc + +ac_include ../make/rdepend.mk +ac_include depend.make diff --git a/Build/source/texk/windvi/README b/Build/source/texk/windvi/README new file mode 100644 index 00000000000..4253e58175b --- /dev/null +++ b/Build/source/texk/windvi/README @@ -0,0 +1,324 @@ +THIS IS BETA QUALITY SOFTWARE! + +XDVI-K-T1 prescript: + +- Please see INSTALL for installation instructions. And please note that + by default this xdvi will be installed on top of your old xdvi, so you + might want to install it by hand with another name. +- Please see XDVIFONTS for instructiont on font installation +- Please send bug reports to janl@linpro.no. If you don't have + a fix please make a minimal (La)TeX file for reporoducing the + problem available for me by e-mail, ftp or http. +- Xdvik-t1 will be maintained separately from xdvik until the t1 + extentions are robust and complete enough for general use. + At that point they will be merged with regular xdvik. + +Features: +- Internal rendering of type1 fonts. Fast. +- There is something broken with painting type1 glyphs when anti-aliasing + is active. On 8 bit displays -install helps. I don't know what's wrong, + I'm not X11 programmer. If you are, please look into it ;-) +- A bit slow on remote X displays, even slower over ssh. There is a + performance problem compared to pk files somewhere in the painting + routines. + +The font search order is now: +1. Virtual fonts +2. Type1 fonts +3. PK fonts +4. GF fonts if xdvik was compiled with gf support. + +In most texk/teTeX installations cmr10.pfb is present in the texmf +tree. This means that it is found at step 2 in the search and the t1 +font is used. To make xdvi use type1 versions of other ps fonts +please see the XDVIFONTS file. Currently xdvik handles fonts with no +implied coding (such as cmr10). Please see the xdvifont.map file for +further insight. + +13/5/1999 - janl@math.uio.no + +--------------- + +XDVI-K prescript: + +This is the kpathsea version of xdvi, called xdvik. + +xdvik is maintained by me, Nicolai Langfeldt, (janl@math.uio.no) + +The k extentions for xdvi was written by many people, whose names +are sprinkled in the source files. + +Se `../kpathsea/BUGS' for details on reporting bugs. Please send any +bug reports to janl@math.uio.no, not to Paul and not to any kpathsea +list. Also please check the file BUGS in this directory for +information about issues that have been unclear to me during the work +on this, it might provide hints if you discover a problem. + +The K version differs from the original in that it uses the same code +for path searching as the other web2c software and incorporates some +features desired inside the web2c project (grid on the magnifier, +``hypertex'' and ``selfile'' at least). + +xdvik is free software: Paul's original files are a variant of the BSD +license; some kpathsea files are covered by the GNU General Public +License -- see the files COPYING*. + +xdvik is available from CPAN in the systems/unix/web2c directories as +well as http://www.math.uio.no/~janl/xdvi/ + +k-modification history: +* 21.21: + - xdvik 21.21 is produced from xdvik 20c and xdvi-21.21. Two whole + days of work to get the merge sane. +* Various versions: A lot of fixes to the port of k features to xdvi-21 + contributed by self and tex-k/tex-pretest readers as well as Thomas + Esser of teTeX. Some potential problems are mentioned in the BUGS + file of the xdvik 21 distribution. +* 21.29b: + - Selfile fix from Dr. Werner Fink <werner@suse.de> helps the CANCEL + button to work. + - mime.c patch from Allin Cottrell <cottrell@ricardo.ecn.wfu.edu> + makes hypertex browsing more reliable + - xdvik always assumed that #foo is a URL fragment reference and + removed it unconditionaly. Emacs uses # as temporary file + prefix (and infix) and so emacs' TeX mode produced tex and thus + dvi files with # in the name. Problem found by many and solutions + suggested by many. Only remove #foo if the dvi name _is_ an url. + +xdvi changelog is at the end of this file. + +Nicolai Langfeldt, Oslo, 30/11/1998 + +Here follows the original contents of this README file: +---- + +DESCRIPTION + +xdvi is a program for previewing .dvi files, which are produced by the +mathematical typesetting system, TeX. + +Installation instructions are in the file INSTALL. + +At the present time, the person to send bug reports to is Paul Vojta, + vojta@math.berkeley.edu. +When doing so, please specify hardware and OS version, options used +when running the ./configure script, and anything else that may be +relevant. Be sure you've checked the FAQ first, especially for questions +regarding searching for font files. + +Current information on xdvi is also available on the WWW at the URL +http://math.berkeley.edu/~vojta/xdvi.html + +This software has been tested on Sparc (SunOS 4.1.4 and 5.5.1) and Intel 486 +(Linux 1.2.11). + +Current versions of this program can be obtained via anonymous ftp from +the following location: + ftp.x.org file contrib/applications/xdvi-22.tar.gz + [198.112.44.100] +To ease the load on ftp.x.org, you may also check other X archives, for example: + gatekeeper.dec.com file pub/X11/contrib/applications/xdvi-22.tar.gz + [16.1.0.2] +More recent versions of xdvi are often available at: + math.berkeley.edu pub/Software/TeX/xdvi-latest.tar.gz + [128.32.183.94] + math.berkeley.edu pub/Software/TeX/xdvi-beta.tar.gz + [128.32.183.94] +The xdvi-beta version, if present, is more recent but may have more bugs. + +Paul Vojta, 4 February 1999 + +================================================================ + + This program is the combined work of many people, including but not +restricted to: + Eric Cooper, CMU + Bob Scheifler, MIT LCS + Paal Kvamme, Norwegian Institute of Technology + H\aa vard Eidnes, Norwegian Institute of Technology + Mark Eichin, MIT SIPB + Paul Vojta, UC Berkeley + Jeffrey Lee, U of Toronto + Donald Richardson, Clarkson Univ. + Ricardo Telichevesky, MIT + Luis Miguel Silveira, MIT + +================================================================ + +Notes of a historical nature follow. Most recent changes are listed at the end +of the file. + +================================================================ + +This directory contains a version of xdvi capable of reading GF, PXL +and PK font files. This version of xdvi is based on the source that +"came with" X v10r3. Xdvi was modified by Paal Kvamme at the Norwegian +Institute of Technology, based on the modifications I had made to +dviimp (a dvi to ImPress converter). This code was again more or less +directly translated from the web source of PKtoPX. + +If you discover (and fix) any bugs in this code, please notify me, so +I can make the corresponding changes myself. + +--------- +H}vard Eidnes (TeXish: H\aa vard Eidnes) +Division of Computer Science +Norwegian Institute of Technology + +E-Mail: h_eidnes%vax.runit.unit.uninett@nta-vax.arpa +================================================================ +Also has path search added by Mark Eichin, looks in TEXFONTS +================================================================ + +================================================================ +Additional notes: + X11 version now works on the IBM PC/RT as well as VAX. + [eichin:19880313.1330EST] +================================================================ +*MORE* fixes (for athena release locker) [eichin:19880722.2058EST] +Fixes: + narrow vertical and horizontal lines no longer disappear. + bogus underlining (which usually occured on even sample sizes +of odd sized characters) no longer occurs. + -S number (or typing number followed by S) will adjust the +sampling fraction; 0 is special cased to mean if anything in the +sampled zone is set, set the sample, else clear it. Interesting to +experiment with, though not useful for reading (the default value of 3 +is just right.) + -display and -geometry arguments work (so do old style forms, +though they were broken before) + fixed one of the PK debugging messages to print the correct +font name instead of printing the pointer as text. + included Ken Raeburn <raeburn>'s changes to support multiple +screens. +================================================================ +More changes: + + 1. Incorporated the bitmap under a viewport widget using the toolkit + (X11 only); + 2. Added an icon and icon geometry arguments (X11 only); + 3. Supported window resizing; + 4. Added a 'c' option to move whatever is currently under the cursor to + the center of the window; + 5. Added an 'R' option to reread the .dvi file, and added logic to make + 'R' happen automatically whenever any part of the window is exposed + and the dvi file changes (so that you can iconify xdvi, run tex, + deiconify xdvi, and voila!); + 6. Added a 'magnifying glass': when you push a button, a window pops + up, showing the region of the page, unshrunk; + 7. Added support for gf fonts; + 8. Upgraded font searching (at our site we use /usr/custom/tex82/gf + for gf fonts, /usr/custom/tex82/pk for pk fonts, etc.); + 9. Made numerous internal changes (removed all the lint I could, + made unshrunk bitmaps permanently resident, which speeds up size + changing, made table.h necessary only for pxl.h, split up the source + file into xdvi.c, dvi.c, gf.c, pxl.c, and pk.c, made shrinking occur + relative to the character's hot point, etc.) + 10. The program reads SIGIO signals and processes incoming events + immediately, so that it can stop displaying things that would be + erased anyway. If these interrupts are not coming through, then + it also checks for incoming events every several dozen characters + displayed. + 11. Further split up dvi.c into dvi_init.c and dvi_draw.c; added + compilation options for various internal bitmap representations. + Fixed it so gcc won't give warnings, and so it works with R3 toolkit. +-- Patchlevel 2: -- + 12. Added MAXCHARS compilation option. Eliminated the nonsense with + generating table.h. +-- Patchlevel 3: -- + 13. Added -altfont command line option and SYSV compilation option. + 14. Modified for System V boxes: -DSYSV compiler option. Modifications + by Donald Richardson, donr@crystal.mie.clarkson.edu +-- Patchlevel 4: -- + 15. Removed MAXCHARS compilation option. It's automatic now. Made X10 + scrolling smoother. Implemented the moving magnifying glass. +-- Patchlevel 5: -- + 16. Implemented compilation without the toolkit, as well as scrollbars + and tpic support in X10. Also this version should work with color + VAXstations, although overstrike characters will come out incorrectly. + 17. Fixed a bug in gf reading routines: specials at the beginning of + a character def. were not being processed. Thanks to + kevin@amath.washington.edu for a bug report and fix. + 18. Added 'k' keystroke. +-- Patchlevel 6: -- + 19. Added buttons on the right side of the window. + 20. Added -pagewidth and -pageheight command line options and A4 + compilation option. + 21. Added a yet more robust font finding algorithm. +-- Patchlevel 7: -- + 22. Replaced -pagewidth and -pageheight options with -paper. +-- Patchlevel 8: -- + 23. Added compatibility for X11R4 and VMS. Fixed up alignment of rules. +-- Patchlevel 9: -- + 24. Removed obsolete '#' and '=' options from the X11 version: they + interfere with emacs. +-- Patchlevel 10: -- + 25. Implemented arrow keys, expert mode, searching for the font's actual + size first, the -[xy]offset and -sw options, and numerous bug fixes. +-- Patchlevel 11: -- + 26. Implemented recursive searching for font files in subdirectories. + 27. Changed +sw to -hushspecials and implemented -hush. + 28. Modified mksedscript so that the man page comes out neater. + 29. Added a -keep option and resource to match the `k' keystroke. +-- Patchlevel 12: -- + 30. Implemented virtual fonts (this does not include built-in + Postscript<tm> fonts!!!). + 31. X11R5 support, and numerous bug fixes. +-- Patchlevel 13: -- + 32. Added support for TeXXeT. +-- Patchlevel 14: -- + 33. Added support for greyscale anti-aliasing. +-- Patchlevel 15: -- + 34. Added support for MakeTeXPK, as in dvips. +-- Patchlevel 16: -- + 35. In the code for greyscale anti-aliasing, try to allocate a colormap + so that GXor operations can be used for drawing. Also interpolate + between foreground and background colors. +-- Patchlevel 17: -- + 36. Fixed some bugs in the greyscale code. + 37. Implemented an environment variable for the MakeTeXPK script. + 38. Replaced mksedscript with a script using /bin/sh. +-- Patchlevel 18: -- + 39. Implemented checking of checksums and the -hushchecksums option. + 40. Implemented non-square magnifying glasses. + 41. Removed support for X10. + 42. Removed support for the pxl font format. + 43. Added support for PostScript specials via DPS or NeWS or gs. +-- Patchlevel 19: -- + 44. Implemented `header=' and `!' PostScript specials (and the + corresponding -noscan option). + 45. Implemented path searching for PostScript header and figure files, + in addition to shell escape capability (also the -allowshell option). + 46. Allow setting of -gamma with the `S' keystroke. + 47. Added options -nomakepk, -mfmode, -safer, -interpreter, -nogssafer, and + -gspalette. +-- Patchlevel 20: -- + 48. Bug fixes. +-- Patchlevel 21: -- + 49. Receipt of a SIGUSR1 signal causes xdvi to reread the dvi file. + 50. Support for the TeX Directory Structure standard, ls-R quick-find, + and configuration files. + 51. Fix greyscale code to work with TrueColor visual. Thanks to Lee + Hetherington for this one. +-- Version 22: -- + 52. Handle rotated bounding boxes correctly when not showing PostScript. + (Based on a patch by H. Zeller.) + 53. The "-s 0" command line option. + 54. Support for Motif. + 55. Support for displays with more than one visual, and the -noinstall + command line option. + 56. Support for installing a private colormap (-install command line + option). + 57. Configuration via a script generated by a modified GNU autoconf. + 58. Dimension arguments may now be given in terms of any of the TeX units + (pt, pc, in, bp, cm, mm, dd, cc, or sp). + 59. Allow XDVISIZES values to be of the form m0, m0.5, etc., signifying + magsteps. + 60. Change -hushspecials to -warnspecials, and suppress warnings about + undefined specials by default. + 61. Add -gsalpha option. +-- Added since last major release: + 62. Add 'V' keystroke to toggle -gsalpha argument (based on a patch by + fred@thp.Uni-Duisburg.DE). + +Paul Vojta, vojta@math.berkeley.edu diff --git a/Build/source/texk/windvi/README.VMS b/Build/source/texk/windvi/README.VMS new file mode 100644 index 00000000000..4618bc73fcb --- /dev/null +++ b/Build/source/texk/windvi/README.VMS @@ -0,0 +1,483 @@ +NAME +---- + +XDVI - DVI Previewer for VAX VMS systems running the DECWindows software. + +SYNOPSIS +-------- + + XDVI [+[<page>]] [-s <shrink>] [-density <density>] [-nogrey] + [-gamma <g>] [-p <pixels>] [-margins <dimen>] [-sidemargin <dimen>] + [-topmargin <dimen>] [-offsets <dimen>] [-xoffset <dimen>] + [-yoffset <dimen>] [-paper <papertype>] [-altfont <font>] [-l] [-rv] + [-mgs[n] <size>] [-hush] [-hushspecials] [-hushchars] [-hushchecksums] + [-fg <color>] [-bg <color>] [-hl <color>] [-bd <color>] [-cr <color>] + [-bw <width>] [-display <host::display>] [-geometry <geometry>] + [-icongeometry <geometry>] [-iconic] [-keep] [-copy] [-thorough] + [-version] dvi_file + +DESCRIPTION +----------- + + XDVI is a program which runs under the DECWindows system. It is used to + preview DVI files, such as those produced by TeX and LaTeX. + + XDVI has the capability of displaying the file reduced by various (integer) + factors, and also has a "magnifying glass" which allows one to see a small + part of the unshrunk image momentarily. + + Before displaying any page or part thereof, XDVI checks to see if the DVI + file has changed since the last time it was displayed. If this is the case, + XDVI will reinitialize itself for the new DVI file. For this reason, + exposing parts of the XDVI window while TeX is running should be avoided. + This feature allows you to preview many versions of the same file while + running XDVI only once. + +OPTIONS +------- + + In addition to specifying the DVI file (with or without the .DVI extension), + XDVI supports the following command line options. If the option begins with + a "+" instead of a "-", the option is restored to its default value. By + default, these options can be set via the resource names given in parentheses + in the description of each option. + + +<page> Specifies the first page to show. If + is given + without a number, the last page is assumed; the first + page is the default. + + -altfont <font> (.altFont) Declares a default font to use when the + font in the DVI file cannot be found. This is useful, + for example, with PostScript fonts. + + -background <color> (.background) Determines the color of the background. + Same as -bg. + + -bd <color> (.borderColor) Determines the color of the window + border. + + -bg <color> (.background) Determines the color of the background. + + -bordercolor <color> Same as -bd. + + -borderwidth <width> (.borderWidth) Specifies the width of the border of + the window. Same as -bw. + + -bw <width> (.borderWidth) Specifies the width of the border of + the window. + + -copy (.copy) Always use the copy operation when writing + characters to the display. This option may be + necessary for correct operation on a color display, but + overstrike characters will be incorrect. If greyscale + anti-aliasing is in use, the -copy operation will + disable the use of colorplanes and make overstrikes + come out incorrectly. See also -thorough. + + -cr <color> (.cursorColor) Determines the color of the cursor. + The default is the color of the page border. + + -density <density> (.densityPercent) Determines the density used when + shrinking bitmaps for fonts. A higher value produces a + lighter font. The default value is 40. + + -display <display> Specifies the host, display, and screen to be used for + displaying the DVI file. The display must be specified + in the form node::display.screen. The default is + obtained from the logical name "DECW$DISPLAY", which + may be defined using the SET DISPLAY command. + + -fg <color> (.foreground) Determines the color of the text + (foreground). + + -foreground <color> Same as -fg. + + -gamma <gamma> (.gamma) Controls the interpolation of colors in the + greyscale anti-aliasing color palette. The default + value is 1.0. For 0 < gamma < 1, the fonts will be + lighter (more like the background), and for gamma > 1, + the fonts will be darker (more like the foreground). + Negative values behave the same way, but use a slightly + different algorithm. + + -geometry <geometry> (*geometry) Specifies the initial geometry of the + window. + + -hl <color> (.highlight) Determines the color of the page border. + The default is the foreground color. + + -hush (.Hush) Causes XDVI to suppress all suppressible + warnings. + + -hushchars (.hushLostChars) Causes XDVI to suppress warnings + about references to characters which are not defined in + the font. + + -hushchecksums (.hushChecksums) Causes XDVI to suppress warnings + about checksum mismatches between the DVI file and the + font file. + + -hushspecials (.hushSpecials) Causes XDVI to suppress warnings about + \special strings which it cannot process. + + -icongeometry <geometry> (.iconGeometry) Specifies the initial position for + the icon. + + -iconic (.iconic) Causes the XDVI window to start in the + iconic state. The default is to start with the window + open. + + -keep (.keepPosition) Sets a flag to indicate that XDVI + should not move to the home position when moving to a + new page. See also the `k' keystroke. + + -l (.listFonts) Causes the names of the fonts used to be + listed. + + -margins <dimen> (.Margin) Specifies the size of both the top and side + margins. This should be a decimal number optionally + followed by "cm", e.g., 1.5 or 3cm, giving a + measurement in inches or centimeters. XDVI determines + the "home" position of the page within the window as + follows. If the entire page fits in the window, then + the margin settings are ignored. If, even after + removing the margins from the left, right, top, and + bottom, the page still cannot fit in the window, then + the page is put in the window such that the top and + left margins are hidden, and presumably the upper + left-hand corner of the text on the page will be in the + upper left-hand corner of the window. Otherwise, the + text is centered in the window. See also -sidemargin, + -topmargin, and the keystroke `M'. + + -mgs <size> Same as -mgs1. + + -mgs[n] <size> (.magnifierSize[n]) Specifies the size of the window + to be used for the "magnifying glass" for Button n. + The size may be given as an integer (indicating that + the magnifying glass is to be square), or it may be + given in the form WxH. See the MOUSE ACTIONS section. + Defaults are 200x150, 400x250, 700x500, 1000x800, and + 1200x1200. + + -nogrey (.grey) Turns off the use of greyscale anti-aliasing + when printing shrunken bitmaps. In this case, the + logic of the corresponding resource is the reverse: + -nogrey corresponds to grey:off; +nogrey to grey:on. + See also the 'G' keystroke. + + -offsets <dimen> (.Offset) Specifies the size of both the horizontal + and vertical offsets of the output on the page. This + should be a decimal number optionally followed by "cm", + e.g., 1.5 or 3cm, giving a measurement in inches or + centimeters. By decree of the Stanford TeX Project, + the default TeX page origin is always 1 inch over and + down from the top-left page corner, even when + non-American paper sizes are used. Therefore, the + default offsets are 1.0 inch. See also -xoffset and + -yoffset. + + -p <pixels> (.pixelsPerInch) Defines the size of the fonts to use, + in pixels per inch. The default value is 300. + + -paper <papertype> (.paper) Specifies the size of the printed page. This + may be of the form WxH (or WxHcm), where W is the width + in inches (or cm) and H is the height in inches (or + cm), respectively. There are also synonyms which may + be used: us (8.5x11), usr (11x8.5), legal (8.5x14), + foolscap (13.5x17), as well as the ISO sizes a1-a7, + b1-b7, c1-c7, a1r-a7r (a1-a7 rotated), etc. The + default size is 8.5 x 11 inches. + + -rv (.reverseVideo) Causes the page to be displayed with + white characters on a black background, instead of vice + versa. + + -s <shrink> (.shrinkFactor) Defines the initial shrink factor. + The default value is 3. + + -sidemargin <dimen> (.sideMargin) Specifies the side margin (see + -margins). + + -thorough (.thorough) XDVI will usually try to ensure that + overstrike characters (e.g., \notin) are printed + correctly. On monochrome displays, this is always + possible with one logical operation, either AND or OR. + On color displays, however, this may take two + operations, one to set the appropriate bits and one to + clear other bits. If this is the case, then by default + XDVI will instead use the copy operation, which does + not handle overstriking correctly. The -thorough + option chooses the slower but more correct choice. See + also -copy. + + -topmargin <dimen> (.topMargin) Specifies the top and bottom margins (see + -margins). + + -version Print information on the version of XDVI. + + -xoffset <dimen> (.xOffset) Specifies the size of the horizontal + offset of the output on the page. See -offsets. + + -yoffset <dimen> (.yOffset) Specifies the size of the vertical offset + of the output on the page. See -offsets. + +KEYSTROKES +---------- + + XDVI recognizes the following keystrokes when typed in its window. Each may + optionally be preceded by a (positive or negative) number, whose + interpretation will depend on the particular keystroke. Note that the + keystrokes are case sensitive. + + q Quits the program. Control-C, control-D, and control-Z will do this, + too. + + n Moves to the next page (or to the nth next page if a number is given). + Synonyms are `f', Space, Return, Line Feed, and <Next Screen>. + + p Moves to the previous page (or back n pages). Synonyms are `b', + control-H, Delete, and <Prev Screen>. + + g Moves to the page with the given number. Initially, the first page is + assumed to be page number 1, but this can be changed with the `P' + keystroke, below. If no page number is given, then it goes to the last + page. + + P "This is page number n." This can be used to make the `g' keystroke + refer to actual page numbers instead of absolute page numbers. + + Control-L Redisplays the current page. + + ^ Move to the "home" position of the page. This is normally the upper + left-hand corner of the page, depending on the margins as described in + the -margins option, above. + + u Moves up two thirds of a window-full. The <Up Arrow> key is a synonym + for this keystroke. + + d Moves down two thirds of a window-full. The <Down Arrow> key is a + synonym for this keystroke. + + l Moves left two thirds of a window-full. The <Left Arrow> key is a + synonym for this keystroke. + + r Moves right two thirds of a window-full. The <Right Arrow> key is a + synonym for this keystroke. + + c Moves the page so that the point currently beneath the cursor is moved + to the middle of the window. It also (gasp!) warps the cursor to the + same place. + + M Sets the margins so that the point currently under the cursor is the + upper left-hand corner of the text in the page. Note that this command + itself does not move the image at all. For details on how the margins + are used, see the -margins option. + + s Changes the shrink factor to the given number. If no number is given, + the smallest factor that makes the entire page fit in the window will be + used. (Margins are ignored in this computation.) + + S Sets the density factor to be used when shrinking bitmaps. This should + be a number between 0 and 100; higher numbers produce lighter + characters. + + R Forces the DVI file to be reread. This allows you to preview many + versions of the same file while running XDVI only once. + + k Normally when XDVI switches pages, it moves to the home position as + well. The `k' keystroke toggles a `keep-position' flag which, when set, + will keep the same position when moving between pages. Also `0k' and + `1k' clear and set this flag, respectively. See also the -keep option. + + G This key toggles the use of greyscale anti-aliasing for displaying + shrunken bitmaps. In addition, the key sequences `0G' and `1G' clear and + set this flag, respectively. See also the -nogrey option. + +MOUSE ACTIONS +------------- + + If the shrink factor is set to any number other than one, then clicking any + mouse button will pop up a "magnifying glass" which shows the unshrunk image + in the vicinity of the mouse click. This subwindow disappears when the mouse + button is released. Different mouse buttons produce different sized windows, + as indicated by the -mgs option. Moving the cursor while holding the button + down will move the magnifying glass. + + Also, the scrollbars (if present) behave in the standard X Window way: + pushing Button 2 in a scrollbar moves the top or left edge of the scrollbar + to that point and optionally drags it; pushing Button 1 moves the image up + or right by an amount equal to the distance from the button press to the + upper left-hand corner of the window; pushing Button 3 moves the image down + or left by the same amount. Note that this is different than the way + DECWindows normally defines the actions of the mouse buttons in scrollbars. + +LOGICAL NAMES +------------- + + Unless the -display option is used on the command line, XDVI uses the logical + name "DECW$DISPLAY" to specify which bit map display terminal to use. This + logical name may be defined with the SET DISPLAY command. + + The logical name "XDVIFONTS" determines the directory path(s) searched for + fonts in the following manner. The string consists of one or more strings + separated by slashes. In each such string, the substring "%f" is changed to + the font name; "%d" is changed to the magnification; and "%p" is changed to + the font file format ("pk" or "gf"). If no "%f" appears in the string, then + the string ":%f.%d%p" is added on the end. For example, if the string is + "TEX_FONTS" and the font is cmr10 at 300 dots per inch, then XDVI searches + for TEX_FONTS:CMR10.300PK and TEX_FONTS:CMR10.300GF, in that order. An extra + slash anywhere in the "XDVIFONTS" logical name causes the system default + directories to be tried at that point. If the font is not found in the + desired size, then XDVI will try to find the nearest size. If the font + cannot be found at all, then XDVI will try to vary the point size of the font + (within a certain range), and if this fails, then it will use the font + specified as the alternate font (cf. -altfont). + + In addition, a "%F" specifier is available; it is a synonym for "%f", but it + does not inhibit putting the string ":%f.%d%p" at the end. Finally, a "%b" + specifier is available; it is converted to the current resolution being used + (i.e., the value of the -p parameter or the .pixelsperinch resource). + + For compatibility with some versions of TeX, you may also use the logical + name "TEXFONTS" in place of "XDVIFONTS", although in that case the string + should not include any "%" specifiers. The reason for recognizing "TEXFONTS" + is that certain versions of TeX also support the convention regarding an + extra slash in the font path; therefore, users who create their own fonts can + put both their .TFM and raster files in the same directory and do + + $ DEFINE TEXFONTS "/MFDIR" + + or + + $ DEFINE TEXFONTS "MFDIR/" + + in order to get both TeX and XDVI to search their directory in addition to + the system standard directories. The "XDVIFONTS" logical name overrides the + "TEXFONTS" logical name, so that on those sites where "TEXFONTS" must be set + explicitly, and therefore this feature is not useful, the "XDVIFONTS" logical + name may be set to an empty string to cause XDVI to ignore "TEXFONTS". + + XDVI also recognizes the "PKFONTS" and "TEXPKS" logical names, which are + checked after "XDVIFONTS" but before "TEXFONTS". + + The logical name "XDVISIZES" may be set to indicate which sizes of fonts are + available. It should consist of a list of numbers separated by slashes. If + the list begins with a slash, the system default sizes are used, as well. + Sizes are expressed in dots per inch and must be integers. The current + default set of sizes is 300/329/360/432/518/622/746. XDVI will also try the + actual size of the font before trying any of the given sizes. + + Virtual fonts are also supported, although XDVI does not have any built-in + fonts to which they can refer. The search path for .VF files can be + specified with the "XDVIVFS" logical name in a similar manner to that for the + "XDVIFONTS" logical name. XDVI will also check the "VFFONTS" logical name if + the "XDVIFONTS" logical name is not defined. Virtual fonts are searched for + immediately after looking for the font as a normal font in the exact size + specified. + +FILES +----- + + TEX_FONTS System default directory for font pixel files. + +RESOURCE NAMES +-------------- + + All of the command line options may be set via the resource names given in + parentheses in the descriptions of the options. This may be used to define a + specific set of options as the default each time you run XDVI. To make use + of this feature, create a file named DECW$XDEFAULTS.DAT in the same directory + as the rest of your DECW*.DAT files. Include in this file the resource names + and arguments of each of the options you wish to specify. For example: + + XDvi.copy: off + XDvi.thorough: on + XDvi.shrinkFactor: 2 + XDvi.Margin: 0.95 + XDvi*geometry: 1015x750+3+25 + + When XDVI is invoked, it would behave as if it had been invoked with the + following command: + + XDVI +copy -thorough -s 2 -margins 0.95 -geometry 1015x750+3+25 dvifile + + Specifying options on the command line will override any options specified + via resource names in the DECW$XDEFAULTS.DAT file. + +INSTALLATION +------------ + + The installation of XDVI on a VMS system is relatively easy. If you have a + source-only distribution, you will need to have access to the VAX C compiler + to build an executable image. The following steps should get you started: + + 1) Gather all of the distribution files into one directory, and then create + the executable image by executing the MAKE-VMS.COM file: + + $ @MAKE-VMS + + 2) Create a help file for XDVI using the supplied XDVI.RNH file: + + $ RUNOFF XDVI.RNH + + 3) Insert the resulting XDVI.HLP file into one of your local help libraries: + + $ LIBRARY /INSERT HELPLIB.HLB XDVI.HLP + + 4) Modify the command file you use to set up the TEX commands so that it + defines the foreign symbol XDVI, and the logical names "XDVIFONTS", + "XDVIVFS", and "XDVISIZES". For more information on the expected contents + of the logical names, see the LOGICAL NAMES section of this document. The + following lines are what I use locally: + + $ PROC = F$ENVIRONMENT ("PROCEDURE") + $ TEXDIR = F$PARSE (PROC, , , "DEVICE", "NO_CONCEAL") + - + F$PARSE (PROC, , , "DIRECTORY", "NO_CONCEAL") + $ TEXDIR = TEXDIR - "][" - "][" - "][" - "]" + $ TEXDISK = TEXDIR + ".]" + $ PIXELS = TEXDIR + ".GF.CANON300.]" + $ LPIXELS = TEXDIR + ".LOCAL.PIXELS.CANON300.]" + $! + $! Define the virtual disk devices. + $! + $ DEFINE /PROCESS /TRANSLATE = (CONCEAL, TERMINAL) TEX_DISK 'TEXDISK' + $ DEFINE /PROCESS /TRANSLATE = (CONCEAL, TERMINAL) PIXELS$ 'PIXELS' + $ DEFINE /PROCESS /TRANSLATE = (CONCEAL, TERMINAL) LPIXELS$ 'LPIXELS' + $! + $! Define the directories for TeX and its related TeXware. + $! + $ DEFINE TEX_EXE TEX_DISK:[LOCAL.PROGRAMS] + $ DEFINE TEX_PIXELS PIXELS$, LPIXELS$ + $! + $! Define the information necessary to run XDVI. + $! + $ XDVI :== "$TEX_EXE:XDVI" + $ DEFINE XDVIFONTS "TEX_PIXELS:[DPI%d]%f.%p" + $ DEFINE XDVIVFS XDVIFONTS + $ DEFINE XDVISIZES - + "300/329/360/432/518/600/622/746/896/1075/1200/1290/1548" + $ EXIT + + 5) If you wish, you may create a DECW$XDEFAULTS.DAT file that specifies a + default set of command line options. See the RESOURCE NAMES section for + more information and an example of what I use locally. + + If you have any comments about XDVI, or find any bugs in the program, please + contact me at the address below. Enjoy! + + Scott Allendorf + Department of Physics and Astronomy + The University of Iowa + Iowa City, IA 52242 + + Email: scott-allendorf@uiowa.edu + +AUTHORS +------- + + Eric Cooper, CMU, did a version for direct output to a QVSS. + Modified for X by Bob Scheifler, MIT Laboratory for Computer Science. + Modified for X11 by Mark Eichin, MIT SIPB. + Modified for VMS and DECWindows by Scott Allendorf, University of Iowa. + Additional enhancements by many others. diff --git a/Build/source/texk/windvi/TODO b/Build/source/texk/windvi/TODO new file mode 100644 index 00000000000..aa8df85c6fe --- /dev/null +++ b/Build/source/texk/windvi/TODO @@ -0,0 +1,10 @@ + +- Aldus import graphic filters. + +- tpic specials: implement pen size and stroke + +- color support (almost completed) + +- dvips + gs 'enhanced' mode + +- printing (does not print ps) diff --git a/Build/source/texk/windvi/VMS-C.OPT b/Build/source/texk/windvi/VMS-C.OPT new file mode 100644 index 00000000000..c4fba19f00d --- /dev/null +++ b/Build/source/texk/windvi/VMS-C.OPT @@ -0,0 +1,2 @@ +sys$share:decw$xlibshr/share +sys$share:vaxcrtl/share diff --git a/Build/source/texk/windvi/XDVI.RNH b/Build/source/texk/windvi/XDVI.RNH new file mode 100644 index 00000000000..29deb734622 --- /dev/null +++ b/Build/source/texk/windvi/XDVI.RNH @@ -0,0 +1,692 @@ +.! +.! This is a RUNOFF source file that produces a VMS-style HELP library +.! for the XDVI program. +.! +.! This file was created by hand-converting XDVI.MAN. The internal date +.! in the XDVI.MAN file was "27 March 1990". If you improve this file, +.! please let me know. Pete Siemsen, siemsen@usc.edu +.! +.! Merged with patchlevel 8.001 help file for VMS by Scott Allendorf. +.! Added new switches for patchlevel 10. Scott Allendorf. +.! Added new switches for patchlevel 11. Scott Allendorf. +.! Added new switches for patchlevel 14. Scott Allendorf. +.! Added new switches for patchlevel 16. Scott Allendorf. +.! Updated for patchlevel 17. Scott Allendorf. +.! Updated for patchlevel 18. Scott Allendorf. +.! +.NO PAGING +.NO FLAGS ALL +.RIGHT MARGIN 71 +.LITERAL +! +! DO NOT EDIT THIS FILE. It was produced by passing a .RNH file through +! RUNOFF. Edit the .RNH file instead. +! +.END LITERAL +.LEFT MARGIN 1 + +.INDENT -1 +1 XDVI +.BREAK +XDVI is a program which runs under the DECWindows system. It is used to +preview DVI files, such as those produced by TeX and LaTeX. +.SKIP +XDVI has the capability of displaying the file reduced by various +(integer) factors, and also has a "magnifying glass" which allows one +to see a small part of the unshrunk image momentarily. +.SKIP +Before displaying any page or part thereof, XDVI checks to see if +the DVI file has changed since the last time it was displayed. If this +is the case, XDVI will reinitialize itself for the new DVI file. For +this reason, exposing parts of the XDVI window while TeX is running +should be avoided. This feature allows you to preview many versions +of the same file while running XDVI only once. + +.SKIP +Format: +.SKIP +.INDENT +3 +XDVI [Options] dvi_file + +.INDENT -1 +2 Options +.BREAK +In addition to specifying the DVI file (with or without the .DVI extension), +XDVI supports the following command line options. If the option +begins with a "+" instead of a "-", the option is restored to its +default value. By default, these options can be set via the resource +names given in the description of each option. +.INDENT -1 +3 + +.BREAK ++<page> +.SKIP +Specifies the first page to show. If + is given without a number, the +last page is assumed; the first page is the default. +.INDENT -1 +3 -altfont +.BREAK +-altfont <font> +.SKIP +Declares a default font to use when the font in the DVI file cannot be +found. This is useful, for example, with PostScript fonts. +.SKIP +The resource name is ".altFont". +.INDENT -1 +3 -background +.BREAK +-background <color> +.SKIP +Determines the color of the background. Same as -bg. +.SKIP +The resource name is ".background". +.INDENT -1 +3 -bd +.BREAK +-bd <color> +.SKIP +Determines the color of the window border. +.SKIP +The resource name is ".borderColor". +.INDENT -1 +3 -bg +.BREAK +-bg <color> +.SKIP +Determines the color of the background. +.SKIP +The resource name is ".background". +.INDENT -1 +3 -bordercolor +.BREAK +-bordercolor <color> +.SKIP +Same as -bd. +.INDENT -1 +3 -borderwidth +.BREAK +-borderwidth <width> +.SKIP +Specifies the width of the border of the window. Same as -bw. +.SKIP +The resource name is ".borderWidth". +.INDENT -1 +3 -bw +.BREAK +-bw <width> +.SKIP +Specifies the width of the border of the window. +.SKIP +The resource name is ".borderWidth". +.INDENT -1 +3 -copy +.BREAK +Always use the copy operation when writing characters to the display. +This option may be necessary for correct operation on a color display, +but overstrike characters will be incorrect. If greyscale anti-aliasing +is in use, the -copy operation will disable the use of colorplanes and make +overstrikes come out incorrectly. See also -thorough. +.SKIP +The resource name is ".copy". +.INDENT -1 +3 -cr +.BREAK +-cr <color> +.SKIP +Determines the color of the cursor. The default is the +color of the page border. +.SKIP +The resource name is ".cursorColor". +.INDENT -1 +3 -debug +.BREAK +-debug <bitmask> +.SKIP +If nonzero, prints additional debugging information on standard output. +The bitmask should be given as a decimal number. The values of the bits +are defined in the source file xdvi.h . +.SKIP +The resource name is ".debugLevel". +.INDENT -1 +3 -density +.BREAK +-density <density> +.SKIP +Determines the density used when shrinking bitmaps for fonts. A +higher value produces a lighter font. The default value is 40. +.SKIP +The resource name is ".densityPercent". +.INDENT -1 +3 -display +.BREAK +-display <display> +.SKIP +Specifies the host, display, and screen to be used for displaying the DVI file. +The display must be specified in the form node::display.screen. The default +is obtained from the logical name "DECW$DISPLAY", which may be defined using the +SET DISPLAY command. +.INDENT -1 +3 -fg +.BREAK +-fg <color> +.SKIP +Determines the color of the text (foreground). +.SKIP +The resource name is ".foreground". +.INDENT -1 +3 -foreground +.BREAK +-foreground <color> +.SKIP +Same as -fg. +.INDENT -1 +3 -gamma +.BREAK +-gamma <gamma> +.SKIP +Controls the interpolation of colors in the greyscale anti-aliasing color +palette. The default value is 1.0. For 0 < gamma < 1, the fonts will be +lighter (more like the background), and for gamma > 1, the fonts will be darker +(more like the foreground). Negative values behave the same way, but use a +slightly different algorithm. +.SKIP +The resource name is ".gamma". +.INDENT -1 +3 -geometry +.BREAK +-geometry <geometry> +.SKIP +Specifies the initial geometry of the window. +.SKIP +The resource name is "*geometry". +.INDENT -1 +3 -hl +.BREAK +-hl <color> +.SKIP +Determines the color of the page border. The default is the foreground color. +.SKIP +The resource name is ".highlight". +.INDENT -1 +3 -hush +.BREAK +Causes XDVI to suppress all suppressible warnings. +.SKIP +The resource name is ".Hush". +.INDENT -1 +3 -hushchars +.BREAK +Causes XDVI to suppress warnings about references to characters which +are not defined in the font. +.SKIP +The resource name is ".hushLostChars". +.INDENT -1 +3 -hushchecksums +.BREAK +-hushchecksums +.SKIP +Causes XDVI to supress warnings about checksum mismatches between the DVI file +and the font file. +.SKIP +The resource name is ".hushChecksums". +.INDENT -1 +3 -hushspecials +.BREAK +Causes XDVI to suppress warnings about \special strings which it cannot process. +.SKIP +The resource name is ".hushSpecials". +.INDENT -1 +3 -icongeometry +.BREAK +-icongeometry <geometry> +.SKIP +Specifies the initial position for the icon. +.SKIP +The resource name is ".iconGeometry". +.INDENT -1 +3 -iconic +.BREAK +-iconic +.SKIP +Causes the XDVI window to start in the iconic state. The default is to start +with the window open. +.SKIP +The resource name is ".iconic". +.INDENT -1 +3 -keep +.BREAK +-keep +.SKIP +Sets a flag to indicate that XDVI should not move to the home position when +moving to a new page. See also `k' under the Keystrokes help entry. +.SKIP +The resource name is ".keepPosition". +.INDENT -1 +3 -l +.BREAK +Causes the names of the fonts used to be listed. +.SKIP +The resource name is ".listFonts". +.INDENT -1 +3 -margins +.BREAK +-margins <dimen> +.SKIP +Specifies the size of both the top and side margins. This should be a +decimal number optionally followed by "cm", e.g., 1.5 or 3cm, giving a +measurement in inches or centimeters. +XDVI determines the "home" position of +the page within the window as follows. If the entire page fits in the +window, then the margin settings are ignored. If, even after removing +the margins from the left, right, top, and bottom, the page still +cannot fit in the window, then the page is put in the window such that +the top and left margins are hidden, and presumably the upper +left-hand corner of the text on the page will be in the upper +left-hand corner of the window. Otherwise, the text is centered in +the window. See also -sidemargin, -topmargin under the Options help entry, +and `M' under the Keystrokes help entry. +.SKIP +The resource name is ".Margin". +.INDENT -1 +3 -mfmode +.BREAK +-mfmode <mode-def> +.SKIP +Specifies a `mode-def' string, which can be used in searching for fonts +(see also the 'Logical_Names' entry). +It is also passed to METAFONT during automatic creation of fonts. +.SKIP +The resource name is ".mfMode" +.INDENT -1 +3 -mgs[n] +.BREAK +-mgs[n] <size> +.SKIP +Specifies the size of the window to be used for the "magnifying glass" +for Button n. The size may be given as an integer (indicating that the +magnifying glass is to be square), or it may be given in the form WxH. See +the Mouse_Actions section. +Defaults are 200x150, 400x250, 700x500, 1000x800, and 1200x1200. +.SKIP +The resource name is ".magnifierSize[n]". +.INDENT -1 +3 -mgs +.BREAK +-mgs <size> +.SKIP +Same as -mgs1. +.INDENT -1 +3 -nogrey +.BREAK +-nogrey +.SKIP +Turns off the use of greyscale anti-aliasing when printing shrunken bitmaps. +In this case, the logic of the corresponding resource is the reverse: +-nogrey corresponds to grey:off; +nogrey to grey:on. +See also 'G' under the Keystrokes help entry. +.SKIP +The resource name is ".grey". +.INDENT -1 +3 -nomakepk +.BREAK +-nomakepk +.SKIP +Turns off the automatic generation of missing font files that cannot be +found by other means. +For this option, the logic of the corresponding resource is reversed: +-nogrey corresponds to makePK:off; +nogrey to makePK:on. +.SKIP +The resource name is ".makePK". +.INDENT -1 +3 -offsets +.BREAK +-offsets <dimen> +.SKIP +Specifies the size of both the horizontal and vertical offsets of the +output on the page. This should be a decimal number optionally followed by +"cm", e.g., 1.5 or 3cm, giving a measurement in inches or centimeters. +By decree +of the Stanford TeX Project, the default TeX page origin is always 1 inch +over and down from the top-left page corner, even when non-American paper +sizes are used. Therefore, the default offsets are 1.0 inch. See also -xoffset +and -yoffset. +.SKIP +The resource name is ".Offset". +.INDENT -1 +3 -p +.BREAK +-p <pixels> +.SKIP +Defines the size of the fonts to use, in pixels per inch. The +default value is 300. +.SKIP +The resource name is ".pixelsPerInch". +.INDENT -1 +3 -paper +.BREAK +-paper <papertype> +.SKIP +Specifies the size of the printed page. This may be of the form WxH +(or WxHcm), where W is the width in inches (or cm) and H is the height +in inches (or cm), respectively. There are also synonyms which may be +used: us (8.5x11), usr (11x8.5), legal (8.5x14), foolscap (13.5x17), +as well as the ISO sizes a1-a7, b1-b7, c1-c7, a1r-a7r (a1-a7 rotated), +etc. The default size is 8.5 x 11 inches. +.SKIP +The resource name is ".paper". +.INDENT -1 +3 -rv +.BREAK +Causes the page to be displayed with white characters on a black +background, instead of vice versa. +.SKIP +The resource name is ".reverseVideo". +.INDENT -1 +3 -s +.BREAK +-s <shrink> +.SKIP +Defines the initial shrink factor. The default value is 3. +.SKIP +The resource name is ".shrinkFactor". +.INDENT -1 +3 -sidemargin +.BREAK +-sidemargin <dimen> +.SKIP +Specifies the side margin (see -margins). +.SKIP +The resource name is ".sideMargin". +.INDENT -1 +3 -thorough +.BREAK +XDVI will usually try to ensure that overstrike characters (e.g., +\notin) are printed correctly. On monochrome displays, this is always +possible with one logical operation, either AND or OR. On color +displays, however, this may take two operations, one to set the +appropriate bits and one to clear other bits. If this is the case, +then by default XDVI will instead use the copy operation, which does +not handle overstriking correctly. The -thorough option chooses the +slower but more correct choice. See also -copy. +.SKIP +The resource name is ".thorough". +.INDENT -1 +3 -topmargin +.BREAK +-topmargin <dimen> +.SKIP +Specifies the top and bottom margins (see -margins). +.SKIP +The resource name is ".topMargin". +.INDENT -1 +3 -version +.BREAK +-version +.SKIP +Print information on the version of XDVI. +.INDENT -1 +3 -xoffset +.BREAK +-xoffset <dimen> +.SKIP +Specifies the size of the horizontal offset of the output on the page. See +-offsets. +.SKIP +The resource name is ".xOffset". +.INDENT -1 +3 -yoffset +.BREAK +-yoffset <dimen> +.SKIP +Specifies the size of the vertical offset of the output on the page. See +-offsets. +.SKIP +The resource name is ".yOffset". + +.INDENT -1 +2 Keystrokes +.BREAK +Xdvi recognizes the following keystrokes when typed in its window. +Each may optionally be preceded by a (positive or negative) number, whose +interpretation will depend on the particular keystroke. Note that the +keystrokes are case sensitive. +.INDENT -1 +3 q +.BREAK +Quits the program. Control-C, control-D, and control-Z will do this, too. +.INDENT -1 +3 n +.BREAK +Moves to the next page (or to the nth next page if a number is given). +Synonyms are `f', Space, Return, Line Feed, and <Next Screen>. +.INDENT -1 +3 p +.BREAK +Moves to the previous page (or back n pages). Synonyms are +`b', control-H, Delete, and <Prev Screen>. +.INDENT -1 +3 g +.BREAK +Moves to the page with the given number. Initially, the first page is +assumed to be page number 1, but this can be changed with the `P' +keystroke. If no page number is given, then it goes to the last page. +.INDENT -1 +3 P +.BREAK +"This is page number n." This can be used to make the `g' +keystroke refer to actual page numbers instead of absolute page numbers. +.INDENT -1 +3 Control-L +.BREAK +Redisplays the current page. +.INDENT -1 +3 ^ +.BREAK +Move to the "home" position of the page. This is normally the upper +left-hand corner of the page, depending on the margins as described in +the -margins option. +.INDENT -1 +3 u +.BREAK +Moves up two thirds of a window-full. The <Up Arrow> key is a synonym for this +keystroke. +.INDENT -1 +3 d +.BREAK +Moves down two thirds of a window-full. The <Down Arrow> key is a synonym for +this keystroke. +.INDENT -1 +3 l +.BREAK +Moves left two thirds of a window-full. The <Left Arrow> key is a synonym for +this keystroke. +.INDENT -1 +3 r +.BREAK +Moves right two thirds of a window-full. The <Right Arrow> key is a synonym for +this keystroke. +.INDENT -1 +3 c +.BREAK +Moves the page so that the point currently beneath the cursor is moved to +the middle of the window. It also (gasp!) warps the cursor to the same place. +.INDENT -1 +3 M +.BREAK +Sets the margins so that the point currently under the cursor is the upper +left-hand corner of the text in the page. Note that this command itself does +not move the image at all. For details on how the margins are used, see +the -margins option. +.INDENT -1 +3 s +.BREAK +Changes the shrink factor to the given number. If no number is given, the +smallest factor that makes the entire page fit in the window will be used. +(Margins are ignored in this computation.) +.INDENT -1 +3 S +.BREAK +Sets the density factor to be used when shrinking bitmaps. This should +be a number between 0 and 100; higher numbers produce lighter characters. +If greyscaling mode is in effect, this changes the value of gamma instead. +The new value of gamma is the given number divided by 100; negative values +are allowed. +.INDENT -1 +3 R +.BREAK +Forces the DVI file to be reread. This allows you to preview many +versions of the same file while running XDVI only once. +.INDENT -1 +3 k +.BREAK +Normally when XDVI switches pages, it moves to the home position as +well. The `k' keystroke toggles a `keep-position' flag which, when +set, will keep the same position when moving between pages. Also `0k' +and `1k' clear and set this flag, respectively. See also the -keep option. +.INDENT -1 +3 G +.BREAK +The key toggles the use of greyscale anti-aliasing for displaying shrunken +bitmaps. In addition, the key sequences `0G' and `1G' clear and set this flag, +respectively. See also the -nogrey option. + +.INDENT -1 +2 Mouse_Actions +.BREAK +If the shrink factor is set to any number other than one, then +clicking any mouse button will pop up a "magnifying glass" which shows +the unshrunk image in the vicinity of the mouse click. This subwindow +disappears when the mouse button is released. Different mouse buttons +produce different sized windows, as indicated by the -mgs option. +Moving the cursor while holding the button down will move the +magnifying glass. +.SKIP +Also, the scrollbars (if present) behave in the standard X Window way: pushing +Button 2 in a scrollbar moves the top or left edge of the scrollbar to +that point and optionally drags it; pushing Button 1 moves the image +up or right by an amount equal to the distance from the button press +to the upper left-hand corner of the window; pushing Button 3 moves +the image down or left by the same amount. Note that this is +different than the way +DECWindows normally defines the actions of the mouse buttons in scrollbars. + +.INDENT -1 +2 Logical_Names +.BREAK +Some logical names can be defined to override the values defined when +XDVI was compiled. +.INDENT -1 +3 DECW$DISPLAY +.BREAK +Unless the -display option is used on the command line, XDVI uses the logical +name "DECW$DISPLAY" to specify which bit map +display terminal to use. This logical name may be defined with the SET +DISPLAY command. +.INDENT -1 +3 XDVIFONTS +.BREAK +The logical name "XDVIFONTS" determines the directory path(s) searched for fonts +in the following manner. The string consists of one or more strings +separated by slashes. In each such string, the substring "%f" is +changed to the font name; "%d" is changed to the magnification; and +"%p" is changed to the font file format ("pk" or "gf"). If no "%f" +appears in the string, then the string ":%f.%d%p" is added on the end. +For example, if the string is "TEX_FONTS" and the font is +cmr10 at 300 dots per inch, then XDVI searches for TEX_FONTS:CMR10.300PK +and TEX_FONTS:CMR10.300GF, +in that order. +An extra slash anywhere in the the "XDVIFONTS" logical name causes the +system default directories to be tried at that point. If the font is not +found in the desired size, then XDVI will try to find the nearest size. If the +font cannot be found at all, then XDVI will try to vary the point size +of the font (within a certain range), and if this fails, then it will +use the font specified as the alternate font (cf. -altfont). +.SKIP +In addition, a "%F" specifier is available; it is a synonym for "%f", but it +does not inhibit putting the string ":%f.%d%p" at the end. Finally, a "%b" +specifier is available; it is converted to the current resolution being used +(i.e., the value of the -p parameter or the .pixelsperinch resource). +.SKIP +For compatibility with some versions of TeX, you may also use the logical name +"TEXFONTS" in place of "XDVIFONTS", although in that case the string should +not include any "%" specifiers. The reason for recognizing "TEXFONTS" is +that certain versions of TeX also support the convention regarding an extra +slash in the font path; therefore, users who create their own fonts can put +both their .TFM and raster file in the same directory and do +.SKIP +.LITERAL + $ DEFINE TEXFONTS "/MFDIR" + +or + + $ DEFINE TEXFONTS "MFDIR/" +.END LITERAL +.SKIP +in order to get TeX and XDVI to search their directory in addition to the +system standard directories. The "XDVIFONTS" logical name overrides the +"TEXFONTS" logical name, so that on those sites where "TEXFONTS" must be set +explicitly, and therefore this feature is not useful, the "XDVIFONTS" logical +name may be set to an empty string to cause XDVI to ignore "TEXFONTS". +.SKIP +XDVI also recognizes the "PKFONTS" and "TEXPKS" logical names, which are +checked after "XDVIFONTS" but before "TEXFONTS". + +.INDENT -1 +3 XDVISIZES +.BREAK +The logical name "XDVISIZES" may be set to indicate which +sizes of fonts are available. It should consists of a list of numbers +separated by slashes. If the list begins with a slash, the system +default sizes are used, as well. Sizes are expressed in dots per +inch and must be integers. The current default set of +sizes is 300/329/360/432/518/622/746. XDVI will also try the actual +size of the font before trying any of the given sizes. + +.INDENT -1 +3 XDVIVFS +.BREAK +Virtual fonts are supported, although XDVI does not have any built-in fonts to +which they can refer. The search path for .VF files can be specified with the +"XDVIVFS" logical name in a similar manner to that for the "XDVIFONTS" logical +name. XDVI will also check the "VFFONTS" logical name if the "XDVIFONTS" +logical name is not defined. Virtual fonts are searched for immediately after +looking for the font as a normal font in the exact size specified. + +.INDENT -1 +2 Resource_Names +.BREAK + All of the command line options may be set via the resource names given in + the descriptions of the options. This may be used to define a + specific set of options as the default each time you run XDVI. To make use + of this feature, create a file named DECW$XDEFAULTS.DAT in the same directory + as the rest of your DECW*.DAT files. Include in this file the resource names + and arguments of each of the options you wish to specify. For example: +.SKIP +.LITERAL + XDvi.copy: off + XDvi.thorough: on + XDvi.shrinkFactor: 2 + XDvi.Margin: 0.95 + XDvi*geometry: 1015x750+3+25 +.END LITERAL +.SKIP + When XDVI is invoked, it would behave as if it had been invoked with the + following command: +.SKIP +.LITERAL + XDVI +copy -thorough -s 2 -margins 0.95 -geometry 1015x750+3+25 dvifile +.END LITERAL +.SKIP + Specifying options on the command line will override any options specified + via resource names in the DECW$XDEFAULTS.DAT file. + +.INDENT -1 +2 Authors +.BREAK +.LITERAL +Eric Cooper, CMU, did a version for direct output to a QVSS. +Modified for X by Bob Scheifler, MIT Laboratory for Computer Science. +Modified for X11 by Mark Eichin, MIT SIPB. +Modified for VMS and DECWindows by Scott Allendorf, University of Iowa. +Additional enhancements by many others. +.END LITERAL diff --git a/Build/source/texk/windvi/XDVIFONTS b/Build/source/texk/windvi/XDVIFONTS new file mode 100644 index 00000000000..9f63cef860e --- /dev/null +++ b/Build/source/texk/windvi/XDVIFONTS @@ -0,0 +1,205 @@ +OF TYPE1 FONTS AND FONTMAPS IN XDVI +=================================== + +HOW TO GIVE XDVI TYPE1 FONTS +---------------------------- + +Unlike Postscript printers xdvi has no builtin fonts. So if you want +to use non-TeX type1 fonts such as Times-Roman you need to install +such fonts so xdvi can find them. This file explains the procedure. + +The install procedure is somewhat manual, but very rewarding, and it +need not be repeated unless you want to. + +PLEASE NOTE: xdvi does not NEED these fonts, you will be able to use +xdvi without them. Most texk and teTeX installations come with the +Blue Sky Research/Y&Y type1 versions of Knuths fonts, xdvi will be +able to use them with no further action. + +PLEASE NOTE: This file assumes that you use teTeX installed under +/usr/local/teTeX. It also assumes things about how your texmf tree is +organized. You might have to change many paths to match your setup. + +Enclosed in xdvik is a quite powerful type1 filename mapper called +t1mapper. It was written to help you install type1 fonts in a way +such that xdvik can use them. Here is how to use it. + +1. + +Have gs (ghostscript) version 4 or 5 installed or fetched and +unpacked. Including both font packages ('std' and 'other'). If you +have gs on your machine already you can check what version you have +with the command 'gs -help', this also tells you where the installed +gs stores its fonts. Find the Fontmap file and the fonts. If you +can't find them pretend you don't have them and follow the +instructions in the next paragraph. + +If you don't have gs installed you need to get it and and the font +packages. A likely source of a recent ghostscript is +ftp.ntnu.no:/pub/ghostscript/aladdin. --- Please note that that +package has restrictions on commercial use including any distribution +for money. Please read the file PUBLIC for the full licensing terms. +You can have the fonts under the GPL license as well, see +ftp.ntnu.no:/pub/ghostscript/gnu. Please note that there are license +restrictions on this too, but very different, see the file COPYING +included in the source package --- From the source package you extract +the file 'Fontmap'. Extract the two font packages too. Now you have +the files you need. + +Decide where to install the type1 files for xdvi. +/usr/local/teTeX/share/texmf/fonts/type1/gs is a likely place. Now +run t1mapper to install fonts there: + +t1mapper -gs /usr/local/share/ghostscript/5.50/Fontmap \ + /usr/local/share/ghostscript/fonts \ + /usr/local/teTeX/share/texmf/fonts/type1/gs + +When the command is complete all the fonts gs knows about will have +been copied to /usr/local/teTeX/share/texmf/fonts/type1/gs. This will +give you the standard PostScript fonts as well as some others. Use +the -lns option to make symlinks instead of copying the fonts. + +2. + +If you already have some type1 fonts, other than the ones from +ghostscript, we want to add them too, probably. Some sites have +extensive postscript font collections. All these fonts can be used. + +Additionaly, if you use a machine with a comercial Unix version (such +as IRIX, Solaris, AIX, HP-UX...) it is quite likely that some type1 +fonts are installed on the machine. These can be used by ghostscript +and xdvi. If you don't know where they are search for filenames such +as '*.pfa', '*.pfb', and 'Times-Roman*' and you should be able to find +them. + +To add the fonts found on a Solaris machine so xdvi can find them: + +t1mapper -lns /usr/local/teTeX/share/texmf/fonts/type1/gs \ + /usr/openwin/lib/X11/fonts/Type1/*.pfa + +Run the command on all the type1 fonts you want to be able to use in +xdvi. + +NOTE: Do not run t1mapper on the TeX type1 fonts (cm* and so on). +NOTE: You should probably not run them on your Lucida fonts. + but see xdvi.cfg and lucida.map. + +Copying/linking them all to the same directory will ensure that only +one version of each font is available to xdvi. t1mapper will remove +any font version already available in the target directory before +moving a font there. + +The -lns option will cause t1mapper to symlink the fonts instead of +copying them, saving a good deal of diskspace. These options are +available to modify how t1mapper atempts to copy/link files: + + -cp copy the font files, this is the default and will always work + and never break down on you. + -ln make hard links, this requires all the fonts to be on the same disk. + -lns make symbolic links, this requires that you do not remove the fonts + linked, or xdvi will not be able to use them anymore. + -lnlns atempt hard-link first, if it fails make symbolic link. + -lncp atempt hard-link first, if it fails copy the file. This is a way + to save some diskspace if possible, with no risk of files + disapearing. + +3. + +You should have .afm files for all those fonts. xdvi comes with a +program called type1afm which produces .afm files from type1 files. +It should be run on each type1 file. That can be done like this: + + cd /usr/local/teTeX/share/texmf/fonts/type1/gs + sh + for f in *.{pfa,pfb}; do + type1afm $f + done + exit + +You don't need to do the 'sh' and 'exit' lines if you already run +sh/ksh/bash/zsh, but you _do_ need them if you run csh or tcsh. + +Now you must move the afm files to where they should be stored: + + mkdir /usr/local/teTeX/share/texmf/fonts/afm/gs + mv *.afm /usr/local/teTeX/share/texmf/fonts/afm/gs + +4. + +If you don't have cmr10.pfb, i.e., the type1 version of the +traditional TeX fonts get them from CTAN, e.g., +ftp.tex.ac.uk:/tex-archive/fonts/cm/ps-type1/bluesky/pfb/. Just drop +them in a texmf directory, such as fonts/type1/bluesky/cm/. Afm files +are in /tex-archive/fonts/cm/afm. Drop them in fonts/afm/bluesky/cm. +No further configuration is needed. + +Additionaly, get +/tex-archive/fonts/amsfonts/ps-type1/amsps-unix.tar.gz and install the +pfb files in fonts/type1/bluesky/ams and the afm files in +fonts/afm/bluesky/ams. + +There are some more type1 fonts in +/tex-archive/fonts/cm/ps-type1/bakoma/pfb. As with the bluesky fonts +drop them in a directory, such as fonts/type1/bakoma and the afm files +from /tex-archive/fonts/cm/ps-type1/bakoma/afm in fonts/afm/bakoma. +There is a large overlap between the bakoma and bluesky fonts, you can +save some confusion and diskspace by removing the bakoma fonts that +have bluesky equivalents. + +NOTE: There are license restrictions on the use of the bakoma fonts +which might prevent you from using them. Including using them in +finished documents. The license should be less restricing for xdvi +use than for dvips use though, since xdvi does not produce lasting ink +marks on paper. + +NOTE: The bakoma fonts was made by an automatic process which results +in less precise type1 fonts than the manual process used to create the +bluesky fonts. Many people would not use the bakoma fonts with +printers. They are probably quite fine to use with xdvi though. + +5. + +All the font files are now where they should be. If you use a file +database it's time to update it. teTeX users run 'texhash' to obtain +this effect. + +xdvi can now find all the nice files and will not need pk versions of +all those fonts. + +Please read the INSTALL file too. And the README file. + +OF FONTMAPS +----------- + +In principle Xdvi only accepts a subset of the fontmaps used by dvips +and pdftex. In practice the restrictions are not very restraining. + +Xdvi accepts fontmaps that obey these rules: + +1. If the font is to be encoded there must be a t1lib version of the + encoding vector. See the enclosed vector files. The vector file + must have a .enc extention or be included by a <[ ... thingy. + Encoding is optional. + +2. The other file on the map line must be a font file in pfa or pfb format, + the extention need not be included for the sake of xdvi (but dvips + and pdftex might like it if you include it). The font file name is + REQUIRED. + + Xdvi does not have builtin fonts. t1mapper hi-jacks the builtin + fonts from ghostscript or other places for you. But xdvi _must_ + know the name of the font file associated with the font. + +3. There may not be any other input files on a fontmap line. + + Xdvi is not a printer and cannot accept arbitrary postscript + prologues or setup things in fontmaps. + +4. Xdvi decodes the ExtendFont and SlantFont commands in the quoted + postscript code and the extention factor and slanting is applied + to the font when displayed. Any other magic done by the quoted + postscript code cannot be decoded or duplicated by xdvi. + + In particular Xdvi does not look at the ReEncodeFont command, the + encoding is implied by the presense of a encoding file on the map + line rather than anything specified in the postscript string. diff --git a/Build/source/texk/windvi/acconfig.h b/Build/source/texk/windvi/acconfig.h new file mode 100644 index 00000000000..dc10cf6c9cd --- /dev/null +++ b/Build/source/texk/windvi/acconfig.h @@ -0,0 +1,40 @@ +/* Define to use A4 as the default paper size. */ +#define A4 0 + +/* Define to the length (in bytes) of the above type. */ +#define BMBYTES 4 + +/* Define to determine the integer type to be used in bitmaps. The type used + will be "unsigned BMTYPE". */ +#define BMTYPE int + +/* Define to enable radio buttons on the side of the window for common + commands. */ +#undef BUTTONS + +/* Define to enable greyscale anti-aliasing for shrunken bitmaps. */ +#undef GREY + +/* Define to enable gf format files (in addition to pk format). */ +#undef USE_GF + +/* Define if your system has STREAMS (and if X uses it). */ +#define HAVE_STREAMS 0 + +/* Define if you have the poll function. */ +#define HAVE_POLL 0 + +/* Define if you are using SunOS 4.x. */ +#define SUNOS4 0 + +/* xdvik: Define to avoid using any toolkit (and consequently omit lots + of features). */ +#undef NOTOOL + +/* all: Define to enable running scripts when missing input files. */ +#define MAKE_TEX_MF_BY_DEFAULT 0 +#define MAKE_TEX_PK_BY_DEFAULT 0 +#define MAKE_TEX_TEX_BY_DEFAULT 0 +#define MAKE_TEX_TFM_BY_DEFAULT 0 +#define MAKE_OMEGA_OFM_BY_DEFAULT 0 +#define MAKE_OMEGA_OCP_BY_DEFAULT 0 diff --git a/Build/source/texk/windvi/aclocal.m4 b/Build/source/texk/windvi/aclocal.m4 new file mode 100644 index 00000000000..e05ecd84729 --- /dev/null +++ b/Build/source/texk/windvi/aclocal.m4 @@ -0,0 +1,72 @@ +dnl ### Determine integer type to use for bitmaps + +AC_DEFUN(XDVI_C_BITMAP_TYPE, +[AC_MSG_CHECKING(for integer type to use in bitmaps) +AC_CACHE_VAL(xdvi_cv_bitmap_type, +[AC_TRY_RUN( +[#include <stdio.h> +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + if ((sizeof(unsigned long) == 4 || sizeof(unsigned long) == 2) + && sizeof(unsigned long) != sizeof(unsigned int)) + fprintf(f, "BMTYPE=long BMBYTES=%d\n", sizeof(unsigned long)); + if (sizeof(unsigned int) == 4 || sizeof(unsigned int) == 2) + fprintf(f, "BMTYPE=int BMBYTES=%d\n", sizeof(unsigned int)); + else if (sizeof(unsigned short) == 4 || sizeof(unsigned short) == 2) + fprintf(f, "BMTYPE=short BMBYTES=%d\n", sizeof(unsigned short)); + else fprintf(f, "BMTYPE=char BMBYTES=%d\n", sizeof(unsigned char)); + exit(0); +}], +xdvi_cv_bitmap_type="`cat conftestval`", +AC_MSG_ERROR(could not determine integer type for bitmap))]) +eval "$xdvi_cv_bitmap_type" +AC_DEFINE_UNQUOTED(BMTYPE, $BMTYPE) +AC_DEFINE_UNQUOTED(BMBYTES, $BMBYTES) +AC_MSG_RESULT([unsigned $BMTYPE, size = $BMBYTES])]) + + +dnl ### Check for at-least-pretend Streams capability + +AC_DEFUN(XDVI_SYS_STREAMS, +[AC_CACHE_CHECK([for stropts.h and isastream()], xdvi_cv_sys_streams, +[AC_TRY_LINK( +[#include <stropts.h> +], [#ifndef I_SETSIG +choke me +#else +isastream(0); +#endif], xdvi_cv_sys_streams=yes, xdvi_cv_sys_streams=no)]) +if test $xdvi_cv_sys_streams = yes; then + AC_DEFINE(HAVE_STREAMS) +fi]) + + +dnl ### Check for poll() + +AC_DEFUN(XDVI_FUNC_POLL, +[AC_CACHE_CHECK([for poll.h and poll()], xdvi_cv_func_poll, +[AC_TRY_LINK( +[#include <poll.h> +], [poll((struct pollfd *) 0, 0, 0);], +xdvi_cv_func_poll=yes, xdvi_cv_func_poll=no)]) +if test $xdvi_cv_func_poll = yes; then + AC_DEFINE(HAVE_POLL) +else + AC_CHECK_HEADERS(sys/select.h select.h) +fi]) + + +dnl ### Check for SunOS 4 + +AC_DEFUN(XDVI_SYS_SUNOS_4, +[AC_CACHE_CHECK([for SunOS 4], xdvi_cv_sys_sunos_4, +[case "`(uname -sr) 2>/dev/null`" in +"SunOS 4."*) + xdvi_cv_sys_sunos_4=yes ;; +*) xdvi_cv_sys_sunos_4=no ;; +esac]) +if test $xdvi_cv_sys_sunos_4 = yes; then + AC_DEFINE(SUNOS4) +fi]) diff --git a/Build/source/texk/windvi/alloca.c b/Build/source/texk/windvi/alloca.c new file mode 100644 index 00000000000..26390163005 --- /dev/null +++ b/Build/source/texk/windvi/alloca.c @@ -0,0 +1,198 @@ +/* + alloca -- (mostly) portable public-domain implementation -- D A Gwyn + + last edit: 86/05/30 rms + include xdvi-config.h, since on VMS it renames some symbols. + Use xmalloc instead of malloc. + + This implementation of the PWB library alloca() function, + which is used to allocate space off the run-time stack so + that it is automatically reclaimed upon procedure exit, + was inspired by discussions with J. Q. Johnson of Cornell. + + It should work under any C implementation that uses an + actual procedure stack (as opposed to a linked list of + frames). There are some preprocessor constants that can + be defined when compiling for your specific system, for + improved efficiency; however, the defaults should be okay. + + The general concept of this implementation is to keep + track of all alloca()-allocated blocks, and reclaim any + that are found to be deeper in the stack than the current + invocation. This heuristic does not reclaim storage as + soon as it becomes invalid, but it will do so eventually. + + As a special case, alloca(0) reclaims storage without + allocating any. It is a good idea to use alloca(0) in + your main control loop, etc. to force garbage collection. +*/ +#if 0 +static char SCCSid[] = "@(#)alloca.c 1.1"; +#endif + +#ifdef emacs +#include "xdvi-config.h" +#ifdef static +/* actually, only want this if static is defined as "" + -- this is for usg, in which emacs must undefine static + in order to make unexec workable + */ +#ifndef STACK_DIRECTION +you +lose +-- must know STACK_DIRECTION at compile-time +#endif /* STACK_DIRECTION undefined */ +#endif /* static */ +#endif /* emacs */ + +#ifndef alloca /* If compiling with GCC, this file's not needed. */ + +#ifdef __STDC__ +typedef void *pointer; /* generic pointer type */ +#else +typedef char *pointer; /* generic pointer type */ +#endif + +#define NULL 0 /* null pointer constant */ + +#ifdef WIN32 +#include <malloc.h> +#else +extern void free(); +extern pointer xmalloc(); +#endif + +/* + Define STACK_DIRECTION if you know the direction of stack + growth for your system; otherwise it will be automatically + deduced at run-time. + + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown +*/ + +#ifndef STACK_DIRECTION +#define STACK_DIRECTION 0 /* direction unknown */ +#endif + +#if STACK_DIRECTION != 0 + +#define STACK_DIR STACK_DIRECTION /* known at compile-time */ + +#else /* STACK_DIRECTION == 0; need run-time code */ + +static int stack_dir; /* 1 or -1 once known */ +#define STACK_DIR stack_dir + +static void +find_stack_direction (/* void */) +{ + static char *addr = NULL; /* address of first + `dummy', once known */ + auto char dummy; /* to get stack address */ + + if (addr == NULL) + { /* initial entry */ + addr = &dummy; + + find_stack_direction (); /* recurse once */ + } + else /* second entry */ + if (&dummy > addr) + stack_dir = 1; /* stack grew upward */ + else + stack_dir = -1; /* stack grew downward */ +} + +#endif /* STACK_DIRECTION == 0 */ + +/* + An "alloca header" is used to: + (a) chain together all alloca()ed blocks; + (b) keep track of stack depth. + + It is very important that sizeof(header) agree with malloc() + alignment chunk size. The following default should work okay. +*/ + +#ifndef ALIGN_SIZE +#define ALIGN_SIZE sizeof(double) +#endif + +typedef union hdr +{ + char align[ALIGN_SIZE]; /* to force sizeof(header) */ + struct + { + union hdr *next; /* for chaining headers */ + char *deep; /* for stack depth measure */ + } h; +} header; + +/* + alloca( size ) returns a pointer to at least `size' bytes of + storage which will be automatically reclaimed upon exit from + the procedure that called alloca(). Originally, this space + was supposed to be taken from the current stack frame of the + caller, but that method cannot be made to work for some + implementations of C, for example under Gould's UTX/32. +*/ + +static header *last_alloca_header = NULL; /* -> last alloca header */ + +pointer +alloca (size) /* returns pointer to storage */ + unsigned size; /* # bytes to allocate */ +{ + auto char probe; /* probes stack depth: */ + char *depth = &probe; + +#if STACK_DIRECTION == 0 + if (STACK_DIR == 0) /* unknown growth direction */ + find_stack_direction (); +#endif + + /* Reclaim garbage, defined as all alloca()ed storage that + was allocated from deeper in the stack than currently. */ + + { + header *hp; /* traverses linked list */ + + for (hp = last_alloca_header; hp != NULL;) + if ((STACK_DIR > 0 && hp->h.deep > depth) + || (STACK_DIR < 0 && hp->h.deep < depth)) + { + header *np = hp->h.next; + + free ((pointer) hp); /* collect garbage */ + + hp = np; /* -> next header */ + } + else + break; /* rest are not deeper */ + + last_alloca_header = hp; /* -> last valid storage */ + } + + if (size == 0) + return NULL; /* no allocation required */ + + /* Allocate combined header + user data storage. */ + + { + pointer new = xmalloc (sizeof (header) + size); + /* address of header */ + + ((header *)new)->h.next = last_alloca_header; + ((header *)new)->h.deep = depth; + + last_alloca_header = (header *)new; + + /* User storage begins just after header. */ + + return (pointer)((char *)new + sizeof(header)); + } +} + +#endif /* no alloca */ diff --git a/Build/source/texk/windvi/c-auto.in b/Build/source/texk/windvi/c-auto.in new file mode 100644 index 00000000000..b79e5cbb4ec --- /dev/null +++ b/Build/source/texk/windvi/c-auto.in @@ -0,0 +1,127 @@ +/* c-auto.in. Generated automatically from configure.in by autoheader. */ + +/* Define if you don't have vprintf but do have _doprnt. */ +#undef HAVE_DOPRNT + +/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */ +#undef HAVE_SYS_WAIT_H + +/* Define if you have <vfork.h>. */ +#undef HAVE_VFORK_H + +/* Define if you have the vprintf function. */ +#undef HAVE_VPRINTF + +/* Define to `int' if <sys/types.h> doesn't define. */ +#undef pid_t + +/* Define as the return type of signal handlers (int or void). */ +#undef RETSIGTYPE + +/* Define to `unsigned' if <sys/types.h> doesn't define. */ +#undef size_t + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define vfork as fork if vfork does not work. */ +#undef vfork + +/* Define if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN + +/* Define if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING + +/* Define to use A4 as the default paper size. */ +#define A4 0 + +/* Define to the length (in bytes) of the above type. */ +#define BMBYTES 4 + +/* Define to determine the integer type to be used in bitmaps. The type used + will be "unsigned BMTYPE". */ +#define BMTYPE int + +/* Define to enable radio buttons on the side of the window for common + commands. */ +#undef BUTTONS + +/* Define to enable greyscale anti-aliasing for shrunken bitmaps. */ +#undef GREY + +/* Define to enable gf format files (in addition to pk format). */ +#undef USE_GF + +/* Define if your system has STREAMS (and if X uses it). */ +#define HAVE_STREAMS 0 + +/* Define if you have the poll function. */ +#define HAVE_POLL 0 + +/* Define if you are using SunOS 4.x. */ +#define SUNOS4 0 + +/* xdvik: Define to avoid using any toolkit (and consequently omit lots + of features). */ +#undef NOTOOL + +/* all: Define to enable running scripts when missing input files. */ +#define MAKE_TEX_MF_BY_DEFAULT 0 +#define MAKE_TEX_PK_BY_DEFAULT 0 +#define MAKE_TEX_TEX_BY_DEFAULT 0 +#define MAKE_TEX_TFM_BY_DEFAULT 0 +#define MAKE_OMEGA_OFM_BY_DEFAULT 0 +#define MAKE_OMEGA_OCP_BY_DEFAULT 0 + +/* Define if you have the isinf function. */ +#undef HAVE_ISINF + +/* Define if you have the memcpy function. */ +#undef HAVE_MEMCPY + +/* Define if you have the setenv function. */ +#undef HAVE_SETENV + +/* Define if you have the sigaction function. */ +#undef HAVE_SIGACTION + +/* Define if you have the strchr function. */ +#undef HAVE_STRCHR + +/* Define if you have the strerror function. */ +#undef HAVE_STRERROR + +/* Define if you have the tempnam function. */ +#undef HAVE_TEMPNAM + +/* Define if you have the waitpid function. */ +#undef HAVE_WAITPID + +/* Define if you have the <X11/Xosdefs.h> header file. */ +#undef HAVE_X11_XOSDEFS_H + +/* Define if you have the <ieeefp.h> header file. */ +#undef HAVE_IEEEFP_H + +/* Define if you have the <netdb.h> header file. */ +#undef HAVE_NETDB_H + +/* Define if you have the <select.h> header file. */ +#undef HAVE_SELECT_H + +/* Define if you have the <sys/bsdtypes.h> header file. */ +#undef HAVE_SYS_BSDTYPES_H + +/* Define if you have the <sys/select.h> header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define if you have the <zlib.h> header file. */ +#undef HAVE_ZLIB_H + +/* Define if you have the www library (-lwww). */ +#undef HAVE_LIBWWW + +/* Define if you have the z library (-lz). */ +#undef HAVE_LIBZ diff --git a/Build/source/texk/windvi/c-openmx.h b/Build/source/texk/windvi/c-openmx.h new file mode 100644 index 00000000000..4e4c7db7ab6 --- /dev/null +++ b/Build/source/texk/windvi/c-openmx.h @@ -0,0 +1,37 @@ +/* c-openmx.h: define OPEN_MAX, the maximum number of open files a + process can have. Possibly dynamically determined. + +Copyright (C) 1993 Karl Berry. + +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., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef C_OPENMX_H +#define C_OPENMX_H + +#include <kpathsea/c-limits.h> + +#ifndef OPEN_MAX +#ifdef _SC_OPEN_MAX +#define OPEN_MAX sysconf (_SC_OPEN_MAX) +#else /* no SC_OPEN_MAX */ +#ifdef NOFILE +#define OPEN_MAX NOFILE +#else /* no NOFILE */ +#define OPEN_MAX 24 /* The POSIX minimum. */ +#endif /* no NOFILE */ +#endif /* no _SC_OPEN_MAX */ +#endif /* no OPEN_MAX */ + +#endif /* not C_OPENMX_H */ diff --git a/Build/source/texk/windvi/config.hin b/Build/source/texk/windvi/config.hin new file mode 100644 index 00000000000..f504452c0a7 --- /dev/null +++ b/Build/source/texk/windvi/config.hin @@ -0,0 +1,22 @@ +/* These are the symbols not moved to c-auto.in for some reason or + other. The file is here for reference. - janl +*/ + +/* Define to enable support for a configuration file. Its value must be a + colon-separated list of paths to search. */ +#undef DEFAULT_CONFIG_PATH + +/* Define to enable support for a configuration file (as above), including + support for the variables $SELFAUTODIR and $SELFAUTOPARENT. */ +#undef SELFAUTO + +/* Define to enable support for a configuration file and self-auto support + (as above), plus setting of certain resources via the configuration file. */ +#undef CFG2RES + +/* Define to enable right-to-left typesetting. */ +#undef TEXXET + +/* Define to set a default mfmode and resolution. */ +#undef MFMODE + diff --git a/Build/source/texk/windvi/configure b/Build/source/texk/windvi/configure new file mode 100755 index 00000000000..fdf8703c762 --- /dev/null +++ b/Build/source/texk/windvi/configure @@ -0,0 +1,4037 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer" +ac_help="$ac_help + --without-mktexmf-default do not run mktexmf if MF source missing" +ac_help="$ac_help + --without-mktexpk-default do not run mktexpk if PK font missing" +ac_help="$ac_help + --without-mktextfm-default do not run mktextfm if TFM file missing" +ac_help="$ac_help + --without-mkocp-default do not run mkocp if OCP file missing" +ac_help="$ac_help + --without-mkofm-default do not run mkofm if OFM file missing" +ac_help="$ac_help + --with-mktexfmt-default run mktexfmt if format file missing" +ac_help="$ac_help + --with-mktextex-default run mktextex if TeX source missing" +ac_help="$ac_help + --with-x use the X Window System" +ac_help="$ac_help + --with-x-toolkit=KIT OBSOLETE: use --with-mf-x-toolkit and/or + --with-xdvi-x-toolkit instead." +ac_help="$ac_help + --with-ps=PS use PostScript; default gs (PS=no/yes/gs/dps/news)" +ac_help="$ac_help + --disable-grey disable greyscale anti-aliasing for shrunken bitmaps +" +ac_help="$ac_help + --disable-buttons disable buttons on the side of the window" +ac_help="$ac_help + --enable-gf enable gf format pixel files (in addition to pk)" +ac_help="$ac_help + --enable-a4 set default paper size to A4 and default unit to cm" +ac_help="$ac_help + --with-system-zlib use installed zlib library" +ac_help="$ac_help + --with-zlib-libdir=DIR + Specify directory where the zlib.a resides." +ac_help="$ac_help + --with-zlib-include=DIR + Specify the zlib header files location." + +# Initialize some variables set by options. +# The variables have the same names as the options, with +# dashes changed to underlines. +build=NONE +cache_file=./config.cache +exec_prefix=NONE +host=NONE +no_create= +nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +target=NONE +verbose= +x_includes=NONE +x_libraries=NONE +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +# Initialize some other variables. +ac_config_files= +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +ac_max_here_lines=12 + +ac_prev= +for ac_option +do + + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + case "$ac_option" in + -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) ac_optarg= ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) + ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } + fi + ac_feature=`echo $ac_feature| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he) + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat << EOF +Usage: configure [options] [host] +Options: [defaults in brackets after descriptions] +Configuration: + --cache-file=FILE cache test results in FILE + --help print this message + --no-create do not create output files + --quiet, --silent do not print \`checking...' messages + --version print the version of autoconf that created configure +Directory and file names: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [same as prefix] + --bindir=DIR user executables in DIR [EPREFIX/bin] + --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] + --libexecdir=DIR program executables in DIR [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data in DIR + [PREFIX/share] + --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data in DIR + [PREFIX/com] + --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] + --libdir=DIR object code libraries in DIR [EPREFIX/lib] + --includedir=DIR C header files in DIR [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] + --infodir=DIR info documentation in DIR [PREFIX/info] + --mandir=DIR man documentation in DIR [PREFIX/man] + --srcdir=DIR find the sources in DIR [configure dir or ..] + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM + run sed PROGRAM on installed program names +EOF + cat << EOF +Host type: + --build=BUILD configure for building on BUILD [BUILD=HOST] + --host=HOST configure for HOST [guessed] + --target=TARGET configure for TARGET [TARGET=HOST] +Features and packages: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +EOF + if test -n "$ac_help"; then + echo "--enable and --with options recognized:$ac_help" + fi + exit 0 ;; + + -host | --host | --hos | --ho) + ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) + host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + case "$ac_option" in + *=*) ;; + *) ac_optarg=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then + { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } + fi + ac_package=`echo $ac_package| sed 's/-/_/g'` + eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries="$ac_optarg" ;; + + -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + if test -n "`echo $ac_envvar| sed 's/[_a-zA-Z0-9]//g'`"; then + { echo "configure: error: invalid variable name: $ac_envvar" 1>&2; exit 1; } + fi + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then + echo "configure: warning: $ac_option: invalid host type" 1>&2 + fi + if test "x$nonopt" != xNONE; then + { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } + fi + nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +# File descriptor usage: +# 0 standard input +# 1 file creation +# 2 errors and warnings +# 3 some systems may open it to /dev/tty +# 4 used on the Kubota Titan +# 6 checking for... messages and results +# 5 compiler messages saved in config.log +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>./config.log + +echo "\ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. +" 1>&5 + +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell metacharacters. +ac_configure_args= +for ac_arg +do + case "$ac_arg" in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ac_configure_args="$ac_configure_args '$ac_arg'" ;; + *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + +# NLS nuisances. +# Only set these to C if already set. These must not be set unconditionally +# because not all systems understand e.g. LANG=C (notably SCO). +# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +# Non-C LC_CTYPE values break the ctype check. +if test "${LANG+set}" = set; then LANG=C; export LANG; fi +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo > confdefs.h + +# A filename unique to this package, relative to the directory that +# configure is in, which we can look for to find out if srcdir is correct. +ac_unique_file=xdvi.c + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +ac_exeext= +ac_objext=o +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then + # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. + if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then + ac_n= ac_c=' +' ac_t=' ' + else + ac_n=-n ac_c= ac_t= + fi +else + ac_n= ac_c='\c' ac_t= +fi + + + + + +# Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:583: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test $ac_x $ac_dir/$ac_word; then + ac_cv_prog_CC="gcc" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:614: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no + if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test $ac_x $ac_dir/$ac_word; then + if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + break + fi + done + IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test -z "$CC"; then + case "`uname -s`" in + *win32* | *WIN32*) + # Extract the first word of "cl", so it can be a program name with args. +set dummy cl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:666: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test $ac_x $ac_dir/$ac_word; then + ac_cv_prog_CC="cl" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + fi + test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:699: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +cat > conftest.$ac_ext << EOF + +#line 710 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:741: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 +cross_compiling=$ac_cv_prog_cc_cross + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:746: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:755: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:774: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + case $ac_dir in + /*|[A-z]:/*) ac_aux_dir=$ac_dir;; + *) ac_aux_dir=`pwd`/$ac_dir;; + esac + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + case $ac_dir in + /*|[A-z]:/*) ac_aux_dir=$ac_dir;; + *) ac_aux_dir=`pwd`/$ac_dir;; + esac + ac_install_sh="$ac_aux_dir/install.sh -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +ac_config_guess=$ac_aux_dir/config.guess +ac_config_sub=$ac_aux_dir/config.sub +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:842: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" + # Hack for MSDOS and descendants. + if test -z "$COMSPEC"; then ac_x=-f; else ac_x=-x; fi + for ac_dir in $PATH; do + # Account for people who put trailing slashes in PATH elements. + case "$ac_dir/" in + /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if test $ac_x $ac_dir/$ac_prog; then + if test $ac_prog = install && + grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL="$ac_install_sh" + fi +fi +echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +echo "configure:897: checking whether ${MAKE-make} sets \${MAKE}" >&5 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 +echo "configure:924: checking whether ln -s works" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftestdata +# MS-DOS is a special case, because it sort of pretends that ln -s +# works for executables. +if test -z "$COMSPEC" && ln -s X conftestdata 2>/dev/null +then + rm -f conftestdata + ac_cv_prog_LN_S="ln -s" +else + ac_cv_prog_LN_S=ln +fi +fi +LN_S="$ac_cv_prog_LN_S" +if test "$ac_cv_prog_LN_S" = "ln -s"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:949: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 + if test "x$USE_MAINTAINER_MODE" = xyes; then + MAINT= + else + MAINT='#M#' + fi + + + +echo $ac_n "checking for loader (symbol LD)""... $ac_c" 1>&6 +echo "configure:968: checking for loader (symbol LD)" >&5 +if eval "test \"`echo '$''{'cf_cv_subst_LD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +test -z "$LD" && LD=ld +cf_cv_subst_LD=$LD +fi + +LD=${cf_cv_subst_LD} +echo "$ac_t""$LD" 1>&6 + + +echo $ac_n "checking for archiver (symbol AR)""... $ac_c" 1>&6 +echo "configure:982: checking for archiver (symbol AR)" >&5 +if eval "test \"`echo '$''{'cf_cv_subst_AR'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +test -z "$AR" && AR=ar +cf_cv_subst_AR=$AR +fi + +AR=${cf_cv_subst_AR} +echo "$ac_t""$AR" 1>&6 + + +echo $ac_n "checking for archiver options (symbol ARFLAGS)""... $ac_c" 1>&6 +echo "configure:996: checking for archiver options (symbol ARFLAGS)" >&5 +if eval "test \"`echo '$''{'cf_cv_subst_ARFLAGS'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + +test -z "$ARFLAGS" && ARFLAGS=rc +cf_cv_subst_ARFLAGS=$ARFLAGS +fi + +ARFLAGS=${cf_cv_subst_ARFLAGS} +echo "$ac_t""$ARFLAGS" 1>&6 + + + +# Check whether --with-mktexmf-default or --without-mktexmf-default was given. +if test "${with_mktexmf_default+set}" = set; then + withval="$with_mktexmf_default" + : +else + with_mktexmf_default=yes +fi + +# Check whether --with-mktexpk-default or --without-mktexpk-default was given. +if test "${with_mktexpk_default+set}" = set; then + withval="$with_mktexpk_default" + : +else + with_mktexpk_default=yes +fi + +# Check whether --with-mktextfm-default or --without-mktextfm-default was given. +if test "${with_mktextfm_default+set}" = set; then + withval="$with_mktextfm_default" + : +else + with_mktextfm_default=yes +fi + +# Check whether --with-mkocp-default or --without-mkocp-default was given. +if test "${with_mkocp_default+set}" = set; then + withval="$with_mkocp_default" + : +else + with_mkocp_default=yes +fi + +# Check whether --with-mkofm-default or --without-mkofm-default was given. +if test "${with_mkofm_default+set}" = set; then + withval="$with_mkofm_default" + : +else + with_mkofm_default=yes +fi + +# Check whether --with-mktexfmt-default or --without-mktexfmt-default was given. +if test "${with_mktexfmt_default+set}" = set; then + withval="$with_mktexfmt_default" + : +fi + +# Check whether --with-mktextex-default or --without-mktextex-default was given. +if test "${with_mktextex_default+set}" = set; then + withval="$with_mktextex_default" + with_mktextex_default=yes +else + with_mktextex_default=no +fi + + +echo $ac_n "checking where the main texmf tree is located""... $ac_c" 1>&6 +echo "configure:1066: checking where the main texmf tree is located" >&5 +texmfmain= +if test "x$datadir" != 'x${prefix}/share'; then + # First case, datadir is defined... + eval p=\"$datadir\" + # Unconditionally set the directory, but... + texmfmain=`echo "$p/texmf" | sed 's,//*,/,g'` + # ... do complain if it wasn't found. + if test -d "$texmfmain"; then + echo "$ac_t"""$texmfmain"" 1>&6 + else + echo "$ac_t""not found" 1>&6 + echo "configure: warning: No texmf tree found at $texmfmain. + ***************************************************************** + * Error: The main texmf tree was not found. * + * If you do not have the files, you should be able to them from * + * the same place you got these sources from, or from one of the * + * CTAN hosts. * + ***************************************************************** + Winging it." 1>&2 + fi +else + # Second case, datadir is default... + if test "x$prefix" = "xNONE"; then + p="$ac_default_prefix" + else + eval p=\"$prefix\" + fi + for e in share/texmf lib/texmf texmf; do + if test -d "$p/$e"; then + texmfmain='${prefix}'/"$e" + break + fi + done + if test -z "$texmfmain" && test "x$prefix" = "xNONE"; then + # Still no texmfmain found, no prefix set, perhaps kpsewhich is + # installed and can help us out. + texmfmain=`kpsewhich --expand-path='$TEXMFMAIN'` 2>/dev/null + fi + texmfmain=`echo "$texmfmain" | sed 's,//*,/,g'` + if test -n "$texmfmain"; then + echo "$ac_t"""$texmfmain"" 1>&6 + else + eval texmfmain="$datadir/texmf" + echo "$ac_t""not found" 1>&6 + echo "configure: warning: The main texmf tree was not found at $texmfmain. + ***************************************************************** + * Error: The main texmf tree was not found. * + * Use the --datadir option to specify its parent directory. * + * If you do not have the files, you should be able to them from * + * the same place you got these sources from, or from one of the * + * CTAN hosts. * + ***************************************************************** + Winging it by pretending $texmfmain is correct." 1>&2 + fi +fi + + + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1126: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext <<EOF +#line 1141 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1147: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext <<EOF +#line 1158 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1164: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext <<EOF +#line 1175 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:1206: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1211 "configure" +#include "confdefs.h" +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext <<EOF +#line 1236 "configure" +#include "confdefs.h" +#include <string.h> +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext <<EOF +#line 1254 "configure" +#include "confdefs.h" +#include <stdlib.h> +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext <<EOF +#line 1275 "configure" +#include "confdefs.h" +#include <ctype.h> +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:1286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +echo $ac_n "checking for pid_t""... $ac_c" 1>&6 +echo "configure:1310: checking for pid_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1315 "configure" +#include "confdefs.h" +#include <sys/types.h> +#if STDC_HEADERS +#include <stdlib.h> +#include <stddef.h> +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_pid_t=yes +else + rm -rf conftest* + ac_cv_type_pid_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_pid_t" 1>&6 +if test $ac_cv_type_pid_t = no; then + cat >> confdefs.h <<\EOF +#define pid_t int +EOF + +fi + +ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 +echo "configure:1344: checking for vfork.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1349 "configure" +#include "confdefs.h" +#include <vfork.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1354: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_VFORK_H 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking for working vfork""... $ac_c" 1>&6 +echo "configure:1379: checking for working vfork" >&5 +if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + echo $ac_n "checking for vfork""... $ac_c" 1>&6 +echo "configure:1385: checking for vfork" >&5 +if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1390 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char vfork(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char vfork(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_vfork) || defined (__stub___vfork) +choke me +#else +vfork(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1413: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_vfork=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_vfork=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + +ac_cv_func_vfork_works=$ac_cv_func_vfork +else + cat > conftest.$ac_ext <<EOF +#line 1435 "configure" +#include "confdefs.h" +/* Thanks to Paul Eggert for this test. */ +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef HAVE_VFORK_H +#include <vfork.h> +#endif +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. + The compiler is told about this with #include <vfork.h>, + but some compilers (e.g. gcc -O) don't grok <vfork.h>. + Test for this by using a static variable whose address + is put into a register that is clobbered by the vfork. */ +static +#ifdef __cplusplus +sparc_address_test (int arg) +#else +sparc_address_test (arg) int arg; +#endif +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} +main() { + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. + This test uses lots of local variables, at least + as many local variables as main has allocated so far + including compiler temporaries. 4 locals are enough for + gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. + A buggy compiler should reuse the register of parent + for one of the local variables, since it will think that + parent can't possibly be used any more in this routine. + Assigning to the local variable will thus munge parent + in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), + vfork doesn't separate parent from child file descriptors. + If the child closes a descriptor before it execs or exits, + this munges the parent's descriptor as well. + Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + exit( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +EOF +if { (eval echo configure:1530: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_func_vfork_works=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_vfork_works=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ac_cv_func_vfork_works" 1>&6 +if test $ac_cv_func_vfork_works = no; then + cat >> confdefs.h <<\EOF +#define vfork fork +EOF + +fi + +echo $ac_n "checking for vprintf""... $ac_c" 1>&6 +echo "configure:1553: checking for vprintf" >&5 +if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1558 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char vprintf(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char vprintf(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_vprintf) || defined (__stub___vprintf) +choke me +#else +vprintf(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_vprintf=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_vprintf=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_VPRINTF 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +if test "$ac_cv_func_vprintf" != yes; then +echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 +echo "configure:1605: checking for _doprnt" >&5 +if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1610 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char _doprnt(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char _doprnt(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub__doprnt) || defined (__stub____doprnt) +choke me +#else +_doprnt(); +#endif + +; return 0; } +EOF +if { (eval echo configure:1633: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func__doprnt=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func__doprnt=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_DOPRNT 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi + +fi + +echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 +echo "configure:1658: checking for 8-bit clean memcmp" >&5 +if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_memcmp_clean=no +else + cat > conftest.$ac_ext <<EOF +#line 1666 "configure" +#include "confdefs.h" + +main() +{ + char c0 = 0x40, c1 = 0x80, c2 = 0x81; + exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1); +} + +EOF +if { (eval echo configure:1676: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_func_memcmp_clean=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_memcmp_clean=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 +test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" + +echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 +echo "configure:1694: checking for sys/wait.h that is POSIX.1 compatible" >&5 +if eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1699 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/wait.h> +#ifndef WEXITSTATUS +#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif +#ifndef WIFEXITED +#define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif +int main() { +int s; +wait (&s); +s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; +; return 0; } +EOF +if { (eval echo configure:1715: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_sys_wait_h=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_sys_wait_h=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 +if test $ac_cv_header_sys_wait_h = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_SYS_WAIT_H 1 +EOF + +fi + +echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 +echo "configure:1736: checking return type of signal handlers" >&5 +if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1741 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <signal.h> +#ifdef signal +#undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int main() { +int i; +; return 0; } +EOF +if { (eval echo configure:1758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_type_signal=void +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_type_signal=int +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_type_signal" 1>&6 +cat >> confdefs.h <<EOF +#define RETSIGTYPE $ac_cv_type_signal +EOF + + +echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 +echo "configure:1777: checking whether byte ordering is bigendian" >&5 +if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_c_bigendian=unknown +# See if sys/param.h defines the BYTE_ORDER macro. +cat > conftest.$ac_ext <<EOF +#line 1784 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/param.h> +int main() { + +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif +; return 0; } +EOF +if { (eval echo configure:1795: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + # It does; now see whether it defined to BIG_ENDIAN or not. +cat > conftest.$ac_ext <<EOF +#line 1799 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/param.h> +int main() { + +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif +; return 0; } +EOF +if { (eval echo configure:1810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_bigendian=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_c_bigendian=no +fi +rm -f conftest* +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +if test $ac_cv_c_bigendian = unknown; then +if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <<EOF +#line 1830 "configure" +#include "confdefs.h" +main () { + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} +EOF +if { (eval echo configure:1843: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_c_bigendian=no +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_c_bigendian=yes +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_c_bigendian" 1>&6 +if test $ac_cv_c_bigendian = yes; then + cat >> confdefs.h <<\EOF +#define WORDS_BIGENDIAN 1 +EOF + +fi + +# Put here by Thomas Esser for teTeX. This causes some tests to be run +# twice by the kps version. +# If we find X, set shell vars x_includes and x_libraries to the +# paths, otherwise set no_x=yes. +# Uses ac_ vars as temps to allow command line to override cache and checks. +# --without-x overrides everything else, but does not touch the cache. +echo $ac_n "checking for X""... $ac_c" 1>&6 +echo "configure:1873: checking for X" >&5 + +# Check whether --with-x or --without-x was given. +if test "${with_x+set}" = set; then + withval="$with_x" + : +fi + +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else +if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=NO ac_x_libraries=NO +rm -fr conftestdir +if mkdir conftestdir; then + cd conftestdir + # Make sure to not put "make" in the Imakefile rules, since we grep it out. + cat > Imakefile <<'EOF' +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' +EOF + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl; do + if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && + test -f $ac_im_libdir/libX11.$ac_extension; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case "$ac_im_incroot" in + /usr/include) ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; + esac + case "$ac_im_usrlibdir" in + /usr/lib | /lib) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;; + esac + fi + cd .. + rm -fr conftestdir +fi + +if test "$ac_x_includes" = NO; then + # Guess where to find include files, by looking for this one X11 .h file. + test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h + + # First, try using that file with no special directory specified. +cat > conftest.$ac_ext <<EOF +#line 1935 "configure" +#include "confdefs.h" +#include <$x_direct_test_include> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1940: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + # We can compile using X headers with no special include directory. +ac_x_includes= +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + # Look for the header file in a standard set of common directories. +# Check X11 before X11Rn because it is often a symlink to the current release. + for ac_dir in \ + /usr/X11/include \ + /usr/X11R6/include \ + /usr/X11R5/include \ + /usr/X11R4/include \ + \ + /usr/include/X11 \ + /usr/include/X11R6 \ + /usr/include/X11R5 \ + /usr/include/X11R4 \ + \ + /usr/local/X11/include \ + /usr/local/X11R6/include \ + /usr/local/X11R5/include \ + /usr/local/X11R4/include \ + \ + /usr/local/include/X11 \ + /usr/local/include/X11R6 \ + /usr/local/include/X11R5 \ + /usr/local/include/X11R4 \ + \ + /usr/X386/include \ + /usr/x386/include \ + /usr/XFree86/include/X11 \ + \ + /usr/include \ + /usr/local/include \ + /usr/unsupported/include \ + /usr/athena/include \ + /usr/local/x11r5/include \ + /usr/lpp/Xamples/include \ + \ + /usr/openwin/include \ + /usr/openwin/share/include \ + ; \ + do + if test -r "$ac_dir/$x_direct_test_include"; then + ac_x_includes=$ac_dir + break + fi + done +fi +rm -f conftest* +fi # $ac_x_includes = NO + +if test "$ac_x_libraries" = NO; then + # Check for the libraries. + + test -z "$x_direct_test_library" && x_direct_test_library=Xt + test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc + test -z "$x_direct_test_arguments" && x_direct_test_arguments=1 + + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS="$LIBS" + LIBS="-l$x_direct_test_library $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2010 "configure" +#include "confdefs.h" +#include <${x_direct_test_include}> +int main() { +${x_direct_test_function}(${x_direct_test_arguments}) +; return 0; } +EOF +if { (eval echo configure:2017: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + LIBS="$ac_save_LIBS" +# We can link X programs with no special library path. +ac_x_libraries= +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + LIBS="$ac_save_LIBS" +# First see if replacing the include by lib works. +# Check X11 before X11Rn because it is often a symlink to the current release. +for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ + /usr/X11/lib \ + /usr/X11R6/lib \ + /usr/X11R5/lib \ + /usr/X11R4/lib \ + \ + /usr/lib/X11 \ + /usr/lib/X11R6 \ + /usr/lib/X11R5 \ + /usr/lib/X11R4 \ + \ + /usr/local/X11/lib \ + /usr/local/X11R6/lib \ + /usr/local/X11R5/lib \ + /usr/local/X11R4/lib \ + \ + /usr/local/lib/X11 \ + /usr/local/lib/X11R6 \ + /usr/local/lib/X11R5 \ + /usr/local/lib/X11R4 \ + \ + /usr/X386/lib \ + /usr/x386/lib \ + /usr/XFree86/lib/X11 \ + \ + /usr/lib \ + /usr/local/lib \ + /usr/unsupported/lib \ + /usr/athena/lib \ + /usr/local/x11r5/lib \ + /usr/lpp/Xamples/lib \ + /lib/usr/lib/X11 \ + \ + /usr/openwin/lib \ + /usr/openwin/share/lib \ + ; \ +do + for ac_extension in a so sl; do + if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi +rm -f conftest* +fi # $ac_x_libraries = NO + +if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" +else + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" +fi +fi + fi + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + echo "$ac_t""$have_x" 1>&6 + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6 +fi + +if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. + cat >> confdefs.h <<\EOF +#define X_DISPLAY_MISSING 1 +EOF + + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +else + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi + + # It would also be nice to do this for all -L options, not just this one. + if test -n "$x_libraries"; then + X_LIBS="$X_LIBS -L$x_libraries" + # For Solaris; some versions of Sun CC require a space after -R and + # others require no space. Words are not sufficient . . . . + case "`(uname -sr) 2>/dev/null`" in + "SunOS 5"*) + echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 +echo "configure:2123: checking whether -R must be followed by a space" >&5 + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" + cat > conftest.$ac_ext <<EOF +#line 2126 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:2133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_R_nospace=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_R_nospace=no +fi +rm -f conftest* + if test $ac_R_nospace = yes; then + echo "$ac_t""no" 1>&6 + X_LIBS="$X_LIBS -R$x_libraries" + else + LIBS="$ac_xsave_LIBS -R $x_libraries" + cat > conftest.$ac_ext <<EOF +#line 2149 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:2156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_R_space=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_R_space=no +fi +rm -f conftest* + if test $ac_R_space = yes; then + echo "$ac_t""yes" 1>&6 + X_LIBS="$X_LIBS -R $x_libraries" + else + echo "$ac_t""neither works" 1>&6 + fi + fi + LIBS="$ac_xsave_LIBS" + ;; + OSF1*|IRIX*) + # OSF1 refers to Dec-Unix. -rpath is required in du 4.0 - at least + # -rpath is required in irix 5.x and 6.x - at least + # (Is -rpath really needed in IRIX? OJM) + X_LIBS="$X_LIBS -Wl,-rpath,$x_libraries" + ;; + esac + fi + + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. + + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else + # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And karl@cs.umb.edu says + # the Alpha needs dnet_stub (dnet does not exist). + echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 +echo "configure:2195: checking for dnet_ntoa in -ldnet" >&5 +ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldnet $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2203 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dnet_ntoa(); + +int main() { +dnet_ntoa() +; return 0; } +EOF +if { (eval echo configure:2214: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 +echo "configure:2236: checking for dnet_ntoa in -ldnet_stub" >&5 +ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-ldnet_stub $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2244 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dnet_ntoa(); + +int main() { +dnet_ntoa() +; return 0; } +EOF +if { (eval echo configure:2255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" +else + echo "$ac_t""no" 1>&6 +fi + + fi + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to dickey@clark.net. + echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 +echo "configure:2284: checking for gethostbyname" >&5 +if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2289 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else +gethostbyname(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2312: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_gethostbyname=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_gethostbyname=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_func_gethostbyname = no; then + echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 +echo "configure:2333: checking for gethostbyname in -lnsl" >&5 +ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lnsl $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2341 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname(); + +int main() { +gethostbyname() +; return 0; } +EOF +if { (eval echo configure:2352: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" +else + echo "$ac_t""no" 1>&6 +fi + + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says simon@lia.di.epfl.ch: it contains + # gethostby* variants that don't use the nameserver (or something). + # -lsocket must be given before -lnsl if both are needed. + # We assume that if connect needs -lnsl, so does gethostbyname. + echo $ac_n "checking for connect""... $ac_c" 1>&6 +echo "configure:2382: checking for connect" >&5 +if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2387 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char connect(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_connect) || defined (__stub___connect) +choke me +#else +connect(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_connect=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_connect=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_func_connect = no; then + echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 +echo "configure:2431: checking for connect in -lsocket" >&5 +ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsocket $X_EXTRA_LIBS $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2439 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect(); + +int main() { +connect() +; return 0; } +EOF +if { (eval echo configure:2450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" +else + echo "$ac_t""no" 1>&6 +fi + + fi + + # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. + echo $ac_n "checking for remove""... $ac_c" 1>&6 +echo "configure:2474: checking for remove" >&5 +if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2479 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char remove(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char remove(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_remove) || defined (__stub___remove) +choke me +#else +remove(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_remove=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_remove=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_func_remove = no; then + echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 +echo "configure:2523: checking for remove in -lposix" >&5 +ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lposix $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2531 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char remove(); + +int main() { +remove() +; return 0; } +EOF +if { (eval echo configure:2542: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" +else + echo "$ac_t""no" 1>&6 +fi + + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + echo $ac_n "checking for shmat""... $ac_c" 1>&6 +echo "configure:2566: checking for shmat" >&5 +if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2571 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shmat(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shmat(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shmat) || defined (__stub___shmat) +choke me +#else +shmat(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2594: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_shmat=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_shmat=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_func_shmat = no; then + echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 +echo "configure:2615: checking for shmat in -lipc" >&5 +ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lipc $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2623 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shmat(); + +int main() { +shmat() +; return 0; } +EOF +if { (eval echo configure:2634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" +else + echo "$ac_t""no" 1>&6 +fi + + fi + fi + + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS="$LDFLAGS" + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # libraries we check for below, so use a different variable. + # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. + echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 +echo "configure:2667: checking for IceConnectionNumber in -lICE" >&5 +ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lICE $X_EXTRA_LIBS $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2675 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char IceConnectionNumber(); + +int main() { +IceConnectionNumber() +; return 0; } +EOF +if { (eval echo configure:2686: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" +else + echo "$ac_t""no" 1>&6 +fi + + LDFLAGS="$ac_save_LDFLAGS" + +fi + +echo $ac_n "checking for size_t""... $ac_c" 1>&6 +echo "configure:2711: checking for size_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2716 "configure" +#include "confdefs.h" +#include <sys/types.h> +#if STDC_HEADERS +#include <stdlib.h> +#include <stddef.h> +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_size_t=yes +else + rm -rf conftest* + ac_cv_type_size_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_size_t" 1>&6 +if test $ac_cv_type_size_t = no; then + cat >> confdefs.h <<\EOF +#define size_t unsigned +EOF + +fi + + +# XDVI checks by Paul Vojta +echo $ac_n "checking for integer type to use in bitmaps""... $ac_c" 1>&6 +echo "configure:2746: checking for integer type to use in bitmaps" >&5 +if eval "test \"`echo '$''{'xdvi_cv_bitmap_type'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } +else + cat > conftest.$ac_ext <<EOF +#line 2754 "configure" +#include "confdefs.h" +#include <stdio.h> +main() +{ + FILE *f=fopen("conftestval", "w"); + if (!f) exit(1); + if ((sizeof(unsigned long) == 4 || sizeof(unsigned long) == 2) + && sizeof(unsigned long) != sizeof(unsigned int)) + fprintf(f, "BMTYPE=long BMBYTES=%d\n", sizeof(unsigned long)); + if (sizeof(unsigned int) == 4 || sizeof(unsigned int) == 2) + fprintf(f, "BMTYPE=int BMBYTES=%d\n", sizeof(unsigned int)); + else if (sizeof(unsigned short) == 4 || sizeof(unsigned short) == 2) + fprintf(f, "BMTYPE=short BMBYTES=%d\n", sizeof(unsigned short)); + else fprintf(f, "BMTYPE=char BMBYTES=%d\n", sizeof(unsigned char)); + exit(0); +} +EOF +if { (eval echo configure:2772: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + xdvi_cv_bitmap_type="`cat conftestval`" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + { echo "configure: error: could not determine integer type for bitmap" 1>&2; exit 1; } +fi +rm -fr conftest* +fi + +fi + +eval "$xdvi_cv_bitmap_type" +cat >> confdefs.h <<EOF +#define BMTYPE $BMTYPE +EOF + +cat >> confdefs.h <<EOF +#define BMBYTES $BMBYTES +EOF + +echo "$ac_t""unsigned $BMTYPE, size = $BMBYTES" 1>&6 +echo $ac_n "checking for stropts.h and isastream()""... $ac_c" 1>&6 +echo "configure:2797: checking for stropts.h and isastream()" >&5 +if eval "test \"`echo '$''{'xdvi_cv_sys_streams'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2802 "configure" +#include "confdefs.h" +#include <stropts.h> + +int main() { +#ifndef I_SETSIG +choke me +#else +isastream(0); +#endif +; return 0; } +EOF +if { (eval echo configure:2814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + xdvi_cv_sys_streams=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + xdvi_cv_sys_streams=no +fi +rm -f conftest* +fi + +echo "$ac_t""$xdvi_cv_sys_streams" 1>&6 +if test $xdvi_cv_sys_streams = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_STREAMS 1 +EOF + +fi +echo $ac_n "checking for SunOS 4""... $ac_c" 1>&6 +echo "configure:2834: checking for SunOS 4" >&5 +if eval "test \"`echo '$''{'xdvi_cv_sys_sunos_4'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "`(uname -sr) 2>/dev/null`" in +"SunOS 4."*) + xdvi_cv_sys_sunos_4=yes ;; +*) xdvi_cv_sys_sunos_4=no ;; +esac +fi + +echo "$ac_t""$xdvi_cv_sys_sunos_4" 1>&6 +if test $xdvi_cv_sys_sunos_4 = yes; then + cat >> confdefs.h <<\EOF +#define SUNOS4 1 +EOF + +fi +echo $ac_n "checking for poll.h and poll()""... $ac_c" 1>&6 +echo "configure:2853: checking for poll.h and poll()" >&5 +if eval "test \"`echo '$''{'xdvi_cv_func_poll'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2858 "configure" +#include "confdefs.h" +#include <poll.h> + +int main() { +poll((struct pollfd *) 0, 0, 0); +; return 0; } +EOF +if { (eval echo configure:2866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + xdvi_cv_func_poll=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + xdvi_cv_func_poll=no +fi +rm -f conftest* +fi + +echo "$ac_t""$xdvi_cv_func_poll" 1>&6 +if test $xdvi_cv_func_poll = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_POLL 1 +EOF + +else + for ac_hdr in sys/select.h select.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2889: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2894 "configure" +#include "confdefs.h" +#include <$ac_hdr> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2899: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <<EOF +#define $ac_tr_hdr 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + +fi + +# These were probably missing from the test-set? +# On the other hand, they are not used already, why start now? -janl +# AC_TYPE_OFF_T +# AC_HEADER_TIME + +# <sys/bsdtypes.h> is for ISC 4.0, to define fd_set in psgs.c. +for ac_func in memcpy strerror waitpid sigaction strchr tempnam setenv +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2936: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2941 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + +for ac_hdr in netdb.h sys/bsdtypes.h X11/Xosdefs.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2992: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2997 "configure" +#include "confdefs.h" +#include <$ac_hdr> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3002: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <<EOF +#define $ac_tr_hdr 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + +# For the bitmap size. -- I think this is in XDVI_C_BITMAP_TYPE now -janl +# AC_CHECK_SIZEOF(long) + + +# Check whether --with-x-toolkit or --without-x-toolkit was given. +if test "${with_x_toolkit+set}" = set; then + withval="$with_x_toolkit" + + echo "configure: warning: the --with-x-toolkit option is obsolete; please use --with-mf-x-toolkit +and/or --with-xdvi-x-toolkit instead. (Assuming default toolkit.)" 1>&2 + with_xdvi_x_toolkit=yes + with_mf_x_toolkit=yes + +fi + + + +# Check if the user wants to use Ghostscript, DPS or NeWS to +# display PostScript. +# Check whether --with-ps or --without-ps was given. +if test "${with_ps+set}" = set; then + withval="$with_ps" + case $withval in + yes|gs) PS_DEF="$PS_DEF -DPS_GS";; + no) PS_DEF=no;; + dps) PS_DEF="$PS_DEF -DPS_DPS";; + news) PS_DEF="$PS_DEF -DPS_NEWS";; + *) echo "configure: warning: Unknown --with-ps argument \`$withval'; using gs." 1>&2;; + esac +fi + + +# Check whether --enable-grey or --disable-grey was given. +if test "${enable_grey+set}" = set; then + enableval="$enable_grey" + if test "$enableval" = yes; then + cat >> confdefs.h <<\EOF +#define GREY 1 +EOF + +fi +else + cat >> confdefs.h <<\EOF +#define GREY 1 +EOF + +fi + + +# Check whether --enable-buttons or --disable-buttons was given. +if test "${enable_buttons+set}" = set; then + enableval="$enable_buttons" + if test "$enableval" = yes; then + cat >> confdefs.h <<\EOF +#define BUTTONS 1 +EOF + +fi +else + cat >> confdefs.h <<\EOF +#define BUTTONS 1 +EOF + +fi + + +# Check whether --enable-gf or --disable-gf was given. +if test "${enable_gf+set}" = set; then + enableval="$enable_gf" + if test "$enableval" != no; then + cat >> confdefs.h <<\EOF +#define USE_GF 1 +EOF + + OPT_SRCS="$OPT_SRCS gf.c" + OPT_OBJS="$OPT_OBJS gf.o" +fi +fi + + +# Check whether --enable-a4 or --disable-a4 was given. +if test "${enable_a4+set}" = set; then + enableval="$enable_a4" + if test "$enableval" != no; then + cat >> confdefs.h <<\EOF +#define A4 1 +EOF + +fi +fi + + + + + +# Check whether --with-system_zlib or --without-system_zlib was given. +if test "${with_system_zlib+set}" = set; then + withval="$with_system_zlib" + : +fi + + +# Check whether --with-zlib_libdir or --without-zlib_libdir was given. +if test "${with_zlib_libdir+set}" = set; then + withval="$with_zlib_libdir" + : +fi + + +# Check whether --with-zlib_include or --without-zlib_include was given. +if test "${with_zlib_include+set}" = set; then + withval="$with_zlib_include" + : +fi + + +if test "$needs_zlib" = no; then + ZLIBCPPFLAGS= + LDZLIB= + ZLIBDEP= +else + EXTRA_ZLIB_INCLUDE= + EXTRA_ZLIB_LIBDIR= + + if test "$with_system_zlib" = yes; then + if test "x$with_zlib_libdir" != x; then + EXTRA_ZLIB_LIBDIR="-L$with_zlib_libdir" + fi + if test "x$with_zlib_include" != x; then + EXTRA_ZLIB_INCLUDE="-I$with_zlib_include" + fi + fi + + OLD_LDFLAGS=$LDFLAGS + OLD_CPP=$CPP + OLD_LIBS=$LIBS + + LDFLAGS="$LDFLAGS $EXTRA_ZLIB_LIBDIR" + CPP="$CPP $EXTRA_ZLIB_INCLUDE" + + if test "$with_system_zlib" = yes; then + echo $ac_n "checking for inflate in -lz""... $ac_c" 1>&6 +echo "configure:3171: checking for inflate in -lz" >&5 +ac_lib_var=`echo z'_'inflate | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lz $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3179 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char inflate(); + +int main() { +inflate() +; return 0; } +EOF +if { (eval echo configure:3190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo z | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <<EOF +#define $ac_tr_lib 1 +EOF + + LIBS="-lz $LIBS" + +else + echo "$ac_t""no" 1>&6 +echo "configure: warning: Standard ZLIB library not found. Compiling my own." 1>&2 + with_system_zlib=no +fi + + fi + + if test "$with_system_zlib" = yes; then + for ac_hdr in zlib.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3226: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3231 "configure" +#include "confdefs.h" +#include <$ac_hdr> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <<EOF +#define $ac_tr_hdr 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + if test "$ac_cv_header_zlib_h" != yes; then + echo "configure: warning: zlib.h not found. Using my own zlib sources." 1>&2 + with_system_zlib=no + fi + fi + + LDFLAGS=$OLD_LDFLAGS + CPP=$OLD_CPP + LIBS=$OLD_LIBS + + if test "$with_system_zlib" != yes; then + ZLIBCPPFLAGS='-I$(ZLIBDIR) -I$(ZLIBSRCDIR)' + LDZLIB='$(ZLIBDIR)/libz.a' + ZLIBDEP='$(ZLIBDIR)/libz.a' + using_system_zlib=no + else + ZLIBCPPFLAGS="$EXTRA_ZLIB_INCLUDE" + LDZLIB="$EXTRA_ZLIB_LIBDIR -lz" + ZLIBDEP= + using_system_zlib=yes + fi +fi + + + + + + +# For --with-x-toolkit. Only distinguish `no' from everything else. +# They don't get to disable X entirely, this is *x*dvi. + +# -lXext may not be present, and that may be ok. Link with it only if it is. +if test -z "$x_ext_lib"; then # allow envvar override + if test -n "$x_libraries"; then + XLFLAG="-L$x_libraries" + else + XLFLAG= + fi + echo $ac_n "checking for XextCreateExtension in -lXext""... $ac_c" 1>&6 +echo "configure:3301: checking for XextCreateExtension in -lXext" >&5 +ac_lib_var=`echo Xext'_'XextCreateExtension | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lXext -lX11 $X_EXTRA_LIBS $XLFLAG $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3309 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XextCreateExtension(); + +int main() { +XextCreateExtension() +; return 0; } +EOF +if { (eval echo configure:3320: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + x_ext_lib=-lXext +else + echo "$ac_t""no" 1>&6 +: +fi + +fi + + +if test "x$with_x_toolkit" = xno; then + cat >> confdefs.h <<\EOF +#define NOTOOL 1 +EOF + + x_tool_libs= +else + # Effectively promote --with-x-toolkit=xt to athena since the code + # does not distinguish. + x_tool_libs="-lXaw -lXmu -lXt" +fi + + +# For --with-ps. +test -z "$PS_DEF" && PS_DEF=-DPS_GS +test "$PS_DEF" = no && PS_DEF= +# If we're on Solaris and we want DPS, then add the extra compilation stuff +# to get it. +if echo "$PS_DEF" | grep PS_DPS >/dev/null; then + if test "`(uname) 2>/dev/null`" = SunOS \ + && uname -r | grep '^5' >/dev/null; then + echo "$ac_t""adding DPS includes and libraries for Solaris" 1>&6 + X_CFLAGS="$X_CFLAGS -I/usr/openwin/include/X11" + echo $ac_n "checking for isinf in -lsunmath""... $ac_c" 1>&6 +echo "configure:3368: checking for isinf in -lsunmath" >&5 +ac_lib_var=`echo sunmath'_'isinf | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lsunmath $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3376 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char isinf(); + +int main() { +isinf() +; return 0; } +EOF +if { (eval echo configure:3387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_sunmath=-lsunmath +else + echo "$ac_t""no" 1>&6 +ac_sunmath="" +fi + + X_LIBS="$X_LIBS -R/usr/openwin/lib /usr/openwin/lib/libdps.so $ac_sunmath" + # We only need isinf and ieeefp.h to work around a Solaris bug in + # -ldps; see psdps.c. isinf is in -lsunmath. + for ac_func in isinf +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3414: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3419 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3442: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + for ac_hdr in ieeefp.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3470: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3475 "configure" +#include "confdefs.h" +#include <$ac_hdr> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3480: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <<EOF +#define $ac_tr_hdr 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + else + # SunOS 4.x is simpler. + echo "$ac_t""adding DPS includes and libraries for SunOS 4.x" 1>&6 + X_LIBS="$X_LIBS -ldps" + fi +elif echo "$PS_DEF" | grep PS_NEWS >/dev/null; then + echo "$ac_t""adding NeWS libraries" 1>&6 + X_LIBS="$X_LIBS -lxview -lcps -lolgx -lxvps" +fi + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +DEFS=-DHAVE_CONFIG_H + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS <<EOF +#! /bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +ac_config_files="$ac_config_files Makefile" + +trap 'rm -fr `echo "$ac_config_files c-auto.h:c-auto.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS <<EOF + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@CC@%$CC%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@SET_MAKE@%$SET_MAKE%g +s%@LN_S@%$LN_S%g +s%@MAINT@%$MAINT%g +s%@LD@%$LD%g +s%@AR@%$AR%g +s%@ARFLAGS@%$ARFLAGS%g +s%@texmfmain@%$texmfmain%g +s%@CPP@%$CPP%g +s%@LIBOBJS@%$LIBOBJS%g +s%@X_CFLAGS@%$X_CFLAGS%g +s%@X_PRE_LIBS@%$X_PRE_LIBS%g +s%@X_LIBS@%$X_LIBS%g +s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g +s%@ZLIBCPPFLAGS@%$ZLIBCPPFLAGS%g +s%@LDZLIB@%$LDZLIB%g +s%@ZLIBDEP@%$ZLIBDEP%g +s%@x_ext_lib@%$x_ext_lib%g +s%@x_tool_libs@%$x_tool_libs%g +s%@PS_DEF@%$PS_DEF%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <<EOF + +CONFIG_FILES=\${CONFIG_FILES-"$ac_config_files"} +EOF +cat >> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*|[A-z]:/*) # Absolute path. + srcdir="$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + "") ;; + [/$]*|[A-z]:/*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + rm -f conftest.in + ac_file_inputs=`echo $ac_file_in|sed -e "s%:% $ac_given_srcdir/%g" -e "s%^%$ac_given_srcdir/%"` + cat $ac_file_inputs > conftest.in + # + # Replace lines of the form ac_include foo with the contents of foo: + # first, from the ac_include lines construct a list of file names. + # From that list, we construct a second list of those files that exist. + # Then we construct lists of sed commands for including those files, + # and a sed command that removes the ac_include lines. We don't attempt + # to read non-existent files because some (buggy) versions of sed choke + # on this. Have to use sed because old (Ultrix, SunOS) awk does not support + # getline or system. (Anyway, configure scripts aren't supposed to use awk.) + # Can't use only one -e and commands {dr foo} because foo has to be last. + # Be careful, because the filename may contain /. Be careful with + # whitespace; we need to use echo. + # + file_substs=`sed -n '/^ac_include/s%ac_include[ ]*\(.*\)%\1%p' conftest.in` + # Create the sed command line ... + if test -n "$file_substs"; then + echo "configure: warning: ac_include is obsolete; instead use kpse_include" 1>&2 + file_subst_cmd="sed -e 's/^ac_include/kpse_include/'" + else + file_subst_cmd='sed' + fi + kpse_substs=`sed -n '/^kpse_include/s%kpse_include[ ]*\(.*\)%\1%p' conftest.in` + for ac_inc in $file_substs $kpse_substs; do + if test -f "$ac_given_srcdir/$ac_inc"; then + ac_mung=`echo $ac_inc | sed 's,/,%,g'` + file_subst_cmd="$file_subst_cmd -e '/^kpse_include $ac_mung$/r $ac_given_srcdir/$ac_inc'" + fi + done + file_subst_cmd="$file_subst_cmd -e '/^kpse_include/d'" + # ... and fix the whitespace and escaped slashes. + file_subst_cmd=`echo "$file_subst_cmd" | sed -e 's,%,\\\/,g' \ +-e 's/kpse_include /kpse_include[ ]*/g'` + # I can't find any way to do variable substitution in the sed commands + # (so the user could have, e.g., $top_srcdir in their ac_include line). + (eval $file_subst_cmd conftest.in) \ + | sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* conftest.in + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='\([ ][ ]*\)[^ ].*$%\1#\2' +ac_dC='\3' +ac_dD='%g' +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)%\1#\2define\3' +ac_uC=' ' +ac_uD='\4%g' +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='$%\1#\2define\3' +ac_eC=' ' +ac_eD='%g' + +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <<EOF + CONFIG_HEADERS=" c-auto.h:c-auto.in" +EOF +cat >> $CONFIG_STATUS <<\EOF +fi +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + ac_file_inputs=`echo $ac_file_in|sed -e "s%:% $ac_given_srcdir/%g" -e "s%^%$ac_given_srcdir/%"` + cat $ac_file_inputs > conftest.in + +EOF + +# Transform confdefs.h into a sed script conftest.vals that substitutes +# the proper values into config.h.in to produce config.h. And first: +# Protect against being on the right side of a sed subst in config.status. +# Protect against being in an unquoted here document in config.status. +rm -f conftest.vals +cat > conftest.hdr <<\EOF +s/[\\&%]/\\&/g +s%[\\$`]%\\&%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%ac_d%ac_u%gp +s%ac_u%ac_e%gp +EOF +sed -n -f conftest.hdr confdefs.h > conftest.vals +rm -f conftest.hdr + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >> conftest.vals <<\EOF +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +EOF + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. + +rm -f conftest.tail +while : +do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in +' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + +EOF +cat >> $CONFIG_STATUS <<EOF + + + +EOF +cat >> $CONFIG_STATUS <<\EOF + + + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + +if test "$no_recursion" != yes; then + + # Remove --cache-file and --srcdir arguments so they do not pile up. + ac_sub_configure_args= + ac_prev= + for ac_arg in $ac_configure_args; do + if test -n "$ac_prev"; then + ac_prev= + continue + fi + case "$ac_arg" in + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + ;; + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + ;; + *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; + esac + done + + for ac_config_dir in : $subdirs; do + + # Do not complain, so a configure script can configure whichever + # parts of a large source tree are present. + if test ! -d $srcdir/$ac_config_dir; then + continue + fi + + echo configuring in $ac_config_dir + + case "$srcdir" in + .) ;; + *) + if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :; + else + { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; } + fi + ;; + esac + + ac_popdir=`pwd` + cd $ac_config_dir + + # A "../" for each directory in /$ac_config_dir. + ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` + + case "$srcdir" in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + /*|[A-z]:/*) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_config_dir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f ./configure; then + ac_sub_configure=./configure + elif test -f $ac_sub_srcdir/configure; then + ac_sub_configure=$ac_sub_srcdir/configure + elif test -f $ac_sub_srcdir/configure.in; then + ac_sub_configure=$ac_configure + else + echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2 + ac_sub_configure= + fi + + # The recursion is here. + if test -n "$ac_sub_configure"; then + + # Make the cache file name correct relative to the subdirectory. + case "$cache_file" in + /*|[A-z]:/*) ac_sub_cache_file=$cache_file ;; + *) # Relative path. + ac_sub_cache_file="$ac_dots$cache_file" ;; + esac + case "$ac_given_INSTALL" in + "") ;; + [/$]*|[A-z]:/*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir" + # The eval makes quoting arguments work. + if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir + then : + else + { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; } + fi + fi + + cd $ac_popdir + done +fi + + +date >stamp-auto diff --git a/Build/source/texk/windvi/configure.in b/Build/source/texk/windvi/configure.in new file mode 100644 index 00000000000..e6c59dae2ad --- /dev/null +++ b/Build/source/texk/windvi/configure.in @@ -0,0 +1,104 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(xdvi.c) + +AC_CONFIG_HEADER(c-auto.h:c-auto.in) +AC_PROG_CC +AC_PROG_INSTALL +AC_PROG_MAKE_SET +AC_PROG_LN_S + +sinclude(../kpathsea/withenable.ac) + +AC_FUNC_VFORK +AC_FUNC_VPRINTF +AC_FUNC_MEMCMP +AC_HEADER_SYS_WAIT +AC_TYPE_SIGNAL +AC_C_BIGENDIAN +# Put here by Thomas Esser for teTeX. This causes some tests to be run +# twice by the kps version. +AC_PATH_XTRA +AC_TYPE_SIZE_T + +# XDVI checks by Paul Vojta +XDVI_C_BITMAP_TYPE +XDVI_SYS_STREAMS +XDVI_SYS_SUNOS_4 +XDVI_FUNC_POLL + +# These were probably missing from the test-set? +# On the other hand, they are not used already, why start now? -janl +# AC_TYPE_OFF_T +# AC_HEADER_TIME + +# <sys/bsdtypes.h> is for ISC 4.0, to define fd_set in psgs.c. +AC_CHECK_FUNCS(memcpy strerror waitpid sigaction strchr tempnam setenv) +AC_CHECK_HEADERS(netdb.h sys/bsdtypes.h X11/Xosdefs.h) + +# For the bitmap size. -- I think this is in XDVI_C_BITMAP_TYPE now -janl +# AC_CHECK_SIZEOF(long) + +sinclude(../kpathsea/xt.ac) +sinclude(withenable.ac) +sinclude(../../libs/libwww/withenable.ac) +sinclude(../../libs/libwww/libwww.ac) +sinclude(../../libs/zlib/withenable.ac) +sinclude(../../libs/zlib/zlib.ac) + +# For --with-x-toolkit. Only distinguish `no' from everything else. +# They don't get to disable X entirely, this is *x*dvi. + +# -lXext may not be present, and that may be ok. Link with it only if it is. +if test -z "$x_ext_lib"; then # allow envvar override + if test -n "$x_libraries"; then + XLFLAG="-L$x_libraries" + else + XLFLAG= + fi + AC_CHECK_LIB(Xext, XextCreateExtension, + x_ext_lib=-lXext, :, -lX11 $X_EXTRA_LIBS $XLFLAG) +fi +AC_SUBST(x_ext_lib) + +if test "x$with_x_toolkit" = xno; then + AC_DEFINE(NOTOOL) + x_tool_libs= +else + # Effectively promote --with-x-toolkit=xt to athena since the code + # does not distinguish. + x_tool_libs="-lXaw -lXmu -lXt" +fi +AC_SUBST(x_tool_libs) + +# For --with-ps. +test -z "$PS_DEF" && PS_DEF=-DPS_GS +test "$PS_DEF" = no && PS_DEF= +AC_SUBST(PS_DEF)dnl +dnl +# If we're on Solaris and we want DPS, then add the extra compilation stuff +# to get it. +if echo "$PS_DEF" | grep PS_DPS >/dev/null; then + if test "`(uname) 2>/dev/null`" = SunOS \ + && uname -r | grep '^5' >/dev/null; then + AC_MSG_RESULT(adding DPS includes and libraries for Solaris) + X_CFLAGS="$X_CFLAGS -I/usr/openwin/include/X11" + AC_CHECK_LIB(sunmath, isinf, ac_sunmath=-lsunmath, ac_sunmath="") + X_LIBS="$X_LIBS -R/usr/openwin/lib /usr/openwin/lib/libdps.so $ac_sunmath" + # We only need isinf and ieeefp.h to work around a Solaris bug in + # -ldps; see psdps.c. isinf is in -lsunmath. + AC_CHECK_FUNCS(isinf) + AC_CHECK_HEADERS(ieeefp.h) + else + # SunOS 4.x is simpler. + AC_MSG_RESULT(adding DPS includes and libraries for SunOS 4.x) + X_LIBS="$X_LIBS -ldps" + fi +elif echo "$PS_DEF" | grep PS_NEWS >/dev/null; then + AC_MSG_RESULT(adding NeWS libraries) + X_LIBS="$X_LIBS -lxview -lcps -lolgx -lxvps" +fi + +AC_OUTPUT(Makefile) + +dnl update `stamp-auto' since we just remade `c-auto.h' +date >stamp-auto diff --git a/Build/source/texk/windvi/depend.mak b/Build/source/texk/windvi/depend.mak new file mode 100644 index 00000000000..6f0edeb5e02 --- /dev/null +++ b/Build/source/texk/windvi/depend.mak @@ -0,0 +1,1110 @@ +$(objdir)/dvi-draw.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h \ + $(kpathseadir)/c-ctype.h \ + $(gnuw32dir)/oldnames.h \ + dvi.h + +$(objdir)/ttf.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h \ + dvi.h + +$(objdir)/src-spec-1.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h \ + $(kpathseadir)/c-stat.h \ + $(gnuw32dir)/oldnames.h \ + $(kpathseadir)/magstep.h \ + dvi.h + +$(objdir)/winprint.obj: \ + wingui.h \ + resource.h \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/winevt.obj: \ + wingui.h \ + resource.h \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h \ + dvi.h + +$(objdir)/font-open.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h \ + $(kpathseadir)/tex-glyph.h + +$(objdir)/winxutl.obj: \ + wingui.h \ + resource.h \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h \ + winxutl.h + +$(objdir)/winopt.obj: \ + wingui.h \ + resource.h \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h \ + version.h \ + c-openmx.h \ + $(kpathseadir)/proginit.h \ + $(kpathseadir)/tex-hush.h \ + $(kpathseadir)/tex-make.h \ + $(kpathseadir)/line.h + +$(objdir)/dvi-init.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h \ + $(kpathseadir)/c-stat.h \ + $(gnuw32dir)/oldnames.h \ + $(kpathseadir)/magstep.h \ + $(kpathseadir)/tex-glyph.h \ + dvi.h \ + $(t1dir)/t1lib.h + +$(objdir)/mime.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/winlog.obj: \ + wingui.h \ + resource.h \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/winimg.obj: \ + wingui.h \ + resource.h \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/squeeze.obj: \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/c-memstr.h + +$(objdir)/t1.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/special.obj: \ + wingui.h \ + resource.h \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h \ + $(kpathseadir)/c-ctype.h \ + $(gnuw32dir)/oldnames.h \ + $(kpathseadir)/c-stat.h \ + $(kpathseadir)/line.h \ + dvi.h \ + $(zlibdir)/zlib.h \ + $(zlibdir)/zconf.h \ + $(bzip2dir)/bzlib.h + +$(objdir)/vf.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h \ + dvi.h + +$(objdir)/windraw.obj: \ + wingui.h \ + resource.h \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h \ + version.h + +$(objdir)/alloca.obj: \ + + +$(objdir)/dvips.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/winabout.obj: \ + wingui.h \ + resource.h + +$(objdir)/gf.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/winhtex.obj: \ + wingui.h \ + resource.h \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h \ + winhtex.h \ + $(kpathseadir)/c-pathch.h \ + $(kpathseadir)/c-ctype.h \ + $(gnuw32dir)/oldnames.h + +$(objdir)/tfmload.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/pk.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/util.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h \ + $(kpathseadir)/c-ctype.h \ + $(gnuw32dir)/oldnames.h + +$(objdir)/wwwfetch.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/psgs.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/psgsw32.obj: \ + $(gnuw32dir)/win32lib.h \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/xdvi.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h \ + c-openmx.h \ + $(kpathseadir)/c-ctype.h \ + $(gnuw32dir)/oldnames.h \ + $(kpathseadir)/c-pathch.h \ + $(kpathseadir)/c-stat.h \ + $(kpathseadir)/proginit.h \ + $(kpathseadir)/tex-hush.h \ + $(kpathseadir)/tex-make.h \ + version.h \ + xdvi.icon + +$(objdir)/wincfg.obj: \ + wingui.h \ + resource.h \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h \ + mfmodes.h + +$(objdir)/src-spec.obj: \ + $(gnuw32dir)/win32lib.h \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h \ + $(kpathseadir)/c-stat.h \ + $(gnuw32dir)/oldnames.h \ + $(kpathseadir)/magstep.h \ + dvi.h + +$(objdir)/events.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/wintransf.obj: \ + wingui.h \ + resource.h \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/hypertex.obj: \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/windvi.obj: \ + wingui.h \ + resource.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/winver.obj: \ + wingui.h \ + resource.h \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/wingoto.obj: \ + wingui.h \ + resource.h \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + +$(objdir)/wincolor.obj: \ + wingui.h \ + resource.h \ + xdvi-config.h \ + $(kpathseadir)/c-auto.h \ + $(kpathseadir)/config.h \ + $(kpathseadir)/c-std.h \ + $(kpathseadir)/c-unistd.h \ + $(kpathseadir)/systypes.h \ + $(kpathseadir)/c-memstr.h \ + $(kpathseadir)/c-errno.h \ + $(kpathseadir)/c-minmax.h \ + $(kpathseadir)/c-limits.h \ + $(kpathseadir)/c-proto.h \ + $(gnuw32dir)/win32lib.h \ + $(kpathseadir)/debug.h \ + $(kpathseadir)/types.h \ + $(kpathseadir)/lib.h \ + $(kpathseadir)/progname.h \ + windvi.h \ + c-auto.h \ + $(gsw32dir)/gs32lib.h \ + ../../gstools/ghostscript/src/gsdll.h \ + ../../gstools/ghostscript/src/iapi.h \ + ../../gstools/ghostscript/src/errors.h \ + $(kpathseadir)/c-fopen.h \ + $(kpathseadir)/c-pathmx.h \ + $(kpathseadir)/tex-file.h \ + $(kpathseadir)/c-vararg.h \ + patchlevel.h + diff --git a/Build/source/texk/windvi/diese.txt b/Build/source/texk/windvi/diese.txt new file mode 100644 index 00000000000..868306aaacf --- /dev/null +++ b/Build/source/texk/windvi/diese.txt @@ -0,0 +1,28 @@ +F:\Work\TeX\source\supp\xdvik>grep # *.c | grep -ve "#[ ]*if" | grep -ve "#[ ]*d +efine" | grep -ve "#[ ]*endif" | grep -ve "#[ ]*else" | grep -v #undef | grep -v +e "#[ ]*include" +alloca.c:static char SCCSid[] = "@(#)alloca.c 1.1"; +alloca.c: unsigned size; /* # bytes to allocate */ +dvi-draw.c: * Find font #n. +dvi-draw.c: if (currinf.fontp == NULL) tell_oops("non-existent font #%d", n) +; +hypertex.c: Printf("In anchor #%d\n", i); +hypertex.c: sprintf(astr, "anchor #%d: %s%s", i, namestr, hrefstr); +hypertex.c: sprintf(buf, "%s %s#%s -geometry %dx%d &", program_invocatio +n_name, +hypertex.c: while (*cp == '#') cp++; +hypertex.c:/* Can handle href's of form file:?.dvi#name */ +hypertex.c: cp = strchr(dvi_name, '#'); /* Handle optional # in name */ +hypertex.c: while (*cp == '#') cp++; +mime.c: if (*cp == '#') continue; +mime.c: if (*cp == '#') continue; +special.c:static int path_len = 0; /* # points in current path */ +squeeze.c: (c=='-')||(c=='.')||(c=='#')||(c=='|')||(c=='_')|| +util.c:#elif HAVE_SETENV +windraw.c: /* Escape dangers, esp. # from emacs */ +winevt.c:"@(#) Copyright (c) 1994 Paul Vojta. All rights reserved.\n"; +winxutl.c: if (colorname[0] == '#') +xdvi.c:"@(#) Copyright (c) 1994-1999 Paul Vojta. All rights reserved.\n"; +xdvi.c: if (*str == '#') { /* some color rgb definition */ +xdvi.c: if (*str == '#') { /* an rgb definition */ +xdvi.c: /* Escape dangers, esp. # from emacs */ diff --git a/Build/source/texk/windvi/doc/win32.mak b/Build/source/texk/windvi/doc/win32.mak new file mode 100644 index 00000000000..8c53e5a25fb --- /dev/null +++ b/Build/source/texk/windvi/doc/win32.mak @@ -0,0 +1,39 @@ +################################################################################ +# +# Makefile : Windvi / doc +# Author : Fabrice Popineau <Fabrice.Popineau@supelec.fr> +# Platform : Win32, Microsoft VC++ 6.0, depends upon fpTeX 0.5 sources +# Time-stamp: <04/03/05 12:04:00 popineau> +# +################################################################################ +root_srcdir = ..\..\.. +!ifdef DEVELOPMENT +INCLUDE=$(INCLUDE);$(root_srcdir)\texk.development +!else +INCLUDE=$(INCLUDE);$(root_srcdir)\texk +!endif + +pdfdocfiles = windvi.pdf +manfiles = +htmldocfiles = windvi.html + +docsubdir = windvi + +!include <msvc/common.mak> + +all: doc + +info: doc + +!include <msvc/config.mak> +!include <msvc/install.mak> + +install:: install-info install-doc + +!include <msvc/clean.mak> + +# +# Local Variables: +# mode: makefile +# End: + diff --git a/Build/source/texk/windvi/doc/windvi.cfg b/Build/source/texk/windvi/doc/windvi.cfg new file mode 100644 index 00000000000..02da5ac00a4 --- /dev/null +++ b/Build/source/texk/windvi/doc/windvi.cfg @@ -0,0 +1,67 @@ +\Preamble{2,xhtml} \begin{document} \EndPreamble +\def\TeX{TeX} +%\def\OMEGA{Omega} +\def\LaTeX{LaTeX} +\def\LaTeXe{LaTeX2e} +\def\eTeX{e-\TeX} +\def\acro#1{#1} +\def\MF{\textsc{metafont}} + +\def\Ucom#1{% + \underline{{\ttfamily #1}}} +\newenvironment{multicols}[1]{}{} + +\ConfigureEnv{multicols} + {\let\HpDepth=\HPageDepth} + {\ifnum \HPageDepth>\HpDepth \HAdvance\HpDepth by 1 + \EndHPage[\HpDepth]{}\fi} + {}{} + + % MSIE and NC explode on long underlines (and lines, + % and backgrounds), hence the color: + + \Css{.alltt .underline{ text-decoration:none; color:green; }} + + % NC has problems with positioning the characters of \TeX + % within the main title, hence: + +\Configure{maketitle} + {\IgnorePar\EndP\HCode{<div align="center" class="maketitle">}} + {\IgnorePar\EndP\HCode{</div>}\ShowPar} + {\NoFonts\HCode{<h2>}\IgnorePar \def\TeX{TeX}} + {\HCode{</h2>}\EndNoFonts} + + \def\warningbox{} %\IgnorePar\EndP\HCode{<hr /><p><b>}} + \def\endwarningbox{} %\HCode{</b></p><hr />}\ShowPar} + + \ConfigureEnv{warningbox} + {\IgnorePar\EndP\Tg<div class="warning">\ShowPar} + {\IgnorePar\EndP\Tg</div>\ShowPar} + {} {} + +\ifx \HColor\UnDef \else + \HColor{pale}{\#CCCCCC} +\fi +\catcode`\:11 +\def\href{\bgroup \catcode`\#=12 \catcode`\~=12 \cont:href} +\def\cont:href#1{\egroup \Link[#1]{}{}\end:href} +\def\end:href#1{#1\EndLink} +\def\url{\bgroup \catcode`\#=12 \catcode`\~=12 \cont:url} +\def\cont:url#1{\egroup \Link[#1]{}{}#1\EndLink} +\def\hypertarget#1#2{\Link{}{#1}#2\EndLink} + + + + % MSIE and NC explode on bordered DIV, hence the TABLE: + +\def\lrBox{\IgnorePar\HCode{<div class="fbox"><table border="1" + class="fbox"><tr class="fbox"><td class="fbox"><p class="fbox">}} +\def\endlrBox{\IgnorePar\EndP\HCode{</p></td></tr></table></div>}\global + \let\svcenterline=\centerline + \global\def\centerline##1{\global\let\centerline=\svcenterline}} + \Css{DIV.fbox{ margin-left:8\%; margin-right:8\%; }} +\catcode`\:12 + +\endinput + + diff --git a/Build/source/texk/windvi/doc/windvi.tex b/Build/source/texk/windvi/doc/windvi.tex new file mode 100644 index 00000000000..6b3e09cea40 --- /dev/null +++ b/Build/source/texk/windvi/doc/windvi.tex @@ -0,0 +1,721 @@ +\documentclass[a4paper,11pt]{article} + +\advance\textwidth by 1in +\advance\oddsidemargin by -1in +\advance\evensidemargin by -1in +\newsavebox{\warnbox} +\setcounter{tocdepth}{2} +\pretolerance=1000 +\tolerance=1500 +\hbadness=3000 +\vbadness=3000 +\hyphenpenalty=400 +\renewcommand{\topfraction}{0.85} +\renewcommand{\floatpagefraction}{0.86} +\renewcommand{\textfraction}{0.1} +\setcounter{topnumber}{5} +\setcounter{totalnumber}{5} +\def\eTeX{$\varepsilon$-\TeX} +\def\Dash{---} +\def\hyph{-} +\def\OMEGA{$\Omega$} + +\usepackage{graphicx} +\usepackage{hyperref} +\usepackage{url} +\usepackage{mflogo} +\usepackage{array} +\usepackage{moreverb} +\usepackage{longtable} +\usepackage{alltt} +\usepackage{colortbl} +\usepackage{pifont} +\usepackage{xspace} +\usepackage{time} +\usepackage{relsize} + +\makeatletter +\newcommand{\acro}[1]{\textsmaller{#1}\@} +\makeatother + +\def\MP{MetaPost} +\let\mf\MF + +\input{mynames} + +\def\WDVI{\textsf{Windvi}} + +\begin{document} +\author{Fabrice Popineau\\ +\texttt{Fabrice.Popineau@supelec.fr}} +\title{Windvi 0.67 User's Manual} +\date{\today} +\maketitle +\tableofcontents +\section{Introduction} + +\subsection{Why another Windows dvi viewer ?} +\begin{quote} +Note that throughout this document, when I say +`Win32', this means Windows 9x and Windows NT. +\end{quote} + +There are many previewers for dvi files under Win32. The most popular +is probably \texttt{Dviwin} by H. Sendoukas. However it lacks some +important features: +\begin{itemize} +\item the ability to recursively search directories for font files, +\item the ability to use .vf files or display PostScript fonts, +\item the ability to display PostScript images. +\end{itemize} + +Unfortunately, the \texttt{Dviwin} sources were never put into the +public domain; on the other side of the fence, \texttt{Xdvi} under +Unix has these features, is widely used and its sources are available. +\texttt{Xdvi(k)} uses the \texttt{kpathsea} library to search +directories, already used in the Web2c-win32 port of \TeX, so there +was some interest in porting \texttt{Xdvi(k)} to Win32. It turned +out that this was far more than just a port, since X Window is far +from Win32. All the user interface and the graphical part has been +rewritten. + +\subsection{Features} + +The most important features of \WDVI{} are as follows: +\begin{itemize} +\item monochrome or grey scale bitmaps (antialiasing) for fonts, +\item easy navigation through the dvi file + \begin{itemize} + \item page by page, + \item with different increments (by 5 or 10 pages at a time) + \item goto home, end, or any page within the document, + \end{itemize} +\item different shrink factors to zoom page in and out, +\item magnifying glass to show the page at the pixel level, +\item use of .vf fonts +\item display .pk .gf font files +\item automatic generation of missing PK files even for PostScript fonts, +\item tracking dvi file changes, and automatic reopening, +\item understanding Omega extended dvi files, +\item drag-and-drop file from the Windows shell explorer, +\item color support (a-la dvips), +\item real-time logging of background font generation, +\item visualization of PostScript inclusions, +\item graphical transformations under NT only, +\item support of Hyper\TeX{} specials, +\item printing support through the unified printer driver. +\end{itemize} + +\section{Installation} + +\subsection{The home of Windvi} + +Windvi is part of the \fptex distribution, which is itself based on +\tetex and \webc. + +You will find the whole \fptex distribution on any CTAN archive, for example: + +\url{ftp://ftp.tex.ac.uk/pub/tex/systems/win32/fptex} + +Beta versions of \fptex and other tools are available from: + +\url{ftp://ftp.ese-metz.fr/pub/tex/win32-beta} + +If you want to retrieve only the windvi distribution, you should get: + +\url{ftp://ftp.tex.ac.uk/pub/tex/systems/win32/fptex/windvi.zip} +for the standalone released version; + +\url{ftp://ftp.ese-metz.fr/pub/tex/win32-beta/windvixx.zip} +for beta versions, xx being always as high as possible. + +Announcements of beta version are made through the fptex +mailing-list. Subscriptions can be sent to +\url{mailto:majordomo@tug.org}. Send a message whose body is +'subscribe fptex' to subscribe. The list address is 'fptex@tug.org'. + +\subsection{Unpacking} + +Assuming you have retrieved one of the \texttt{windvixx.zip} files, you will +have to unpack it at the \texttt{<root>} of some TDS conformant texmf +tree like this one: + + +\begin{verbatim} + <root>/bin/win32 + /texmf/ + /dvips + /tex + /latex + /web2c +\end{verbatim} + +\begin{itemize} +\item \texttt{owindvi.exe}, \texttt{windvi.exe}, + \texttt{mktex*.exe} and \texttt{gsftopk.exe} go to + \texttt{bin/win32} +\item \texttt{render.ps} (used by gsftopk) goes to \texttt{texmf/dvips} +\item \texttt{texmf.cnf} and \texttt{mktex.cnf} go to \texttt{texmf/web2c}. +\end{itemize} + +In order not to overwrite the texmf.cnf and mktex.cnf files of people +who are already using Web2C for win32, those files are distributed as +texmf.xam and mktex.xam. You must rename them if you don't already +have .cnf files. + +Next, add \verb|<root>\bin\win32| to your \texttt{PATH}. This is +done by modifying \texttt{autoexec.bat} under Windows 9x or the +Control Panel/System under NT/W2K. + +\subsection{Configuration} + +If you have respected the previous layout for the tree, ie the +relative position of \texttt{windvi.exe} with respect to the texmf +directory, you should not have anything more to configure than update +your PATH environment variable. + +If you want to use \texttt{windvi.exe} in another context, you may need to +set the TEXMFMAIN and / or TEXMFCNF environment variable. TEXMFMAIN must +point to the texmf directory and TEXMFCNF to the directory containing +texmf.cnf. + +\subsection{Generation of PK files} + +The generation of PK files is under control of the \kpathsea{} library +through the use of \texttt{mktexpk.exe}. You can choose the destination for +generated files --- the scheme is explained in detail in the +\kpathsea{} documentation. + +The main points are: +\begin{itemize} +\item any generated file will go in the same texmf tree as the one in +which the font source has been found, +\item if the source directory is not writable, the directory named by +VARTEXFONTS will be used, so you had better set this variable to something +meaningful in texmf.cnf +\item MT\_FEATURES can be set either in mktex.cnf or in your environment to +control the naming of generated files: you can add 'dosnames', +'nomode', 'stripsupplier', 'striptypeface', 'fontmaps' and 'varfonts' +to the features. Feel free to experiment with them by setting +MT\_FEATURES in the environment and checking with 'mktexnam cmr10' for +the result you want. +\end{itemize} + +\subsection{Type1 fonts} + +In order to use \texttt{gsftopk.exe} to generate PK files for Type1 fonts, you +will need to install Ghostscript. Ghostscript is used in the background +for computing the bitmaps. See section~\ref{gs-install} about +Ghostscript installation. + +After that, \WDVI{} should be able to generate PK files for your Type1 +fonts, providing you have the corresponding vf and tfm files. It is +however wise to try \texttt{mktexnam.exe} on some of your fonts +(\texttt{'mktexnam ptmr8r'} for example) to check that the fonts will +be put at the right place. + +\subsection{PostScript\TM\ inclusions} + +\WDVI\ is able to display some PostScript\TM\ inclusions, thanks to +Ghostscript. What is understood~: +\begin{itemize} +\item \texttt{graphics} bundle from \LaTeX2e, +\item \texttt{psfig} inclusions, +\item some raw PostScript\TM\ like the \texttt{pspicture} package. +\end{itemize} + +The \texttt{bop / eop} mechanism is not (yet) supported, so do not +expect the \texttt{draft} package to display anything. Also, not all +material is processed by Ghostscript, so rotated text will not appear +so when displayed. + +For performance reasons, the magnifying glass will not render your ps +inclusions. + +See section~\ref{gs-install} about Ghostscript installation. + +\section{Quick startup} + +Create a shortcut to \WDVI{} on your desktop: +\begin{itemize} +\item click right button on the desktop, +\item New Shortcut, +\item browse and find \texttt{windvi.exe} +\item OK. +\end{itemize} + +Next, explore your computer, drag and drop some dvi file onto the +\WDVI{} icon. If everything goes well, \WDVI{} +will open your dvi file and choose a suitable shrink factor for the +page to be fully displayed. + +\subsection{Hyper\TeX{} support} + +\WDVI\ will handle specials inserted by packages such as +\emph{hyperref} by Sebastian Rahtz. This means that you will be able +to navigate inisde (and outside !) your document, much like with your +usual browser. + +Hyperlinks are automatically hilighted. The behaviour is modified in +the following way~: +\begin{itemize} +\item clicking on mouse left will move to the page the link is + pointing to. That means if it is inside your document, the page + pointed is displayed. If it is in another dvi file, this file is + opened and the page displayed. If the link references anything else + than a dvi file, the \textsl{Windows} shell is called to handle the + reference. That means such an url as + \url{mailto:fabrice.popineau@supelec.fr} will probably launch + \textsl{Outlook Express} or whatever is your default mail tool. +\item clicking on control plus mouse left will do the same, except + that if the link points to another dvi file, your current dvi file + will stay open, and another windvi will display the new file. If you + are running in single-instance mode, there will be no difference + between using control and not using it. +\item there is a \emph{back} icon tool to go back through the + hyperlinks list you have browsed. +\end{itemize} + +\section{Reference guide} + +\subsection{Settings} + +Current settings are saved each time you quit in a +\texttt{windvi.cnf} file. This file is located under the +\textsf{HOME} directory if this environment variable is set, or +under \verb|c:\| otherwise. + +You can have a site-wide \texttt{windvi.cnf} file +located in \texttt{\$TEXMFCNF/windvi.cnf}. This file will be read +before the user one and settings will be merged. + +\subsection{Logging} + +Any error or informational message will make the log window pop +up. Font generation and so on is displayed in real-time. + +There is no way currently to avoid the pop-up feature. + +\subsection{Features} + +\subsubsection{General features} + +All the features of \WDVI{} are documented in this +\href{file://examples/wtest.tex}{sample file}. You are encouraged to +look at it. + +\subsubsection{Postscript inclusions} + +\WDVI{} will allow you to preview many PostScript inclusions, +including raw PostScript specials. See the \texttt{Examples/wtest.tex} +file for examples. The \texttt{bop / eop} feature found in dvips is +not yet supported. + +Most of the features available are described in the document +\texttt{Examples/wtest.tex}. + +However, there is a drawback. The ghostscript interpreter will allow +the whole page at the requested scaling factor to do its job. That +means a color page on a 24bits device, A4 size at 600dpi will be as +huge as 34Mb. This is enough to make your W9x crash. NT won't crash +but will slow down a lot and may become unusable. + +Eventually, PostScript visualization will be turned off automatically +if it is detected that ghostscript will use too much memory. + +\subsubsection{Colors} + +\WDVI{} will honor color specials as introduced either by +\texttt{colordvi} (plain \TeX{}) or \texttt{color} package (\LaTeX{}). + +However, it is recommended to use this feature on true color +devices. That means at least 32768 colors available. + +On 256 colors devices, no antialiasing is done for color +text. Moreover, the rendering maybe wrong because of the low number of +colors available. + +\subsection{Printing} + +Currently, printing works provided that you used the right command +line options to run windvi. The options needed are the metafont mode +for your printer and the base dpi number. Once you have run it with +the right parameters, they will be saved in your \path|windvi.cnf| +file so no need to bother for them again, unless you change your +printer. For example : +\begin{verbatim} +windvi -p 720 -mfmode esphi foo.dvi +\end{verbatim} +will allow you to print at 720dpi on an Epson Stylus printer. + +The file holding the modes is \path|texmf/metafont/misc/modes.mf| and +if you ever change it, you might want to rebuild your \mf formats +using \path|fmtutil|. + +This will be made obsolete (or almost) by the forthcoming support for +Type1 and TTF fonts. + +\subsection{Command line options} + +\begin{description} +\item [+<page>] Specifies the first page to show. If \texttt{+} is + given without a number, the last page is assumed; the first page is + the default. +\item[-allowshell] This option enables the shell escape in PostScript specials. +(For security reasons, shell escapes are disabled by default.) +This option should be rarely used; in particular it should not be used just +to uncompress files: that function is done automatically if the file name +ends in \verb|.Z| or \verb|.gz| . Shell escapes are always turned off if the +\verb|-safer| option is used. +\item[-altfont <font>] Declares a default font to use when the font in + the dvi file cannot be found. This is useful, for example, with + PostScript fonts. Defaults to \texttt{cmr10} +\item[-background <color>] uses \texttt{<color>} as background color +\item[-bg <color>] same as \texttt{-background} +\item[-debug <bitmask>]If nonzero, prints additional information on + standard output. The number is taken as a set of independent bits. + The meaning of each bit follows. 1=bitmaps; 2=dvi translation; 4=pk + reading; 8=batch operation; 16=events; 32=file opening; + 64=PostScript communication; 128=Kpathsea stat(2) calls; + 256=Kpathsea hash table lookups; 512=Kpathsea path definitions; + 1024=Kpathsea path expansion; 2048=Kpathsea searches. To trace + everything having to do with file searching and opening, use 4000. + Some of these debugging options are actually provided by Kpathsea. + See the `Debugging' section in the Kpathsea manual. + +\item[-density <density>] Determines the density used when shrinking + bitmaps for fonts. A higher value produces a lighter font. The + default value is 40. For monochrome displays; for color displays, + use -gamma. See also the `S' keystroke. Same as \texttt{-S}. +\item[-foreground <color>] Uses \texttt{<color>} as foreground color +\item[-fg <color>] same as \texttt{-foreground} +\item[-gamma <gamma>] Controls the interpolation of colors in the + greyscale anti-aliasing color palette. Default value is 1.0. For + $0 < $ gamma $ < 1$, the fonts will be lighter (more like the + background), and for gamma $ > 1$, the fonts will be darker (more + like the foreground). Negative values behave the same way, but use + a slightly different algorithm. For color and grayscale displays; + for monochrome, see -density. For color and greyscale displays; for + monochrome, see \texttt{-density}. See also the `S' keystroke. +\item[-geometry <string>] Specifies an initial X-Window geometry string. +\item[-grid1 <color>] Determines the color of level 1 grid (default as + foreground) +\item[-grid2 <color>] Determines the color of level 2 grid (default as + foreground) +\item[-grid3 <color>] Determines the color of level 3 grid (default as + foreground) +\item[-gspalette <palette>] Specifies the palette to be used when using Ghostscript for rendering +PostScript specials. Possible values are +\begin{itemize} +\item Color, +\item Greyscale, +\item Monochrome. +\end{itemize} +The default is Color. +\item[-gsalpha] Causes Ghostscript to be called with anti-aliasing + enabled in PostScript figures, for a nicer appearance. It is + available on newer versions of Ghostscript. +\item[-hush] Causes \WDVI{} to suppress all suppressible warnings. +\item[-hushchars] Causes \WDVI{} to suppress warnings about references + to characters which are not defined in the font. +\item[-hushchecksums] Causes \WDVI{} to suppress warnings about + checksum mismatches between the dvi file and the font file. +\item[-hushspecials] Causes \WDVI{} to suppress warnings about + \texttt{special} strings that it cannot process. +\item[-keep] Sets a flag to indicate that \WDVI{} should not move to the home + position when moving to a new page. See also the `k' keystroke. +\item[-margins <dimen>] This determines the ``home'' position of the + page within the window as follows. If the entire page fits in the + window, then the margin settings are ignored. If, even after + removing the margins from the left, right, top, and bottom, the page + still cannot fit in the window, then the page is put in the window + such that the top and left margins are hidden, and presumably the + upper left-hand corner of the text on the page will be in the upper + left-hand corner of the window. Otherwise, the text is centered in + the window. The dimension should be a decimal number optionally + followed by any of the two-letter abbreviations for units accepted + by (pt, pc, in, bp, cm, mm, dd, cc or sp). See also + \texttt{-sidemargin}, \texttt{-topmargin} , and the keystroke ` M .' +\item[-mfmode <mode-def>] Specifies a \emph{mode-def} string, which + can be used in searching for fonts. Generally, when changing the + mode-def, it is also necessary to change the font size to the + appropriate value for that mode. This is done by adding a colon and + the value in dots per inch; for example, \texttt{-mfmode + ljfour:600}. This method overrides any value given by the + \texttt{-p} command-line argument. The metafont mode is also passed + to \MF{} during automatic creation of fonts. By default, it is + \texttt{ljfour:600} +\item[-mgs <size>] Same as \texttt{-mgs1} . +\item[-mgs[n] <size>] Specifies the size of the window to be used for + the ``magnifying glass'' for Button n . The size may be given as an + integer (indicating that the magnifying glass is to be square), or + it may be given in the form width $\times$ height. Defaults are + 200$\times$150, 400$\times$250, 700$\times$500, 1000$\times$800, and + 1200$\times$1200. +\item[-nogrey] Turns off the use of greyscale anti-aliasing when + printing shrunken bitmaps. (For this option, the logic of the + corresponding resource is reversed: \texttt{-nogrey} corresponds to + \texttt{grey:off} and \texttt{+nogrey} to \texttt{grey:on} See also + the `G' keystroke. +\item[-nomakepk] Turns off automatic generation of font files that + cannot be found by other means. +\item[-nopostscript] Turns off rendering of PostScript\TM\ specials. +Bounding boxes, if known, will be displayed instead. +This option can also be toggled with the ` v ' keystroke. +\item[-noscan] Normally, when PostScript\TM\ is turned on, +\WDVI\ will do a preliminary scan of the dvi +file, in order to send any necessary header files before sending the +PostScript code that requires them. This option turns off such prescanning. +(It will be automatically be turned back on if +\WDVI\ +detects any specials that require headers.) +\item[-offsets] Specifies the size of both the horizontal and vertical + offsets of the output on the page. This should be a decimal number + optionally followed by `` cm '', e.g. , 1.5 or 3cm , giving a + measurement in inches or centimeters. By decree of the Stanford + \TeX\ Project, the default \TeX{} page origin is always 1 inch + over and down from the top-left page corner, even when non-American + paper sizes are used. Therefore, the default offsets are 1.0 inch. + See also \texttt{-xoffset} and \texttt{-yoffset} . +\item[-p <dpi>] Defines the size of the fonts to use, in pixels per + inch. The default value is 600. +\item[-qpaper <papertype>] Specifies the size of the printed page. + This may be of the form \emph{width}$\times$\emph{height} (or + \emph{width}$\times$\emph{height}cm), where width is the width in + inches (or cm) and height is the height in inches (or cm), + respectively. There are also synonyms which may be used: us + (8.5x11), usr (11x8.5), legal (8.5x14), foolscap (13.5x17), as well + as the ISO sizes a1 - a7 , b1 - b7 , c1 - c7 , a1r - a7r ( a1 - + a7rotated), etc. The default size is 21 x 29.7 cm. +\item[-rv] Causes the page to be displayed with white characters on a + black background, instead of vice versa. +\item[-s <shrinkfactor>] Defines the initial shrink factor. The + default value is to choose en appropriate factor. +\item[-S <density>] Same as -density, q.v. +\item[-sidemargin <dimen>] Specifies the side margin (see + \texttt{-margins}). +\item[-topmargin <dimen>] Specifies the top and bottom margins (see + \texttt{-margins}). +\item[-version] Displays the version number and exits. +\item[-xoffset <dimen>] Specifies the size of the horizontal offset of + the output on the page. See \texttt{-offsets} . +\item[-yoffset <dimen>] Specifies the size of the vertical offset of + the output on the page. See \texttt{-offsets} . +\item[-xform] Turns on graphical transformations, which allows to + apply any transformation to glyph boxes. +\end{description} + +\subsection{Mouse} +\begin{description} +\item[left button] pops up the small magnifying glass, as long as the + button is down. +\item[middle button] pops up the medium magnifying glass, as long as the + button is down. +\item[right button] pops up the big magnifying glass, as long as the + button is down. +\item[Shift + left button] change the arrow cursor for a crossbar + cursor and enter 'setting home position' mode. Home position is set + when the button is released. Usefule with the 'Keep Home' feature. +\end{description} +\subsection{Shortcut keys} + +\begin{description} +\item[Home, '\textasciicircum'] goto the upper left corner of the + page. If margins are active, use them. +\item[Next, 'n', Enter] goto next page. +\item[Prior, 'b', Backspace] goto previous page. +\item[Ctrl-Home, Ctrl-End] goto first (resp. last) page. +\item[Numpad +, Numpad -] zoom in (resp. out). +\item[Arrow keys, 'l', 'r', 'u', 'd'] move in the corresponding + direction (left, right, up, down). +\item['k'] Normally when \WDVI{} switches pages, it moves to the home + position as well. The ` k ' keystroke toggles a `keep-position' + flag which, when set, will keep the same position when moving + between pages. +\item['M'] set margins at the cursor. +\item['t'] change tick units (cursor position). +\end{description} + +\section{Ghostscript installation} +\label{gs-install} + +Statring with Ghostscript 5.50 and \fptex 0.4 (as on the \texlive 5 +\cdrom), no specific Ghostscript installation should be needed. All +the tools are linked to some library that knows where to look for +Ghostscript in the registry. + +In doubt or in case of trouble, try to set your PATH so that gsdll32.dll be +found: +\begin{verbatim} +PATH=c:\\gstools\\gs5.50;\%PATH\% +\end{verbatim} + +If you encounter error messages like: +\begin{verbatim} +Aladdin Ghostscript: Can't find initialization file gs_init.ps. +gsdll_init returns 255 +\end{verbatim} +or something about font not found, it is more than likely that +Ghostscript has been installed in a strange way. You can solve this by +telling Ghostscript explicitely where its files are located: +\begin{verbatim} + set GS_LIB=c:\gstools\gs5.50;c:\gstools\fonts +\end{verbatim} + +Also : make sure to have only one version of Ghostscript +installed. Version 5.50 can't work with initialization files of +version 5.10 for example. + +Also beware that if you are running any version of \path|gsftopk| +older than 0.19.1 and you have upgraded Ghostscript to version 6.0 or +later, then \path|gsftopk| will fail to build fonts. + +\section{FAQ} + +\begin{enumerate} +\item \textbf{\WDVI{} opens and closes immediately.} +You should check your installation: +\begin{itemize} +\item did you rename the .xam files into .cnf files ? +\item have you .cnf files ? +\item what \texttt{mktexnam cmr10} does report ? +\item in case of trouble, do the following: +\begin{verbatim} +set KPATHSEA_DEBUG_OUTPUT=err.log +mktexnam --debug=1536 cmr10 +\end{verbatim} +and send the \texttt{err.log} file to \url{mailto:Fabrice.Popineau@supelec.fr} +\end{itemize} + +\item \textbf{\WDVI{} is stuck with the hour glass cursor, displaying + some font name in the status bar.} Currently, when kpathsea is + generating fonts, \WDVI{} is blocked. You can't see any progress + status. This is because \texttt{kpathsea}-based programs are + inherently console mode programs and \texttt{\WDVI{}} is a GUI + program. If it takes too long time and the status bar doesn't + change, there is the chance of an improper installation. Check with + the previous question. In this case, you will need to kill \WDVI{} + by hand, and any process named \texttt{mf.exe} or + \texttt{mktexpk.exe} too. +\item In any case, check in the \texttt{Help -> View Log File} window + for any strange messages and report them. +\item \textbf{I'm using MiKTeX. Can I use \WDVI{} ?} Yes. But even if + the layout tree for MiKTeX is TDS-conformant, it is not quite the + same as the layout for Web2C. This is what Jody Klymak + \url{mailto:jklymak@apl.washington.edu} did~: + + \begin{quotation} + I got windvi running under Windows NT using the following steps. + I'm sure the steps are very similar on a Win95 machine. They are + essentially the same a Fabrice's instructions. It seems to handle + fonts correctly. If anyone has a better way to do it, let me + know. I'm no NT wiz. + + Cheers, Jody + + ******************************************************************* + + Installing windvi under MikTeX under WinNT 4.0 + Assuming you are set up like I am: + + MikTeX in \verb|c:\texmf| + and GSTools in \verb|c:\gstools| + + \begin{itemize} + \item Make a directory \verb|c:\texmf\windvi| + \item unpack windvi.zip in this directory + \item Put *.exe in \verb|c:\texmf\miktex\bin| + \item Put \verb|render.ps| in \verb|c:\texmf\dvips| + \item Under the system control panel click the \textsl{Environment + tab} and add: +\begin{verbatim} + TEXMFCNF c:\texmf\windvi + TEXMFMAIN c:\texmf + path c:\gstools\gs5.10 + GS_LIB c:\gstools\gs5.10;c:\gstools\gs5.10\fonts +\end{verbatim} + \item Edit \verb|c:\texmf\windvi\texmf.cnf| + \begin{itemize} + \item change \verb|TEXMFMAIN = c:/texmf| + \item change \verb|VARTEXFONTS = c:/texmf/fonts| + \end{itemize} +\end{itemize} + \end{quotation} + +Read carefully the kpathsea documentation, and try your settings with +the \texttt{mktexnam.exe} and \texttt{kpsewhich.exe} programs. +Report any settings needed to enhance this FAQ section. + +\item \textbf{How do I stop \WDVI{} to randomly access my floppy drive + ? } Check the following url + \url{http://www.annoyances.org/win95/win95ann6.html}. This is + probably caused by some kind of anti-virus program. Try to disable + it. + +\end{enumerate} + +\section{Known bugs and TODO list} + +\begin{itemize} +\item \WDVI{} is uninterruptible during font loading; +\item \verb+\pagecolor{}+ is not honoured if there are PostScript + inclusions in the page; +\item The first PostScript inclusion is not drawn, the page has to be + redrawn once, next everything is fine; +\item We need to add more support for `specials'; +\item There are probably some other bugs left. +\end{itemize} + +\appendix + +\newpage +\section{Color naming} + +You can use `rgb:/rr/gg/bb/' where rr, gg and bb are the hexadecimal +(00-FF) intensities of red, green and blue component, or any of the +following symbolic names : + +\begin{tabular}{llll} \hline +snow & MidnightBlue & MediumSpringGreen & red \\ +GhostWhite & navy & GreenYellow & HotPink \\ +WhiteSmoke & NavyBlue & LimeGreen & DeepPink \\ +gainsboro & CornflowerBlue & YellowGreen & pink \\ +FloralWhite & DarkSlateBlue & ForestGreen & LightPink \\ +OldLace & SlateBlue & OliveDrab & PaleVioletRed \\ +linen & MediumSlateBlue & DarkKhaki & maroon \\ +AntiqueWhite & LightSlateBlue & khaki & MediumVioletRed \\ +PapayaWhip & MediumBlue & PaleGoldenrod & VioletRed \\ +BlanchedAlmond & RoyalBlue & LightGoldenrodYellow & magenta \\ +bisque & blue & LightYellow & violet \\ +PeachPuff & DodgerBlue & yellow & plum \\ +NavajoWhite & DeepSkyBlue & gold & orchid \\ +moccasin & SkyBlue & LightGoldenrod & MediumOrchid \\ +cornsilk & LightSkyBlue & goldenrod & DarkOrchid \\ +ivory & SteelBlue & DarkGoldenrod & DarkViolet \\ +LemonChiffon & LightSteelBlue & RosyBrown & BlueViolet \\ +seashell & LightBlue & IndianRed & purple \\ +honeydew & PowderBlue & SaddleBrown & MediumPurple \\ +MintCream & PaleTurquoise & sienna & thistle \\ +azure & DarkTurquoise & peru & gray0 \\ +AliceBlue & MediumTurquoise & burlywood & grey0 \\ +lavender & turquoise & beige & DarkGrey \\ +LavenderBlush & cyan & wheat & DarkGray \\ +MistyRose & LightCyan & SandyBrown & DarkBlue \\ +white & CadetBlue & tan & DarkCyan \\ +black & MediumAquamarine & chocolate & DarkMagenta \\ +DarkSlateGray & aquamarine & firebrick & DarkRed \\ +DarkSlateGrey & DarkGreen & brown & LightGreen \\ +DimGray & DarkOliveGreen & DarkSalmon & \\ +DimGrey & DarkSeaGreen & salmon & \\ +SlateGray & SeaGreen & LightSalmon & \\ +SlateGrey & MediumSeaGreen & orange & \\ +LightSlateGray & LightSeaGreen & DarkOrange & \\ +LightSlateGrey & PaleGreen & coral & \\ +gray & SpringGreen & LightCoral & \\ +grey & LawnGreen & tomato & \\ +LightGrey & green & OrangeRed & \\ +LightGray & chartreuse & red & \\ +\hline +\end{tabular} + +\end{document} diff --git a/Build/source/texk/windvi/dummy.ps b/Build/source/texk/windvi/dummy.ps new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/Build/source/texk/windvi/dummy.ps diff --git a/Build/source/texk/windvi/dvi-draw.c b/Build/source/texk/windvi/dvi-draw.c new file mode 100644 index 00000000000..ffb9afe3980 --- /dev/null +++ b/Build/source/texk/windvi/dvi-draw.c @@ -0,0 +1,1951 @@ +/*========================================================================*\ + +Copyright (c) 1990-1999 Paul Vojta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +PAUL VOJTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +NOTE: + xdvi is based on prior work, as noted in the modification history + in xdvi.c. + +\*========================================================================*/ +#define HAVE_BOOLEAN +#include "xdvi-config.h" +#include <kpathsea/c-ctype.h> +#include <kpathsea/c-fopen.h> +#include <kpathsea/c-vararg.h> +#include "dvi.h" + +#ifdef TRANSFORM +extern BOOL bTransfInUse; +#endif + +static struct frame frame0; /* dummy head of list */ +#ifdef TEXXET +static struct frame *scan_frame; /* head frame for scanning */ +#endif + +#ifndef DVI_BUFFER_LEN +#define DVI_BUFFER_LEN 512 +#endif + +static ubyte dvi_buffer[DVI_BUFFER_LEN]; +static struct frame *current_frame; + +#ifndef TEXXET +#define DIR 1 +#else +#define DIR currinf.dir +#endif + +/* + * Explanation of the following constant: + * offset_[xy] << 16: margin (defaults to one inch) + * shrink_factor << 16: one pixel page border + * shrink_factor << 15: rounding for pixel_conv + */ +#define OFFSET_X (offset_x << 16) + (shrink_factor * 3 << 15) +#define OFFSET_Y (offset_y << 16) + (shrink_factor * 3 << 15) + +#if (BMBYTES == 1) +BMUNIT bit_masks[9] = { + 0x0, 0x1, 0x3, 0x7, + 0xf, 0x1f, 0x3f, 0x7f, + 0xff +}; +#else +#if (BMBYTES == 2) +BMUNIT bit_masks[17] = { + 0x0, 0x1, 0x3, 0x7, + 0xf, 0x1f, 0x3f, 0x7f, + 0xff, 0x1ff, 0x3ff, 0x7ff, + 0xfff, 0x1fff, 0x3fff, 0x7fff, + 0xffff +}; +#else /* BMBYTES == 4 */ +BMUNIT bit_masks[33] = { + 0x0, 0x1, 0x3, 0x7, + 0xf, 0x1f, 0x3f, 0x7f, + 0xff, 0x1ff, 0x3ff, 0x7ff, + 0xfff, 0x1fff, 0x3fff, 0x7fff, + 0xffff, 0x1ffff, 0x3ffff, 0x7ffff, + 0xfffff, 0x1fffff, 0x3fffff, 0x7fffff, + 0xffffff, 0x1ffffff, 0x3ffffff, 0x7ffffff, + 0xfffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, + 0xffffffff +}; +#endif +#endif + +#ifdef VMS +#define off_t int +#endif +#ifndef WIN32 +extern off_t lseek(); +#endif /* ! WIN32 */ + +#ifndef SEEK_SET /* if <unistd.h> is not provided (or for <X11R5) */ +#define SEEK_SET 0 +#define SEEK_CUR 1 +#define SEEK_END 2 +#endif + +static void draw_part(); + +#if NeedFunctionPrototypes +#ifndef TEXXET +static long set_no_char(wide_ubyte ch); +#else +static void set_no_char(wide_ubyte cmd, wide_ubyte ch); +#endif /* TEXXET */ +#else /* !NeedFunctionPrototypes */ +#ifndef TEXXET +static long set_no_char(); +#else +static void set_no_char(); +#endif /* TEXXET */ +#endif /* NeedFunctionPrototypes */ + +#ifdef TRANSFORM +extern HRGN hClipRgn; +#endif + +/* + * X routines. + */ + +/* + * Put a rectangle on the screen. + */ + +/* HTEX needs this to be non-static -janl */ +void +put_rule(x, y, w, h) + int x, y; + unsigned int w, h; +{ +#ifdef WIN32 + RECT rTemp; +#ifdef HTEX + HDC hdc = highlight? highGC : ruleGC; +#else + HDC hdc = ruleGC; +#endif + +#ifdef TRANSFORM + POINT lppt[4]; + HRGN hNewClipRgn = NULL; + XFORM xfrm, xfrm_temp; + extern BOOL bTransfInUse; + + if (!allowDrawingChars) + return; + + rTemp.left = x - currwin.base_x; + rTemp.top = y - currwin.base_y; + rTemp.right = rTemp.left + w; + rTemp.bottom = rTemp.top + h; + + if (resource.use_xform && bTransfInUse) { + RECT rTemp; + BOOL bClipped1, bClipped2; + extern XFORM current_transf; + if (SetWorldTransform(hdc, ¤t_transf) == 0) + Win32Error("XPutImage/SetWorldTransform/current"); + + lppt[0].x = x - currwin.base_x; + lppt[0].y = y - currwin.base_y; + lppt[1].x = lppt[0].x + w; + lppt[1].y = lppt[0].y; + lppt[2].x = lppt[0].x + w; + lppt[2].y = lppt[0].y + h; + lppt[3].x = lppt[0].x; + lppt[3].y = lppt[0].y + h; + LPtoDP(hdc, lppt, 4); + if ((hNewClipRgn = CreatePolygonRgn(lppt, 4, ALTERNATE)) == NULL) { + Win32Error("XPutImage/CreatePolygonRgn"); + } + if (SelectClipRgn(hdc, hNewClipRgn) == ERROR) { + Win32Error("XPutImage/SelectClipRgn"); + } + bClipped2 = RectVisible(hdc, &rTemp); + if (!bClipped2) + goto nothing; + } + else +#endif + { + if (!RectVisible(hdc, &rTemp)) + goto nothing; + } + FillRect(hdc, &rTemp, foreBrush); + nothing: +#if TRANSFORM + if (resource.use_xform && bTransfInUse) { + SelectClipRgn(hdc, NULL); + if (hNewClipRgn) DeleteObject(hNewClipRgn); + ModifyWorldTransform(hdc, &xfrm_temp, MWT_IDENTITY); + } +#endif +#else + if (x < max_x && x + (int) w >= min_x + && y < max_y && y + (int) h >= min_y) { + if (--event_counter == 0) read_events(False); +#ifdef HTEX + XFillRectangle(DISP, currwin.win, highlight? highGC: ruleGC, +#else + XFillRectangle(DISP, currwin.win, ruleGC, +#endif + x - currwin.base_x, y - currwin.base_y, w ? w : 1, h ? h : 1); + } +#endif +} + +static void +put_bitmap(bitmap, x, y) + struct bitmap *bitmap; + int x, y; +{ + +#ifdef HTEX + if (HTeXAnestlevel > 0) { + htex_recordbits(x, y, bitmap->w, bitmap->h); + } +#endif + + if (debug & DBG_BITMAP) + Printf("X(%d,%d)\n", x - currwin.base_x, y - currwin.base_y); +#ifdef WIN32 + image->width = bitmap->w; + image->height = bitmap->h; + image->data = bitmap->bits; + image->bytes_per_line = bitmap->bytes_wide; + image->endian_permuted = &(bitmap->endian_permuted); + image->depth = 1; +#ifdef HTEX + XPutImage(DISP, currwin.win, HTeXreflevel > 0? highGC: foreGC, image, + 0, 0, + x - currwin.base_x, y - currwin.base_y, + bitmap->w, bitmap->h); +#else + XPutImage(DISP, currwin.win, foreGC, image, + 0, 0, + x - currwin.base_x, y - currwin.base_y, + bitmap->w, bitmap->h); +#endif + +#else + if (x < max_x && x + (int) bitmap->w >= min_x && + y < max_y && y + (int) bitmap->h >= min_y) { + if (--event_counter == 0) read_events(False); + image->width = bitmap->w; + image->height = bitmap->h; + image->data = bitmap->bits; + image->bytes_per_line = bitmap->bytes_wide; +#ifdef HTEX + XPutImage(DISP, currwin.win, HTeXreflevel > 0? highGC: foreGC, image, +#else + XPutImage(DISP, currwin.win, foreGC, image, +#endif + 0, 0, + x - currwin.base_x, y - currwin.base_y, + bitmap->w, bitmap->h); + if (foreGC2) + XPutImage(DISP, currwin.win, foreGC2, image, + 0, 0, + x - currwin.base_x, y - currwin.base_y, + bitmap->w, bitmap->h); + } +#endif +} + +#ifdef GREY +static void +put_image(g, x, y) + struct glyph *g; + int x, y; +{ + XImage *img = g->image2; + +#ifdef HTEX + if (HTeXAnestlevel > 0) { + htex_recordbits(x, y, img->width, img->height); + } +#endif +#ifdef WIN32 + XPutImage(DISP, currwin.win, foreGC, img, + 0, 0, + x - currwin.base_x, y - currwin.base_y, + (unsigned int) img->width, (unsigned int) img->height); + +#else /* ! WIN32 */ + if (x < max_x && x + img->width >= min_x && + y < max_y && y + img->height >= min_y) { + + if (--event_counter == 0) read_events(False); + +#ifdef HTEX + XPutImage(DISP, currwin.win, foreGC, img, +#else + XPutImage(DISP, currwin.win, foreGC, img, +#endif + 0, 0, + x - currwin.base_x, y - currwin.base_y, + (unsigned int) img->width, (unsigned int) img->height); + if (foreGC2) + XPutImage(DISP, currwin.win, foreGC2, img, + 0, 0, + x - currwin.base_x, y - currwin.base_y, + (unsigned int) img->width, (unsigned int) img->height); + if (pixeltbl_t != NULL) { + img->data = g->pixmap2_t; + XPutImage(DISP, currwin.win, foreGC2, img, + 0, 0, + x - currwin.base_x, y - currwin.base_y, + (unsigned int) img->width, (unsigned int) img->height); + img->data = g->pixmap2; + } + } +#endif +} +#endif /* GREY */ + +/* + * Draw the border of a rectangle on the screen. + */ + +static void +put_border(x, y, width, height, ourGC) + int x, y; + unsigned int width, height; + GC ourGC; +{ + + --width; + --height; + /* top */ + XFillRectangle(DISP, currwin.win, ourGC, x, y, width, 1); + /* right */ + XFillRectangle(DISP, currwin.win, ourGC, x + (int) width, y, 1, height); + /* bottom */ + XFillRectangle(DISP, currwin.win, ourGC, x + 1, y + (int) height, + width, 1); + /* left */ + XFillRectangle(DISP, currwin.win, ourGC, x, y + 1, 1, height); +} + +#ifdef GRID +#ifdef WIN32 +void +put_grid(struct WindowRec *win, unsigned int unit, GC gc1, GC gc2, GC gc3) +{ + int i; /* looping variable */ + float sep; /* grid separation */ + int tmp; /* temporary variable */ + HDC hdc; + unsigned int offset; + + if (!allowDrawingChars) + return; + + switch (grid_mode) { + case 0: + return; + break; + case 1: + sep = ((float) unit); + hdc = gc1; + break; + case 2: + sep = ((float) unit) / 2.0; + hdc = gc2; + break; + case 3: + sep = ((float) unit) / 4.0; + hdc = gc3; + break; + default: + fprintf(stderr, "Warning: invalid grid_mode %d\n", grid_mode); + return; + } +#if 1 + fprintf(stderr, "Put_grid in base (%d, %d) rect (%d, %d) x (%d, %d)\n", + win->base_x, win->base_y, + win->min_x, win->min_y, + win->max_x, win->max_y); +#endif + + /* Horizontal Grid */ + for (i = 0, offset = (unsigned int)(sep - (win->base_y+win->min_y) % (int) sep) -1; + win->min_y + i*sep + offset <= win->max_y; + i++) + XFillRectangle(DISP, win->win, (hdc), win->min_x, win->min_y + i*sep + offset, + win->max_x - win->min_x, 1); + + /* Vertical Grid */ + for (i = 0, offset = (unsigned int)(sep - (win->base_x+win->min_x) % (int) sep) - 1; + win->min_x + i*sep + offset <= win->max_x; + i++) + XFillRectangle(DISP, win->win, (hdc), win->min_x + i*sep + offset, + win->min_y, 1, win->max_y - win->min_y); + +} +#else /* ! WIN32 */ +/* drawing grid */ +void +put_grid(x, y, width, height, unit, gc1, gc2, gc3) + int x, y; + unsigned int width, height, unit; + GC gc1, gc2, gc3; +{ + int i; /* looping variable */ + float sep; /* grid separation */ + int tmp; /* temporary variable */ + + --width; + --height; + +/* drawing vertial grid */ +#define DRAWGRID_VER(gc) for (i=1; \ + (tmp=x+(int) (((float) i)*sep)) < x+width; \ + i++) \ + XFillRectangle(DISP, currwin.win, (gc), \ + tmp, y, 1, height) +/* drawing horizontal grid */ +#define DRAWGRID_HOR(gc) for (i=1; \ + (tmp=y+(int) (((float) i)*sep)) < y+height; \ + i++) \ + XFillRectangle(DISP, currwin.win, (gc), \ + x, tmp, width, 1) + + if ( grid_mode > 2 ) /* third level grid */ + { + sep = (float) unit / 4.0; + DRAWGRID_VER ( gc3 ); /* vertical grid */ + DRAWGRID_HOR ( gc3 ); /* horizontal grid */ + } + + if ( grid_mode > 1 ) /* second */ + { + sep = (float) unit / 2.0; + DRAWGRID_VER ( gc2 ); /* vertical grid */ + DRAWGRID_HOR ( gc2 ); /* horizontal grid */ + } + + if ( grid_mode > 0 ) /* first level */ + { + sep = (float) unit ; + DRAWGRID_VER ( gc1 ); /* vertical grid */ + DRAWGRID_HOR ( gc1 ); /* horizontal grid */ + } +} +#endif /* WIN32 */ + +#endif /* GRID */ + +/* + * Byte reading routines for dvi file. + */ + +#define xtell(pos) ((long) (lseek(fileno(dvi_file), 0L, SEEK_CUR) - \ + (currinf.end - (pos)))) + +static ubyte +xxone() +{ + if (currinf.virtual) { + ++(currinf.pos); + return EOP; + } + currinf.end = dvi_buffer + + read(fileno(dvi_file), (char *) (currinf.pos = dvi_buffer), + DVI_BUFFER_LEN); + return currinf.end > dvi_buffer ? *(currinf.pos)++ : EOF; +} + +#define xone() (currinf.pos < currinf.end ? *(currinf.pos)++ : xxone()) + +static unsigned long +xnum(size) + ubyte size; +{ + long x = 0; + + while (size--) x = (x << 8) | xone(); + return x; +} + +static long +xsnum(size) + ubyte size; +{ + long x; + +#if __STDC__ + x = (signed char) xone(); +#else + x = xone(); + if (x & 0x80) x -= 0x100; +#endif + while (--size) x = (x << 8) | xone(); + return x; +} + +#define xsfour() xsnum(4) + +static void +xskip(offset) + long offset; +{ + currinf.pos += offset; + if (!currinf.virtual && currinf.pos > currinf.end) + (void) lseek(fileno(dvi_file), (long) (currinf.pos - currinf.end), + SEEK_CUR); +} + +#ifdef HAVE_PROTOTYPES +static NORETURN void +tell_oops(_Xconst char *message, ...) +#else +/* VARARGS */ +static NORETURN void +tell_oops(va_alist) + va_dcl +#endif +{ +#ifndef HAVE_PROTOTYPES + _Xconst char *message; +#endif + va_list args; + + Fprintf(stderr, "%s: ", prog); +#ifdef HAVE_PROTOTYPES + va_start(args, message); +#else + va_start(args); + message = va_arg(args, _Xconst char *); +#endif + (void) vfprintf(stderr, message, args); + va_end(args); + if (currinf.virtual) + Fprintf(stderr, " in virtual font %s\n", currinf.virtual->fontname); + else + Fprintf(stderr, ", offset %ld\n", xtell(currinf.pos - 1)); +#if PS + ps_destroy(); +#endif + Exit(1); +} + + +/* + * Code for debugging options. + */ + +static void +print_bitmap(bitmap) + struct bitmap *bitmap; +{ + BMUNIT *ptr = (BMUNIT *) bitmap->bits; + int x, y, i; + + if (ptr == NULL) oops("print_bitmap called with null pointer."); + Printf("w = %d, h = %d, bytes wide = %d\n", + bitmap->w, bitmap->h, bitmap->bytes_wide); + for (y = 0; y < (int) bitmap->h; ++y) { + for (x = bitmap->bytes_wide; x > 0; x -= BMBYTES) { +#ifndef WORDS_BIGENDIAN + for (i = 0; i < BMBITS; ++i) +#else + for (i = BMBITS - 1; i >= 0; --i) +#endif + Putchar((*ptr & (1 << i)) ? '@' : ' '); + ++ptr; + } + Putchar('\n'); + } +} + +static void +print_char(ch, g) + ubyte ch; + struct glyph *g; +{ + Printf("char %d", ch); + if (ISPRINT(ch)) + Printf(" (%c)", ch); + Putchar('\n'); + Printf("x = %d, y = %d, dvi = %ld\n", g->x, g->y, g->dvi_adv); + print_bitmap(&g->bitmap); +} + +static _Xconst char *dvi_table1[] = { +#ifdef Omega + "SET1", "SET2", NULL, NULL, "SETRULE", "PUT1", "PUT2", NULL, +#else + "SET1", NULL, NULL, NULL, "SETRULE", "PUT1", NULL, NULL, +#endif + NULL, "PUTRULE", "NOP", "BOP", "EOP", "PUSH", "POP", "RIGHT1", + "RIGHT2", "RIGHT3", "RIGHT4", "W0", "W1", "W2", "W3", "W4", + "X0", "X1", "X2", "X3", "X4", "DOWN1", "DOWN2", "DOWN3", + "DOWN4", "Y0", "Y1", "Y2", "Y3", "Y4", "Z0", "Z1", + "Z2", "Z3", "Z4"}; + +static _Xconst char *dvi_table2[] = { + "FNT1", "FNT2", "FNT3", "FNT4", "XXX1", "XXX2", "XXX3", "XXX4", + "FNTDEF1", "FNTDEF2", "FNTDEF3", "FNTDEF4", "PRE", "POST", "POSTPOST", + "SREFL", "EREFL", NULL, NULL, NULL, NULL}; + +static void +print_dvi(ch) + ubyte ch; +{ + _Xconst char *s; + + Printf("%4d %4d ", PXL_H, PXL_V); + if (ch <= (ubyte) (SETCHAR0 + 127)) { + Printf("SETCHAR%-3d", ch - SETCHAR0); + if (ISPRINT(ch)) + Printf(" (%c)", ch); + Putchar('\n'); + return; + } + else if (ch < FNTNUM0) s = dvi_table1[ch - 128]; + else if (ch <= (ubyte) (FNTNUM0 + 63)) { + Printf("FNTNUM%d\n", ch - FNTNUM0); + return; + } + else s = dvi_table2[ch - (FNTNUM0 + 64)]; + if (s) Puts(s); + else + tell_oops("unknown op-code %d", ch); +} + + +/* + * Count the number of set bits in a given region of the bitmap + */ + +char sample_count[] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4}; + +static int +sample(bits, bytes_wide, bit_skip, w, h) + BMUNIT *bits; + int bytes_wide, bit_skip, w, h; +{ + BMUNIT *ptr, *endp; + BMUNIT *cp; + int bits_left; + int n, bit_shift, wid; + + ptr = bits + bit_skip / BMBITS; + endp = ADD(bits, h * bytes_wide); + bits_left = w; +#ifndef WORDS_BIGENDIAN + bit_shift = bit_skip % BMBITS; +#else + bit_shift = BMBITS - bit_skip % BMBITS; +#endif + n = 0; + while (bits_left) { +#ifndef WORDS_BIGENDIAN + wid = BMBITS - bit_shift; +#else + wid = bit_shift; +#endif + if (wid > bits_left) wid = bits_left; + if (wid > 4) wid = 4; +#ifdef WORDS_BIGENDIAN + bit_shift -= wid; +#endif + for (cp = ptr; cp < endp; cp = ADD(cp, bytes_wide)) + n += sample_count[(*cp >> bit_shift) & bit_masks[wid]]; +#ifndef WORDS_BIGENDIAN + bit_shift += wid; + if (bit_shift == BMBITS) { + bit_shift = 0; + ++ptr; + } +#else + if (bit_shift == 0) { + bit_shift = BMBITS; + ++ptr; + } +#endif + bits_left -= wid; + } + return n; +} + +static void +shrink_glyph(g) + struct glyph *g; +{ + int shrunk_bytes_wide, shrunk_height; + int rows_left, rows, init_cols; + int cols_left; + int cols; + BMUNIT *old_ptr, *new_ptr; + BMUNIT m, *cp; + int min_sample = shrink_factor * shrink_factor * density / 100; + int rtmp; +#ifdef WIN32 + extern PF_BSWAP bswap; + + /* Ensure that the original data are not permuted */ + if (g->bitmap.endian_permuted == 1) { + bswap((BMUNIT*)g->bitmap.bits, + (g->bitmap.bytes_wide * g->bitmap.h)/BMBYTES); + g->bitmap.endian_permuted = 0; + } +#endif + /* These machinations ensure that the character is shrunk according to + its hot point, rather than its upper left-hand corner. */ + g->x2 = g->x / shrink_factor; + init_cols = g->x - g->x2 * shrink_factor; + if (init_cols <= 0) init_cols += shrink_factor; + else ++g->x2; + g->bitmap2.w = g->x2 + ROUNDUP((int) g->bitmap.w - g->x, shrink_factor); + /* include row zero with the positively numbered rows */ + rtmp = g->y + 1; + g->y2 = rtmp / shrink_factor; + rows = rtmp - g->y2 * shrink_factor; + if (rows <= 0) { + rows += shrink_factor; + --g->y2; + } + g->bitmap2.h = shrunk_height = g->y2 + + ROUNDUP((int) g->bitmap.h - rtmp, shrink_factor) + 1; + alloc_bitmap(&g->bitmap2); + old_ptr = (BMUNIT *) g->bitmap.bits; + new_ptr = (BMUNIT *) g->bitmap2.bits; + shrunk_bytes_wide = g->bitmap2.bytes_wide; + rows_left = g->bitmap.h; + bzero((char *) new_ptr, shrunk_bytes_wide * shrunk_height); + while (rows_left) { + if (rows > rows_left) rows = rows_left; + cols_left = g->bitmap.w; +#ifndef WORDS_BIGENDIAN + m = (1 << 0); +#else + m = ((BMUNIT) 1 << (BMBITS-1)); +#endif + cp = new_ptr; + cols = init_cols; + while (cols_left) { + if (cols > cols_left) cols = cols_left; + if (sample(old_ptr, g->bitmap.bytes_wide, + (int) g->bitmap.w - cols_left, cols, rows) + >= min_sample) + *cp |= m; +#ifndef WORDS_BIGENDIAN + if (m == ((BMUNIT)1 << (BMBITS-1))) { + m = (1 << 0); + ++cp; + } + else m <<= 1; +#else + if (m == (1 << 0)) { + m = ((BMUNIT) 1 << (BMBITS-1)); + ++cp; + } + else m >>= 1; +#endif + cols_left -= cols; + cols = shrink_factor; + } + *((char **) &new_ptr) += shrunk_bytes_wide; + *((char **) &old_ptr) += rows * g->bitmap.bytes_wide; + rows_left -= rows; + rows = shrink_factor; + } + g->y2 = g->y / shrink_factor; + if (debug & DBG_BITMAP) + print_bitmap(&g->bitmap2); +#ifdef WIN32 + g->bitmap2.endian_permuted = 0; +#endif +} + +#ifdef GREY +static void +shrink_glyph_grey(g) + struct glyph *g; +{ + int rows_left, rows, init_cols; + int cols_left; + int cols; + int x, y; + long thesample; + BMUNIT *old_ptr; + unsigned int size; + int rtmp; +#ifdef WIN32 + extern PF_BSWAP bswap; + + /* Ensure that the original data are not permuted */ + if (g->bitmap.endian_permuted == 1) { + bswap((BMUNIT*)g->bitmap.bits, + (g->bitmap.bytes_wide * g->bitmap.h)/BMBYTES); + g->bitmap.endian_permuted = 0; + } +#endif + /* These machinations ensure that the character is shrunk according to + its hot point, rather than its upper left-hand corner. */ + g->x2 = g->x / shrink_factor; + init_cols = g->x - g->x2 * shrink_factor; + if (init_cols <= 0) init_cols += shrink_factor; + else ++g->x2; + g->bitmap2.w = g->x2 + ROUNDUP((int) g->bitmap.w - g->x, shrink_factor); + /* include row zero with the positively numbered rows */ + rtmp = g->y + 1; + g->y2 = rtmp / shrink_factor; + rows = rtmp - g->y2 * shrink_factor; + if (rows <= 0) { + rows += shrink_factor; + --g->y2; + } + g->bitmap2.h = g->y2 + ROUNDUP((int) g->bitmap.h - rtmp, shrink_factor) + + 1; + +#ifdef WIN32 + g->image2 = XCreateImage(DISP, maneDrawDC, + 4, + ZPixmap, 0, (char *) NULL, + g->bitmap2.w, g->bitmap2.h, + BMBITS, 0); + g->image2->endian_permuted = NULL; +#else + g->image2 = XCreateImage(DISP, our_visual, our_depth, ZPixmap, + 0, (char *) NULL, g->bitmap2.w, g->bitmap2.h, BMBITS, 0); +#endif + size = g->image2->bytes_per_line * g->bitmap2.h; + g->pixmap2 = g->image2->data = xmalloc(size != 0 ? size : 1); + if (pixeltbl_t != NULL) + g->pixmap2_t = xmalloc(size != 0 ? size : 1); + + old_ptr = (BMUNIT *) g->bitmap.bits; + rows_left = g->bitmap.h; + y = 0; + while (rows_left) { + x = 0; + if (rows > rows_left) rows = rows_left; + cols_left = g->bitmap.w; + cols = init_cols; + while (cols_left) { + if (cols > cols_left) cols = cols_left; + + thesample = sample(old_ptr, g->bitmap.bytes_wide, + (int) g->bitmap.w - cols_left, cols, rows); + XPutPixel(g->image2, x, y, pixeltbl[thesample]); + if (pixeltbl_t != NULL) { + g->image2->data = g->pixmap2_t; + XPutPixel(g->image2, x, y, pixeltbl_t[thesample]); + g->image2->data = g->pixmap2; + } + + cols_left -= cols; + cols = shrink_factor; + x++; + } + *((char **) &old_ptr) += rows * g->bitmap.bytes_wide; + rows_left -= rows; + rows = shrink_factor; + y++; + } + + while (y < (int) g->bitmap2.h) { + for (x = 0; x < (int) g->bitmap2.w; x++) { + XPutPixel(g->image2, x, y, *pixeltbl); + if (pixeltbl_t != NULL) { + g->image2->data = g->pixmap2_t; + XPutPixel(g->image2, x, y, *pixeltbl_t); + g->image2->data = g->pixmap2; + } + } + y++; + } + + g->y2 = g->y / shrink_factor; +#ifdef WIN32 + g->bitmap2.endian_permuted = 0; +#endif +} +#endif /* GREY */ + +/* + * Find font #n. + */ + +static void +change_font(n) + unsigned long n; +{ + struct tn *tnp; + + if (n < currinf.tn_table_len) currinf.fontp = currinf.tn_table[n]; + else { + currinf.fontp = NULL; + for (tnp = currinf.tn_head; tnp != NULL; tnp = tnp->next) + if (tnp->TeXnumber == n) { + currinf.fontp = tnp->fontp; + break; + } + } + if (currinf.fontp == NULL) tell_oops("non-existent font #%d", n); + if (currinf.fontp->set_char_p == NULL) + tell_oops("No procedure to set font #%d", + n,currinf.fontp->fontname); + maxchar = currinf.fontp->maxchar; + currinf.set_char_p = currinf.fontp->set_char_p; +} + + +/* + * Open a font file. + */ + +static void +open_font_file(fontp) + struct font *fontp; +{ + if (fontp->file == NULL) { + fontp->file = xfopen_local(fontp->filename, OPEN_MODE); + if (fontp->file == NULL) + oops("Font file disappeared: %s", fontp->filename); + } +} + +/* + * Read special string. + */ + +static char * +read_special(nbytes) + long nbytes; +{ + static char *spcl = NULL; + static long spcl_len = -1; + char *p; + + if (spcl_len < nbytes) { + if (spcl != NULL) free(spcl); + spcl = xmalloc((unsigned) nbytes + 1); + spcl_len = nbytes; + } + p = spcl; + for (;;) { + int i = currinf.end - currinf.pos; + + if (i > nbytes) i = nbytes; + bcopy((char *) currinf.pos, p, i); + currinf.pos += i; + p += i; + nbytes -= i; + if (nbytes == 0) break; + (void) xxone(); + --(currinf.pos); + } + *p = '\0'; + return spcl; +} + +#if PS + +/* + * Size of page interval for "Scanning pages xx-xx" message. + */ + +#ifndef REPORT_INCR +#define REPORT_INCR 50 +#endif + +/* + * Table used for scanning. If >= 0, then skip that many bytes. + * M1 means end of page, M2 means special, M3 means FNTDEF, + * M4 means unrecognizable, and M5 means doesn't belong here. + */ + +#define M1 255 +#define M2 254 +#define M3 253 +#define M4 252 +#define M5 251 +#define MM 251 + +static ubyte scantable[256] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* chars 0 - 127 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +#ifdef Omega + 1,2, /* SET1,SET2 (128,129) */ + /* -,-,SETRULE,PUT1,PUT2,-,-,PUTRULE,NOP,BOP (130-139) */ + M4,M4,8,1,2,M4,M4,8,0,44, +#else + + 1,M4, /* SET1,- (128,129) */ + /* -,-,SETRULE,PUT1,-,-,-,PUTRULE,NOP,BOP (130-139) */ + M4,M4,8,1,M4,M4,M4,8,0,44, +#endif + M1,0,0,1,2,3,4,0,1,2, /* EOP,PUSH,POP,RIGHT1-4,W0M2 (140-149) */ + 3,4,0,1,2,3,4,1,2,3, /* W3-4,X0-4,DOWN1-3 (150-159) */ + 4,0,1,2,3,4,0,1,2,3, /* DOWN4,Y0-4,Z0-3 (160-169) */ + 4, /* Z4 (170) */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* change font 171 - 234 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 1,2,3,4,M2, /* FNT1-4,XXX1 (235-239) */ + /* XXX2-4,FNTDEF1-4,PRE,POST,POSTPOST (240-249) */ + M2,M2,M2,M3,M3,M3,M3,M5,M5,M5, + 0,0,M4,M4,M4,M4}; /* SREFL,EREFL,-,-,-,- (250-255) */ + +/* + * Prescanning routine for dvi file. This looks for specials like + * `header=' and `!'. + */ + +void +prescan() +{ + ubyte ch; + ubyte n; + long a; + int nextreportpage; + char scanmsg[40]; +#ifdef WIN32 + extern void scan_init_fore_color(void); + extern void scan_get_last_fore_color(void); +#endif + +#ifndef WIN32 + if (!resource._postscript) { + scanned_page = total_pages; + return; + } +#else + /* debug = DBG_PS; */ + scan_init_fore_color(); +#endif + nextreportpage = scanned_page; + ++scanned_page; + (void) lseek(fileno(dvi_file), page_offset[scanned_page], SEEK_SET); + currinf.pos = currinf.end = dvi_buffer; + for (;;) { + if (debug & DBG_PS) + Printf("Scanning page %d\n", scanned_page); + if (scanned_page > nextreportpage) { + nextreportpage += REPORT_INCR; + if (nextreportpage > current_page) + nextreportpage = current_page; + Sprintf(scanmsg, "Scanning pages %d-%d", + scanned_page + pageno_correct, + nextreportpage + pageno_correct); + showmessage(scanmsg); + XFlush(DISP); + } + for (;;) { + ch = xone(); + n = scantable[ch]; + if (n < MM) + while (n-- != 0) + (void) xone(); + else if (n == M1) break; /* end of page */ + else switch (n) { + case M2: /* special */ + a = xnum(ch - XXX1 + 1); + if (a > 0) + scan_special(read_special(a)); + break; + case M3: /* FNTDEF */ + xskip((long) (12 + ch - FNTDEF1 + 1)); + ch = xone(); + xskip((long) ch + (long) xone()); + break; + case M4: /* unrecognizable */ + tell_oops("unknown op-code %d", ch); + break; + case M5: /* doesn't belong */ + tell_oops("prescan, shouldn't happen: %s encountered", + dvi_table2[ch - (FNTNUM0 + 64)]); + break; + } + } +#ifdef WIN32 + scan_get_last_fore_color(); +#if DEBUG_SPECIALS + fprintf(stderr, "Mid : scanned_page = %d, current_page = %d\n", + scanned_page, current_page); +#endif +#endif + if (scanned_page >= current_page) break; + ++scanned_page; + } +#if DEBUG_SPECIALS + fprintf(stderr, "End of prescan, scanned_page = %d\n", scanned_page); +#endif + scanned_page_bak = scanned_page; +#ifndef WIN32 + /* I don't think this is the right place for this. */ + XClearWindow(DISP, mane.win); +#endif + psp.endheader(); +} + +#endif /* PS */ + +/* + * Routines to print characters. + */ + +#ifndef TEXXET +#define ERRVAL 0L +#else +#define ERRVAL +#endif + +#ifndef TEXXET +long +set_char P1C(wide_ubyte, ch) +#else +void +set_char P2C(wide_ubyte, cmd, wide_ubyte, ch) +#endif +{ + struct glyph *g; +#ifdef TEXXET + long dvi_h_sav; +#endif + + if (ch > maxchar) realloc_font(currinf.fontp, WIDENINT ch); + if ((g = &currinf.fontp->glyph[ch])->bitmap.bits == NULL) { + if (g->addr == 0) { + if (!hush_chars) + Fprintf(stderr, "Character %d not defined in font %s\n", ch, + currinf.fontp->fontname); + g->addr = -1; + return ERRVAL; + } + if (g->addr == -1) + return ERRVAL; /* previously flagged missing char */ + open_font_file(currinf.fontp); + Fseek(currinf.fontp->file, g->addr, 0); + (*currinf.fontp->read_char)(currinf.fontp, ch); + if (debug & DBG_BITMAP) print_char((ubyte) ch, g); + currinf.fontp->timestamp = ++current_timestamp; + } + +#ifdef TEXXET + dvi_h_sav = DVI_H; + if (currinf.dir < 0) DVI_H -= g->dvi_adv; + + if (scan_frame == NULL) { +#endif + if (shrink_factor == 1) + put_bitmap(&g->bitmap, PXL_H - g->x, PXL_V - g->y); + else { +#ifdef GREY + if (use_grey) { + if (g->pixmap2 == NULL) { + shrink_glyph_grey(g); + } + put_image(g, PXL_H - g->x2, PXL_V - g->y2); + } else { + if (g->bitmap2.bits == NULL) { + shrink_glyph(g); + } + put_bitmap(&g->bitmap2, PXL_H - g->x2, PXL_V - g->y2); + } +#else + if (g->bitmap2.bits == NULL) { + shrink_glyph(g); + } + put_bitmap(&g->bitmap2, PXL_H - g->x2, PXL_V - g->y2); +#endif + } +#ifndef TEXXET + return g->dvi_adv; +#else + } +#ifdef Omega + if ((cmd == PUT1) || (cmd == PUT2)) +#else + if (cmd == PUT1) +#endif + DVI_H = dvi_h_sav; + else + if (currinf.dir > 0) DVI_H += g->dvi_adv; +#endif +} + + +#ifndef TEXXET +static long set_empty_char P1C(wide_ubyte, ch) +{ return 0; } +#else +static void set_empty_char P2C(wide_ubyte, cmd, wide_ubyte, ch) +{ return; } +#endif + +#ifndef TEXXET +long load_n_set_char P1C(wide_ubyte, ch) +#else +void load_n_set_char P2C(wide_ubyte, cmd, wide_ubyte, ch) +#endif +{ + if (load_font(currinf.fontp)) { /* if not found */ + Fputs("Character(s) will be left blank.\n", stderr); + currinf.set_char_p = currinf.fontp->set_char_p = set_empty_char; + currinf.fontp->glyph = NULL; /* init for read_postamble */ +#ifndef TEXXET + return 0; +#else + return; +#endif + } + maxchar = currinf.fontp->maxchar; + currinf.set_char_p = currinf.fontp->set_char_p; +#ifndef TEXXET + return (*currinf.set_char_p)(ch); +#else + (*currinf.set_char_p)(cmd, ch); + return; +#endif +} + + +#ifndef TEXXET +long +set_vf_char P1C(wide_ubyte, ch) +#else +void +set_vf_char P2C(wide_ubyte, cmd, wide_ubyte, ch) +#endif +{ + struct macro *m; + struct drawinf oldinfo; +#ifdef Omega + wide_ubyte oldmaxchar; +#else + ubyte oldmaxchar; +#endif + static ubyte c; +#ifdef TEXXET + long dvi_h_sav; +#endif + + if (ch > maxchar) realloc_virtual_font(currinf.fontp, ch); + if ((m = &currinf.fontp->macro[ch])->pos == NULL) { + if (!hush_chars) + Fprintf(stderr, "Character %d not defined in font %s\n", ch, + currinf.fontp->fontname); + m->pos = m->end = &c; + return ERRVAL; + } +#ifdef TEXXET + dvi_h_sav = DVI_H; + if (currinf.dir < 0) DVI_H -= m->dvi_adv; + if (scan_frame == NULL) { +#endif + oldinfo = currinf; + oldmaxchar = maxchar; + WW = XX = YY = ZZ = 0; + currinf.tn_table_len = VFTABLELEN; + currinf.tn_table = currinf.fontp->vf_table; + currinf.tn_head = currinf.fontp->vf_chain; + currinf.pos = m->pos; + currinf.end = m->end; + currinf.virtual = currinf.fontp; + draw_part(current_frame, currinf.fontp->dimconv); + if (currinf.pos != currinf.end + 1) + tell_oops("virtual character macro does not end correctly"); + currinf = oldinfo; + maxchar = oldmaxchar; +#ifndef TEXXET + return m->dvi_adv; +#else + } +#ifdef Omega + if ((cmd == PUT1) || (cmd == PUT2)) +#else + if (cmd == PUT1) +#endif + DVI_H = dvi_h_sav; + else + if (currinf.dir > 0) DVI_H += m->dvi_adv; +#endif +} + + +#ifndef TEXXET +static long +set_no_char P1C(wide_ubyte, ch) +#else +static void +set_no_char P2C(wide_ubyte, cmd, wide_ubyte, ch) +#endif +{ + if (currinf.virtual) { + currinf.fontp = currinf.virtual->first_font; + if (currinf.fontp != NULL) { + maxchar = currinf.fontp->maxchar; + currinf.set_char_p = currinf.fontp->set_char_p; +#ifndef TEXXET + return (*currinf.set_char_p)(ch); +#else + (*currinf.set_char_p)(cmd, ch); + return; +#endif + } + } + tell_oops("attempt to set character of unknown font"); + /* NOTREACHED */ +} + + +/* + * Set rule. Arguments are coordinates of lower left corner. + */ + +static void +set_rule(h, w) + int h, w; +{ +#ifndef TEXXET + put_rule(PXL_H, PXL_V - h + 1, (unsigned int) w, (unsigned int) h); +#else + put_rule(PXL_H - (currinf.dir < 0 ? w - 1 : 0), PXL_V - h + 1, + (unsigned int) w, (unsigned int) h); +#endif +} + +#define xspell_conv(n) spell_conv0(n, current_dimconv) + +static void +draw_part(minframe, current_dimconv) + struct frame *minframe; + double current_dimconv; +{ + ubyte ch; +#ifdef TEXXET + struct drawinf oldinfo; + ubyte oldmaxchar; + off_t file_pos; + int refl_count; +#endif + float curr_pt_size; // added SU + static char *spc_bak = NULL; + + currinf.fontp = NULL; + currinf.set_char_p = set_no_char; +#ifdef TEXXET + currinf.dir = 1; + scan_frame = NULL; /* indicates we're not scanning */ +#endif + // delay_src = False; + for (;;) { + ch = xone(); + if (debug & DBG_DVI) + print_dvi(ch); + if (ch <= (ubyte) (SETCHAR0 + 127)) { +#ifndef TEXXET + DVI_H += (*currinf.set_char_p)(ch); +#else + (*currinf.set_char_p)(ch, ch); +#endif + /* check if there are delayed src specials */ + if (delay_src) { + // fprintf(stderr, "now calling src spec \n"); + applicationDoSpecial(spc_bak, 1); + // delay_src = false; + } + else { + // fprintf(stderr, "NOT calling src spec \n"); + } + } + else if (FNTNUM0 <= ch && ch <= (ubyte) (FNTNUM0 + 63)) { + change_font((unsigned long) (ch - FNTNUM0)); + // fprintf(stderr, "changing font\n"); + } + else { + long a, b; + + switch (ch) { + case SET1: + case PUT1: +#ifndef TEXXET + a = (*currinf.set_char_p)(xone()); + if (ch != PUT1) DVI_H += a; +#else + (*currinf.set_char_p)(ch, xone()); +#endif + break; + +#ifdef Omega + case SET2: + case PUT2: +#ifndef TEXXET + a = (*currinf.set_char_p)(xnum(2)); + if (ch != PUT2) DVI_H += a; +#else + (*currinf.set_char_p)(ch, xnum(2)); +#endif + break; +#endif /* Omega */ + + case SETRULE: + /* Be careful, dvicopy outputs rules with + height = 0x80000000. We don't want any + SIGFPE here. */ + a = xsfour(); + b = xspell_conv(xsfour()); +#ifndef TEXXET + if (a > 0 && b > 0) +#else + if (a > 0 && b > 0 && scan_frame == NULL) +#endif + set_rule(pixel_round(xspell_conv(a)), + pixel_round(b)); + DVI_H += DIR * b; + break; + + case PUTRULE: + a = xspell_conv(xsfour()); + b = xspell_conv(xsfour()); +#ifndef TEXXET + if (a > 0 && b > 0) +#else + if (a > 0 && b > 0 && scan_frame == NULL) +#endif + set_rule(pixel_round(a), pixel_round(b)); + break; + + case NOP: + break; + + case BOP: + xskip((long) 11 * 4); + DVI_H = OFFSET_X; + DVI_V = OFFSET_Y; + PXL_V = pixel_conv(DVI_V); + WW = XX = YY = ZZ = 0; + break; + + case EOP: + if (current_frame != minframe) + tell_oops("stack not empty at EOP"); + return; + + case PUSH: + if (current_frame->next == NULL) { + struct frame *newp = xmalloc(sizeof(struct frame)); + current_frame->next = newp; + newp->prev = current_frame; + newp->next = NULL; + } + current_frame = current_frame->next; + current_frame->data = currinf.data; + break; + + case POP: + if (current_frame == minframe) + tell_oops("more POPs than PUSHes"); + currinf.data = current_frame->data; + current_frame = current_frame->prev; + break; + +#ifdef TEXXET + case SREFL: + if (scan_frame == NULL) { + /* we're not scanning: save some info. */ + oldinfo = currinf; + oldmaxchar = maxchar; + if (!currinf.virtual) + file_pos = xtell(currinf.pos); + scan_frame = current_frame; /* now we're scanning */ + refl_count = 0; + break; + } + /* we are scanning */ + if (current_frame == scan_frame) ++refl_count; + break; + + case EREFL: + if (scan_frame != NULL) { /* if we're scanning */ + if (current_frame == scan_frame && --refl_count < 0) + { + /* we've hit the end of our scan */ + scan_frame = NULL; + /* first: push */ + if (current_frame->next == NULL) { + struct frame *newp = + xmalloc(sizeof(struct frame)); + current_frame->next = newp; + newp->prev = current_frame; + newp->next = NULL; + } + current_frame = current_frame->next; + current_frame->data = currinf.data; + /* next: restore old file position, XX, etc. */ + if (!currinf.virtual) { + off_t bgn_pos = xtell(dvi_buffer); + + if (file_pos >= bgn_pos) { + oldinfo.pos = dvi_buffer + + (file_pos - bgn_pos); + oldinfo.end = currinf.end; + } + else { + (void) lseek(fileno(dvi_file), file_pos, + SEEK_SET); + oldinfo.pos = oldinfo.end; + } + } + currinf = oldinfo; + maxchar = oldmaxchar; + /* and then: recover position info. */ + DVI_H = current_frame->data.dvi_h; + DVI_V = current_frame->data.dvi_v; + PXL_V = current_frame->data.pxl_v; + /* and finally, reverse direction */ + currinf.dir = -currinf.dir; + } + break; + } + /* we're not scanning, */ + /* so just reverse direction and then pop */ + currinf.dir = -currinf.dir; + currinf.data = current_frame->data; + current_frame = current_frame->prev; + break; +#endif /* TEXXET */ + + case RIGHT1: + case RIGHT2: + case RIGHT3: + case RIGHT4: + DVI_H += DIR * xspell_conv(xsnum(ch - RIGHT1 + 1)); + break; + + case W1: + case W2: + case W3: + case W4: + WW = xspell_conv(xsnum(ch - W0)); + case W0: + DVI_H += DIR * WW; + break; + + case X1: + case X2: + case X3: + case X4: + XX = xspell_conv(xsnum(ch - X0)); + case X0: + DVI_H += DIR * XX; + break; + + case DOWN1: + case DOWN2: + case DOWN3: + case DOWN4: + DVI_V += xspell_conv(xsnum(ch - DOWN1 + 1)); + PXL_V = pixel_conv(DVI_V); + break; + + case Y1: + case Y2: + case Y3: + case Y4: + YY = xspell_conv(xsnum(ch - Y0)); + case Y0: + DVI_V += YY; + PXL_V = pixel_conv(DVI_V); + break; + + case Z1: + case Z2: + case Z3: + case Z4: + ZZ = xspell_conv(xsnum(ch - Z0)); + case Z0: + DVI_V += ZZ; + PXL_V = pixel_conv(DVI_V); + break; + + case FNT1: + case FNT2: + case FNT3: + case FNT4: + change_font(xnum(ch - FNT1 + 1)); + break; + + case XXX1: + case XXX2: + case XXX3: + case XXX4: + a = xnum(ch - XXX1 + 1); + if (a > 0) { + spc_bak = read_special(a); + applicationDoSpecial(spc_bak, 0); + } + break; + + case FNTDEF1: + case FNTDEF2: + case FNTDEF3: + case FNTDEF4: + xskip((long) (12 + ch - FNTDEF1 + 1)); + a = (long) xone(); + xskip(a + (long) xone()); + break; + +#ifndef TEXXET + case SREFL: + case EREFL: +#endif + case PRE: + case POST: + case POSTPOST: + tell_oops("shouldn't happen: %s encountered", + dvi_table2[ch - (FNTNUM0 + 64)]); + break; + + default: + tell_oops("unknown op-code %d", ch); + } /* end switch*/ + } /* end else (ch not a SETCHAR or FNTNUM) */ + } /* end for */ +} + +#undef xspell_conv + +#ifdef HTEX +static void +check_for_anchor() /* see if anchor requested, if so go to it */ +{ + if (anchor_name != NULL) { + htex_reinit(); /* Set up hypertext stuff */ + htex_do_loc(anchor_name); + free(anchor_name); + anchor_name = NULL; + } +} +#endif /* HTEX */ + +void draw_page P1C() +{ + extern HDC magDC, magMemDC; + + /* Check for changes in dvi file. */ + if (!check_dvi_file()) return; + +#ifdef WIN32 + if (! allowDrawingChars && !isPrinting) + bColorPage = FALSE; +#endif +#if PS + if (scanned_page < current_page) prescan(); +#ifdef WIN32 + { + if (!bMagDisp && !allowDrawingChars && !isPrinting) { + psToDisplay = False; + } + } +#endif +#endif + + if (!allowDrawingChars && !isPrinting) { + RECT r; + COLORREF new_back_Pixel = get_back_color(current_page); +#if 0 + extern void dump_colors(char *); + dump_colors("draw_page()"); +#endif + if ( back_Pixel != new_back_Pixel ) { + back_Pixel = new_back_Pixel; + if (backBrush) + DeleteObject(backBrush); +#if 0 /* DEBUG_COLOR */ + fprintf(stderr, "Creating back brush %-8x\n", back_Pixel); +#endif + backBrush = CreateSolidBrush(back_Pixel); + } +#if 0 + fprintf(stderr, "draw_page filling bg with color %-8x\n", back_Pixel); +#endif + r.left = min_x - currwin.base_x; + r.top = min_y - currwin.base_y; + r.right = min(page_w - currwin.base_x, max_x); + r.bottom = min(page_h - currwin.base_y, max_y); + FillRect(foreGC, &r, backBrush); + } + +#ifdef WIN32 + if (!isPrinting) { + /* FIXME : we should ensure that base_x and base_y + do correspond to Scroll variables everywhere ! */ + extern int xCurrentScroll, yCurrentScroll; + if (1) { + put_border(-currwin.base_x, -currwin.base_y, + ROUNDUP(unshrunk_paper_w, shrink_factor) + 2, + ROUNDUP(unshrunk_paper_h, shrink_factor) + 2, highGC); + } + else { + put_border(-xCurrentScroll, -yCurrentScroll, + ROUNDUP(unshrunk_paper_w, shrink_factor) + 2, + ROUNDUP(unshrunk_paper_h, shrink_factor) + 2, highGC); + } + } +#else + put_border(-currwin.base_x, -currwin.base_y, + ROUNDUP(unshrunk_paper_w, shrink_factor) + 2, + ROUNDUP(unshrunk_paper_h, shrink_factor) + 2, highGC); +#endif +#if 0 +#ifdef GRID + if ( grid_mode > 0 ) /* grid is wanted */ + put_grid(-currwin.base_x, -currwin.base_y, + ROUNDUP(unshrunk_paper_w, shrink_factor) + 2, + ROUNDUP(unshrunk_paper_h, shrink_factor) + 2, + ROUNDUP(unshrunk_paper_unit, shrink_factor), + grid1GC, grid2GC, grid3GC); +#endif /* GRID */ +#endif + (void) lseek(fileno(dvi_file), page_offset[current_page], SEEK_SET); + + bzero((char *) &currinf.data, sizeof(currinf.data)); + currinf.tn_table_len = TNTABLELEN; + currinf.tn_table = tn_table; + currinf.tn_head = tn_head; + currinf.pos = currinf.end = dvi_buffer; + currinf.virtual = NULL; +#ifdef HTEX + htex_initpage(); /* Start up the hypertext stuff for this page */ +#endif + psfig_begun = False; + draw_part(current_frame = &frame0, dimconv); +#ifdef HTEX + htex_donepage(current_page, 1); /* Finish up the hypertext stuff for this page */ + check_for_anchor(); /* see if a new anchor was requested */ +#endif +#if PS + psp.endpage(); +#endif +#ifdef WIN32 +#ifdef GRID + if ( grid_mode > 0 ) { /* grid is wanted */ + extern unsigned int xCurrentScroll, yCurrentScroll; + put_grid(&currwin, + ROUNDUP(unshrunk_paper_unit, shrink_factor), +#if 0 + grid1GC, grid2GC, grid3GC +#else + highGC, highGC, highGC +#endif + ); + } +#endif /* GRID */ +#endif +} + +#ifdef HTEX +extern int *htex_parsedpages; /* List of pages parsed */ + +/* Parse dvi pages not yet scanned by xdvi, searching for html anchors */ +void htex_parsepages() +{ + int i; + + for (i=0; i < total_pages; i++) { + if (htex_parsedpages[i] != 0) continue; + htex_parse_page(i); + } + /* Return to original position in dvi file? */ +} + +void htex_parse_page(i) +int i; +{ + /* Skip to beginning of page i */ +/* Stuff from draw_page in dvi_draw.c: */ + (void) lseek(fileno(dvi_file), page_offset[i], SEEK_SET); + bzero((char *) &currinf.data, sizeof(currinf.data)); + currinf.tn_head = tn_head; + currinf.pos = currinf.end = dvi_buffer; + currinf.virtual = NULL; + htex_initpage(); + htex_scanpage(i); + htex_donepage(i, 0); +} + + +/* HTeX parse page without drawing it function: */ +/* Basically the same as is done by draw_part, except we don't + do anything other than record html anchors */ +/* Assumes page has been set up properly as above */ +void htex_scanpage(pageno) +int pageno; +{ + ubyte ch; + long a; + + /* Read in page, searching for XXX1 to XXX4 (\special) + sections and ignoring everything else */ + for (;;) { + ch = xone(); + if (ch <= SETCHAR0 + 127) { /* It's a character - do nothing */ + } else if (FNTNUM0 <= ch && ch <= FNTNUM0 + 63) { + /* It's a previously numbered font - again do nothing */ + } else { + switch(ch) { + case PUSH: /* No args */ + case POP: /* No args */ + case NOP: /* Nothing! */ + break; + case SET1: + case PUT1: + xskip((long) 1); /* Set or put 1 char - skip it */ + break; +#ifdef Omega + case SET2: + case PUT2: + xskip((long) 2); /* Set or put 16-bit char - skip it */ + break; +#endif + case SETRULE: + case PUTRULE: + xskip((long) 8); /* two integers a and b */ + break; + case BOP: /* Beginning of page stuff */ + xskip((long) 11*4); + break; + case EOP: /* End of the page! */ + return; + case SREFL: + case EREFL: + break; + case RIGHT1: + case RIGHT2: + case RIGHT3: + case RIGHT4: + xskip(ch - RIGHT1 + 1); + break; + case W1: + case W2: + case W3: + case W4: + xskip(ch - W0); + case W0: + break; + case X1: + case X2: + case X3: + case X4: + xskip(ch - X0); + case X0: + break; + case DOWN1: + case DOWN2: + case DOWN3: + case DOWN4: + xskip(ch - DOWN1 + 1); + break; + case Y1: + case Y2: + case Y3: + case Y4: + xskip(ch - Y0); + case Y0: + break; + case Z1: + case Z2: + case Z3: + case Z4: + xskip(ch - Z0); + case Z0: + break; + case FNT1: + case FNT2: + case FNT3: + case FNT4: + xskip(ch - FNT1 + 1); + break; + case XXX1: + case XXX2: + case XXX3: + case XXX4: /* Only thing we pay attention to! */ + a = xnum(ch - XXX1 + 1); + if (a > 0) + htex_dospecial(a, pageno); + break; + case FNTDEF1: + case FNTDEF2: + case FNTDEF3: + case FNTDEF4: + xskip((long) (12 + ch - FNTDEF1 + 1)); + xskip((long) xone() + (long) xone()); + break; + case PRE: + case POST: + case POSTPOST: + default: + break; + } + } + } +} + +/* Do the same same stuff as special() in dvi_draw.c */ +/* But only check HTeX specials */ +void htex_dospecial(nbytes, pageno) +long nbytes; +int pageno; +{ + static char *cmd = NULL; + static long cmdlen = -1; + char *p; + + if (cmdlen < nbytes) { + if (cmd) free(cmd); + cmd = xmalloc((unsigned) nbytes+1); + cmdlen = nbytes; + } + p = cmd; + for (;;) { + int i = currinf.end - currinf.pos; + if (i > nbytes) i = nbytes; + bcopy((_Xconst char *) currinf.pos, p, i); + currinf.pos += i; + p += i; + nbytes -= i; + if (nbytes == 0) break; + (void) xxone(); + --(currinf.pos); + } + *p = '\0'; + p = cmd; + while (isspace(*p)) ++p; + checkHyperTeX(p, pageno); +} +#endif /* HTEX */ diff --git a/Build/source/texk/windvi/dvi-init.c b/Build/source/texk/windvi/dvi-init.c new file mode 100644 index 00000000000..c1819ce0e98 --- /dev/null +++ b/Build/source/texk/windvi/dvi-init.c @@ -0,0 +1,1047 @@ +/*========================================================================*\ + +Copyright (c) 1990-1999 Paul Vojta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +PAUL VOJTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +NOTE: + xdvi is based on prior work, as noted in the modification history + in xdvi.c. + +\*========================================================================*/ +#define HAVE_BOOLEAN +#include "xdvi-config.h" +#include <kpathsea/c-fopen.h> +#include <kpathsea/c-stat.h> +#include <kpathsea/magstep.h> +#include <kpathsea/tex-glyph.h> +#include "dvi.h" + +#if defined(HTEX) && !defined(WIN32) +#include "HTEscape.h" +#endif + +#include <t1lib.h> + +#define PK_PRE 247 +#define PK_ID 89 +#define PK_MAGIC (PK_PRE << 8) + PK_ID +#define GF_PRE 247 +#define GF_ID 131 +#define GF_MAGIC (GF_PRE << 8) + GF_ID +#define VF_PRE 247 +#define VF_ID_BYTE 202 +#define VF_MAGIC (VF_PRE << 8) + VF_ID_BYTE + +#define dvi_oops(str) (dvi_oops_msg = (str), longjmp(dvi_env, 1)) + +#ifdef SELFILE +extern void set_icon_and_title (); /* from xdvi.c */ +extern void home (); /* from events.c */ +#endif + +static struct stat fstatbuf; + +static Boolean font_not_found; + +/* + * DVI preamble and postamble information. + */ +static char job_id[300]; +static long numerator, denominator; + +/* + * Offset in DVI file of last page, set in read_postamble(). + */ +static long last_page_offset; + +#ifdef HTEX +extern int this_is_a_href; +#else +int this_is_a_href = 0; +#endif + +/* + * free_vf_chain frees the vf_chain structure. + */ + +static void +free_vf_chain(tnp) + struct tn *tnp; +{ + while (tnp != NULL) { + struct tn *tnp1 = tnp->next; + free((char *) tnp); + tnp = tnp1; + } +} + + +/* + * Release all shrunken bitmaps for all fonts. + */ + +void +reset_fonts() +{ + struct font *f; + struct glyph *g; + + for (f = font_head; f != NULL; f = f->next) + if ((f->flags & FONT_LOADED) && !(f->flags & FONT_VIRTUAL)) { +#if TTF + if (f->ttfid>=0) { + continue; + } +#endif +#if T1 + if (f->t1id>=0) { + /* Type1 font, all glyps in t1lib structures only */ + T1_DeleteAllSizes(f->t1id); + continue; + } +#endif + if (f->glyph) { + for (g = f->glyph; g <= f->glyph + f->maxchar; ++g) { + if (g && g->bitmap2.bits) { + free(g->bitmap2.bits); + g->bitmap2.bits = NULL; + } +#ifdef GREY + if (g && g->pixmap2) { + XDestroyImage(g->image2); + g->pixmap2 = NULL; + if (g->pixmap2_t != NULL) { + free(g->pixmap2_t); + g->pixmap2_t = NULL; + } + } +#endif + } /* inner for */ + } + } +} + +/* + * realloc_font allocates the font structure to contain (newsize + 1) + * characters. + */ + +void +realloc_font(fontp, newsize) + struct font *fontp; + wide_ubyte newsize; +{ + struct glyph *glyph; + + glyph = fontp->glyph = xrealloc(fontp->glyph, + (unsigned int) (newsize + 1) * sizeof(struct glyph)); + if (newsize > fontp->maxchar) + bzero((char *) (glyph + fontp->maxchar + 1), + (int) (newsize - fontp->maxchar) * sizeof(struct glyph)); + maxchar = fontp->maxchar = newsize; +} + + +/* + * realloc_virtual_font does the same thing for virtual fonts. + */ + +void +realloc_virtual_font(fontp, newsize) + struct font *fontp; + wide_ubyte newsize; +{ + struct macro *macro; + + macro = fontp->macro = xrealloc(fontp->macro, + (unsigned int) (newsize + 1) * sizeof(struct macro)); + if (newsize > fontp->maxchar) + bzero((char *) (macro + fontp->maxchar + 1), + (int) (newsize - fontp->maxchar) * sizeof(struct macro)); + maxchar = fontp->maxchar = newsize; +} + + +/* + * load_font locates the t1 font or raster file and reads the index of + * characters, plus whatever other preprocessing is done (depending on + * the format). Return True on error, False on success. + */ + +Boolean +load_font(fontp) + struct font *fontp; +{ + double fsize = fontp->fsize; + int dpi = fsize + 0.5; + char *font_found; + int size_found; + int magic; + Boolean hushcs = hush_chk; + + fontp->flags |= FONT_LOADED; + fontp->file = font_open(fontp->fontname, &font_found, + fsize, &size_found, fontp->magstepval, + &fontp->filename +#if T1 + , &fontp->t1id +#endif + ); + +#if TTF + if (fontp->ttfid>=0) { + /* It's a TrueType font */ + fontp->fsize=fsize; /* It comes in all sizes */ + fontp->timestamp = ++current_timestamp; + fontp->maxchar = maxchar = 255; + fontp->set_char_p = set_ttf_char; + /* read_TTF_char is a dummy */ + fontp->read_char = read_TTF_char; + fontp->glyph = NULL; + return False; + } +#endif +#if T1 + if (fontp->t1id>=0) { + /* It's a type1 font */ + fontp->fsize=fsize; /* It comes in all sizes */ + fontp->timestamp = ++current_timestamp; + fontp->maxchar = maxchar = 255; + fontp->set_char_p = set_t1_char; + /* read_T1_char is a dummy */ + fontp->read_char = read_T1_char; + fontp->glyph = NULL; + return False; + } +#endif + + if (fontp->file == NULL) { + Fprintf(stderr, "%s: Can't find font %s.%dpk\n", prog, + fontp->fontname, dpi); + /* Err, can we just return here? Mustn't we load cmr10 in the + fonts place? Looks like type1 version of replacement is + never loaded. */ + return True; + } + --n_files_left; + if (font_found != NULL) { + Fprintf(stderr, + "%s: can't find font %s; using %s instead at %d dpi.\n", + prog, fontp->fontname, font_found, dpi); + free(fontp->fontname); + fontp->fontname = strdup(font_found); + hushcs = True; + } + else if (!kpse_bitmap_tolerance ((double) size_found, fsize)) + Fprintf(stderr, + "%s: Can't find font %s at %d dpi; using %d dpi instead.\n", + prog, fontp->fontname, dpi, size_found); + fontp->fsize = size_found; + fontp->timestamp = ++current_timestamp; + fontp->maxchar = maxchar = 255; + fontp->set_char_p = set_char; + magic = two(fontp->file); + if (magic == PK_MAGIC) read_PK_index(fontp, WIDENINT hushcs); + else +#if USE_GF + if (magic == GF_MAGIC) read_GF_index(fontp, WIDENINT hushcs); + else +#endif +#ifdef Omega + if (magic == VF_MAGIC) + maxchar = read_VF_index(fontp, WIDENINT hushcs); +#else + if (magic == VF_MAGIC) read_VF_index(fontp, WIDENINT hushcs); +#endif + else + oops("Cannot recognize format for font file %s", fontp->filename); + + if (fontp->flags & FONT_VIRTUAL) { +#ifdef Omega +#else + while (maxchar > 0 && fontp->macro[maxchar].pos == NULL) --maxchar; + if (maxchar < 255) + realloc_virtual_font(fontp, WIDENINT maxchar); +#endif + } else { + while (maxchar > 0 && fontp->glyph[maxchar].addr == 0) --maxchar; + if (maxchar < 255) + realloc_font(fontp, WIDENINT maxchar); + } + return False; +} + + +/* + * MAGSTEPVALUE - If the given magnification is close to a \magstep + * or a \magstephalf, then return twice the number of \magsteps. + * Otherwise return NOMAGSTP. + */ + +#define NOMAGSTP (-29999) +#define NOBUILD 29999 + +static int +magstepvalue(mag) + float *mag; +{ + int m_ret; + unsigned dpi_ret = + kpse_magstep_fix ((unsigned) *mag, (unsigned) pixels_per_inch, &m_ret); + *mag = (float) dpi_ret; /* MAG is actually a dpi. */ + return m_ret ? m_ret : NOMAGSTP; +} + +/* + * reuse_font recursively sets the flags for font structures being reused. + */ + +static void +reuse_font(fontp) + struct font *fontp; +{ + struct font **fp; + struct tn *tnp; + + if (fontp->flags & FONT_IN_USE) return; + + fontp->flags |= FONT_IN_USE; + if (list_fonts) + Printf("%s: (reusing) %s at %d dpi\n", prog, fontp->fontname, + (int) (fontp->fsize + 0.5)); + if (fontp->flags & FONT_VIRTUAL) { + for (fp = fontp->vf_table; fp < fontp->vf_table + VFTABLELEN; ++fp) + if (*fp != NULL) reuse_font(*fp); + for (tnp = fontp->vf_chain; tnp != NULL; tnp = tnp->next) + reuse_font(tnp->fontp); + } +} + + +/* + * define_font reads the rest of the fntdef command and then reads in + * the specified pixel file, adding it to the global linked-list holding + * all of the fonts used in the job. + */ +struct font * +define_font(file, cmnd, vfparent, tntable, tn_table_len, tn_headpp) + FILE *file; + wide_ubyte cmnd; + struct font *vfparent; /* vf parent of this font, or NULL */ + struct font **tntable; /* table for low TeXnumbers */ + unsigned int tn_table_len; /* length of table for TeXnumbers */ + struct tn **tn_headpp; /* addr of head of list of TeXnumbers */ +{ + int TeXnumber; + struct font *fontp; + float fsize; +/* BEGIN CHUNK dvi-init.c 1 */ +#ifdef SRC_SPECIALS + float helpconv; + long conv_help; +#endif +/* END CHUNK dvi-init.c 1 */ + double scale_dimconv; + long checksum; + int scale; + int design; + int magstepval; + int len; + char *fontname; + int size; + + TeXnumber = num(file, (int) cmnd - FNTDEF1 + 1); + checksum = four(file); + scale = four(file); + design = four(file); + len = one(file); len += one(file); /* sequence point in the middle */ + fontname = xmalloc((unsigned) len + 1); + Fread(fontname, sizeof(char), len, file); + fontname[len] = '\0'; +/* BEGIN CHUNK dvi-init.c 2 */ +#ifdef SRC_SPECIALS + /* helpconv will contain the pt size (in floats) + * + * helpconv = (float)design * ((float)scale/(float)design) / (float)(2**16); + * + * simplified: + */ + helpconv = (float)scale / 65536.0; +#endif +/* END CHUNK dvi-init.c 2 */ + if(debug & DBG_PK) + Printf("%s: Define font \"%s\" scale=%d design=%d\n", + prog, fontname, scale, design); + if (vfparent == NULL) { + fsize = 0.001 * scale / design * magnification * pixels_per_inch; + scale_dimconv = dimconv; + } + else { + /* The scaled size is given in units of vfparent->scale * + * 2 ** -20 SPELL units, so we convert it into SPELL + * units by multiplying by + * vfparent->dimconv. + * The design size is given in units of 2 ** -20 pt, so we convert + * into SPELL units by multiplying by + * (pixels_per_inch * 2**16) / (72.27 * 2**20). */ + fsize = (72.27 * (1<<4)) * vfparent->dimconv * scale / design; + scale_dimconv = vfparent->dimconv; +#if 0 /* FP: seems to be wrong ! */ + scale = vfparent->scale; +#endif + } + magstepval = magstepvalue(&fsize); + size = fsize + 0.5; +/* BEGIN CHUNK dvi-init.c 3 */ +#ifdef SRC_SPECIALS + conv_help = (float)dimconv * (float)(1<<19) / 655360.0; + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "Define font has vals: %f, %d, %lf, %lf, [%f]\n", + fsize, magstepval, dimconv, scale_dimconv, conv_help); + } +#endif +/* END CHUNK dvi-init.c 3 */ + /* + * reuse font if possible + */ + for (fontp = font_head;; fontp = fontp->next) { + if (fontp == NULL) { /* if font doesn't exist yet */ + if (list_fonts) + Printf("%s: %s at %d dpi\n", prog, fontname, (int) (fsize + 0.5)); + fontp = xmalloc((unsigned) sizeof(struct font)); + fontp->fontname = fontname; + fontp->fsize = fsize; +/* BEGIN CHUNK dvi-init.c 4 */ +#ifdef SRC_SPECIALS + fontp->pt_size = helpconv; +#endif +/* END CHUNK dvi-init.c 4 */ + fontp->magstepval = magstepval; + fontp->file = NULL; /* needed if it's a virtual font */ + fontp->checksum = checksum; + fontp->flags = FONT_IN_USE; + fontp->dimconv = scale * scale_dimconv / (1<<20); + fontp->set_char_p = load_n_set_char; + fontp->scale=scale; + /* With virtual fonts, we might be opening another font + (pncb.vf), instead of what we just allocated for + (rpncb), thus leaving garbage in the structure for + when close_a_file comes along looking for something. */ + fontp->file = NULL; + fontp->filename = NULL; + if (vfparent == NULL) font_not_found |= load_font(fontp); + fontp->next = font_head; + font_head = fontp; + break; + } + if (strcmp(fontname, fontp->fontname) == 0 + && size == (int) (fontp->fsize + 0.5)) { + /* if font already in use */ + reuse_font(fontp); + free(fontname); + break; + } + } + if (TeXnumber < tn_table_len) + tntable[TeXnumber] = fontp; + else { + struct tn *tnp; + tnp = xmalloc((unsigned) sizeof(struct tn)); + tnp->next = *tn_headpp; + *tn_headpp = tnp; + tnp->TeXnumber = TeXnumber; + tnp->fontp = fontp; + } + return fontp; +} + + +/* + * process_preamble reads the information in the preamble and stores + * it into global variables for later use. + */ +static void +process_preamble() +{ + ubyte k; + + if (one(dvi_file) != PRE) + dvi_oops("Not a DVI file."); + if (one(dvi_file) != 2) + dvi_oops("Wrong version of DVI output for this program"); + numerator = four(dvi_file); + denominator = four(dvi_file); + magnification = four(dvi_file); + dimconv = (((double) numerator * magnification) + / ((double) denominator * 1000.)); + dimconv = dimconv * (((long) pixels_per_inch)<<16) / 254000; + tpic_conv = pixels_per_inch * magnification / 1000000.0; + k = one(dvi_file); + Fread(job_id, sizeof(char), (int) k, dvi_file); + job_id[k] = '\0'; +} + +/* + * find_postamble locates the beginning of the postamble + * and leaves the file ready to start reading at that location. + */ +#define TMPSIZ 516 /* 4 trailer bytes + 512 junk bytes allowed */ +static void +find_postamble() +{ + long pos; + ubyte temp[TMPSIZ]; + ubyte *p; + ubyte *p1; + ubyte byte; + + Fseek(dvi_file, (long) 0, 2); + pos = ftell(dvi_file) - TMPSIZ; + if (pos < 0) pos = 0; + Fseek(dvi_file, pos, 0); + p = temp + fread((char *) temp, sizeof(char), TMPSIZ, dvi_file); + for (;;) { + p1 = p; + while (p1 > temp && *(--p1) != TRAILER) ; + p = p1; + while (p > temp && *(--p) == TRAILER) ; + if (p <= p1 - 4) break; /* found 4 TRAILER bytes */ + if (p <= temp) dvi_oops("DVI file corrupted"); + } + pos += p - temp; + byte = *p; + while (byte == TRAILER) { + Fseek(dvi_file, --pos, 0); + byte = one(dvi_file); + } + if (byte != 2) + dvi_oops("Wrong version of DVI output for this program"); + Fseek(dvi_file, pos - 4, 0); + Fseek(dvi_file, sfour(dvi_file), 0); +} + + +/* + * read_postamble reads the information in the postamble, + * storing it into global variables. + * It also takes care of reading in all of the pixel files for the fonts + * used in the job. + */ +static void +read_postamble() +{ + ubyte cmnd; + struct font *fontp; + struct font **fontpp; + + if (one(dvi_file) != POST) + dvi_oops("Postamble doesn't begin with POST"); + last_page_offset = four(dvi_file); + if (numerator != four(dvi_file) + || denominator != four(dvi_file) + || magnification != four(dvi_file)) + dvi_oops("Postamble doesn't match preamble"); + /* read largest box height and width */ + unshrunk_dvifile_page_h = unshrunk_page_h + = (spell_conv(sfour(dvi_file)) >> 16) + offset_y; + if (unshrunk_page_h < unshrunk_paper_h) + unshrunk_page_h = unshrunk_paper_h; + unshrunk_dvifile_page_w = unshrunk_page_w + = (spell_conv(sfour(dvi_file)) >> 16) + offset_x; + if (unshrunk_page_w < unshrunk_paper_w) + unshrunk_page_w = unshrunk_paper_w; + (void) two(dvi_file); /* max stack size */ + total_pages = two(dvi_file); + font_not_found = False; + while ((cmnd = one(dvi_file)) >= FNTDEF1 && cmnd <= FNTDEF4) + (void) define_font(dvi_file, cmnd, (struct font *) NULL, + tn_table, TNTABLELEN, &tn_head); + if (cmnd != POSTPOST) + dvi_oops("Non-fntdef command found in postamble"); + if (font_not_found) + dvi_oops("Not all pixel files were found"); + /* + * free up fonts no longer in use + */ + fontpp = &font_head; + while ((fontp = *fontpp) != NULL) + if (fontp->flags & FONT_IN_USE) + fontpp = &fontp->next; + else { + if (debug & DBG_PK) + Printf("%s: Discarding font \"%s\" at %d dpi\n", + prog, fontp->fontname, (int) (fontp->fsize + 0.5)); + *fontpp = fontp->next; /* remove from list */ + free(fontp->fontname); + if (fontp->flags & FONT_LOADED) { + if (fontp->file != NULL) { + Fclose(fontp->file); + ++n_files_left; + } + free(fontp->filename); + if (fontp->flags & FONT_VIRTUAL) { + struct macro *m; + + for (m = fontp->macro; + m <= fontp->macro + fontp->maxchar; ++m) + if (m->free_me) free((char *) m->pos); + free((char *) fontp->macro); + free((char *) fontp->vf_table); + free_vf_chain(fontp->vf_chain); + } + else if (fontp->glyph != NULL) { /* skip empty fonts (tjc) */ + struct glyph *g; + + for (g = fontp->glyph; + g <= fontp->glyph + fontp->maxchar; ++g) { + if (g == NULL) continue; + if (g->bitmap.bits != NULL) { + free(g->bitmap.bits); + g->bitmap.bits = NULL; + } + if (g->bitmap2.bits != NULL) { + free(g->bitmap2.bits); + g->bitmap2.bits = NULL; + } +#ifdef GREY + if (g->pixmap2 != NULL) { + XDestroyImage(g->image2); + g->pixmap2 = NULL; + if (g->pixmap2_t != NULL) { + free(g->pixmap2_t); + g->pixmap2_t = NULL; + } + } +#endif + } + free((char *) fontp->glyph); + } + free((char *) fontp); + } + } +} + +static void +prepare_pages() +{ + int i; + + page_offset = xmalloc((unsigned) total_pages * sizeof(long)); + i = total_pages; + page_offset[--i] = last_page_offset; + Fseek(dvi_file, last_page_offset, 0); + /* + * Follow back pointers through pages in the DVI file, + * storing the offsets in the page_offset table. + */ + while (i > 0) { + Fseek(dvi_file, (long) (1+4+(9*4)), 1); + Fseek(dvi_file, page_offset[--i] = four(dvi_file), 0); + } +} + +void +init_page() +{ + page_w = ROUNDUP(unshrunk_page_w, mane.shrinkfactor) + 2; + page_h = ROUNDUP(unshrunk_page_h, mane.shrinkfactor) + 2; +} + +#ifndef S_ISDIR +#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +#endif + +/* + * init_dvi_file is the main subroutine for reading the startup + * information from the dvi file. Returns True on success. + */ + +Boolean +init_dvi_file() +{ +#ifdef WIN32 + char szBuf[80]; + extern void UpdateStatusBar(LPSTR lpszStatusString, + WORD partNumber, WORD displayFlags); + + wsprintf(szBuf, "Initializing %s", xbasename(dvi_name)); + UpdateStatusBar(szBuf, 0, 0); +#endif + (void) fstat(fileno(dvi_file), &fstatbuf); + if (S_ISDIR(fstatbuf.st_mode)) + return False; + dvi_time = fstatbuf.st_mtime; + process_preamble(); + find_postamble(); + read_postamble(); + prepare_pages(); + init_page(); + if (current_page >= total_pages) current_page = total_pages - 1; + warn_spec_now = warn_spec; +#if PS + ps_newdoc(); +#endif +#ifdef SRC_SPECIALS + src_delete_all_specials(); +#endif +#ifdef HTEX + htex_reinit(); +#endif /* HTEX */ +#ifdef WIN32 + wsprintf(szBuf, "Ready"); + UpdateStatusBar(szBuf, 0, 0); +#endif + return True; +} + +#ifdef WIN32 +/* + add the current file to the list of last used files. + */ + +#define MAX_USED_FILES 4 + +void push_current_used() +{ + extern void UpdateMainMenuUsedFiles(void); + extern char **lpLastUsedFiles; + extern int iLastUsedFilesNum; + int i; + char path[260], *fp; + + if (!dvi_name) { + fprintf(stderr, "push_current_used : error, no valid dvi_name\n"); + return; + } + /* Get the full file name */ +#if 1 + /* Beware : might have added file: + FIXME: there should be a copy of original dvi_name + rather that parsing it back ! + In fact, dvi_name must be made absolute first. + */ + if (memicmp(dvi_name, "file:", 5) == 0) { + if (GetFullPathName(dvi_name+5, sizeof(path), path, &fp) == 0) + Win32Error("push_current_used/GetFullPathName"); + } + else +#endif + if (GetFullPathName(dvi_name, sizeof(path), path, &fp) == 0) + Win32Error("push_current_used/GetFullPathName"); + + if (iLastUsedFilesNum < MAX_USED_FILES) { + for (i = iLastUsedFilesNum; i >= 1; i--) + lpLastUsedFiles[i] = lpLastUsedFiles[i - 1]; + lpLastUsedFiles[0] = xstrdup(path); + iLastUsedFilesNum++; + } + else { + /* Cancellation or something like that */ + if (FILESTRCASEEQ(path, lpLastUsedFiles[0])) + return; + + free(lpLastUsedFiles[iLastUsedFilesNum - 1]); + for (i = iLastUsedFilesNum - 1; i >= 1; i--) + lpLastUsedFiles[i] = lpLastUsedFiles[i-1]; + lpLastUsedFiles[0] = xstrdup(path); + UpdateMainMenuUsedFiles(); + } +} + +void +set_directory_dvifile() +{ + char path[260], *fp; + /* Get the full file name */ + if (GetFullPathName(dvi_name, sizeof(path), path, &fp) == 0) + Win32Error("set_directory_dvifile/GetFullPathName"); + NormalizeDviName(sizeof(path), path); + if (fp == path) { + fprintf(stderr, "Error : no valid path %s -> %s\n", dvi_name, path); + } + + *(fp-1) = '\0'; + + dvi_name = strdup(fp); + if (SetCurrentDirectory(path) == 0) + Win32Error("set_directory_dvifile/SetCurrentDirectory"); +} +#endif /* WIN32 */ + +/** + ** open_dvi_file opens the dvi file and calls init_dvi_file() to + ** initialize it. + **/ + +void +open_dvi_file() +{ + int n; + char *file; + + if (setjmp(dvi_env)) oops(dvi_oops_msg); + + n = strlen(dvi_name); + file = dvi_name; +#ifdef WIN32 + dvipos = 0L; + dvistate = CLEARED; +#endif + if (!this_is_a_href) { + /* + * Try foo.dvi before foo, in case there's an executable foo with + * documentation foo.tex. Unless it already ends with ".dvi". + */ + if (n < sizeof(".dvi") + || strcmp(dvi_name + n - sizeof(".dvi") + 1, ".dvi") != 0) { + dvi_name = xmalloc((unsigned) n + sizeof(".dvi")); + Strcpy(dvi_name, file); + Strcat(dvi_name, ".dvi"); + dvi_file = xfopen(dvi_name, OPEN_MODE); + if (dvi_file != NULL && init_dvi_file()) { +#ifdef WIN32 + /* New recent used file */ + push_current_used(); + initcolor(); +#endif + return; + } + free(dvi_name); + dvi_name = file; + } + } + + /* Then try `foo', in case the user likes DVI files without `.dvi'. */ + if ((dvi_file = xfopen(dvi_name, OPEN_MODE)) == NULL + || !init_dvi_file()) { +#ifdef WIN32 + /* May be this can be handled more gracefully ? */ + extern HWND hWndMain; + char buf[200]; +#if PS + ps_destroy(); +#endif + wsprintf(buf, "File not found : %s", xbasename(dvi_name)); + MessageBox(hWndMain, buf, + NULL, MB_OK | MB_ICONERROR | MB_APPLMODAL); + Exit(1); +#else /* ! WIN32 */ + perror(dvi_name); +#if PS + ps_destroy(); +#endif + exit(1); +#endif /* ! WIN32 */ + } +#ifdef WIN32 + /* New recent used file */ + scanned_page = scanned_page_reset = -1; +#ifdef XFORM + reset_xform_stack(); +#endif +#ifdef SRC_SPECIALS + src_delete_all_specials(); +#endif +#ifdef HTEX + htex_reinit(); +#endif + push_current_used(); + initcolor(); +#endif +} + +#ifdef SELFILE +/* Allow the user to choose a new dvi file, by popping up a dialog box + which allows the graphical selection of the correct filename, + maybe we should only allow files ending in .dvi to be selected. */ + +FILE * +select_filename(open, move_home) + int open, move_home ; +{ + extern FILE *XsraSelFile(); + FILE *dummy_file ; + static char *dummy_name ; + + dummy_file = XsraSelFile(top_level, "Select a dvi file: ", + "Ok", "Cancel", + "Can't open file: ", NULL, + OPEN_MODE, NULL, &dummy_name) ; + if (dummy_file != NULL) { + /* we may not want the file they returned... */ + if (!open) + fclose (dummy_file) ; + + /* The name is what we really want, so use it, but turn it into an URL */ + free(dvi_name); +#if 0 + dummy_name = HTEscape(dummy_name,URL_PATH); + dvi_name = xmalloc((unsigned) strlen(dummy_name)+6); + strcat(strcpy(dvi_name,"file:"),dummy_name); +#else + dvi_name = xstrdup(dummy_name); +#endif + /* Should we really free dummy_name? */ + + current_page = 0 ; /* go to start of new dvi file */ + if (move_home) + home(False); /* Move to home position on new first page */ + + /* We do this elsewhere if we don't open the file. */ + if (open) + set_icon_and_title (dvi_name, NULL, NULL, 1); + + } else if (open && dvi_name) { /* User cancelled, so open old file */ + dummy_file = xfopen(dvi_name, OPEN_MODE); + if (dummy_file == NULL) + dvi_oops("Could not open old file"); + --dvi_time; + } + + return dummy_file ; +} +#endif /* SELFILE */ + +/** + ** Check for changes in dvi file. + **/ + +Boolean +check_dvi_file() +{ + struct font *fontp; +#if 0 + fprintf(stderr, "dvi_file = %x, stat = %d, dvi_time = %x, fstat.mtime = %x\n", + dvi_file, fstat(fileno(dvi_file), &fstatbuf), dvi_time, fstatbuf.st_mtime); +#endif + if (dvi_name == NULL) + return False; + + if (dvi_file == NULL || fstat(fileno(dvi_file), &fstatbuf) != 0 + || fstatbuf.st_mtime != dvi_time) { + if (dvi_file) { + Fclose(dvi_file); + dvi_file = NULL; + if (list_fonts) Putchar('\n'); + } + if (page_offset != (long *) NULL) { + free((char *) page_offset); + page_offset = (long *) NULL; + } + bzero((char *) tn_table, (int) sizeof(tn_table)); + free_vf_chain(tn_head); + tn_head = NULL; + for (fontp = font_head; fontp != NULL; fontp = fontp->next) + fontp->flags &= ~FONT_IN_USE; +#ifdef SELFILE + if ((dvi_time > fstatbuf.st_mtime) && /* choose a new file */ + (dvi_file = select_filename(True, True)) == NULL) + dvi_oops("Cannot open new dvi file."); + else +#endif /* SELFILE */ + + if ((dvi_file = xfopen(dvi_name, OPEN_MODE)) == NULL) + dvi_oops("Cannot reopen dvi file."); + + /* This function should be applied in both cases, for a + * new opened or a reread dvi file or we will get empty + * page_offset and fonts. <werner@suse.de> + */ + if (!init_dvi_file()) + dvi_oops("Cannot initialise dvi file."); + + scanned_page = scanned_page_reset = -1; + initcolor(); + + reconfig(); +/* BEGIN CHUNK dvi-init.c 5 */ +#ifdef SRC_SPECIALS + src_delete_all_specials(); +#endif +/* END CHUNK dvi-init.c 5 */ +#ifdef HTEX + htex_reinit(); +#endif /* HTEX */ + redraw_page(); + return False; + } + return True; +} + +#ifdef WIN32 + +void CloseCurrentFile() +{ + struct font *fontp; + + if (dvi_file) { + Fclose(dvi_file); + dvi_file = NULL; + if (list_fonts) Putchar('\n'); + } + if (page_offset) { + /* With SELFILE, we are called once before the file + selection, and then once recursively (below). Thus + we would free a freed pointer. */ + free((char *) page_offset); + page_offset = NULL; + bzero((char *) tn_table, (int) sizeof(tn_table)); + free_vf_chain(tn_head); + tn_head = NULL; + for (fontp = font_head; fontp != NULL; fontp = fontp->next) + fontp->flags &= ~FONT_IN_USE; + } + +} + +void OpenCurrentFile(char *name) +{ + extern void ChangePage(int); + extern void ChangeZoom(int); + extern void initcolor(); + + dvi_name = xstrdup(name); + dvi_file = fopen(name, OPEN_MODE); + set_icon_and_title (dvi_name, NULL, NULL, 1); + if (dvi_file == NULL + || !init_dvi_file()) + dvi_oops("Cannot reopen dvi file."); + initcolor(); + reconfig(); +#ifdef SRC_SPECIALS + src_delete_all_specials(); +#endif +#ifdef HTEX + htex_reinit(); +#endif /* HTEX */ + ChangePage(0); + ChangeZoom(0); + redraw_page(); +} + +void NormalizeDviName(int size, char * name) +{ + int len = strlen(name); + if (_stricmp(name + len - 4, ".dvi") && (len+4 < size)) { + strcat(name, ".dvi"); + } + +} + +#endif diff --git a/Build/source/texk/windvi/dvi.h b/Build/source/texk/windvi/dvi.h new file mode 100644 index 00000000000..392712138fa --- /dev/null +++ b/Build/source/texk/windvi/dvi.h @@ -0,0 +1,64 @@ +/* + * Mnemonics for bytes in dvi file. + */ + +#define SETCHAR0 0 +#define SET1 128 +#define SET2 129 +#define SETRULE 132 +#define PUT1 133 +#define PUT2 134 +#define PUTRULE 137 +#define NOP 138 +#define BOP 139 +#define EOP 140 +#define PUSH 141 +#define POP 142 +#define RIGHT1 143 +#define RIGHT2 144 +#define RIGHT3 145 +#define RIGHT4 146 +#define W0 147 +#define W1 148 +#define W2 149 +#define W3 150 +#define W4 151 +#define X0 152 +#define X1 153 +#define X2 154 +#define X3 155 +#define X4 156 +#define DOWN1 157 +#define DOWN2 158 +#define DOWN3 159 +#define DOWN4 160 +#define Y0 161 +#define Y1 162 +#define Y2 163 +#define Y3 164 +#define Y4 165 +#define Z0 166 +#define Z1 167 +#define Z2 168 +#define Z3 169 +#define Z4 170 +#define FNTNUM0 171 +#define FNT1 235 +#define FNT2 236 +#define FNT3 237 +#define FNT4 238 +#define XXX1 239 +#define XXX2 240 +#define XXX3 241 +#define XXX4 242 +#define FNTDEF1 243 +#define FNTDEF2 244 +#define FNTDEF3 245 +#define FNTDEF4 246 +#define PRE 247 +#define POST 248 +#define POSTPOST 249 +#define SREFL 250 +#define EREFL 251 + +#define TRAILER 223 /* Trailing bytes at end of file */ diff --git a/Build/source/texk/windvi/dvips.c b/Build/source/texk/windvi/dvips.c new file mode 100644 index 00000000000..ddc70cd7a9b --- /dev/null +++ b/Build/source/texk/windvi/dvips.c @@ -0,0 +1,136 @@ +/* This code was stolen from dvips for xdvi use. The file itself did + not carry any licensing info. According to other filed the code + either public domain, or, in the worst case, GPL. + + - Nicolai Langfeldt, 21/2/1999 + +*/ + +#define HAVE_BOOLEAN 1 + +#include "xdvi-config.h" + +#if T1 + +#include <kpathsea/tex-file.h> + +/* Adapted from resident.c */ + +#define INLINE_SIZE (2000) +static char was_inline[INLINE_SIZE] ; + +extern void add_T1_mapentry P4H(char *, char *, char *, char *); + +/* Read a dvips psfont map file. Return 1 if it was read ok. 0 + otherwise. */ + +int getpsinfo P1C(char *, name) + +{ + FILE *deffile ; + char *p ; + char *specinfo; + char specbuf[500] ; + char *fullname; + + /* Try first for xdvi specific file */ + fullname=kpse_find_file(name, kpse_program_text_format, 0); + /* Then any fontmap file */ + if (fullname==NULL) + fullname=kpse_find_file(name, kpse_fontmap_format, 0); + + if (fullname==NULL) + return 0; + + deffile=fopen(fullname,"r"); + if (deffile==NULL) return 0; + + fprintf(stderr,"Reading dvips map %s\n",fullname); + + while (fgets(was_inline, INLINE_SIZE, deffile)!=NULL) { + char *TeXname = NULL ; + char *PSname = NULL ; + char *Fontfile = NULL; + char *Vectfile = NULL; + char *hdr_name = NULL; + boolean encoding_p = false; + specinfo = NULL ; + specbuf[0] = 0 ; + + /* One line at a time */ + p = was_inline ; + + if (*p < ' ' || *p == '*' || *p == '#' || *p == ';' || *p == '%') + continue ; + + while (*p) { + while (*p && *p <= ' ') + p++ ; + if (*p) { + if (*p == '"') { /* PostScript instructions? */ + if (specinfo) { + strcat(specbuf, specinfo) ; + strcat(specbuf, " ") ; + } + specinfo = p + 1 ; + + } else if (*p == '<') { /* Header to download? */ + if (p[1] == '<') { /* << means always full download, ignore */ + p++; + } else if (p[1] == '[') { /* <[ means an encoding */ + p++; + encoding_p = true; + } + p++ ; + /* skip whitespace after < */ + while (*p && *p <= ' ') + p++; + + /* save start of header name */ + hdr_name = p ; + + } else if (TeXname) /* second regular word on line? */ + PSname = p ; + + else /* first regular word? */ + TeXname = p ; + + if (*p == '"') { + p++ ; /* find end of "..." word */ + while (*p != '"' && *p) + p++ ; + } else + while (*p > ' ') /* find end of anything else */ + p++ ; + + /* Terminate the substring we just identified */ + if (*p) + *p++ = 0 ; + + /* If we had a header we were downloading, figure out what to + do; couldn't do this above since we want to check the + suffix. */ + if (hdr_name) { + char *suffix = find_suffix (hdr_name); + if (encoding_p || (suffix!=NULL && strcmp(suffix, "enc")==0)) { + Vectfile = hdr_name; + } else { + Fontfile = hdr_name; + } + } + } + } /* while (*p) */ + + /* Line finished. Lookit what we got */ + if (specinfo) + strcat(specbuf, specinfo) ; + + if (TeXname) + add_T1_mapentry(TeXname, Fontfile, Vectfile, specinfo) ; + + } + (void)fclose(deffile) ; + return 1; +} + +#endif diff --git a/Build/source/texk/windvi/events.c b/Build/source/texk/windvi/events.c new file mode 100644 index 00000000000..5898edeb821 --- /dev/null +++ b/Build/source/texk/windvi/events.c @@ -0,0 +1,3172 @@ +/*========================================================================*\ + +Copyright (c) 1990-1999 Paul Vojta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +PAUL VOJTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +NOTE: + xdvi is based on prior work, as noted in the modification history + in xdvi.c. + +\*========================================================================*/ + +#include "xdvi-config.h" + + +/* Xlib and Xutil are already included */ + +#ifdef TOOLKIT + +#ifdef OLD_X11_TOOLKIT +#include <X11/Atoms.h> +#else /* not OLD_X11_TOOLKIT */ +#include <X11/Xatom.h> +#include <X11/StringDefs.h> +#endif /* not OLD_X11_TOOLKIT */ + +#include <X11/Shell.h> /* needed for def. of XtNiconX */ + +#ifndef XtSpecificationRelease +#define XtSpecificationRelease 0 +#endif +#if XtSpecificationRelease >= 4 +#ifndef MOTIF +#include <X11/Xaw/Viewport.h> +#ifdef HTEX +#include <X11/Xaw/Dialog.h> +#include <X11/Xaw/Text.h> +#endif +#else /* MOTIF */ +#include <Xm/MainW.h> +#include <Xm/ToggleB.h> +#include <Xm/RowColumn.h> +#include <Xm/MenuShell.h> +#endif /* MOTIF */ + +#ifdef BUTTONS +#ifndef MOTIF +#include <X11/Xaw/Command.h> +#define PANEL_WIDGET_CLASS compositeWidgetClass +#define BUTTON_WIDGET_CLASS commandWidgetClass +#else /* MOTIF */ +#include <Xm/Form.h> +#include <Xm/BulletinB.h> +#include <Xm/PushB.h> +#define PANEL_WIDGET_CLASS xmBulletinBoardWidgetClass +#define BUTTON_WIDGET_CLASS xmPushButtonWidgetClass +#endif /* MOTIF */ +#endif /* BUTTONS */ + +#else /* XtSpecificationRelease < 4 */ + +#define XtPointer caddr_t +#include <X11/Viewport.h> +#ifdef BUTTONS +#include <X11/Command.h> +#define PANEL_WIDGET_CLASS compositeWidgetClass +#define BUTTON_WIDGET_CLASS commandWidgetClass +#endif + +#endif /* XtSpecificationRelease */ + +#else /* not TOOLKIT */ + +typedef int Position; +#define XtPending() XPending(DISP) + +#endif /* not TOOLKIT */ + +#include <signal.h> +#include <sys/file.h> /* this defines FASYNC */ + +#if !defined(FLAKY_SIGPOLL) && !HAVE_STREAMS && !defined(FASYNC) +#define FLAKY_SIGPOLL 1 +#endif + +#ifndef FLAKY_SIGPOLL + +#ifndef SIGPOLL +#define SIGPOLL SIGIO +#endif + +#ifndef SA_RESTART +#define SA_RESTART 0 +#endif + +#if HAVE_STREAMS +#include <stropts.h> + +#ifndef S_RDNORM +#define S_RDNORM S_INPUT +#endif + +#ifndef S_RDBAND +#define S_RDBAND 0 +#endif + +#ifndef S_HANGUP +#define S_HANGUP 0 +#endif + +#ifndef S_WRNORM +#define S_WRNORM S_OUTPUT +#endif +#endif /* HAVE_STREAMS */ + +#endif /* not FLAKY_SIGPOLL */ + +#if HAVE_POLL +# include <poll.h> +#else +# if HAVE_SYS_SELECT_H +# include <sys/select.h> +# else +# if HAVE_SELECT_H +# include <select.h> +# endif +# endif +#endif + +#include <errno.h> + +#ifdef X_NOT_STDC_ENV +extern int errno; +#endif /* X_NOT_STDC_ENV */ + +#ifndef X11HEIGHT +#define X11HEIGHT 8 /* Height of server default font */ +#endif + +#define MAGBORD 1 /* border size for magnifier */ + +/* + * Command line flags. + */ + +#define delay_rulers resource._delay_rulers +#define tick_units resource._tick_units +#define tick_length resource._tick_length +#define fore_Pixel resource._fore_Pixel +#define back_Pixel resource._back_Pixel +#define high_Pixel resource._high_Pixel +#ifdef TOOLKIT +extern struct _resource resource; +#define brdr_Pixel resource._brdr_Pixel +#endif /* TOOLKIT */ + +#define clip_w mane.width +#define clip_h mane.height +static Position main_x, main_y; +static Position mag_x, mag_y, new_mag_x, new_mag_y; +static Boolean mag_moved = False; +static Boolean busycurs = False; + +#ifndef FLAKY_SIGPOLL +sigset_t sigpollusrterm; +#endif + +#if HAVE_POLL +static struct pollfd fds[1] = {{0, POLLIN, 0}}; +#else +static fd_set readfds; +#endif + +#ifdef TOOLKIT +#ifdef BUTTONS +static Widget line_widget; +static Widget panel_widget; +static int destroy_count = 0; +#endif /* BUTTONS */ + +#ifndef MOTIF +static Widget x_bar, y_bar; /* horizontal and vertical scroll bars */ +#endif + +static Arg resize_args[] = { + {XtNwidth, (XtArgVal) 0}, + {XtNheight, (XtArgVal) 0}, +}; + +#define XdviResizeWidget(widget, w, h) \ + (resize_args[0].value = (XtArgVal) (w), \ + resize_args[1].value = (XtArgVal) (h), \ + XtSetValues(widget, resize_args, XtNumber(resize_args)) ) + +#ifdef BUTTONS + +#ifndef MOTIF +static Arg resizable_on[] = { + {XtNresizable, (XtArgVal) True}, +}; + +static Arg resizable_off[] = { + {XtNresizable, (XtArgVal) False}, +}; +#endif + +static Arg line_args[] = { + {XtNbackground, (XtArgVal) 0}, + {XtNwidth, (XtArgVal) 1}, +#ifndef MOTIF + {XtNheight, (XtArgVal) 0}, + {XtNfromHoriz, (XtArgVal) NULL}, + {XtNborderWidth, (XtArgVal) 0}, + {XtNtop, (XtArgVal) XtChainTop}, + {XtNbottom, (XtArgVal) XtChainBottom}, + {XtNleft, (XtArgVal) XtChainRight}, + {XtNright, (XtArgVal) XtChainRight}, +#else /* MOTIF */ + {XmNleftWidget, (XtArgVal) NULL}, + {XmNleftAttachment, (XtArgVal) XmATTACH_WIDGET}, + {XmNtopAttachment, (XtArgVal) XmATTACH_FORM}, + {XmNbottomAttachment, (XtArgVal) XmATTACH_FORM}, +#endif /* MOTIF */ +}; + +static Arg panel_args[] = { + {XtNwidth, (XtArgVal) (XTRA_WID - 1)}, +#ifndef MOTIF + {XtNheight, (XtArgVal) 0}, + {XtNborderWidth, (XtArgVal) 0}, + {XtNfromHoriz, (XtArgVal) NULL}, + {XtNtop, (XtArgVal) XtChainTop}, + {XtNbottom, (XtArgVal) XtChainBottom}, + {XtNleft, (XtArgVal) XtChainRight}, + {XtNright, (XtArgVal) XtChainRight}, +#else /* MOTIF */ + {XmNleftAttachment, (XtArgVal) XmATTACH_FORM}, + {XmNtopAttachment, (XtArgVal) XmATTACH_FORM}, + {XmNbottomAttachment, (XtArgVal) XmATTACH_FORM}, +#endif /* MOTIF */ +}; + +static struct { + _Xconst char *label; + _Xconst char *name; + int closure; + int y_pos; + } +#define BPOS(n) (10 + (n)*28) + command_table[] = { + {"Quit", "quit", 'q', BPOS(1)}, + {"Abort", "abort", 'Q', BPOS(2)}, + {"Again", "again", '\001', BPOS(4)}, + {"Help", "help", '?', BPOS(4)}, + {"Reread", "reread", 'R', BPOS(5)}, + {"100%", "sh1", 1 << 8 | 's', BPOS(7)}, +#define LOWRES_s_COMMANDS 6 + /* Good for 300dpi */ + {"50%", "sh2", 2 << 8 | 's', BPOS(8)}, + {"33%", "sh3", 3 << 8 | 's', BPOS(9)}, + {"25%", "sh4", 4 << 8 | 's', BPOS(10)}, +#define HIRES_s_COMMANDS 9 + /* Good for 600dpi */ + {"33%", "sh2", 3 << 8 | 's', BPOS(8)}, + {"25%", "sh3", 4 << 8 | 's', BPOS(9)}, + {"17%", "sh4", 6 << 8 | 's', BPOS(10)}, + + /* What's good for 1200dpi? */ + +#define PAGE_BUTTONS 12 + {"First", "next0", 1 << 8 | 'g', BPOS(12)}, + {"Page-10", "prev10", 10 << 8 | 'p', BPOS(13)}, + {"Page-5", "prev5", 5 << 8 | 'p', BPOS(14)}, + {"Prev", "prev", 'p', BPOS(15)}, + {"Next", "next", 'n', BPOS(16)}, + {"Page+5", "next5", 5 << 8 | 'n', BPOS(17)}, + {"Page+10", "next10", 10 << 8 | 'n', BPOS(18)}, + {"Last", "next999", 'g', BPOS(19)}, +#if PS + {"View PS", "postscript", 'v', BPOS(21)}, +#endif +#ifdef HTEX + {"Back", "back", 'B', BPOS(23)}, +#endif +#ifdef SELFILE + {"File", "file", '\006', BPOS(24)}, +#endif /* SELFILE */ +}; + +static void handle_command(); + +static XtCallbackRec command_call[] = { + {handle_command, NULL}, + {NULL, NULL}, +}; + +static Arg command_args[] = { +#ifndef MOTIF + {XtNlabel, (XtArgVal) NULL}, +#else + {XmNlabelString, (XtArgVal) NULL}, +#endif + {XtNx, (XtArgVal) 6}, + {XtNy, (XtArgVal) 0}, +#ifndef MOTIF + {XtNwidth, (XtArgVal) 64}, +#else + {XtNwidth, (XtArgVal) 90}, +#endif + {XtNheight, (XtArgVal) 30}, +#ifndef MOTIF + {XtNcallback, (XtArgVal) command_call}, +#else + {XmNactivateCallback, (XtArgVal) command_call}, +#endif +}; + +void +create_buttons(h) + XtArgVal h; +{ + int i; + + line_args[0].value = (XtArgVal) resource._hl_Pixel; +#ifndef MOTIF + line_args[2].value = h; + line_args[3].value = (XtArgVal) vport_widget; + line_widget = XtCreateManagedWidget("line", widgetClass, + form_widget, line_args, + XtNumber(line_args)); + panel_args[1].value = h; + panel_args[3].value = (XtArgVal) line_widget; +#endif + panel_widget = XtCreateManagedWidget("panel", PANEL_WIDGET_CLASS, + form_widget, panel_args, + XtNumber(panel_args)); + + /* This adjusts the command table according to any shrinkbutton + resources */ + for (i = 0; i <= XtNumber(command_table) - 4; ++i) { + if (strncmp(command_table[i].name, "sh1",2) == 0) { + /* It's a shrink command. Check if the resources tell us to + modify it, and how */ + int j,k; + + j = atoi(&command_table[i].name[2]); + k = resource.shrinkbutton[j-1]; + + if (k != 0) { + char *s = xmalloc(9); + + if (k < 1) + k = 1; + else if (k > 99) + k = 99; + + if (k<16) { + Sprintf(s, "%d%%", (int) 100/k); + } else { + /* Need more precition */ + Sprintf(s, "%.2f%%", (double) 100/k); + } + command_table[i].label = s; + command_table[i].closure = k << 8 | 's'; + } /* if k != 0 */ + } /* if strncmp */ + } /* For */ + + command_args[2].value = (XtArgVal) vport_widget; + + /* This loop sets up the buttons */ + for (i = 0; i < XtNumber(command_table); ++i) { + if ( ((i==HIRES_s_COMMANDS)&&(pixels_per_inch<600)) || + ((i==LOWRES_s_COMMANDS)&&(pixels_per_inch>=600)) ) i+=3; +#ifndef MOTIF + command_args[0].value = (XtArgVal) command_table[i].label; +#else /* MOTIF */ + command_args[0].value = (XtArgVal) + XmCvtCTToXmString((char *) command_table[i].label); +#endif /* MOTIF */ + command_args[2].value = (XtArgVal) command_table[i].y_pos; + command_call[0].closure = (XtPointer) &command_table[i].closure; + (void) XtCreateManagedWidget(command_table[i].name, + BUTTON_WIDGET_CLASS, panel_widget, + command_args, XtNumber(command_args)); + } +#ifdef MOTIF + line_args[2].value = (XtArgVal) panel_widget; + line_widget = XtCreateManagedWidget("line", widgetClass, form_widget, + line_args, XtNumber(line_args)); + XtVaSetValues(vport_widget, XmNleftAttachment, XmATTACH_WIDGET, + XmNleftWidget, line_widget, NULL); +#endif +} +#endif /* BUTTONS */ + +#else /* !TOOLKIT */ +static Window x_bar, y_bar; +static int x_bgn, x_end, y_bgn, y_end; /* scrollbar positions */ +#endif /* TOOLKIT */ + +/* We split this help string into smaller pieces, because some C +implementations have been known to croak on large strings. */ + +static char* help_string[] = +{ + "", + "----------------------------Help and Exiting----------------------------", + "", + "h or H or ? or Help", + " Displays this help text.", + "", + "q or Control-C or Control-D or Cancel or Stop or Control-Z (VAX VMS)", + " Quits the program.", + "", + "------------------------------Page Motion-------------------------------", + "", + "n or f or Space or Return or LineFeed or PgDn", + " Moves to the next page (or to the nth next page if a", + " number is given).", + "", + "p or b or Control-H or BackSpace or DELete or PgUp", + " Moves to the previous page (or back n pages).", + "", + "u or Up-arrow", + " Moves up two thirds of a window-full.", + "", + "d or Down-arrow", + " Moves down two thirds of a window-full.", + "", + "l or Left-arrow", + " Moves left two thirds of a window-full.", + "", + "r or Right-arrow", + " Moves right two thirds of a window-full.", + "", + "g or j or End", + " Moves to the page with the given number. Initially,", + " the first page is assumed to be page number 1, but this", + " can be changed with the `P' keystroke, below. If no", + " page number is given, then it goes to the last page.", + "", + "< Move to first page in document.", + "> Move to last page in document.", + "", + "-----------------------------Other Commands-----------------------------", + "", + "Control-A or Again", + " Repeat last command (including its argument).", + "", + "Control-L or Clear", + " Redisplays the current page.", + "", + "Control-P", + " Prints bitmap unit, bit order, and byte order.", + "", + "^ or Home", + " Move to the ``home'' position of the page. This is", + " normally the upper left-hand corner of the page,", + " depending on the margins as described in the -margins", + " option, above.", + "", + "c Moves the page so that the point currently beneath the", + " cursor is moved to the middle of the window. It also", + " (gasp!) warps the cursor to the same place.", + "", + "G This key toggles the use of greyscale anti-aliasing for", + " displaying shrunken bitmaps. In addition, the key", + " sequences `0G' and `1G' clear and set this flag,", + " respectively. See also the -nogrey option.", + "", + "k Normally when xdvi switches pages, it moves to the home", + " position as well. The `k' keystroke toggles a `keep-", + " position' flag which, when set, will keep the same", + " position when moving between pages. Also `0k' and `1k'", + " clear and set this flag, respectively. See also the", + " -keep option.", + "", + "M Sets the margins so that the point currently under the", + " cursor is the upper left-hand corner of the text in the", + " page. Note that this command itself does not move the", + " image at all. For details on how the margins are used,", + " see the -margins option.", + "", + "P ``This is page number n.'' This can be used to make", + " the `g' keystroke refer to actual page numbers instead", + " of absolute page numbers.", + "", + "R Forces the dvi file to be reread. This allows you to", + " preview many versions of the same file while running", + " xdvi only once.", + "", + "s Changes the shrink factor to the given number. If no", + " number is given, the smallest factor that makes the", + " entire page fit in the window will be used. (Margins", + " are ignored in this computation.)", + "", + "S Sets the density factor to be used when shrinking", + " bitmaps. This should be a number between 0 and 100;", + " higher numbers produce lighter characters.", + "", + "t Toggles to the next unit in a sorted list of TeX dimension", + " units for the popup magnifier ruler.", + "", + "x Toggles expert mode (in which the buttons do not appear).", + " Also `0x' and `1x' clear and enable this mode,", + " respectively. See also the -expert option.", + "", + "V Toggles Ghostscript anti-aliasing. Also `0V' and `1V' clear", + " and enables this mode, respectively. See also the the -gsalpha", + " option.", + "", +#ifdef SELFILE + "Control-F Find another DVI file.", + "", +#endif +#ifdef HTEX + "B Go back to the previous anchor.", + "F Follow hyperlink forward.", + "", +#endif + "------------------------------------------------------------------------", +}; + +static void +show_help() +{ + int k; + + for (k = 0; k < (sizeof(help_string)/sizeof(help_string[0])); ++k) + (void)puts(help_string[k]); +} + +/* + * Mechanism to keep track of the magnifier window. The problems are, + * (a) if the button is released while the window is being drawn, this + * could cause an X error if we continue drawing in it after it is + * destroyed, and + * (b) creating and destroying the window too quickly confuses the window + * manager, which is avoided by waiting for an expose event before + * destroying it. + */ +static short alt_stat; /* 1 = wait for expose, */ + /* -1 = destroy upon expose */ +static Boolean alt_canit; /* stop drawing this window */ + +/* + * Data for buffered events. + */ + +#ifndef FLAKY_SIGPOLL +static VOLATILE short event_freq = 70; +#else +#define event_freq 70 +#endif + +static void can_exposures(), keystroke(); + +#ifdef GREY +#define gamma resource._gamma + +static void +mask_shifts(mask, pshift1, pshift2) + Pixel mask; + int *pshift1, *pshift2; +{ + int k, l; + + for (k = 0; (mask & 1) == 0; ++k) + mask >>= 1; + for (l = 0; (mask & 1) == 1; ++l) + mask >>= 1; + *pshift1 = sizeof(short) * 8 - l; + *pshift2 = k; +} + +/* + * Try to allocate 4 color planes for 16 colors (for GXor drawing) + */ + +void +init_plane_masks() +{ + Pixel pixel; + + if (copy || plane_masks[0] != 0) + return; + + if (XAllocColorCells(DISP, our_colormap, False, plane_masks, 4, + &pixel, 1)) { + /* Make sure fore_Pixel and back_Pixel are a part of the palette */ + back_Pixel = pixel; + fore_Pixel = pixel | plane_masks[0] | plane_masks[1] + | plane_masks[2] | plane_masks[3]; + if (mane.win != (Window) 0) + XSetWindowBackground(DISP, mane.win, back_Pixel); + } + else { + copy = True; + puts("\ +Greyscaling is running in copy mode: your display can only display\n\ +a limited number of colors at a time (typically 256), and other applications\n\ +(such as netscape) are using many of them. Running in copy mode will\n\ +cause overstrike characters to appear incorrectly, and may result in\n\ +poor display quality.\n\ +\n\ +See the section ``GREYSCALING AND COLORMAPS'' in the xdvi manual page\n\ +for more details."); + fflush(stdout); /* useful if called by netscape */ + } +} + +extern double pow(); + +#ifndef TOOLKIT +#define XtWindow(win) win +#endif + +#define MakeGC(fcn, fg, bg) (values.function = fcn, \ + values.foreground=fg, values.background=bg, \ + XCreateGC(DISP, XtWindow(top_level), \ + GCFunction | GCForeground | GCBackground, &values)) + +void +init_pix() +{ + static int shrink_allocated_for = 0; + static float oldgamma = 0.0; + static Pixel palette[17]; + XGCValues values; + int i; + + if (fore_color_data.pixel == back_color_data.pixel) { + /* get foreground and background RGB values for interpolating */ + fore_color_data.pixel = fore_Pixel; + XQueryColor(DISP, our_colormap, &fore_color_data); + back_color_data.pixel = back_Pixel; + XQueryColor(DISP, our_colormap, &back_color_data); + } + + if (our_visual->class == TrueColor) { + /* This mirrors the non-grey code in xdvi.c */ + static int shift1_r, shift1_g, shift1_b; + static int shift2_r, shift2_g, shift2_b; + static Pixel set_bits; + static Pixel clr_bits; + unsigned int sf_squared; + + if (oldgamma == 0.0) { + mask_shifts(our_visual->red_mask, &shift1_r, &shift2_r); + mask_shifts(our_visual->green_mask, &shift1_g, &shift2_g); + mask_shifts(our_visual->blue_mask, &shift1_b, &shift2_b); + + set_bits = fore_color_data.pixel & ~back_color_data.pixel; + clr_bits = back_color_data.pixel & ~fore_color_data.pixel; + + if (set_bits & our_visual->red_mask) + set_bits |= our_visual->red_mask; + if (clr_bits & our_visual->red_mask) + clr_bits |= our_visual->red_mask; + if (set_bits & our_visual->green_mask) + set_bits |= our_visual->green_mask; + if (clr_bits & our_visual->green_mask) + clr_bits |= our_visual->green_mask; + if (set_bits & our_visual->blue_mask) + set_bits |= our_visual->blue_mask; + if (clr_bits & our_visual->blue_mask) + clr_bits |= our_visual->blue_mask; + + /* + * Make the GCs + */ + + foreGC = foreGC2 = ruleGC = 0; + copyGC = MakeGC(GXcopy, fore_Pixel, back_Pixel); + if (copy || (set_bits && clr_bits)) { + ruleGC = copyGC; + if (!resource.thorough) copy = True; + } + if (copy) { + foreGC = ruleGC; + if (!resource.copy) + Puts("Note: overstrike characters may be incorrect."); + } + else { + if (set_bits) + foreGC = MakeGC(GXor, + set_bits & fore_color_data.pixel, 0); + if (clr_bits || !set_bits) + *(foreGC ? &foreGC2 : &foreGC) = MakeGC(GXandInverted, + clr_bits & ~fore_color_data.pixel, 0); + if (!ruleGC) ruleGC = foreGC; + } + + oldgamma = gamma; + } + + if (mane.shrinkfactor == 1) return; + sf_squared = mane.shrinkfactor * mane.shrinkfactor; + + if (shrink_allocated_for < mane.shrinkfactor) { + if (pixeltbl != NULL) { + free((char *) pixeltbl); + if (pixeltbl_t != NULL) + free((char *) pixeltbl_t); + } + pixeltbl = xmalloc((sf_squared + 1) * sizeof(Pixel)); + if (foreGC2 != NULL) + pixeltbl_t = xmalloc((sf_squared + 1) * sizeof(Pixel)); + shrink_allocated_for = mane.shrinkfactor; + } + + /* + * Compute pixel values directly. + */ + +#define SHIFTIFY(x, shift1, shift2) ((((Pixel)(x)) >> (shift1)) << (shift2)) + + for (i = 0; i <= sf_squared; ++i) { + double frac = gamma > 0 + ? pow((double) i / sf_squared, 1 / gamma) + : 1 - pow((double) (sf_squared - i) / sf_squared, -gamma); + unsigned int red, green, blue; + Pixel pixel; + + red = frac + * ((double) fore_color_data.red - back_color_data.red) + + back_color_data.red; + green = frac + * ((double) fore_color_data.green - back_color_data.green) + + back_color_data.green; + blue = frac + * ((double) fore_color_data.blue - back_color_data.blue) + + back_color_data.blue; + + pixel = SHIFTIFY(red, shift1_r, shift2_r) | + SHIFTIFY(green, shift1_g, shift2_g) | + SHIFTIFY(blue, shift1_b, shift2_b); + + if (copy) pixeltbl[i] = pixel; + else { + pixeltbl[i] = set_bits ? pixel & set_bits + : ~pixel & clr_bits; + if (pixeltbl_t != NULL) + pixeltbl_t[i] = ~pixel & clr_bits; + } + } + +#undef SHIFTIFY + + return; + } + + /* if not TrueColor ... */ + + if (gamma != oldgamma) { + XColor color; + + if (oldgamma == 0.0) + init_plane_masks(); + + for (i = 0; i < 16; ++i) { + double frac = gamma > 0 ? pow((double) i / 15, 1 / gamma) + : 1 - pow((double) (15 - i) / 15, -gamma); + + color.red = frac + * ((double) fore_color_data.red - back_color_data.red) + + back_color_data.red; + color.green = frac + * ((double) fore_color_data.green - back_color_data.green) + + back_color_data.green; + color.blue = frac + * ((double) fore_color_data.blue - back_color_data.blue) + + back_color_data.blue; + + color.pixel = back_Pixel; + color.flags = DoRed | DoGreen | DoBlue; + + if (!copy) { + if (i & 1) color.pixel |= plane_masks[0]; + if (i & 2) color.pixel |= plane_masks[1]; + if (i & 4) color.pixel |= plane_masks[2]; + if (i & 8) color.pixel |= plane_masks[3]; + XStoreColor(DISP, our_colormap, &color); + palette[i] = color.pixel; + } + else { + if (XAllocColor(DISP, our_colormap, &color)) + palette[i] = color.pixel; + else + palette[i] = (i * 100 >= density * 15) + ? fore_Pixel : back_Pixel; + } + } + + copyGC = MakeGC(GXcopy, fore_Pixel, back_Pixel); + foreGC = ruleGC = copy ? copyGC + : MakeGC(GXor, fore_Pixel, back_Pixel); + foreGC2 = 0; + + oldgamma = gamma; + } + + if (mane.shrinkfactor == 1) return; + + if (shrink_allocated_for < mane.shrinkfactor) { + if (pixeltbl != NULL) free((char *) pixeltbl); + pixeltbl = xmalloc((unsigned) + (mane.shrinkfactor * mane.shrinkfactor + 1) * sizeof(Pixel)); + shrink_allocated_for = mane.shrinkfactor; + } + + for (i = 0; i <= mane.shrinkfactor * mane.shrinkfactor; ++i) + pixeltbl[i] = + palette[(i * 30 + mane.shrinkfactor * mane.shrinkfactor) + / (2 * mane.shrinkfactor * mane.shrinkfactor)]; +} + +#undef MakeGC + +void +init_colors() +{ + static Boolean warn_done = False; + Boolean warn = False; + + copy = resource.copy; + +#ifdef GREY + if (use_grey) + init_pix(); + else +#endif + { + XGCValues values; + Pixel set_bits = (Pixel) (fore_Pixel & ~back_Pixel); + Pixel clr_bits = (Pixel) (back_Pixel & ~fore_Pixel); + + if (copy == Maybe) + copy = (!resource.thorough + && DefaultDepthOfScreen(SCRN) > 1); + +#define MakeGC(fcn, fg, bg) (values.function = fcn, values.foreground=fg,\ + values.background=bg,\ + XCreateGC(DISP, RootWindowOfScreen(SCRN),\ + GCFunction|GCForeground|GCBackground, &values)) + + foreGC = foreGC2 = ruleGC = NULL; + if (copy || (set_bits && clr_bits)) + ruleGC = MakeGC(GXcopy, fore_Pixel, back_Pixel); + if (copy) foreGC = ruleGC; + else if (!resource.thorough && ruleGC) { + foreGC = ruleGC; + warn = True; + } + else { + if (set_bits) foreGC = MakeGC(GXor, set_bits, 0); + if (clr_bits || !set_bits) + *(foreGC ? &foreGC2 : &foreGC) = + MakeGC(GXandInverted, clr_bits, 0); + if (!ruleGC) ruleGC = foreGC; + } + } + + if (warn && !warn_done) { + Puts("Note: overstrike characters may be incorrect."); + warn_done = True; /* Print warning only once. */ + } +} + +/* + * Ruler routines + */ + +static int +tick_scale(k) + int k; +{ + if (k == 0) + return 3; + else if ((k % 1000) == 0) + return 7; + else if ((k % 500) == 0) + return 6; + else if ((k % 100) == 0) + return 5; + else if ((k % 50) == 0) + return 4; + else if ((k % 10) == 0) + return 3; + else if ((k % 5) == 0) + return 2; + else + return 1; +} + + +static void +draw_rulers(width, height, ourGC) + unsigned int width, height; + GC ourGC; +{ + int k; /* tick counter */ + double old_pixels_per_tick; + double pixels_per_tick; + int scale; + int tick_offset; /* offset along axes */ + int x; /* coordinates of top-left popup */ + int y; /* window corner */ + double xx; /* coordinates of tick */ + double yy; /* coordinates of tick */ + static char *last_tick_units = ""; /* memory of last tick units */ + + if (tick_length <= 0) /* user doesn't want tick marks */ + return; + + x = 0; /* the pop-up window always has origin (0,0) */ + y = 0; + + /* We need to clear the existing window to remove old rulers. I think + that this could be avoided if draw_rulers() could be invoked earlier. + The expose argument in XClearArea() must be True to force redrawing + of the text inside the popup window. Also, it would be better to draw + the rulers before painting the text, so that rulers would not + overwrite the text, but I haven't figured out yet how to arrange + that. */ + + XClearArea(DISP, alt.win, x, y, width, height, True); + + /* The global resource._pixels_per_inch tells us how to find the ruler + scale. For example, 300dpi corresponds to these TeX units: + + 1 TeX point (pt) = 4.151 pixels + 1 big point (bp) = 4.167 pixels + 1 pica (pc) = 49.813 pixels + 1 cicero (cc) = 53.501 pixels + 1 didot point (dd) = 4.442 pixels + 1 millimeter (mm) = 11.811 pixels + 1 centimeter (cm) = 118.110 pixels + 1 inch (in) = 300.000 pixels + 1 scaled point (sp) = 0.00006334 pixels + + The user can select the units via a resource (e.g. XDvi*tickUnits: bp), + or a command-line option (e.g. -xrm '*tickUnits: cm'). The length of + the ticks can be controlled by a resource (e.g. XDvi*tickLength: 10), or + a command-line option (e.g. -xrm '*tickLength: 10000'). If the tick + length exceeds the popup window size, then a graph-paper grid is drawn + over the whole window. Zero, or negative, tick length completely + suppresses rulers. */ + + pixels_per_tick = (double)resource._pixels_per_inch; + if (strcmp(tick_units,"pt") == 0) + pixels_per_tick /= 72.27; + else if (strcmp(tick_units,"bp") == 0) + pixels_per_tick /= 72.0; + else if (strcmp(tick_units,"in") == 0) + /* NO-OP */; + else if (strcmp(tick_units,"cm") == 0) + pixels_per_tick /= 2.54; + else if (strcmp(tick_units,"mm") == 0) + pixels_per_tick /= 25.4; + else if (strcmp(tick_units,"dd") == 0) + pixels_per_tick *= (1238.0 / 1157.0) / 72.27; + else if (strcmp(tick_units,"cc") == 0) + pixels_per_tick *= 12.0 * (1238.0 / 1157.0) / 72.27; + else if (strcmp(tick_units,"pc") == 0) + pixels_per_tick *= 12.0 /72.27; + else if (strcmp(tick_units,"sp") == 0) + pixels_per_tick /= (65536.0 * 72.27); + else + { + Printf("Unrecognized tickUnits [%s]: defaulting to TeX points [pt]\n", + tick_units); + tick_units = "pt"; + pixels_per_tick /= 72.27; + } + + /* To permit accurate measurement in the popup window, we can reasonably + place tick marks about 3 to 10 pixels apart, so we scale the computed + pixels_per_tick by a power of ten to bring it into that range. */ + + old_pixels_per_tick = pixels_per_tick; /* remember the original scale */ + while (pixels_per_tick < 3.0) + pixels_per_tick *= 10.0; + while (pixels_per_tick > 30.0) + pixels_per_tick /= 10.0; + if (strcmp(last_tick_units, tick_units) != 0) + { /* tell user what the ruler scale is, but only when it changes */ + if (old_pixels_per_tick != pixels_per_tick) + Printf("Ruler tick interval adjusted to represent %.2f%s\n", + pixels_per_tick/old_pixels_per_tick, tick_units); + else if (debug & DBG_EVENT) + Printf("Ruler tick interval represents 1%s\n", tick_units); + } + + /* In order to make the ruler as accurate as possible, given the coarse + screen resolution, we compute tick positions in floating-point + arithmetic, then round to nearest integer values. */ + + for (k = 0, xx = 0.0; xx < (double)width; k++, xx += pixels_per_tick) + { /* draw vertical ticks on top and bottom */ + tick_offset = (int)(0.5 + xx); /* round to nearest pixel */ + scale = tick_scale(k); + XDrawLine(DISP, alt.win, ourGC, + x + tick_offset, y, + x + tick_offset, y + scale*tick_length); + XDrawLine(DISP, alt.win, ourGC, + x + tick_offset, y + height, + x + tick_offset, y + height - scale*tick_length); + } + + for (k = 0, yy = 0.0; yy < (double)height; k++, yy += pixels_per_tick) + { /* draw horizontal ticks on left and right */ + tick_offset = (int)(0.5 + yy); /* round to nearest pixel */ + scale = tick_scale(k); + XDrawLine(DISP, alt.win, ourGC, + x, y + tick_offset, + x + scale*tick_length, y + tick_offset); + XDrawLine(DISP, alt.win, ourGC, + x + width, y + tick_offset, + x + width - scale*tick_length, y + tick_offset); + } + + last_tick_units = tick_units; + + XFlush(DISP); /* bring window up-to-date */ +} + +#undef MakeGC + +#endif /* GREY */ + +/* + * Event-handling routines + */ + +static void +expose(windowrec, x, y, w, h) + struct WindowRec *windowrec; + int x, y; + unsigned int w, h; +{ + if (windowrec->min_x > x) windowrec->min_x = x; + if (windowrec->max_x < x + w) + windowrec->max_x = x + w; + if (windowrec->min_y > y) windowrec->min_y = y; + if (windowrec->max_y < y + h) + windowrec->max_y = y + h; +} + +static void +clearexpose(windowrec, x, y, w, h) + struct WindowRec *windowrec; + int x, y; + unsigned int w, h; +{ + XClearArea(DISP, windowrec->win, x, y, w, h, False); + expose(windowrec, x, y, w, h); +} + +static void +scrollwindow(windowrec, x0, y0) + struct WindowRec *windowrec; + int x0, y0; +{ + int x, y; + int x2 = 0, y2 = 0; + int ww, hh; + + x = x0 - windowrec->base_x; + y = y0 - windowrec->base_y; + ww = windowrec->width - x; + hh = windowrec->height - y; + windowrec->base_x = x0; + windowrec->base_y = y0; + if (currwin.win == windowrec->win) { + currwin.base_x = x0; + currwin.base_y = y0; + } + windowrec->min_x -= x; + if (windowrec->min_x < 0) windowrec->min_x = 0; + windowrec->max_x -= x; + if (windowrec->max_x > windowrec->width) + windowrec->max_x = windowrec->width; + windowrec->min_y -= y; + if (windowrec->min_y < 0) windowrec->min_y = 0; + windowrec->max_y -= y; + if (windowrec->max_y > windowrec->height) + windowrec->max_y = windowrec->height; + if (x < 0) { + x2 = -x; + x = 0; + ww = windowrec->width - x2; + } + if (y < 0) { + y2 = -y; + y = 0; + hh = windowrec->height - y2; + } + if (ww <= 0 || hh <= 0) { + XClearWindow(DISP, windowrec->win); + windowrec->min_x = windowrec->min_y = 0; + windowrec->max_x = windowrec->width; + windowrec->max_y = windowrec->height; + } + else { + XCopyArea(DISP, windowrec->win, windowrec->win, copyGC, + x, y, (unsigned int) ww, (unsigned int) hh, x2, y2); + if (x > 0) + clearexpose(windowrec, ww, 0, + (unsigned int) x, windowrec->height); + if (x2 > 0) + clearexpose(windowrec, 0, 0, + (unsigned int) x2, windowrec->height); + if (y > 0) + clearexpose(windowrec, 0, hh, + windowrec->width, (unsigned int) y); + if (y2 > 0) + clearexpose(windowrec, 0, 0, + windowrec->width, (unsigned int) y2); + } +} + +#ifdef TOOLKIT + +/* + * routines for X11 toolkit + */ + +static Arg arg_wh[] = { + {XtNwidth, (XtArgVal) &window_w}, + {XtNheight, (XtArgVal) &window_h}, +}; + +static Position window_x, window_y; +static Arg arg_xy[] = { + {XtNx, (XtArgVal) &window_x}, + {XtNy, (XtArgVal) &window_y}, +}; + +#define get_xy() XtGetValues(draw_widget, arg_xy, XtNumber(arg_xy)) + +#define mane_base_x 0 +#define mane_base_y 0 + + +#ifdef MOTIF + +static int +set_bar_value(bar, value, max) + Widget bar; + int value; + int max; +{ + XmScrollBarCallbackStruct call_data; + + if (value > max) value = max; + if (value < 0) value = 0; + call_data.value = value; + XtVaSetValues(bar, XmNvalue, value, NULL); + XtCallCallbacks(bar, XmNvalueChangedCallback, &call_data); + return value; +} + +#endif /* MOTIF */ + +/* not static because SELFILE stuff in dvi_init.c needs it */ +void +home(scrl) + Boolean scrl; +{ +#if PS + psp.interrupt(); +#endif + if (!scrl) XUnmapWindow(DISP, mane.win); +#ifndef MOTIF + get_xy(); + if (x_bar != NULL) { + int coord = (page_w - clip_w) / 2; + + if (coord > home_x / mane.shrinkfactor) + coord = home_x / mane.shrinkfactor; + XtCallCallbacks(x_bar, XtNscrollProc, + (XtPointer) (window_x + coord)); + } + if (y_bar != NULL) { + int coord = (page_h - clip_h) / 2; + + if (coord > home_y / mane.shrinkfactor) + coord = home_y / mane.shrinkfactor; + XtCallCallbacks(y_bar, XtNscrollProc, + (XtPointer) (window_y + coord)); + } +#else /* MOTIF */ + { + int value; + + value = (page_w - clip_w) / 2; + if (value > home_x / mane.shrinkfactor) + value = home_x / mane.shrinkfactor; + (void) set_bar_value(x_bar, value, (int) (page_w - clip_w)); + + value = (page_h - clip_h) / 2; + if (value > home_y / mane.shrinkfactor) + value = home_y / mane.shrinkfactor; + (void) set_bar_value(y_bar, value, (int) (page_h - clip_h)); + } +#endif /* MOTIF */ + if (!scrl) { + XMapWindow(DISP, mane.win); + /* Wait for the server to catch up---this eliminates flicker. */ + XSync(DISP, False); + } +} + + +#ifndef MOTIF + /*ARGSUSED*/ +static void +handle_destroy_bar(w, client_data, call_data) + Widget w; + XtPointer client_data; + XtPointer call_data; +{ + * (Widget *) client_data = NULL; +} +#endif + + +static Boolean resized = False; + +static void +get_geom() +{ + static Dimension new_clip_w, new_clip_h; + static Arg arg_wh_clip[] = { + {XtNwidth, (XtArgVal) &new_clip_w}, + {XtNheight, (XtArgVal) &new_clip_h}, + }; + int old_clip_w; + + XtGetValues(vport_widget, arg_wh, XtNumber(arg_wh)); + XtGetValues(clip_widget, arg_wh_clip, XtNumber(arg_wh_clip)); +#ifndef MOTIF + /* Note: widgets may be destroyed but not forgotten */ + if (x_bar == NULL) { + x_bar = XtNameToWidget(vport_widget, "horizontal"); + if (x_bar != NULL) + XtAddCallback(x_bar, XtNdestroyCallback, handle_destroy_bar, + (XtPointer) &x_bar); + } + if (y_bar == NULL) { + y_bar = XtNameToWidget(vport_widget, "vertical"); + if (y_bar != NULL) + XtAddCallback(y_bar, XtNdestroyCallback, handle_destroy_bar, + (XtPointer) &y_bar); + } +#endif + old_clip_w = clip_w; + /* we need to do this because */ + /* sizeof(Dimension) != sizeof(int) */ + clip_w = new_clip_w; + clip_h = new_clip_h; + if (old_clip_w == 0) home(False); + resized = False; +} + +/* + * callback routines + */ + + /*ARGSUSED*/ +void +handle_resize(widget, junk, event, cont) + Widget widget; + XtPointer junk; + XEvent *event; + Boolean *cont; /* unused */ +{ + resized = True; +} + +#ifdef BUTTONS + /*ARGSUSED*/ +static void +handle_command(widget, client_data_p, call_data) + Widget widget; + XtPointer client_data_p; + XtPointer call_data; +{ + int client_data = * (int *) client_data_p; + + keystroke((client_data) & 0xff, (client_data) >> 8, + ((client_data) >> 8) != 0, (XEvent *) NULL); +} + + /*ARGSUSED*/ +static void +handle_destroy_buttons(w, client_data, call_data) + Widget w; + XtPointer client_data; + XtPointer call_data; +{ + if (--destroy_count != 0) return; +#ifndef MOTIF + XtSetValues(vport_widget, resizable_on, XtNumber(resizable_on)); + if (resource.expert) { + XtGetValues(form_widget, arg_wh, XtNumber(arg_wh)); + XdviResizeWidget(vport_widget, window_w, window_h); + } + else { + XdviResizeWidget(vport_widget, window_w -= XTRA_WID, window_h); + create_buttons((XtArgVal) window_h); + } +#else /* MOTIF */ + if (resource.expert) + XtVaSetValues(vport_widget, + XmNleftAttachment, XmATTACH_FORM, + XmNleftOffset, 0, + NULL); + else { + create_buttons((XtArgVal) 0); /* the argument is ignored */ + window_w -= XTRA_WID; + } +#endif /* MOTIF */ +} + +#endif /* BUTTONS */ + +void +reconfig() +{ +#ifdef BUTTONS +#ifndef MOTIF + XtSetValues(vport_widget, resizable_off, XtNumber(resizable_off)); +#endif +#endif + XdviResizeWidget(draw_widget, page_w, page_h); + get_geom(); +} + + +#ifdef HTEX + +#define BIGBUF 32768 +char anchorpaintstring[BIGBUF]; +static Arg new_paint_args[] = { + {XtNstring, (XtArgVal) anchorpaintstring}, +}; + +/* Using Text widget ??? - see if this works... */ +void paint_anchor(text) +char *text; +{ + static long pos = 0; /* Keep track of how many characters we've added */ + int len; + char *firstnl; + + if (text == NULL) { /* Not on anchor any more */ + if ((pos > 0) && (pos < BIGBUF) && (anchorpaintstring[pos-1] != '\n')) { + anchorpaintstring[pos]= '\n'; /* But we were */ + anchorpaintstring[pos+1]= '\0'; + pos += 1; + XtSetValues(anchor_info, new_paint_args, + XtNumber(new_paint_args)); + XawTextSetInsertionPoint(anchor_info, pos); + } + return; + } /* There IS some anchor text under the mouse */ + len = strlen(text); + if (!strcmp(text, anchorpaintstring+pos-len)) { /* Still on same anchor */ + return; + } + if (len > BIGBUF) { /* Try it anyway: */ + text[BIGBUF-1] = '\0'; + len = BIGBUF; + } + if ((pos + len) > BIGBUF) { /* Fix in case of overflows... */ + firstnl = strchr(anchorpaintstring+pos+len-BIGBUF, '\n'); + if (firstnl == NULL) { + pos = 0; + } else { + strcpy(anchorpaintstring,firstnl+1); + pos -= 1 + firstnl - anchorpaintstring; + } + } + if (pos < 0) pos = 0; /* Shouldn't happen but... */ + sprintf(anchorpaintstring+pos,"\n%s", text); + pos += len+1; + + XtSetValues(anchor_info, new_paint_args, XtNumber(new_paint_args)); + XawTextSetInsertionPoint(anchor_info, pos); + XawTextDisplay(anchor_info); +} + +extern char anchorsearchstring[]; /* not being used? */ + +/* Callback for anchor search: */ +void search_callback(w, c_p, call_data) +Widget w; +XtPointer c_p, call_data; +{ + int len; + char *cp; + + cp = XawDialogGetValueString(anchor_search); + if (cp == NULL) return; + len = strlen(cp); + strcpy(anchorsearchstring,cp); + if (strchr(cp,'\n') == NULL) { + anchorsearchstring[len] = '\n'; + anchorsearchstring[len+1] = '\0'; + } + len = strchr(anchorsearchstring,'\n') - anchorsearchstring + 1; + add_search(anchorsearchstring, len); +} +#endif + +#else /* not TOOLKIT */ + +#ifdef HTEX +/* The anchor window stuff: */ + +void paint_anchor(text) +char *text; +{ + ClearArea(anchor_info, 1, 1, clip_w/2, BAR_THICK); + if (text != NULL) XDrawString(DISP, anchor_info, foreGC, + 1 , BAR_WID, text, strlen(text)); +} + +#endif + +/* + * brute force scrollbar routines + */ + +static void +paint_x_bar() +{ + int new_x_bgn = mane.base_x * clip_w / page_w; + int new_x_end = (mane.base_x + clip_w) * clip_w / page_w; + + if (new_x_bgn >= x_end || x_bgn >= new_x_end) { /* no overlap */ + XClearArea(DISP, x_bar, x_bgn, 1, x_end - x_bgn, BAR_WID, False); + XFillRectangle(DISP, x_bar, ruleGC, + new_x_bgn, 1, new_x_end - new_x_bgn, BAR_WID); + } + else { /* this stuff avoids flicker */ + if (x_bgn < new_x_bgn) + XClearArea(DISP, x_bar, x_bgn, 1, new_x_bgn - x_bgn, + BAR_WID, False); + else + XFillRectangle(DISP, x_bar, ruleGC, + new_x_bgn, 1, x_bgn - new_x_bgn, BAR_WID); + if (new_x_end < x_end) + XClearArea(DISP, x_bar, new_x_end, 1, x_end - new_x_end, + BAR_WID, False); + else + XFillRectangle(DISP, x_bar, ruleGC, + x_end, 1, new_x_end - x_end, BAR_WID); + } + x_bgn = new_x_bgn; + x_end = new_x_end; +} + +static void +paint_y_bar() +{ + int new_y_bgn = mane.base_y * clip_h / page_h; + int new_y_end = (mane.base_y + clip_h) * clip_h / page_h; + + if (new_y_bgn >= y_end || y_bgn >= new_y_end) { /* no overlap */ + XClearArea(DISP, y_bar, 1, y_bgn, BAR_WID, y_end - y_bgn, False); + XFillRectangle(DISP, y_bar, ruleGC, + 1, new_y_bgn, BAR_WID, new_y_end - new_y_bgn); + } + else { /* this stuff avoids flicker */ + if (y_bgn < new_y_bgn) + XClearArea(DISP, y_bar, 1, y_bgn, BAR_WID, new_y_bgn - y_bgn, + False); + else + XFillRectangle(DISP, y_bar, ruleGC, + 1, new_y_bgn, BAR_WID, y_bgn - new_y_bgn); + if (new_y_end < y_end) + XClearArea(DISP, y_bar, 1, new_y_end, + BAR_WID, y_end - new_y_end, False); + else + XFillRectangle(DISP, y_bar, ruleGC, + 1, y_end, BAR_WID, new_y_end - y_end); + } + y_bgn = new_y_bgn; + y_end = new_y_end; +} + +static void +scrollmane(x, y) + int x, y; +{ + int old_base_x = mane.base_x; + int old_base_y = mane.base_y; + +#if PS + psp.interrupt(); +#endif + if (x > (int) (page_w - clip_w)) x = page_w - clip_w; + if (x < 0) x = 0; + if (y > (int) (page_h - clip_h)) y = page_h - clip_h; + if (y < 0) y = 0; + scrollwindow(&mane, x, y); + if (old_base_x != mane.base_x && x_bar) paint_x_bar(); + if (old_base_y != mane.base_y && y_bar) paint_y_bar(); +} + +void +reconfig() +{ + int x_thick = 0; + int y_thick = 0; + + /* determine existence of scrollbars */ + if (window_w < page_w) x_thick = BAR_THICK; + if (window_h - x_thick < page_h) y_thick = BAR_THICK; + clip_w = window_w - y_thick; + if (clip_w < page_w) x_thick = BAR_THICK; + clip_h = window_h - x_thick; + + /* process drawing (clip) window */ + if (mane.win == (Window) 0) { /* initial creation */ + XWindowAttributes attrs; + + mane.win = XCreateSimpleWindow(DISP, top_level, y_thick, x_thick, + (unsigned int) clip_w, (unsigned int) clip_h, 0, + brdr_Pixel, back_Pixel); + XSelectInput(DISP, mane.win, ExposureMask | +#ifdef HTEX + PointerMotionMask | PointerMotionHintMask | + ButtonPressMask | ButtonReleaseMask); +#else + ButtonPressMask | ButtonMotionMask | ButtonReleaseMask); +#endif + (void) XGetWindowAttributes(DISP, mane.win, &attrs); + backing_store = attrs.backing_store; + XMapWindow(DISP, mane.win); + } + else + XMoveResizeWindow(DISP, mane.win, y_thick, x_thick, clip_w, clip_h); + +#ifdef HTEX + if (anchor_info) { + XMoveResizeWindow(DPY anchor_info, + y_thick - 1, x_thick - BAR_THICK - 1, + clip_w/2, BAR_THICK - 1); + paint_anchor(NULL); + XMoveResizeWindow(DPY anchor_search, + y_thick + clip_w/2 - 1, x_thick - BAR_THICK - 1, + clip_w/2, BAR_THICK - 1); + } else { + anchor_info = XCreateSimpleWindow(DISP, top_level, y_thick - 1, + x_thick - BAR_THICK -1, + (unsigned int) clip_w/2, BAR_THICK - 1, 1, + brdr_Pixel, back_Pixel); + XSelectInput(DISP, anchor_info, ExposureMask); + anchor_search = XCreateSimpleWindow(DISP, top_level, + y_thick + clip_w/2 - 1, + x_thick - BAR_THICK -1, + (unsigned int) clip_w/2, BAR_THICK - 1, 1, + brdr_Pixel, back_Pixel); + XSelectInput(DISP, anchor_search, ExposureMask|KeyPressMask); + XMapWindow(DPY anchor_info); + XMapWindow(DPY anchor_search); + } +#endif + /* process scroll bars */ + if (x_thick) { + if (x_bar) { + XMoveResizeWindow(DISP, x_bar, + y_thick - 1, -1, clip_w, BAR_THICK - 1); + paint_x_bar(); + } + else { + x_bar = XCreateSimpleWindow(DISP, top_level, y_thick - 1, -1, + (unsigned int) clip_w, BAR_THICK - 1, 1, + brdr_Pixel, back_Pixel); + XSelectInput(DISP, x_bar, + ExposureMask | ButtonPressMask | Button2MotionMask); + XMapWindow(DISP, x_bar); + } + x_bgn = mane.base_x * clip_w / page_w; + x_end = (mane.base_x + clip_w) * clip_w / page_w; + } + else + if (x_bar) { + XDestroyWindow(DISP, x_bar); + x_bar = (Window) 0; + } + + if (y_thick) { + if (y_bar) { + XMoveResizeWindow(DISP, y_bar, + -1, x_thick - 1, BAR_THICK - 1, clip_h); + paint_y_bar(); + } + else { + y_bar = XCreateSimpleWindow(DISP, top_level, -1, x_thick - 1, + BAR_THICK - 1, (unsigned int) clip_h, 1, + brdr_Pixel, back_Pixel); + XSelectInput(DISP, y_bar, + ExposureMask | ButtonPressMask | Button2MotionMask); + XMapWindow(DISP, y_bar); + } + y_bgn = mane.base_y * clip_h / page_h; + y_end = (mane.base_y + clip_h) * clip_h / page_h; + } + else + if (y_bar) { + XDestroyWindow(DISP, y_bar); + y_bar = (Window) 0; + } +} + +static void +home(scrl) + Boolean scrl; +{ + int x = 0, y = 0; + + if (page_w > clip_w) { + x = (page_w - clip_w) / 2; + if (x > home_x / mane.shrinkfactor) + x = home_x / mane.shrinkfactor; + } + if (page_h > clip_h) { + y = (page_h - clip_h) / 2; + if (y > home_y / mane.shrinkfactor) + y = home_y / mane.shrinkfactor; + } + if (scrl) + scrollmane(x, y); + else { + mane.base_x = x; + mane.base_y = y; + if (currwin.win == mane.win) { + currwin.base_x = x; + currwin.base_y = y; + } + if (x_bar) paint_x_bar(); + if (y_bar) paint_y_bar(); + } +} + +#define get_xy() +#define window_x 0 +#define window_y 0 +#define mane_base_x mane.base_x +#define mane_base_y mane.base_y +#endif /* not TOOLKIT */ + +static void +compute_mag_pos(xp, yp) + int *xp, *yp; +{ + int t; + + t = mag_x + main_x - alt.width/2; + if (t > WidthOfScreen(SCRN) - (int) alt.width - 2*MAGBORD) + t = WidthOfScreen(SCRN) - (int) alt.width - 2*MAGBORD; + if (t < 0) t = 0; + *xp = t; + t = mag_y + main_y - alt.height/2; + if (t > HeightOfScreen(SCRN) - (int) alt.height - 2*MAGBORD) + t = HeightOfScreen(SCRN) - (int) alt.height - 2*MAGBORD; + if (t < 0) t = 0; + *yp = t; +} + + +#define TRSIZE 100 + +/* BEGIN CHUNK events.c 1 */ +#ifdef SRC_SPECIALS +#define src_jumpButton resource._src_jumpButton +#endif +/* END CHUNK events.c 1 */ +#ifdef TOOLKIT + /*ARGSUSED*/ +void +handle_key(widget, junk, eventp, cont) + Widget widget; + XtPointer junk; + XEvent *eventp; + Boolean *cont; /* unused */ +#else /* !TOOLKIT */ +void +handle_key(eventp) + XEvent *eventp; +#endif /* TOOLKIT */ +{ + static Boolean has_arg = False; + static int number = 0; + static int sign = 1; + char ch; + Boolean arg0; + int number0; + char trbuf[TRSIZE]; + int nbytes; + + nbytes = XLookupString(&eventp->xkey, trbuf, TRSIZE, (KeySym *) NULL, + (XComposeStatus *) NULL); + if (nbytes == 0) return; + ch = '\0'; + if (nbytes == 1) ch = *trbuf; + if (ch >= '0' && ch <= '9') { + has_arg = True; + number = number * 10 + sign * (ch - '0'); + return; + } + else if (ch == '-') { + has_arg = True; + sign = -1; + number = 0; + return; + } + number0 = number; + number = 0; + sign = 1; + arg0 = has_arg; + has_arg = False; + keystroke(ch, number0, arg0, eventp); +} + +#ifdef TOOLKIT + /*ARGSUSED*/ +void +handle_button(widget, junk, ev, cont) + Widget widget; + XtPointer junk; + XEvent *ev; +#define event (&(ev->xbutton)) + Boolean *cont; /* unused */ +#else /* !TOOLKIT */ +void +handle_button(event) + XButtonEvent *event; +#endif /* TOOLKIT */ +{ + int x, y; + struct mg_size_rec *size_ptr = mg_size + event->button - 1; + XSetWindowAttributes attr; + +/* BEGIN CHUNK events.c 2 */ +#ifdef SRC_SPECIALS + /* If src specials are evaluated, make src_JumpButton jump to the next special. */ + if (src_evalMode) { + if (event->button == src_jumpButton) { + src_find_special(1, event->x, event->y); + return; + } + } +#endif +/* END CHUNK events.c 2 */ +#ifdef HTEX + if ((event->button == 1)||(event->button == 2)) { + if (pointerlocate(&x, &y)) { + /* Only do this if there's actually an href right there */ + int ret; + /* screen_to_page(&mane,x,y,&page,&px,&py); */ + if (event->button == 2) HTeXnext_extern = 1; + ret = htex_handleref(current_page, x, y); + HTeXnext_extern = 0; + if (ret == 1) return; + } + } +#endif + if (alt.win != (Window) 0 || mane.shrinkfactor == 1 || size_ptr->w <= 0) + XBell(DISP, 20); + else { + mag_x = event->x; + mag_y = event->y; + alt.width = size_ptr->w; + alt.height = size_ptr->h; + main_x = event->x_root - mag_x; + main_y = event->y_root - mag_y; + compute_mag_pos(&x, &y); + alt.base_x = (event->x + mane_base_x) * mane.shrinkfactor - + alt.width/2; + alt.base_y = (event->y + mane_base_y) * mane.shrinkfactor - + alt.height/2; + attr.save_under = True; + attr.border_pixel = brdr_Pixel; + attr.background_pixel = back_Pixel; + attr.override_redirect = True; +#ifdef GREY + attr.colormap = our_colormap; +#endif + alt.win = XCreateWindow(DISP, RootWindowOfScreen(SCRN), + x, y, alt.width, alt.height, MAGBORD, + our_depth, InputOutput, our_visual, + CWSaveUnder | CWBorderPixel | CWBackPixel | +#ifdef GREY + CWColormap | +#endif + CWOverrideRedirect, &attr); + XSelectInput(DISP, alt.win, ExposureMask); + XMapWindow(DISP, alt.win); + + /***************************************************************** + This call will draw the point rulers when the magnifier first + pops up, if the XDvi*delayRulers resource is false. Some users + may prefer rulers to remain invisible until the magnifier is + moved, so the default is true. Rulers can be suppressed entirely + by setting the XDvi*tickLength resource to zero or negative. + + It is better to use highGC for draw_rulers() than foreGC, + because this allows the ruler to be drawn in a different color, + helping to distinguish ruler ticks from normal typeset text. + *****************************************************************/ + if (!delay_rulers) + draw_rulers(alt.width, alt.height, highGC); + + alt_stat = 1; /* waiting for exposure */ + } +} + +#ifdef TOOLKIT +#undef event + + /*ARGSUSED*/ +void +handle_motion(widget, junk, ev, cont) + Widget widget; + XtPointer junk; + XEvent *ev; +#define event (&(ev->xmotion)) + Boolean *cont; /* unused */ +{ +#ifdef HTEX + int x, y; + +/* APS Modification required because of changes in motion events selected: */ + /* We asked only for hints, so check where pointer is: */ + if (pointerlocate(&x, &y)) { + if ((event->state&(Button1Mask|Button2Mask|Button3Mask| + Button4Mask|Button5Mask)) == 0) { + htex_displayanchor(current_page, x, y); + return; + } + } +#endif + new_mag_x = event->x; + main_x = event->x_root - new_mag_x; + new_mag_y = event->y; + main_y = event->y_root - new_mag_y; + mag_moved = (new_mag_x != mag_x || new_mag_y != mag_y); +} + +#undef event +#endif /* TOOLKIT */ + +static void +movemag(x, y) + int x, y; +{ + int xx, yy; + + mag_x = x; + mag_y = y; + if (mag_x == new_mag_x && mag_y == new_mag_y) mag_moved = False; + compute_mag_pos(&xx, &yy); + XMoveWindow(DISP, alt.win, xx, yy); + scrollwindow(&alt, + (x + mane_base_x) * mane.shrinkfactor - (int) alt.width/2, + (y + mane_base_y) * mane.shrinkfactor - (int) alt.height/2); + draw_rulers(alt.width, alt.height, highGC); +} + +#ifdef TOOLKIT + /*ARGSUSED*/ +void +handle_release(widget, junk, ev, cont) + Widget widget; + XtPointer junk; + XEvent *ev; +#define event (&(ev->xbutton)) + Boolean *cont; /* unused */ +#else /* !TOOLKIT */ +void +handle_release() +#endif /* TOOLKIT */ +{ + if (alt.win != (Window) 0) + if (alt_stat) alt_stat = -1; /* destroy upon expose */ + else { + XDestroyWindow(DISP, alt.win); + if (currwin.win == alt.win) alt_canit = True; + alt.win = (Window) 0; + mag_moved = False; + can_exposures(&alt); + } +} + +#ifdef TOOLKIT +#undef event + + /*ARGSUSED*/ +void +handle_exp(widget, closure, ev, cont) + Widget widget; + XtPointer closure; + XEvent *ev; +#define event (&(ev->xexpose)) + Boolean *cont; /* unused */ +{ + struct WindowRec *windowrec = (struct WindowRec *) closure; + + if (windowrec == &alt) + if (alt_stat < 0) { /* destroy upon exposure */ + alt_stat = 0; + handle_release(widget, (caddr_t) NULL, ev, (Boolean *) NULL); + return; + } + else + alt_stat = 0; + expose(windowrec, event->x, event->y, + (unsigned int) event->width, (unsigned int) event->height); +} + +#undef event +#endif /* TOOLKIT */ + +#ifdef MOTIF + +/* ARGSUSED */ +void +file_pulldown_callback(w, client_data, call_data) + Widget w; + XtPointer client_data; + XtPointer call_data; +{ + switch ((int) client_data) { + case 0: + keystroke('R', 0, False, (XEvent *) NULL); + break; + case 1: + keystroke('q', 0, False, (XEvent *) NULL); + break; + } +} + +/* ARGSUSED */ +void +navigate_pulldown_callback(w, client_data, call_data) + Widget w; + XtPointer client_data; + XtPointer call_data; +{ + switch ((int) client_data) { + case 0: + keystroke('p', 10, True, (XEvent *) NULL); + break; + case 1: + keystroke('p', 5, True, (XEvent *) NULL); + break; + case 2: + keystroke('p', 0, False, (XEvent *) NULL); + break; + case 3: + keystroke('n', 0, False, (XEvent *) NULL); + break; + case 4: + keystroke('n', 5, True, (XEvent *) NULL); + break; + case 5: + keystroke('n', 10, True, (XEvent *) NULL); + break; + } +} + +/* ARGSUSED */ +void +scale_pulldown_callback(w, client_data, call_data) + Widget w; + XtPointer client_data; + XtPointer call_data; +{ + int data = (int) client_data; + + if (data >= 0 && data < 4) + keystroke('s', data + 1, True, (XEvent *) NULL); +} + +void +set_shrink_factor(shrink) + int shrink; +{ + static Widget active_shrink_button = NULL; + Widget new_shrink_button; + + mane.shrinkfactor = shrink; + new_shrink_button = (shrink > 0 && shrink <= XtNumber(shrink_button) + ? shrink_button[shrink - 1] : NULL); + if (new_shrink_button != active_shrink_button) { + if (active_shrink_button != NULL) + XmToggleButtonSetState(active_shrink_button, False, False); + if (new_shrink_button != NULL) + XmToggleButtonSetState(new_shrink_button, True, False); + active_shrink_button = new_shrink_button; + } +} + +#endif /* MOTIF */ + +void +showmessage(message) + _Xconst char *message; +{ + get_xy(); + XDrawImageString(DISP, mane.win, copyGC, + 5 - window_x, 5 + X11HEIGHT - window_y, message, strlen(message)); +} + +/* ||| + * Currently the event handler does not coordinate XCopyArea requests + * with GraphicsExpose events. This can lead to problems if the window + * is partially obscured and one, for example, drags a scrollbar. + */ + +#ifdef SRC_SPECIALS +// TEST !!!!! +extern void test_print_out_list ARGS((void)); +extern void test_print_out_reversed_list ARGS((void)); +#endif +static void +keystroke(ch, number0, arg0, eventp) + char ch; + int number0; + Boolean arg0; + XEvent *eventp; +{ + static int last_number = 0; /* memory for Again command */ + static char last_ch = '\0'; /* ditto */ + static Boolean last_arg = False; /* ditto */ + +/* BEGIN CHUNK events.c 3 */ + int src_x, src_y; +/* END CHUNK events.c 3 */ + + int next_page; +#ifdef TOOLKIT + Window ww; +#endif + + next_page = current_page; + +#if DEBUG + if (isprint(ch)) + fprintf(stderr,"<%c>",(int)ch); + else + fprintf(stderr,"<%03o>",(int)ch); +#endif + + if (ch == '\001') /* Ctl-A or Again */ + { + ch = last_ch; + number0 = last_number; + arg0 = last_arg; + } + else /* remember key and arg for Again command */ + { + last_ch = ch; + last_number = number0; + last_arg = arg0; + } + + switch (ch) { + case 'q': + case 'Q': + case '\003': /* control-C */ + case '\004': /* control-D */ +#ifdef VMS + case '\032': /* control-Z */ +#endif +#if PS + ps_destroy(); +#endif +#ifndef FLAKY_SIGPOLL + if (debug & DBG_EVENT) + puts(event_freq < 0 + ? "SIGPOLL is working" : "no SIGPOLL signals received"); +#endif + exit((ch == 'Q') ? 2 : 0); + + case 'n': + case 'f': + case ' ': + case '\r': + case '\n': + /* scroll forward; i.e. go to relative page */ + next_page = current_page + (arg0 ? number0 : 1); + break; +#ifdef HTEX + case 'F': /* Follow link forward! */ + { + int x, y; + if (pointerlocate(&x, &y)) { + /* screen_to_page(&mane,s_x,s_y,&page,&px,&py); */ + (void) htex_handleref(current_page, x, y); + } + } + return; /* Should goto bad if problem arises? */ + case 'B': /* Go back to previous anchor. */ + htex_goback(); /* Should goto bad if problem arises? */ + return; +#endif + case 'p': + case 'b': + case '\b': + case '\177': /* Del */ + /* scroll backward */ + next_page = current_page - (arg0 ? number0 : 1); + break; + case '<': + next_page = 0; + break; + case 'g': + case 'j': + case '>': + /* go to absolute page (last by default) */ + next_page = (arg0 ? number0 - pageno_correct : + total_pages - 1); + break; + case '?': + case 'h': + case 'H': /* Help */ + show_help(); + return; + case 'P': /* declare current page */ + pageno_correct = arg0 * number0 - current_page; + return; + case 'k': /* toggle keep-position flag */ + resource.keep_flag = (arg0 ? number0 : !resource.keep_flag); + return; + case '\f': + /* redisplay current page */ + break; + case '^': + home(True); + return; +#ifdef TOOLKIT +#ifndef MOTIF + case 'l': + if (!x_bar) goto bad; + XtCallCallbacks(x_bar, XtNscrollProc, + (XtPointer) (-2 * (int) clip_w / 3)); + return; + case 'r': + if (!x_bar) goto bad; + XtCallCallbacks(x_bar, XtNscrollProc, + (XtPointer) (2 * (int) clip_w / 3)); + return; + case 'u': + if (!y_bar) goto bad; + XtCallCallbacks(y_bar, XtNscrollProc, + (XtPointer) (-2 * (int) clip_h / 3)); + return; + case 'd': + if (!y_bar) goto bad; + XtCallCallbacks(y_bar, XtNscrollProc, + (XtPointer) (2 * (int) clip_h / 3)); + return; + case 'c': + { + int x, y; + + x = eventp->xkey.x - clip_w / 2; + y = eventp->xkey.y - clip_h / 2; + /* The clip widget gives a more exact value. */ + if (x_bar != NULL) + XtCallCallbacks(x_bar, XtNscrollProc, (XtPointer) x); + if (y_bar != NULL) + XtCallCallbacks(y_bar, XtNscrollProc, (XtPointer) y); + XWarpPointer(DISP, None, None, 0, 0, 0, 0, -x, -y); + } + return; +#else /* MOTIF */ + case 'c': + { + int x, y; + + get_xy(); + /* The clip widget gives a more exact value. */ + x = eventp->xkey.x - clip_w / 2; + y = eventp->xkey.y - clip_h / 2; + + x = set_bar_value(x_bar, x, (int) (page_w - clip_w)); + y = set_bar_value(y_bar, y, (int) (page_h - clip_h)); + XWarpPointer(DISP, None, None, 0, 0, 0, 0, + -x - window_x, -y - window_y); + } + return; + /* These four won't be needed once translations are put in. */ + case 'l': + get_xy(); + (void) set_bar_value(x_bar, -2 * (int) clip_w / 3 - window_x, + (int) (page_w - clip_w)); + return; + case 'r': + get_xy(); + (void) set_bar_value(x_bar, 2 * (int) clip_w / 3 - window_x, + (int) (page_w - clip_w)); + return; + case 'u': + get_xy(); + (void) set_bar_value(y_bar, -2 * (int) clip_h / 3 - window_y, + (int) (page_h - clip_h)); + return; + case 'd': + get_xy(); + (void) set_bar_value(y_bar, 2 * (int) clip_h / 3 - window_y, + (int) (page_h - clip_h)); + return; +#endif /* MOTIF */ + case 'M': + (void) XTranslateCoordinates(DISP, eventp->xkey.window, + mane.win, eventp->xkey.x, eventp->xkey.y, + &home_x, &home_y, &ww); /* throw away last argument */ + home_x *= mane.shrinkfactor; + home_y *= mane.shrinkfactor; + return; +/* BEGIN CHUNK events.c 4 */ +#ifdef SRC_SPECIALS + case 'X': + (void) XTranslateCoordinates(DISP, eventp->xkey.window, + mane.win, eventp->xkey.x, eventp->xkey.y, + &src_x, &src_y, &ww); /* throw away last argument */ + /* just highlight next special without calling editor for it */ + src_find_special(0, src_x, src_y); + return; /* or `break'? */ +#endif +/* END CHUNK events.c 4 */ +#ifdef BUTTONS + case 'x': + if (arg0 && resource.expert == (number0 != 0)) return; + if (resource.expert) { /* create buttons */ + resource.expert = False; + if (destroy_count != 0) return; +#ifndef MOTIF + XtSetValues(vport_widget, resizable_on, + XtNumber(resizable_on)); + XdviResizeWidget(vport_widget, + window_w -= XTRA_WID, window_h); + create_buttons((XtArgVal) window_h); +#else /* MOTIF */ + create_buttons((XtArgVal) 0); /* the argument is ignored */ + window_w -= XTRA_WID; +#endif /* MOTIF */ + } + else { /* destroy buttons */ + resource.expert = True; + if (destroy_count != 0) return; + destroy_count = 2; + XtAddCallback(panel_widget, XtNdestroyCallback, + handle_destroy_buttons, (XtPointer) 0); + XtAddCallback(line_widget, XtNdestroyCallback, + handle_destroy_buttons, (XtPointer) 0); + XtDestroyWidget(panel_widget); + XtDestroyWidget(line_widget); + window_w += XTRA_WID; + } + return; +#endif /* BUTTONS */ +#else /* not TOOLKIT */ + case 'l': + if (mane.base_x <= 0) goto bad; + scrollmane(mane.base_x - 2 * (int) clip_w / 3, mane.base_y); + return; + case 'r': + if (mane.base_x >= page_w - clip_w) goto bad; + scrollmane(mane.base_x + 2 * (int) clip_w / 3, mane.base_y); + return; + case 'u': + if (mane.base_y <= 0) goto bad; + scrollmane(mane.base_x, mane.base_y - 2 * (int) clip_h / 3); + return; + case 'd': + if (mane.base_y >= page_h - clip_h) goto bad; + scrollmane(mane.base_x, mane.base_y + 2 * (int) clip_h / 3); + return; + case 'c': /* unchecked scrollmane() */ + scrollwindow(&mane, mane.base_x + eventp->xkey.x - clip_w/2, + mane.base_y + eventp->xkey.y - clip_h/2); + if (x_bar) paint_x_bar(); + if (y_bar) paint_y_bar(); + XWarpPointer(DISP, None, None, 0, 0, 0, 0, + clip_w/2 - eventp->xkey.x, clip_h/2 - eventp->xkey.y); + return; + case 'M': + home_x = (eventp->xkey.x - (y_bar ? BAR_THICK : 0) + + mane.base_x) * mane.shrinkfactor; + home_y = (eventp->xkey.y - (x_bar ? BAR_THICK : 0) + + mane.base_y) * mane.shrinkfactor; + return; +/* BEGIN CHUNK events.c 5 */ +#ifdef SRC_SPECIALS + case 'X': + /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * !!! WARNING: THIS IS UNTESTED !!! + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + */ + src_x = (eventp->xkey.x - (y_bar ? BAR_THICK : 0) + + mane.base_x); + src_y = (eventp->xkey.y - (x_bar ? BAR_THICK : 0) + + mane.base_y); + src_find_special(0, src_x, src_y); + return; +#endif /* SRC_SPECIALS */ +/* END CHUNK events.c 5 */ +#endif /* not TOOLKIT */ + +/* BEGIN CHUNK events.c 6 */ +#ifdef SRC_SPECIALS + /* + * Control-S toggles visibility of src specials + * (mnemonic for isearch in Emacs ;-) + * Also changes the cursor to emphasize the new mode. + */ + case '\023': /* Control-S */ + if (src_evalMode) { + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "SRC specials OFF\n"); + } + /* free src_arr */ + src_cleanup(); + src_evalMode = False; + XDefineCursor(DISP, mane.win, ready_cursor); + } + else { + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "SRC specials ON\n"); + } + src_evalMode = True; + /* used to have this in addition to emphasize the mode, + * but usage seems more coherent without it: */ + /* src_tickVisibility = True; */ + XDefineCursor(DISP, mane.win, src_cursor); + } + redraw_page(); + break; + case 'T': + /* + * change shape of specials, but only when they're visible; + * this makes the key usable for other purposes in ordinary mode. + * However, it seems that in ordinary mode `T' already does the same + * as Ctrl-p: print the Unit/bitord/byteord stuff; what's + * the reason for this ??? + */ + if (src_evalMode) { + src_tickShape++; + if (src_tickShape > SPECIAL_SHAPE_MAX_NUM) { + src_tickShape = 0; + } + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "changing shape to \"%d\"\n", src_tickShape); + } + if (src_tickVisibility) { + redraw_page(); + } + break; + } +#ifndef PS_GS + case 'V': + if (src_evalMode) { + /* + * toggle visibility of src specials + */ + if (src_tickVisibility) { + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "SRC special visibility OFF\n"); + } + src_tickVisibility = False; + } + else { + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "SRC special visibility ON\n"); + } + src_tickVisibility = True; + } + redraw_page(); + return; + } +#endif /* PS_GS */ +#endif /* SRC_SPECIALS */ +/* END CHUNK events.c 6 */ + case '\020': /* Control P */ + Printf("Unit = %d, bitord = %d, byteord = %d\n", + BitmapUnit(DISP), BitmapBitOrder(DISP), + ImageByteOrder(DISP)); + return; + case 's': + if (!arg0) { + int temp; + + number0 = ROUNDUP(unshrunk_page_w, window_w - 2); +#ifndef MOTIF + temp = ROUNDUP(unshrunk_page_h, window_h - 2); +#else /* MOTIF */ + { /* account for menubar */ + static Dimension new_h; + + /* get rid of scrollbar */ + XdviResizeWidget(draw_widget, 1, 1); + XtVaGetValues(clip_widget, XtNheight, &new_h, NULL); + temp = ROUNDUP(unshrunk_page_h, new_h - 2); + } +#endif /* MOTIF */ + if (number0 < temp) number0 = temp; + } + if (number0 <= 0) goto bad; + if (number0 == mane.shrinkfactor) return; +#ifndef MOTIF + mane.shrinkfactor = number0; +#else + set_shrink_factor(number0); +#endif + init_page(); + if (number0 != 1 && number0 != bak_shrink) { + bak_shrink = number0; +#ifdef GREY + if (use_grey) init_colors(); +#endif + reset_fonts(); + } + reconfig(); + home(False); + break; + case 'S': + if (!arg0) goto bad; +#ifdef GREY + if (use_grey) { + float newgamma = number0 != 0 ? number0 / 100.0 : 1.0; + + if (newgamma == gamma) return; + gamma = newgamma; + init_colors(); + return; + } +#endif + if (number0 < 0) goto bad; + if (number0 == density) return; + density = number0; + reset_fonts(); + if (mane.shrinkfactor == 1) return; + break; + + case 't': + { /* toggle through magnifier ruler tick units */ + int k = 0; + static char *TeX_units[] = { + "bp", "cc", "cm", "dd", "in", "mm", "pc", "pt", "sp", + }; + + for (k = 0; k < sizeof(TeX_units)/sizeof(TeX_units[0]); ++k) + if (strcmp(tick_units,TeX_units[k]) == 0) + break; + k++; + if (k >= sizeof(TeX_units)/sizeof(TeX_units[0])) + k = 0; + tick_units = TeX_units[k]; + Printf("Ruler units = %s\n", tick_units); + } + return; + +#ifdef GREY + case 'G': + use_grey = (arg0 ? number0 : !use_grey); + if (use_grey) init_colors(); + reset_fonts(); + break; +#endif +#ifdef GRID + case 'D': + grid_mode = (arg0 ? number0 : !grid_mode ); + init_page(); + reconfig(); + break; +#endif /* GRID */ + +#if PS + case 'v': + if (!arg0 || resource._postscript != !number0) { + resource._postscript = !resource._postscript; + if (resource._postscript) scanned_page = scanned_page_bak; + psp.toggle(); + } + break; +#endif + +#ifdef SELFILE + case '\006': /* control-f */ + ++dvi_time ; /* notice we want a new file in check_dvi_file */ + break ; +#endif /* SELFILE */ + +#if PS_GS + case 'V': +/* BEGIN CHUNK events.c 7 */ +#ifdef SRC_SPECIALS + if (src_evalMode) { + /* + * toggle visibility of src specials + */ + if (src_tickVisibility) { + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "SRC special visibility OFF\n"); + } + src_tickVisibility = False; + } + else { + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "SRC special visibility ON\n"); + } + src_tickVisibility = True; + } + redraw_page(); + return; + } + else { +#endif +/* END CHUNK events.c 7 */ + if (!arg0 || resource.gs_alpha != !number0) + resource.gs_alpha = !resource.gs_alpha; + break; +/* BEGIN CHUNK events.c 8 */ +#ifdef SRC_SPECIALS + } +#endif +/* END CHUNK events.c 8 */ +#endif + + case 'R': + /* reread DVI file */ + --dvi_time; /* then it will notice a change */ + break; + default: + goto bad; + } + if (0 <= next_page && next_page < total_pages) { + if (current_page != next_page) { + /* BEGIN CHUNK events.c 0 */ +#ifdef SRC_SPECIALS + src_delete_all_specials(); +#endif +/* END CHUNK events.c 0 */ + current_page = next_page; + warn_spec_now = warn_spec; + if (!resource.keep_flag) home(False); + } + canit = True; + XFlush(DISP); + return; /* Don't use longjmp here: it might be called from + * within the toolkit, and we don't want to longjmp out + * of Xt routines. */ + } + bad: XBell(DISP, 10); +} + +/* + * Since redrawing the screen is (potentially) a slow task, xdvi checks + * for incoming events while this is occurring. It does not register + * a work proc that draws and returns every so often, as the toolkit + * documentation suggests. Instead, it checks for events periodically + * (or not, if SIGPOLL can be used instead) and processes them in + * a subroutine called by the page drawing routine. This routine (below) + * checks to see if anything has happened and processes those events and + * signals. (Or, if it is called when there is no redrawing that needs + * to be done, it blocks until something happens.) + */ + +void +#if PS +ps_read_events(wait, allow_can) + wide_bool wait; + wide_bool allow_can; +#else +read_events(wait) + wide_bool wait; +#define allow_can True +#endif +{ + XEvent event; + + alt_canit = False; + for (;;) { + event_counter = event_freq; + /* + * The above line clears the flag indicating that an event is + * pending. So if an event comes in right now, the flag will be + * set again needlessly, but we just end up making an extra call. + * Also, be careful about destroying the magnifying glass while + * drawing on it. + */ + +#ifndef FLAKY_SIGPOLL + + if (event_freq < 0) { /* if SIGPOLL works */ + + if (!XtPending()) { + sigset_t oldsig; + + (void) sigprocmask(SIG_BLOCK, &sigpollusrterm, &oldsig); + if (terminate_flag) { +#if PS + ps_destroy(); +#endif + exit(0); + } + while (!XtPending()) + { + /* + * The following code eliminates unnecessary calls to + * XDefineCursor, since this is a slow operation on + * some hardware (e.g., S3 chips). + */ + if (busycurs && wait && !canit && !mag_moved + && alt.min_x == MAXDIM && mane.min_x == MAXDIM) { + XSync(DISP, False); + if (XtPending()) break; +/* BEGIN CHUNK events.c 9 */ +#ifdef SRC_SPECIALS + if (src_evalMode) { + XDefineCursor(DISP, mane.win, src_cursor); + } + else { +#endif +/* END CHUNK events.c 9 */ + XDefineCursor(DISP, mane.win, ready_cursor); +/* BEGIN CHUNK events.c 10 */ +#ifdef SRC_SPECIALS + } +#endif +/* END CHUNK events.c 10 */ + XFlush(DISP); + busycurs = False; + } + if (!wait && (canit | alt_canit)) { +#if PS + psp.interrupt(); +#endif + if (allow_can) { + (void) sigprocmask(SIG_SETMASK, &oldsig, + (sigset_t *)NULL); + longjmp(canit_env, 1); + } + } + if (!wait || canit || mane.min_x < MAXDIM + || alt.min_x < MAXDIM || mag_moved) { + (void) sigprocmask(SIG_SETMASK, &oldsig, + (sigset_t *) NULL); + return; + } + (void) sigsuspend(&oldsig); + if (terminate_flag) { +#if PS + ps_destroy(); +#endif + exit(0); + } + + } + (void) sigprocmask(SIG_SETMASK, &oldsig, (sigset_t *) NULL); + } + } + else + +#endif /* not FLAKY_SIGPOLL */ + + { + for (;;) { +#if HAVE_POLL + int retval; +#endif + + if (terminate_flag) { +#if PS + ps_destroy(); +#endif + exit(0); + } + + if (XtPending()) + break; + + /* + * The following code eliminates unnecessary calls to + * XDefineCursor, since this is a slow operation on some + * hardware (e.g., S3 chips). + */ + if (busycurs && wait && !canit && !mag_moved + && alt.min_x == MAXDIM && mane.min_x == MAXDIM) { + XSync(DISP, False); + if (XtPending()) break; +/* BEGIN CHUNK events.c 11 */ +#ifdef SRC_SPECIALS + if (src_evalMode) { + XDefineCursor(DISP, mane.win, src_cursor); + } + else { +#endif +/* END CHUNK events.c 11 */ + XDefineCursor(DISP, mane.win, ready_cursor); +/* BEGIN CHUNK events.c 12 */ +#ifdef SRC_SPECIALS + } +#endif +/* END CHUNK events.c 12 */ + XFlush(DISP); + busycurs = False; + } + if (!wait && (canit | alt_canit)) { +#if PS + psp.interrupt(); +#endif + if (allow_can) longjmp(canit_env, 1); + } + if (!wait || canit + || mane.min_x < MAXDIM || alt.min_x < MAXDIM || mag_moved) + return; + /* If a SIGUSR1 signal comes right now, then it will wait + until an X event or another SIGUSR1 signal arrives. */ + +#if HAVE_POLL + do { + retval = poll(fds, XtNumber(fds), -1); + } while (retval < 0 && errno == EAGAIN); + + if (retval < 0 && errno != EINTR) + perror("poll (xdvi read_events)"); +#else + FD_SET(ConnectionNumber(DISP), &readfds); + if (select(ConnectionNumber(DISP) + 1, &readfds, + (fd_set *) NULL, (fd_set *) NULL, + (struct timeval *) NULL) < 0 && errno != EINTR) + perror("select (xdvi read_events)"); +#endif + } + } + +#ifdef TOOLKIT + + XtNextEvent(&event); + if (resized) get_geom(); + if (event.xany.window == alt.win && event.type == Expose) { + handle_exp((Widget) NULL, (XtPointer) &alt, &event, + (Boolean *) NULL); + continue; + } + (void) XtDispatchEvent(&event); + +#else /* not TOOLKIT */ + + XNextEvent(DISP, &event); + if (event.xany.window == mane.win || event.xany.window == alt.win) { + struct WindowRec *wr = &mane; + + if (event.xany.window == alt.win) { + wr = &alt; + /* check in case we already destroyed the window */ + if (alt_stat < 0) { /* destroy upon exposure */ + alt_stat = 0; + handle_release(); + continue; + } + else + alt_stat = 0; + } + switch (event.type) { + case GraphicsExpose: + case Expose: + expose(wr, event.xexpose.x, event.xexpose.y, + event.xexpose.width, event.xexpose.height); + break; + + case MotionNotify: +#ifdef HTEX +/* APS Only using motion hints, so get the last pointer location: */ + while (XCheckMaskEvent(DISP, PointerMotionMask, &event)); + if ((keys_buttons&(Button1Mask|Button2Mask|Button3Mask| + Button4Mask|Button5Mask)) == 0) { + /* None of the buttons was down, so this isn't a mag motion event: */ + int x, y; + if (!pointerlocate(&x, &y)) break; + htex_displayanchor(current_page, x, y); + break; + } +#endif + new_mag_x = event.xmotion.x; + new_mag_y = event.xmotion.y; + mag_moved = (new_mag_x != mag_x || new_mag_y != mag_y); + break; + + case ButtonPress: + handle_button(&event.xbutton); + break; + + case ButtonRelease: + handle_release(); + break; + } /* end switch */ + } /* end if window == {mane,alt}.win */ + + else if (event.xany.window == x_bar) { + if (event.type == Expose) + XFillRectangle(DISP, x_bar, ruleGC, + x_bgn, 1, x_end - x_bgn, BAR_WID); + else if (event.type == MotionNotify) + scrollmane(event.xmotion.x * page_w / clip_w, + mane.base_y); + else switch (event.xbutton.button) + { + case 1: + scrollmane(mane.base_x + event.xbutton.x, mane.base_y); + break; + case 2: + scrollmane(event.xbutton.x * page_w / clip_w, + mane.base_y); + break; + case 3: + scrollmane(mane.base_x - event.xbutton.x, mane.base_y); + } + } + + else if (event.xany.window == y_bar) { + if (event.type == Expose) + XFillRectangle(DISP, y_bar, ruleGC, + 1, y_bgn, BAR_WID, y_end - y_bgn); + else if (event.type == MotionNotify) + scrollmane(mane.base_x, + event.xmotion.y * page_h / clip_h); + else switch (event.xbutton.button) + { + case 1: + scrollmane(mane.base_x, mane.base_y + event.xbutton.y); + break; + case 2: + scrollmane(mane.base_x, + event.xbutton.y * page_h / clip_h); + break; + case 3: + scrollmane(mane.base_x, mane.base_y - event.xbutton.y); + } + } + + else if (event.xany.window == top_level) + switch (event.type) { + case ConfigureNotify: + if (event.xany.window == top_level && + (event.xconfigure.width != window_w || + event.xconfigure.height != window_h)) { + Window old_mane_win = mane.win; + + window_w = event.xconfigure.width; + window_h = event.xconfigure.height; + reconfig(); + if (old_mane_win == (Window) 0) home(False); + } + break; + + case MapNotify: /* if running w/o WM */ + if (mane.win == (Window) 0) { + reconfig(); + home(False); + } + break; + + case KeyPress: + handle_key(&event); + break; + } + +#endif /* not TOOLKIT */ + + } +} + +static void +redraw(windowrec) + struct WindowRec *windowrec; +{ + + currwin = *windowrec; + min_x = currwin.min_x + currwin.base_x; + min_y = currwin.min_y + currwin.base_y; + max_x = currwin.max_x + currwin.base_x; + max_y = currwin.max_y + currwin.base_y; + can_exposures(windowrec); + + if (debug & DBG_EVENT) + Printf("Redraw %d x %d at (%d, %d) (base=%d,%d)\n", max_x - min_x, + max_y - min_y, min_x, min_y, currwin.base_x, currwin.base_y); + if (!busycurs) { + XDefineCursor(DISP, mane.win, redraw_cursor); + XFlush(DISP); + busycurs = True; + } + if (setjmp(dvi_env)) { + XClearWindow(DISP, mane.win); + showmessage(dvi_oops_msg); + if (dvi_file) { + Fclose(dvi_file); + dvi_file = NULL; + } + } + else { + draw_page(); + // fixme: kpse_pathname is sometimes corrupt when calling this function from here: + // src_warn_outdated(); + warn_spec_now = False; + } +} + +void +redraw_page() +{ + if (debug & DBG_EVENT) Fputs("Redraw page: ", stdout); + XClearWindow(DISP, mane.win); + if (backing_store != NotUseful) { + mane.min_x = mane.min_y = 0; + mane.max_x = page_w; + mane.max_y = page_h; + } + else { + get_xy(); + mane.min_x = -window_x; + mane.max_x = -window_x + clip_w; + mane.min_y = -window_y; + mane.max_y = -window_y + clip_h; + } + redraw(&mane); +} + +/* + * Interrupt system for receiving events. The program sets a flag + * whenever an event comes in, so that at the proper time (i.e., when + * reading a new dvi item), we can check incoming events to see if we + * still want to go on printing this page. This way, one can stop + * displaying a page if it is about to be erased anyway. We try to read + * as many events as possible before doing anything and base the next + * action on all events read. + * Note that the Xlib and Xt routines are not reentrant, so the most we + * can do is set a flag in the interrupt routine and check it later. + * Also, sometimes the interrupts are not generated (some systems only + * guarantee that SIGIO is generated for terminal files, and on the system + * I use, the interrupts are not generated if I use "(xdvi foo &)" instead + * of "xdvi foo"). Therefore, there is also a mechanism to check the + * event queue every 70 drawing operations or so. This mechanism is + * disabled if it turns out that the interrupts do work. + * For a fuller discussion of some of the above, see xlife in + * comp.sources.x. + */ + +static void +can_exposures(windowrec) + struct WindowRec *windowrec; +{ + windowrec->min_x = windowrec->min_y = MAXDIM; + windowrec->max_x = windowrec->max_y = 0; +} + +#ifndef FLAKY_SIGPOLL +/* ARGSUSED */ +static RETSIGTYPE +handle_sigpoll(signo) + int signo; +{ + event_counter = 1; + event_freq = -1; /* forget Plan B */ +#if !HAVE_SIGACTION + (void) signal(SIGPOLL, handle_sigpoll); /* reset the signal */ +#endif +} +#endif /* not FLAKY_SIGPOLL */ + +/* ARGSUSED */ +static RETSIGTYPE +handle_sigusr(signo) + int signo; +{ + event_counter = 1; + canit = True; + dvi_time = 0; +#if ! HAVE_SIGACTION + (void) signal(SIGUSR1, handle_sigusr); /* reset the signal */ +#endif +} + +/* ARGSUSED */ +static RETSIGTYPE +handle_sigterm(signo) + int signo; +{ + terminate_flag = True; +} + +static void +enable_intr() { +#ifndef FLAKY_SIGPOLL + int sock_fd = ConnectionNumber(DISP); +#endif +#if HAVE_SIGACTION + struct sigaction a; +#endif + +#ifndef FLAKY_SIGPOLL +#if HAVE_SIGACTION + /* Subprocess handling, e.g., mktexpk, fails on the Alpha without + this, because SIGPOLL interrupts the call of system(3), since OSF/1 + doesn't retry interrupted wait calls by default. From code by + maj@cl.cam.ac.uk. */ + a.sa_handler = handle_sigpoll; + (void) sigemptyset(&a.sa_mask); + (void) sigaddset(&a.sa_mask, SIGPOLL); + a.sa_flags = SA_RESTART; + sigaction(SIGPOLL, &a, NULL); +#else /* not HAVE_SIGACTION */ + (void) signal(SIGPOLL, handle_sigpoll); +#endif /* not HAVE_SIGACTION */ + +#if HAVE_STREAMS + if (isastream(sock_fd) > 0) { + if (ioctl(sock_fd, I_SETSIG, + S_RDNORM | S_RDBAND | S_HANGUP | S_WRNORM) == -1) + perror("ioctl I_SETSIG (xdvi)"); + } + else +#endif + { +#ifdef FASYNC + if (fcntl(sock_fd, F_SETOWN, getpid()) == -1) + perror("fcntl F_SETOWN (xdvi)"); + if (fcntl(sock_fd, F_SETFL, fcntl(sock_fd, F_GETFL, 0) | FASYNC) + == -1) + perror("fcntl F_SETFL (xdvi)"); +#elif defined(SIOCSPGRP) && defined(FIOASYNC) + /* For HP-UX B.10.10 and maybe others. See "man 7 socket". */ + int arg; + + arg = getpid(); + if (ioctl(sock_fd, SIOCSPGRP, &arg) == -1) + perror("ioctl SIOCSPGRP (xdvi)"); + arg = 1; + if (ioctl(sock_fd, FIOASYNC, &arg) == -1) + perror("ioctl FIOASYNC (xdvi)"); +#endif + } +#endif /* not FLAKY_SIGPOLL */ + +#if HAVE_SIGACTION + a.sa_handler = handle_sigusr; + (void) sigemptyset(&a.sa_mask); + (void) sigaddset(&a.sa_mask, SIGUSR1); + a.sa_flags = 0; + sigaction(SIGUSR1, &a, NULL); +#else /* not HAVE_SIGACTION */ + (void) signal(SIGUSR1, handle_sigusr); +#endif /* not HAVE_SIGACTION */ + +#if HAVE_SIGACTION + a.sa_handler = handle_sigterm; + (void) sigemptyset(&a.sa_mask); + (void) sigaddset(&a.sa_mask, SIGINT); + (void) sigaddset(&a.sa_mask, SIGQUIT); + (void) sigaddset(&a.sa_mask, SIGTERM); + a.sa_flags = 0; + sigaction(SIGINT, &a, NULL); + sigaction(SIGQUIT, &a, NULL); + sigaction(SIGTERM, &a, NULL); +#else /* not HAVE_SIGACTION */ + (void) signal(SIGINT, handle_sigterm); + (void) signal(SIGQUIT, handle_sigterm); + (void) signal(SIGTERM, handle_sigterm); +#endif /* not HAVE_SIGACTION */ + +#ifndef FLAKY_SIGPOLL + + (void) sigemptyset(&sigpollusrterm); + (void) sigaddset(&sigpollusrterm, SIGPOLL); + (void) sigaddset(&sigpollusrterm, SIGUSR1); + (void) sigaddset(&sigpollusrterm, SIGINT); + (void) sigaddset(&sigpollusrterm, SIGQUIT); + (void) sigaddset(&sigpollusrterm, SIGTERM); + +#endif + +#if HAVE_POLL + fds[0].fd = ConnectionNumber(DISP); +#else + FD_ZERO(&readfds); +#endif + +} + +void +do_pages() +{ + enable_intr(); + if (debug & DBG_BATCH) { +#ifdef TOOLKIT + while (mane.min_x == MAXDIM) read_events(True); +#else /* !TOOLKIT */ + while (mane.min_x == MAXDIM) + if (setjmp(canit_env)) break; + else read_events(True); +#endif /* TOOLKIT */ + for (current_page = 0; current_page < total_pages; ++current_page) { +#ifdef __convex__ + /* convex C turns off optimization for the entire function + if setjmp return value is discarded.*/ + if (setjmp(canit_env)) /*optimize me*/; +#else + (void) setjmp(canit_env); +#endif + canit = False; + redraw_page(); + } + } + else { /* normal operation */ +#ifdef __convex__ + /* convex C turns off optimization for the entire function + if setjmp return value is discarded.*/ + if (setjmp(canit_env)) /*optimize me*/; +#else + (void) setjmp(canit_env); +#endif + for (;;) { + read_events(True); + if (canit) { + canit = False; + can_exposures(&mane); + can_exposures(&alt); + redraw_page(); + } + else if (mag_moved) { + if (alt.win == (Window) 0) mag_moved = False; + else if (abs(new_mag_x - mag_x) > + 2 * abs(new_mag_y - mag_y)) + movemag(new_mag_x, mag_y); + else if (abs(new_mag_y - mag_y) > + 2 * abs(new_mag_x - mag_x)) + movemag(mag_x, new_mag_y); + else movemag(new_mag_x, new_mag_y); + } + else if (alt.min_x < MAXDIM) redraw(&alt); + else if (mane.min_x < MAXDIM) redraw(&mane); + XFlush(DISP); + } + } +} diff --git a/Build/source/texk/windvi/font-open.c b/Build/source/texk/windvi/font-open.c new file mode 100644 index 00000000000..3f22037575b --- /dev/null +++ b/Build/source/texk/windvi/font-open.c @@ -0,0 +1,118 @@ +/* + font_open.c: find font filenames. This bears no relation (but the + interface) to the original font_open.c. + +Copyright (c) 1999 The texk project + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL PAUL VOJTA OR ANYONE ELSE BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + */ + +#define WIN32_LEAN_AND_MEAN 1 +#include "xdvi-config.h" + +#include <kpathsea/c-fopen.h> +#include <kpathsea/tex-glyph.h> + + +/* We try for a VF first because that's what dvips does. Also, it's + easier to avoid running mktexpk if we have a VF this way. */ + +FILE * +#if T1 +font_open P7C(char *,font, char **,font_ret, double, dpi, int *,dpi_ret, + int, dummy, char **,filename_ret, int *,t1id) +#else +font_open P6C(char *,font, char **,font_ret, double, dpi, int *,dpi_ret, + int, dummy, char **,filename_ret, int *,t1id) + +#endif +{ + FILE *ret; + char *name; +#ifdef WIN32 + extern void UpdateStatusBar(LPSTR lpszStatusString, + WORD partNumber, WORD displayFlags); + char szBuf[80]; + + wsprintf(szBuf, "Finding font %s", font); + UpdateStatusBar(szBuf, 0, 0); +#endif + +#ifdef Omega + name = kpse_find_ovf (font); + if (!name) name = kpse_find_vf(font); +#else + name = kpse_find_vf (font); +#endif +#if TTF + *ttfid=-1 +#endif +#if T1 + *t1id=-1; +#endif + if (name) { + /* VF fonts don't have a resolution, but load_font will complain if + we don't return what it asked for. */ + *dpi_ret = dpi; + *font_ret = NULL; + } else { + kpse_glyph_file_type file_ret; + +#if TTF + /* First atempt to load it as TrueType font */ + + *dpi_ret = dpi; + *font_ret = NULL; + *filename_ret = NULL; + *ttfid=find_TTF_font(font); + if (*ttfid>=0) return NULL; +#endif +#if T1 + /* First atempt to load it as T1 font */ + + *dpi_ret = dpi; + *font_ret = NULL; + *filename_ret = NULL; + *t1id=find_T1_font(font); + if (*t1id>=0) return NULL; +#endif + + name = kpse_find_glyph (font, (unsigned) (dpi + .5), + kpse_any_glyph_format, &file_ret); + + if (name) { + /* If we got it normally, from an alias, or from mktexpk, + don't fill in FONT_RET. That tells load_font to complain. */ + *font_ret + = file_ret.source == kpse_glyph_source_fallback ? file_ret.name + : NULL; /* tell load_font we found something good */ + + *dpi_ret = file_ret.dpi; + } + /* If no VF and no PK, FONT_RET is irrelevant? */ + } + + /* If we found a name, return the stream. */ + ret = name ? xfopen_local (name, FOPEN_RBIN_MODE) : NULL; + *filename_ret = name; + + return ret; +} diff --git a/Build/source/texk/windvi/gf.c b/Build/source/texk/windvi/gf.c new file mode 100644 index 00000000000..42b96090d00 --- /dev/null +++ b/Build/source/texk/windvi/gf.c @@ -0,0 +1,329 @@ +/*========================================================================*\ + +Copyright (c) 1990-1999 Paul Vojta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +PAUL VOJTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +\*========================================================================*/ + +/* + * GF font reading routines. + * Public routines are read_GF_index and read_GF_char. + */ +#define HAVE_BOOLEAN +#include "xdvi-config.h" + +#define PAINT_0 0 +#define PAINT1 64 +#define PAINT2 65 +#define PAINT3 66 +#define BOC 67 +#define BOC1 68 +#define EOC 69 +#define SKIP0 70 +#define SKIP1 71 +#define SKIP2 72 +#define SKIP3 73 +#define NEW_ROW_0 74 +#define NEW_ROW_MAX 238 +#define XXX1 239 +#define XXX2 240 +#define XXX3 241 +#define XXX4 242 +#define YYY 243 +#define NO_OP 244 +#define CHAR_LOC 245 +#define CHAR_LOC0 246 +#define PRE 247 +#define POST 248 +#define POST_POST 249 + +#define GF_ID_BYTE 131 +#define TRAILER 223 /* Trailing bytes at end of file */ + +static FILE *GF_file; + +static void +expect(ch) + ubyte ch; +{ + ubyte ch1 = one(GF_file); + + if (ch1 != ch) + oops("Bad GF file: %d expected, %d received.", ch, ch1); +} + +static void +too_many_bits(ch) + ubyte ch; +{ + oops("Too many bits found when loading character %d", ch); +} + +/* + * Public routines + */ + + +static void +#if NeedFunctionPrototypes +read_GF_char(struct font *fontp, wide_ubyte ch) +#else /* !NeedFunctionPrototypes */ +read_GF_char(fontp, ch) + struct font *fontp; + ubyte ch; +#endif /* NeedFunctionPrototypes */ +{ + struct glyph *g; + ubyte cmnd; + int min_m, max_m, min_n, max_n; + BMUNIT *cp, *basep, *maxp; + int bytes_wide; + Boolean paint_switch; +#define White False +#define Black True + Boolean new_row; + int count; + int word_weight; + + g = &fontp->glyph[ch]; + GF_file = fontp->file; + + if(debug & DBG_PK) + Printf("Loading gf char %d", ch); + + for (;;) { + switch (cmnd = one(GF_file)) { + case XXX1: + case XXX2: + case XXX3: + case XXX4: + Fseek(GF_file, (long) num(GF_file, + WIDENINT cmnd - XXX1 + 1), 1); + continue; + case YYY: + (void) four(GF_file); + continue; + case BOC: + (void) four(GF_file); /* skip character code */ + (void) four(GF_file); /* skip pointer to prev char */ + min_m = sfour(GF_file); + max_m = sfour(GF_file); + g->x = -min_m; + min_n = sfour(GF_file); + g->y = max_n = sfour(GF_file); + g->bitmap.w = max_m - min_m + 1; + g->bitmap.h = max_n - min_n + 1; + break; + case BOC1: + (void) one(GF_file); /* skip character code */ + g->bitmap.w = one(GF_file); /* max_m - min_m */ + g->x = g->bitmap.w - one(GF_file); /* ditto - max_m */ + ++g->bitmap.w; + g->bitmap.h = one(GF_file) + 1; + g->y = one(GF_file); + break; + default: + oops("Bad BOC code: %d", cmnd); + } + break; + } + paint_switch = White; + + if (debug & DBG_PK) + Printf(", size=%dx%d, dvi_adv=%ld\n", g->bitmap.w, g->bitmap.h, + g->dvi_adv); + + alloc_bitmap(&g->bitmap); + cp = basep = (BMUNIT *) g->bitmap.bits; +/* + * Read character data into *basep + */ + bytes_wide = ROUNDUP((int) g->bitmap.w, BMBITS) * BMBYTES; + maxp = ADD(basep, g->bitmap.h * bytes_wide); + bzero(g->bitmap.bits, g->bitmap.h * bytes_wide); + new_row = False; + word_weight = BMBITS; + for (;;) { + count = -1; + cmnd = one(GF_file); + if (cmnd < 64) count = cmnd; + else if (cmnd >= NEW_ROW_0 && cmnd <= NEW_ROW_MAX) { + count = cmnd - NEW_ROW_0; + paint_switch = White; /* it'll be complemented later */ + new_row = True; + } + else switch (cmnd) { + case PAINT1: + case PAINT2: + case PAINT3: + count = num(GF_file, WIDENINT cmnd - PAINT1 + 1); + break; + case EOC: + if (cp >= ADD(basep, bytes_wide)) too_many_bits(ch); + return; + case SKIP1: + case SKIP2: + case SKIP3: + *((char **) &basep) += + num(GF_file, WIDENINT cmnd - SKIP0) * bytes_wide; + case SKIP0: + new_row = True; + paint_switch = White; + break; + case XXX1: + case XXX2: + case XXX3: + case XXX4: + Fseek(GF_file, (long) num(GF_file, + WIDENINT cmnd - XXX1 + 1), 1); + break; + case YYY: + (void) four(GF_file); + break; + case NO_OP: + break; + default: + oops("Bad command in GF file: %d", cmnd); + } /* end switch */ + if (new_row) { + *((char **) &basep) += bytes_wide; + if (basep >= maxp || cp >= basep) too_many_bits(ch); + cp = basep; + word_weight = BMBITS; + new_row = False; + } + if (count >= 0) { + while (count) + if (count <= word_weight) { +#ifndef WORDS_BIGENDIAN + if (paint_switch) + *cp |= bit_masks[count] << (BMBITS - word_weight); +#endif + word_weight -= count; +#ifdef WORDS_BIGENDIAN + if (paint_switch) + *cp |= bit_masks[count] << word_weight; +#endif + break; + } + else { + if (paint_switch) +#ifndef WORDS_BIGENDIAN + *cp |= bit_masks[word_weight] << + (BMBITS - word_weight); +#else + *cp |= bit_masks[word_weight]; +#endif + cp++; + count -= word_weight; + word_weight = BMBITS; + } + paint_switch = 1 - paint_switch; + } + } /* end for */ + g->bitmap.endian_permuted = 0; +} + + +void +read_GF_index(fontp, hushcs) + struct font *fontp; + wide_bool hushcs; +{ + int hppp, vppp; + ubyte ch, cmnd; + struct glyph *g; + long checksum; + + fontp->read_char = read_GF_char; + GF_file = fontp->file; + if (debug & DBG_PK) + Printf("Reading GF pixel file %s\n", fontp->filename); +/* + * Find postamble. + */ + Fseek(GF_file, (long) -4, 2); + while (four(GF_file) != ((unsigned long) TRAILER << 24 | TRAILER << 16 + | TRAILER << 8 | TRAILER)) + Fseek(GF_file, (long) -5, 1); + Fseek(GF_file, (long) -5, 1); + for (;;) { + ch = one(GF_file); + if (ch != TRAILER) break; + Fseek(GF_file, (long) -2, 1); + } + if (ch != GF_ID_BYTE) oops("Bad end of font file %s", fontp->fontname); + Fseek(GF_file, (long) -6, 1); + expect(POST_POST); + Fseek(GF_file, sfour(GF_file), 0); /* move to postamble */ +/* + * Read postamble. + */ + expect(POST); + (void) four(GF_file); /* pointer to last eoc + 1 */ + (void) four(GF_file); /* skip design size */ + checksum = four(GF_file); + if (checksum != fontp->checksum && checksum != 0 && fontp->checksum != 0 + && !hushcs) + Fprintf(stderr, + "Checksum mismatch (dvi = %lu, gf = %lu) in font file %s\n", + fontp->checksum, checksum, fontp->filename); + hppp = sfour(GF_file); + vppp = sfour(GF_file); + if (hppp != vppp && (debug & DBG_PK)) + Printf("Font has non-square aspect ratio %d:%d\n", vppp, hppp); + (void) four(GF_file); /* skip min_m */ + (void) four(GF_file); /* skip max_m */ + (void) four(GF_file); /* skip min_n */ + (void) four(GF_file); /* skip max_n */ +/* + * Prepare glyph array. + */ + fontp->glyph = xmalloc(256 * sizeof(struct glyph)); + bzero((char *) fontp->glyph, 256 * sizeof(struct glyph)); +/* + * Read glyph directory. + */ + while ((cmnd = one(GF_file)) != POST_POST) { + int addr; + + ch = one(GF_file); /* character code */ + g = &fontp->glyph[ch]; + switch (cmnd) { + case CHAR_LOC: + /* g->pxl_adv = sfour(GF_file); */ + (void) four(GF_file); + (void) four(GF_file); /* skip dy */ + break; + case CHAR_LOC0: + /* g->pxl_adv = one(GF_file) << 16; */ + (void) one(GF_file); + break; + default: + oops("Non-char_loc command found in GF preamble: %d", + cmnd); + } + g->dvi_adv = fontp->dimconv * sfour(GF_file); + addr = four(GF_file); + if (addr != -1) g->addr = addr; + if (debug & DBG_PK) + Printf("Read GF glyph for character %d; dy = %ld, addr = %x\n", + ch, g->dvi_adv, addr); + } +} diff --git a/Build/source/texk/windvi/hypertex.c b/Build/source/texk/windvi/hypertex.c new file mode 100644 index 00000000000..21128837307 --- /dev/null +++ b/Build/source/texk/windvi/hypertex.c @@ -0,0 +1,1349 @@ +/* + * Hypertex modifications to DVI previewer for X. + * This portion of xhdvi is completely in the public domain. The + * author renounces any copyright claims. It may be freely used for + * commercial or non-commercial purposes. The author makes no claims + * or guarantees - use this at your own risk. + * + * Arthur Smith, U. of Washington, 1994 + * + * 5/1994 code written from scratch, probably inspired by (but + * incompatible with) the CERN WWW library. + * 3/1995 CERN WWW library called to do document fetching. + * + * + * Note: several coordinate systems are in use in this code. Note + * that the relation between a screen pixel and a dvi coordinate is + * the current shrink factor times 2^16. + * + * When multiple pages are allowed in one drawing area, the variables + * xscroll_pages or yscroll_pages are set. + * + * Conversion between coordinates is done using the screen_to_page, + * page_to_screen, screen_to_abs, abs_to_screen routines. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL PAUL VOJTA OR ANYONE ELSE BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ + +#define HAVE_BOOLEAN +#include "xdvi-config.h" +#if defined(XHDVI) || defined(HTEX) +#include <kpathsea/c-pathch.h> +#include <kpathsea/c-ctype.h> +#include <kpathsea/c-fopen.h> +#include <kpathsea/c-stat.h> +#define GETCWD(str,size) xgetcwd() +#ifndef WIN32 +#include <X11/Shell.h> /* needed for def of XtNtitle */ +#include <X11/StringDefs.h> +#endif + +#ifdef WIN32 +#include <shellapi.h> +#include "winhtex.h" +#else +#include "wwwconf.h" +#include "WWWLib.h" +#include "WWWInit.h" +#include "WWWCache.h" + +#if 0 /* seems unnecessary?! */ +#ifdef HAVE_NETDB_H +#include <netdb.h> /* for struct hostent */ +#endif +#endif /* seems unnecessary?! */ +#endif /* !WIN32 */ + +/* Implementation of HyperTeX through \specials */ +/* One option: allow HTML tags and recognize them */ +/* applicationDoSpecial strips leading blanks, so first char should + be '<' if it's a tag */ + +char *MyStrAllocCopy(); +char *refscan(); +extern void put_rule(); +extern void make_absolute (); +extern int invokeviewer (); + +static void extractbase (); +static void retitle (); + +int this_is_a_href=0; + +#define HTeX_A_NAME 1 +#define HTeX_A_HREF 2 + +#define htex_shrinkfactor mane.shrinkfactor /* Only main win has refs */ + +typedef struct { + int type; /* Type of anchor: URL, etc from WWW anchor list */ + char *name; /* Name string for anchor (Null by default) */ + char *href; /* A reference from this anchor */ + int llx, lly, urx, ury; /* Box on page where anchor located */ +} HTeX_Anchor; + +/* Structure to remember where we have been: */ +typedef struct { + char *refname; /* File name (or href?) */ + int pageno; /* Which page anchor was on */ + int x,y; /* Approximate location on page... */ + int which; /* Number of anchor on this page */ + int type; /* And the other properties of this anchor */ + char *name; + char *href; +} Anchors; + +int waiting_for_anchor = -1; /* If waiting for anchor to be properly parsed? */ +int cur_anchor_on_page; /* Keep track of current page as it's read in */ + +#define HTeX_AnchorSTEP 20 +HTeX_Anchor **HTeX_anchorlist = NULL; +int *nHTeX_anchors, *maxHTeX_anchors; + +Anchors *HTeX_visited = NULL; +int nHTeX_visited = 0, maxHTeX_visited = 0; + +#define HTeX_NSTACK 32 +int HTeXAnest[HTeX_NSTACK]; /* Maximum number of nested anchors */ +int HTeXAnestlevel; /* Current nesting level */ + +int HTeXreflevel; /* 0 if not currently inside an href anchor */ + +int *htex_parsedpages = NULL; /* List of all pages, = 1 if already parsed, zero if not */ +int htex_total_pages; +/* size = total_pages, current page = current_page defined in xhdvi.h */ + +void htex_parseanchor ARGS((char *, HTeX_Anchor *)); +char *MyStrAllocCopy ARGS((char **, char *)); +char *refscan ARGS(( char*, char **, char **)); +void htex_loc_on_page ARGS((Anchors *)); +void freeHTeXAnchors ARGS((HTeX_Anchor *, int)); +void htex_img ARGS((int, char *, int)); +void htex_base ARGS((int, char *, int)); + +#define BEGIN 0 +#define END 1 + +/* Dave Oliver's hypertex format: */ +/* Only understand my version of anchors so far */ +/* ie.: his TYPE=text for hrefs, frag for names */ +void +hy_handletag(cp, pageno) + char *cp; + int pageno; +{ + int beginend=BEGIN; + + while (isspace(*cp)) cp++; + if (!strncasecmp(cp, "END", 3)) { + beginend = END; + cp += 3; + } +/* Leave the parsing to htex_anchor! */ + htex_anchor(beginend, cp, pageno); +} + +int +checkHyperTeX(cp, pageno) +char *cp; +int pageno; +{ + int htexfound = 0; + + if (strncasecmp(cp, "html:", 5) == 0) { + cp += 5; + while (isspace(*cp)) cp++; + htexfound = 1; + } + if (*cp == '<') { /* Possibly Missing the header part */ + htexfound = 1; + htex_handletag(cp, pageno); + } else if (strncasecmp(cp, "hyp", 3) == 0) { + /* Dave Oliver's HyperTeX */ + htexfound = 1; + cp += 4; + hy_handletag(cp, pageno); + } + + return htexfound; +} + +void +htex_handletag(cp, pageno) +char *cp; +int pageno; +{ + int beginend=BEGIN; + + if (*cp != '<') return; + ++cp; + while (isspace(*cp)) cp++; + if (*cp == '/') { + beginend = END; + cp++; + } + switch(*cp) { + case 'A': + case 'a': /* Anchors */ + htex_anchor(beginend, cp+1, pageno); + break; + case 'b': /* Base name? */ + htex_base(beginend, cp, pageno); + break; + case 'i': /* Included images? */ + htex_img(beginend, cp, pageno); + break; + default: /* Tag not implemented yet */ + break; + } +} + +/* Basically just want to parse the line... */ +/* Should use WWW library stuff ? */ + +void +htex_anchor(beginend, cp, pageno) +int beginend, pageno; +char *cp; +{ + int *nap, *maxp; + int oldllx, oldlly, oldurx, oldury; + HTeX_Anchor *HTeXAp, **HTeXApp; + + HTeXApp = HTeX_anchorlist + pageno; + nap = nHTeX_anchors + pageno; + maxp = maxHTeX_anchors + pageno; + if (*HTeXApp == NULL) { + *maxp = HTeX_AnchorSTEP; + *HTeXApp = xmalloc((*maxp)*sizeof(HTeX_Anchor)); + } else if (*nap == *maxp) { + *maxp += HTeX_AnchorSTEP; + *HTeXApp = (HTeX_Anchor *) realloc(*HTeXApp, + (*maxp)*sizeof(HTeX_Anchor)); + } + if (htex_parsedpages[pageno] != 1) { /* Only do if page not done yet */ + if (beginend == END) { + HTeXAnestlevel--; + if (HTeXAnestlevel < 0) { + HTeXAnestlevel = 0; /* Extra </a>'s? */ + } else { + HTeXAp = *HTeXApp + HTeXAnest[HTeXAnestlevel]; + if (HTeXAp->llx > DVI_H) { + HTeXAp->llx = DVI_H; + } + if (HTeXAp->urx < DVI_H) { + HTeXAp->urx = DVI_H; + } + if (HTeXAp->lly > DVI_V) { + HTeXAp->lly = DVI_V; + } + if (HTeXAp->ury < DVI_V) { + HTeXAp->ury = DVI_V; + } + oldllx = HTeXAp->llx; + oldlly = HTeXAp->lly; + oldurx = HTeXAp->urx; + oldury = HTeXAp->ury; + if (debug & DBG_ANCHOR) { + Printf("Added anchor %d, level %d:\n", + HTeXAnest[HTeXAnestlevel], HTeXAnestlevel); + if (HTeXAp->type&HTeX_A_HREF) { + Printf("href = %s\n", HTeXAp->href); + } + if (HTeXAp->type&HTeX_A_NAME) { + Printf("name = %s\n", HTeXAp->name); + } + Printf("box %d %d %d %d\n", + HTeXAp->llx, HTeXAp->lly, HTeXAp->urx, HTeXAp->ury); + } + if (waiting_for_anchor == HTeXAnest[HTeXAnestlevel]) { + htex_to_anchor(current_page, waiting_for_anchor); + waiting_for_anchor = -1; /* Reset it! */ + } + /* End of debug section */ + if (HTeXAnestlevel > 0) { + HTeXAp = *HTeXApp + HTeXAnest[HTeXAnestlevel-1]; + /* Check llx, lly, urx, ury info */ + if (oldllx < HTeXAp->llx) { + HTeXAp->llx = oldllx; + } + if (oldlly < HTeXAp->lly) { + HTeXAp->lly = oldlly; + } + if (oldurx > HTeXAp->urx) { + HTeXAp->urx = oldurx; + } + if (oldury > HTeXAp->ury) { + HTeXAp->ury = oldury; + } + } + } + } else { + HTeXAp = *HTeXApp + *nap; + /* Set type, and the name, href */ + htex_parseanchor(cp, HTeXAp); + if (HTeXAp->type != 0) { + cur_anchor_on_page++; /* Increment the count of anchors here */ + if (htex_parsedpages[pageno] == 2) { + /* Go to this anchor in list we already have: */ + HTeXAp = *HTeXApp + cur_anchor_on_page; + HTeXAp->urx = HTeXAp->llx = DVI_H; /* Current horiz pos.*/ + HTeXAp->ury = HTeXAp->lly = DVI_V; /* Current vert. pos. */ + if (HTeXAnestlevel >= HTeX_NSTACK) { + /* Error - too many nested anchors! */ + } else { + HTeXAnest[HTeXAnestlevel++] = cur_anchor_on_page; + } + } else if (htex_parsedpages[pageno] != 1) { /* Only do if page not done yet */ + HTeXAp->urx = HTeXAp->llx = DVI_H; /* Current horiz pos.*/ + HTeXAp->ury = HTeXAp->lly = DVI_V; /* Current vert. pos. */ + if (HTeXAnestlevel >= HTeX_NSTACK) { + /* Error - too many nested anchors! */ + } else { + HTeXAnest[HTeXAnestlevel++] = *nap; + } + (*nap)++; + } + } + } + } else { /* if page has been properly parsed before */ + if (beginend != END) { + HTeXAp = *HTeXApp + *nap; + /* Set type, and the name, href */ + htex_parseanchor(cp, HTeXAp); + } + } + if (beginend == END) { + if (HTeXreflevel > 0) HTeXreflevel--; + } else { + if (HTeXAp->type&HTeX_A_HREF) HTeXreflevel++; + } +} + +void +htex_initpage() /* Starting a new page */ +{ + if (htex_parsedpages == NULL) htex_reinit(); + HTeXAnestlevel = 0; /* Start with zero nesting level for a page */ + HTeXreflevel = 0; + HTeXnext_extern = 0; /* Go to links in current window */ + cur_anchor_on_page = -1; + paint_anchor(NULL); +} + +/* A character or something was written: record position for current anchor */ +void +htex_recordbits(x, y, w, h) /* x,y are pixel positions on current page */ +int x, y, w, h; +{ + HTeX_Anchor *HTeXAp; + int dvix, dviy, dvix2, dviy2; + int ch = 0; + + dvix = x *(htex_shrinkfactor << 16); + dviy = y*(htex_shrinkfactor << 16); + dvix2 = (x+w)*(htex_shrinkfactor << 16); + dviy2 = (y+h)*(htex_shrinkfactor << 16); + HTeXAp = HTeX_anchorlist[current_page] + HTeXAnest[HTeXAnestlevel-1]; + if (HTeXAp->llx > dvix) { + HTeXAp->llx = dvix; + ch++; + } + if (HTeXAp->lly > dviy) { + HTeXAp->lly = dviy; + ch++; + } + if (HTeXAp->urx < dvix2) { + HTeXAp->urx = dvix2; + ch++; + } + if (HTeXAp->ury > dviy2) { + HTeXAp->ury = dviy2; + ch++; + } + if (debug & DBG_ANCHOR) { + if (ch > 0) { + Printf("New box for anchor %d, level %d: %d %d %d %d\n", + HTeXAnest[HTeXAnestlevel-1], HTeXAnestlevel, + HTeXAp->llx, HTeXAp->lly, HTeXAp->urx, HTeXAp->ury); + } + } +} + +void +htex_donepage(i, pflag) /* This page has been completed */ +int i, pflag; +{ + HTeX_Anchor *HTeXAp; + + /* Finish off boxes for nested anchors not done on this page */ + while (HTeXAnestlevel > 0) { + HTeXAnestlevel--; + HTeXAp = HTeX_anchorlist[i] + HTeXAnest[HTeXAnestlevel]; + if (HTeXAp->llx > DVI_H) { + HTeXAp->llx = DVI_H; + } + if (HTeXAp->urx < DVI_H) { + HTeXAp->urx = DVI_H; + } + if (HTeXAp->lly > DVI_V) { + HTeXAp->lly = DVI_V; + } + if (HTeXAp->ury < DVI_V) { + HTeXAp->ury = DVI_V; + } + } + if (pflag == 1) { /* Really parsed this page */ + htex_drawboxes(); /* Draw boxes around the anchor positions */ + htex_parsedpages[i] = 1; + } else { + htex_parsedpages[i] = 2; /* Means htex_parsed, not done properly */ + } +} + +/* If the dvi file has changed, assume all links have changed also, + and reset everything! */ +void +htex_reinit() +{ + int i; + + if (htex_parsedpages == NULL) { /* First call to this routine */ + htex_parsedpages = xmalloc(total_pages*sizeof(int)); + HTeX_anchorlist = xmalloc(total_pages*sizeof(HTeX_Anchor *)); + nHTeX_anchors = xmalloc(total_pages* sizeof(int)); + maxHTeX_anchors = xmalloc(total_pages* sizeof(int)); + for (i=0; i < total_pages; i++) maxHTeX_anchors[i] = 0; + } else if (htex_total_pages != total_pages) { + htex_parsedpages = (int *) realloc(htex_parsedpages, + total_pages*sizeof(int)); + /* Following operates if new has fewer pages than old: */ + for (i=total_pages; i < htex_total_pages; i++) { + if (maxHTeX_anchors[i] > 0) + freeHTeXAnchors(HTeX_anchorlist[i], nHTeX_anchors[i]); + } + HTeX_anchorlist = (HTeX_Anchor **) realloc(HTeX_anchorlist, + total_pages*sizeof(HTeX_Anchor *)); + nHTeX_anchors = (int *) realloc(nHTeX_anchors, + total_pages* sizeof(int)); + maxHTeX_anchors = (int *) realloc(maxHTeX_anchors, + total_pages* sizeof(int)); + /* Following operates if new has more pages than old: */ + for (i= htex_total_pages; i < total_pages; i++) + maxHTeX_anchors[i] = 0; + } + htex_total_pages = total_pages; + for (i=0; i < total_pages; i++) { + htex_parsedpages[i] = 0; + if (maxHTeX_anchors[i] > 0) { /* Get rid of the old anchor lists: */ + freeHTeXAnchors(HTeX_anchorlist[i], nHTeX_anchors[i]); + free(HTeX_anchorlist[i]); + } + HTeX_anchorlist[i] = NULL; + nHTeX_anchors[i] = 0; + maxHTeX_anchors[i] = 0; + } +} + +/* Following parses the stuff after the '<' in the html tag */ +/* Only understands name and href in anchor */ +/* html: <A HREF="..." NAME="..."> */ +/* html: <A NAME="..." HREF="...> */ +void +htex_parseanchor(cp, anchor) +char *cp; +HTeX_Anchor *anchor; +{ + char *ref, *str; + + anchor->type = 0; + anchor->href = NULL; + anchor->name = NULL; + while (isspace(*cp)) cp++; + while ((*cp) && (*cp != '>')) { + cp = refscan(cp, &ref, &str); + if (cp == NULL) break; + if (strcasecmp(ref, "href") == 0) { + anchor->type |= HTeX_A_HREF; + MyStrAllocCopy(&(anchor->href), str); + } else if (strcasecmp(ref, "name") == 0) { + anchor->type |= HTeX_A_NAME; + MyStrAllocCopy(&(anchor->name), str); + } + } +} + +char *MyStrAllocCopy(dest, src) +char **dest, *src; +{ + if (*dest) free(*dest); + if (! src) + *dest = NULL; + else { + *dest = xmalloc(strlen(src) + 1); + strcpy(*dest, src); + } + return *dest; +} + +/* Parses cp containing 'ref="string"more', returning pointer to "more" */ +char *refscan(name, ref, str) +char *name, **ref, **str; +{ + char *cp; + + *str = name; + for (cp=name; *cp; cp++) { + if (*cp == '=') { + *cp = 0; + *ref = name; + *str = cp+1; + break; + } + } + cp = *str; + if (cp != name) { + while (isspace(*cp)) cp++; + if (*cp == '"') { /* Yes, this really is a string being set */ + *str = cp+1; + while ((cp = strchr(cp+1, '"')) != NULL) { + if (cp[-1] != '\\') break; /* Check if quote escaped */ + } + if (cp != NULL) { + *cp = 0; + cp++; + } + } else { + cp = NULL; + } + } else { + cp = NULL; + } + return cp; +} + +/* What happens when mouse moves on screen: */ +void +htex_displayanchor(page, x, y) +int page, x, y; /* x,y coordinates of mouse position */ +{ + char astr[256]; + char namestr[256]; + char hrefstr[256]; + HTeX_Anchor *HTeXAp; + long dvix, dviy; + int i; + +/* Don't display until we've finished with the page: */ + if (htex_parsedpages == NULL) return; +/* Locate current page if we're scrolling them: */ + current_page = page; + if (htex_parsedpages[current_page] != 1) return; + dvix = x *(htex_shrinkfactor << 16); + dviy = y *(htex_shrinkfactor << 16); + /* Find anchor that fits current position: */ + HTeXAp = HTeX_anchorlist[current_page] + nHTeX_anchors[current_page] - 1; + for (i=nHTeX_anchors[current_page] - 1; i >= 0; i--, HTeXAp--) { + if (HTeXAp->llx > dvix) continue; + if (HTeXAp->lly > dviy) continue; + if (HTeXAp->urx < dvix) continue; + if (HTeXAp->ury < dviy) continue; + if (debug & DBG_ANCHOR) { + Printf("In anchor #%d\n", i); + } + if (HTeXAp->type & HTeX_A_NAME) { + sprintf(namestr, "name = %s ", HTeXAp->name); + } else { + *namestr= 0; + } + if (HTeXAp->type & HTeX_A_HREF) { + sprintf(hrefstr, "href = %s ", HTeXAp->href); + } else { + *hrefstr = 0; + } + sprintf(astr, "anchor #%d: %s%s", i, namestr, hrefstr); + paint_anchor(astr); + break; + } + if (i == -1) paint_anchor(NULL); +} + +/* What happens when mouse is clicked: */ +int +htex_handleref(page, x, y) + int page, x, y; /* current mouse location when ref clicked */ +{ + HTeX_Anchor *HTeXAp; + long dvix, dviy; + int i, afound; + +/* Check that we've finished at least one page first! */ + if (htex_parsedpages == NULL) return 0; +/* Locate current page if we're scrolling them: */ + current_page = page; + if (htex_parsedpages[current_page] != 1) return 0; + dvix = x *(htex_shrinkfactor << 16); + dviy = y *(htex_shrinkfactor << 16); + /* Find anchor that fits current position: */ + HTeXAp = HTeX_anchorlist[current_page] + nHTeX_anchors[current_page] - 1; + afound = -1; +#if 0 + fprintf(stderr, "click @ (%d, %d)\n", x, y); +#endif + for (i=nHTeX_anchors[current_page]-1; i >= 0; i--, HTeXAp--) { + if ((HTeXAp->type&HTeX_A_HREF) == 0) continue; /* Only ref on hrefs */ +#if 0 + fprintf(stderr, "Href @ (%d, %d) -- (%d, %d)\n", + (int)(HTeXAp->llx / (htex_shrinkfactor << 16)), + (int)(HTeXAp->lly / (htex_shrinkfactor << 16)), + (int)(HTeXAp->urx / (htex_shrinkfactor << 16)), + (int)(HTeXAp->ury / (htex_shrinkfactor << 16))); +#endif + if (HTeXAp->llx > dvix) continue; + if (HTeXAp->lly > dviy) continue; + if (HTeXAp->urx < dvix) continue; + if (HTeXAp->ury < dviy) continue; + afound = i; /* Get the last of them in case of nesting */ + break; + } + if (afound == -1) return 0; /* There was no href at this location */ +/* Then just do it: */ + this_is_a_href=1; + htex_dohref(HTeXAp->href); + this_is_a_href=0; + return 1; +} + +void +htex_dohref(href) + char *href; +{ + int i; + +/* Update the list of where we used to be: */ + if (HTeX_visited == NULL) { + maxHTeX_visited = HTeX_AnchorSTEP; + HTeX_visited = xmalloc(maxHTeX_visited*sizeof(Anchors)); + for (i=0; i < maxHTeX_visited; i++) { + HTeX_visited[i].refname = NULL; + HTeX_visited[i].name = NULL; + HTeX_visited[i].href = NULL; + } + } else if (nHTeX_visited >= maxHTeX_visited - 1) { + maxHTeX_visited += HTeX_AnchorSTEP; + HTeX_visited = (Anchors *) realloc(HTeX_visited, + maxHTeX_visited*sizeof(Anchors)); + for (i=nHTeX_visited; i < maxHTeX_visited; i++) { + HTeX_visited[i].refname = NULL; + HTeX_visited[i].name = NULL; + HTeX_visited[i].href = NULL; + } + } + MyStrAllocCopy(&(HTeX_visited[nHTeX_visited].refname), dvi_name); + HTeX_visited[nHTeX_visited].pageno = current_page; +#ifdef HTEX + HTeX_visited[nHTeX_visited].x = mane.base_x; + HTeX_visited[nHTeX_visited].y = mane.base_y; +#else + HTeX_visited[nHTeX_visited].x = mane.base_ax; + HTeX_visited[nHTeX_visited].y = mane.base_ay; +#endif + HTeX_visited[nHTeX_visited].type = HTeX_A_HREF; + HTeX_visited[nHTeX_visited].which = 0; + MyStrAllocCopy(&(HTeX_visited[nHTeX_visited].href), href); + nHTeX_visited++; + if (htex_is_url(href)) htex_do_url(href); + else htex_do_loc(href); + /* Need to handle properly when ref doesn't exist! */ +} + +/* Draw boxes around the anchor positions */ +void htex_drawboxes() +{ + HTeX_Anchor *HTeXAp; + int i; + int x, y, w, h; + + if (!underline_link) return; + HTeXAp = HTeX_anchorlist[current_page]; + for (i=0; i < nHTeX_anchors[current_page]; i++, HTeXAp++) { + if ((HTeXAp->type&HTeX_A_HREF) == 0) continue; /* Only box hrefs */ + x = pixel_conv(HTeXAp->llx)-1; + y = pixel_conv(HTeXAp->lly)-1; + w = pixel_conv(HTeXAp->urx) - x+2; + h = pixel_conv(HTeXAp->ury) - y+2; +/* The last arg of put_rule is whether or not to + use the "highlight" graphics context. */ +#ifdef HTEX + highlight = True; + put_rule(x+1, y+h, w, 1); + highlight = False; +#else +/* put_rule(x, y, w, 1, True); + put_rule(x+w, y, 1, h, True); */ + put_rule(x+1, y+h, w, 1, True); +/* put_rule(x, y+1, 1, h, True); */ +#endif + } +} +#ifdef WIN32 +RECT WinRect; +extern HWND hWndMain; +#else +static Arg arg_wh[] = { + {XtNwidth, (XtArgVal) &window_w}, + {XtNheight, (XtArgVal) &window_h}, +}; +#endif +static void +invokedviviewer(filename, aname, height) + char *filename; + char *aname; + int height; +{ + char buf[1024]; + + if (filename == NULL) return; +#if 0 + /* Ignore the given height -- some calls use unreasonable values. */ + if (height < 50) height = 50; + height += 50; +#endif + +#ifdef WIN32 + GetWindowRect(hWndMain, &WinRect); + window_w = WinRect.right - WinRect.left; + window_h = WinRect.bottom - WinRect.top; +#else + XtGetValues(draw_widget, arg_wh, XtNumber(arg_wh)); +#endif + if (aname == NULL) { + sprintf(buf, "%s %s -geometry %dx%d", program_invocation_name, + filename, + window_w, window_h); /* Same width and height */ + } else { + sprintf(buf, "%s %s#%s -geometry %dx%d", program_invocation_name, + filename, aname, + window_w, window_h); /* Same width and height */ + } +#ifndef WIN32 + strcat(buf, " &"); +#endif + if (debug & DBG_HYPER) { + fprintf(stderr, "Executing: %s\n", buf); + } + system(buf); +} + +/* It's a local reference - find the anchor and go to it */ +void +htex_do_loc(href) +char *href; +{ + int ipage, ia, reffound; + HTeX_Anchor *HTeXAp, **HTeXApp; + char astr[256]; + char *cp; + + if (href == NULL) return; /* shouldn't happen? */ + if (debug & DBG_HYPER) { + fprintf(stderr,"htex_do_url(%s)\n", href); + } + cp = href; + while (*cp == '#') cp++; + HTeXApp = HTeX_anchorlist; + reffound = 0; + /* Should hash based on "name" value? - to speed this up! */ + for (ipage = 0; ipage < total_pages; ipage++, HTeXApp++) { + if (htex_parsedpages[ipage] == 0) continue; + HTeXAp = *HTeXApp; + for (ia=0; ia < nHTeX_anchors[ipage]; ia++, HTeXAp++) { + if ((HTeXAp->type&HTeX_A_NAME) == 0) continue; + if (!strcmp(HTeXAp->name, cp)) { + reffound = 1; + break; + } + } + if (reffound) break; + } + if (reffound == 0) { /* Need to parse remaining pages */ + if (debug & DBG_ANCHOR) { + Printf("Searching for remaining anchors\n"); + } + htex_parsepages(); + /* And try again: */ + HTeXApp = HTeX_anchorlist; + for (ipage = 0; ipage < total_pages; ipage++, HTeXApp++) { + if (htex_parsedpages[ipage] < 2) continue; + HTeXAp = *HTeXApp; + for (ia=0; ia < nHTeX_anchors[ipage]; ia++, HTeXAp++) { + if ((HTeXAp->type&HTeX_A_NAME) == 0) continue; + if (!strcmp(HTeXAp->name, cp)) { + reffound = 1; + break; + } + } + if (reffound) break; + } + } + if (reffound) { + if (HTeXnext_extern == 1) { + invokedviviewer(dvi_name, cp, + pixel_conv(HTeXAp->ury) - pixel_conv(HTeXAp->lly)); + } else { + htex_to_anchor(ipage, ia); /* move to anchor */ + } + } else { + if ((nHTeX_visited == 0) || + (!strcmp(HTeX_visited[nHTeX_visited-1].refname, dvi_name))) { + /* Really was from same file - just print error message */ + sprintf(astr, "Error: reference \"%s\" not found\n", cp); + paint_anchor(astr); + } else { + /* Go to page 1 and print error message */ + sprintf(astr, "Error: reference \"%s\" in file %s not found\n", + cp, dvi_name); + htex_to_page(0); /* Go to first page! */ + paint_anchor(astr); + } + } +} + +void +htex_can_it() +{ +#ifdef WIN32 + redraw_page(); +#else + canit = True; + XFlush(DISP); +#endif +} + +void +htex_to_page(pageno) + int pageno; +{ + /* taken from keystroke subroutine: */ + current_page = pageno; + htex_can_it(); +} + +void +htex_to_anchor(pageno, n) + int pageno, n; +{ + int xp, yp; + HTeX_Anchor *HTeXAp = HTeX_anchorlist[pageno] + n; + + if ((n < 0) || (n >= nHTeX_anchors[pageno])) return; /* Error message for this? */ + if (pageno != current_page) { + if (htex_parsedpages[pageno] != 1) waiting_for_anchor = n; + /* taken from keystroke subroutine: */ + current_page = pageno; + htex_can_it(); + } + xp = (HTeXAp->llx + HTeXAp->urx)/(2*htex_shrinkfactor << 16); + yp = (HTeXAp->lly + HTeXAp->ury)/(2*htex_shrinkfactor << 16); + if (debug & DBG_ANCHOR) { + Printf("Moving to pixel %d %d\n", xp, yp); + } +#ifndef HTEX + if (htex_parsedpages[pageno] > 0) centerpage(pageno, xp, yp); +#endif +} + +/* Following goes back to previous anchor point */ +void +htex_goback() +{ + int i; + + if (nHTeX_visited <= 0) return; /* There's nowhere to go! */ + if (debug & DBG_ANCHOR) { + Printf("Currently %d anchors in sequence:\n", nHTeX_visited); + for (i=0; i < nHTeX_visited; i++) { + Printf("%d file %s, href=%s\n", i, + HTeX_visited[i].refname, HTeX_visited[i].href); + } + } + nHTeX_visited--; + if (strcmp(HTeX_visited[nHTeX_visited].refname, dvi_name) != 0) { + /* Need to read in old file again! */ + MyStrAllocCopy(&dvi_name, HTeX_visited[nHTeX_visited].refname); + i = URL_aware; + URL_aware = FALSE; + open_dvi_file(); + URL_aware = i; + if (dvi_file != NULL) { + retitle(dvi_name); + extractbase(dvi_name); + } else { + perror(dvi_name); + Exit(1); + } + htex_can_it(); + htex_reinit(); + } + htex_loc_on_page(HTeX_visited + nHTeX_visited); + /* taken from keystroke subroutine: */ + htex_can_it(); +} + +/* Is this a url we recognize? */ +int +htex_is_url(href) +const char *href; +{ + /* Why reinvent the wheel? Use libwww routines! */ + return (HTURL_isAbsolute(href)==YES ? 1 : 0); +} + + +#ifndef WIN32 +static Arg temp_args4[] = { + {XtNtitle, (XtArgVal) 0}, + {XtNinput, (XtArgVal) True}, +}; +#endif + +static void +retitle(str) /* Change the title to "str" */ +char *str; +{ +#ifdef WIN32 + SetWindowText(top_level, str); +#else + temp_args4[0].value = (XtArgVal) str; + XtSetValues(top_level, temp_args4, XtNumber(temp_args4)); +#endif +} + +/* Can handle href's of form file:?.dvi#name */ +/* Actually, supposedly we can handle anything now... */ +void +htex_do_url(href) +char *href; +{ + if (href == NULL) return; /* shouldn't happen? */ + if (debug & DBG_HYPER) { + fprintf(stderr,"htex_do_url(%s)\n", href); + } + + /* Have dvi_name parsed using libwww routines to make sure + it doesn't contain invalid characters. Actually, we may + assume that HTURL_isAbsolute(href) when this is called, + so parsing it relative to URLbase shouldn't matter. */ + +#ifdef WIN32 + if (dvi_name) + free(dvi_name); + dvi_name = HTParse(href, URLbase, PARSE_ALL); +#else + /* HTParse already allocates memory. This should be fixed. */ + if (URLbase != NULL) { + MyStrAllocCopy(&dvi_name, HTParse(href, URLbase, PARSE_ALL)); + } else { + MyStrAllocCopy(&dvi_name, HTParse(href, "", PARSE_ALL)); + } +#endif + URL_aware = TRUE; + detach_anchor(); + if (open_www_file() == 0) { + /* HTTP request was handled externally by invoking some viewer */ + URL_aware = FALSE; + htex_can_it(); + htex_goback(); /* Go back to where we were! */ + return; + } else { + /* HTTP request was handled internally by calling open_dvi_file() */ + URL_aware = FALSE; + /* retitle(dvi_name); */ + /* extractbase(dvi_name); */ + htex_reinit(); + if (anchor_name != NULL) { + /* This may be unnecessary, since it's already done in + check_for_anchor() which is called from draw_page(). */ + htex_do_loc(anchor_name); + free(anchor_name); + anchor_name = NULL; + } else { + /* This seems to be necessary if there's no anchor_name. */ + htex_to_page(0); + } + return; + } +} + +/* Find the anchor pointed to by ap on the given page */ + +void +htex_loc_on_page(ap) +Anchors *ap; +{ + if (htex_parsedpages[ap->pageno] == 0) { + htex_parse_page(ap->pageno); /* Parse the needed page! */ + } + htex_to_anchor(ap->pageno, ap->which); /* move to anchor i */ +} + +void +freeHTeXAnchors(HTeXAp, nHTeX) +HTeX_Anchor *HTeXAp; +int nHTeX; +{ + int i; + + for (i=0; i < nHTeX; i++) { + if (HTeXAp[i].type&HTeX_A_NAME) + free(HTeXAp[i].name); + if (HTeXAp[i].type&HTeX_A_HREF) + free(HTeXAp[i].href); + } +} + +/* Following shouldn't be necessary... */ +/* Add the string cp to the current search string */ +#define LINE 1024 +char anchor_search_string[LINE]; + +void +add_search(cp, n) +char *cp; +int n; +{ + int anchor_search_len = 0; + + while (n>0) { + switch(*cp) { + case '\v': + case '\f': + case '\r': + case '\n': /* Finish string and search on it */ + anchor_search_string[anchor_search_len] = '\0'; + if (anchor_search_len > 0) { + htex_dohref(anchor_search_string); + /* Need to handle properly when ref doesn't exist! */ + } + return; + break; + case '\b': + case '\177': /* Del */ + if (anchor_search_len > 0) anchor_search_len--; + break; + case '': + anchor_search_len = 0; + break; + default: + if (*cp > 10) { + anchor_search_string[anchor_search_len++] = *cp; + } + break; + } + cp++; + n--; + } + anchor_search_string[anchor_search_len] = '\0'; + if (debug & DBG_ANCHOR) { + Printf("Search string: %s\n", anchor_search_string); + } +} + +void +htex_base(beginend, cp, pageno) +int beginend, pageno; +char *cp; +{ + char *ref, *str; + if (beginend == END) return; + + if (!strncasecmp(cp, "base", 4)) { + cp += 4; + cp = refscan(cp, &ref, &str); + if (cp == NULL) return; + while (isspace(*ref)) ref++; + while (isspace(*str)) str++; + if (strcasecmp(ref, "href") == 0) { + cp = str + strlen(str) - 1; /* Fix end of anchor */ + while (isspace(*cp)) cp--; + if (*cp == '>') cp --; + while (isspace(*cp)) cp--; + cp++; + *cp = '\0'; + MyStrAllocCopy(&URLbase, str); /* Change base */ + if (debug & DBG_HYPER) { + Printf("Changing base name to: %s\n", URLbase); + } + } + } +} + +void +htex_img(beginend, cp, pageno) +int beginend, pageno; +char *cp; +{ + char *ref, *str; + char fullpathname[1024]; + + if (beginend == END) return; + if (pageno != current_page) return; /* Only do when on page */ + if (htex_parsedpages[pageno] == 1) return; /* And first time through */ + if (!strncasecmp(cp, "img", 3)) { + cp += 3; + cp = refscan(cp, &ref, &str); + if (cp == NULL) return; + while (isspace(*ref)) ref++; + while (isspace(*str)) str++; + if (strcasecmp(ref, "src") == 0) { + cp = str + strlen(str) - 1; /* Fix end of anchor */ + while (isspace(*cp)) cp--; + if (*cp == '>') cp --; + while (isspace(*cp)) cp--; + cp++; + *cp = '\0'; + strcpy(fullpathname, str); + make_absolute(fullpathname, URLbase, 1024); + if (invokeviewer(fullpathname) != 1) { + fprintf(stderr, "Don't know how to deal with <img src=%s>\n", fullpathname); + } + } + } +} + +#ifdef HTEX +#ifndef WIN32 +#undef exit /* just in case */ +void +htex_cleanup(arg) +int arg; +{ + /* Delete all the temp files we created */ + for (;nURLs>0; nURLs--) { + /* fprintf(stderr,"htex: Unlinking %s\n",filelist[nURLs-1].file); */ + unlink(filelist[nURLs-1].file); + } + HTCache_flushAll(); + HTProfile_delete(); +} +#endif /* !WIN32 */ +/* Extract the URL base name from initial file name */ +static void +extractbase(file) +char *file; +{ + char *cp; + static char *cwd = NULL; + int n; + + if (URLbase != NULL) { + free(URLbase); + URLbase = NULL; + } + + if (strrchr(file, '/') != NULL) { /* If no /'s then leave dir NULL */ + n = strlen(file); + if (htex_is_url(file)) { /* It already is a URL */ + URLbase = xmalloc((unsigned) (n+1)); + Sprintf(URLbase, "%s", file); + } else { /* Turn it into one: */ + cwd = GETCWD(cwd, 1024); + URLbase = xmalloc((unsigned) (n+6 + strlen(cwd))); + Sprintf(URLbase, "file:%s/%s", cwd, file); + } + cp = strrchr(URLbase, '/'); + if (cp == NULL) { + fprintf(stderr, "This should not happen!\n"); + free(URLbase); + URLbase = NULL; + return; + } +/* cp[1] = '\0'; */ /* Leave it alone */ + } +} + +void +detach_anchor() +{ + char *cp; + + cp = strchr(dvi_name, '#'); /* Handle optional # in name */ + if (cp != NULL) { + *cp = '\0'; /* Terminate filename string */ + cp++; + while (*cp == '#') cp++; + MyStrAllocCopy(&anchor_name, cp); +#ifdef WIN32 + /* FIXME : this is caused by some .dvi + added to the filename */ + if (strlen(anchor_name) >= 4 && + FILESTRCASEEQ(anchor_name+strlen(anchor_name)-4, + ".dvi")) { + anchor_name[strlen(anchor_name)-4] = '\0'; + } +#endif + } +} + +int +open_www_file() +{ + char *url = NULL; + +#ifndef WIN32 + atexit(htex_cleanup); +#endif + if (debug & DBG_HYPER) { + fprintf(stderr, "open_www_file(%s)\n", dvi_name); + } + + /* open_www_file() may be called from main() at program startup, in + which case we have to turn dvi_name into an absolute URL. */ + + if (URLbase && !HTURL_isAbsolute(dvi_name)) { + MyStrAllocCopy(&url, dvi_name); +#ifdef WIN32 + if (dvi_name) + free(dvi_name); + dvi_name = HTParse(url, "", PARSE_ALL); +#else + MyStrAllocCopy(&dvi_name, HTParse(url, "", PARSE_ALL)); +#endif + free(url); + } + + /* Otherwise, we're called with an absoulte URL in dvi_name, either + from main() or form htex_do_url(). In both cases detach_anchor() + has been called before open_www_file(). */ +#ifdef WIN32 + if (FILESTRNCASEEQ(dvi_name, "ftp:", 4) + || FILESTRNCASEEQ(dvi_name, "mailto:", 7) + || FILESTRNCASEEQ(dvi_name, "http:", 5) + || (strlen(dvi_name) > 5 + && FILESTRNCASEEQ(dvi_name, "file:", 5) + && !FILESTRCASEEQ(dvi_name + strlen(dvi_name) - 4, ".dvi"))) { + /* FIXME : this is a bit rough ! */ + ShellExecute(NULL, "open", dvi_name, NULL, NULL, SW_SHOWNORMAL); + return 0; + } +#else + + if (strcmp(figure_mime_type(dvi_name),"application/x-dvi")!=0) { + + /* Try other standard extensions: */ + if (!invokeviewer(dvi_name)) { + /* Set the WWW browser on it: */ + if (browser) { + char *command = xmalloc(strlen(dvi_name) + + strlen(browser) + 10); + sprintf(command, "%s '%s' &", browser, dvi_name); + if (debug & DBG_HYPER) { + fprintf(stderr, "Executing: %s\n", command); + } + system(command); + free(command); + return 0; + } else { +#if 0 + /* Don't call paint_anchor before window was opened! */ + paint_anchor("Error: WWWBROWSER not set for URL access\n"); +#endif + fprintf(stderr, "You need to set the environment variable WWWBROWSER\n"); + fprintf(stderr, "or specify -browser on the command line to access\n"); + fprintf(stderr, "networked URL's which can't be handled otherwise.\n"); + } + } + } +#endif /* WIN32 */ + else { + if (HTeXnext_extern == 1) { + /* External viewer */ + if (anchor_name != NULL) { + invokedviviewer(dvi_name, anchor_name, 0); + free(anchor_name); + anchor_name = NULL; + } else { + invokedviviewer(dvi_name, NULL, 0); + } + return 0; + } else { + /* Dvi file, ='internal viewer' */ + open_dvi_file(); + if (dvi_file != NULL) { + retitle(dvi_name); + extractbase(dvi_name); + return 1; + } else { + perror(dvi_name); + Exit(1); + } + } + } + return 0; +} + +/* from xhdvi/events.c */ + +/* APS Pointer locator: */ + +int +pointerlocate(xpos, ypos) /* Return screen positions */ +int *xpos, *ypos; +{ + Window root, child; + int root_x, root_y; + unsigned int keys_buttons; + +#ifdef WIN32 + POINT curPos = {0, 0}, ptOrg = {0, 0}; + RECT rcClient, rcClip, rcPage; + BOOL bRet; + extern HWND hWndDraw; + extern int xCurrentScroll, yCurrentScroll; + extern int xMousePos, yMousePos; + + /* Retrieve the page dimensions */ + rcPage.left = 0; + rcPage.top = 0; + rcPage.right = page_w - 1; + rcPage.bottom = page_h - 1; + + if (!GetWindowOrgEx(maneDrawDC, &ptOrg)) { + Win32Error("pointerlocate/GetWindowOrgEx"); + } + + curPos.x = *xpos = xMousePos + xCurrentScroll + ptOrg.x; + curPos.y = *ypos = yMousePos + yCurrentScroll + ptOrg.y; + /* Retrieve the screen coordinates of the client area, + and convert them into client coordinates. */ + GetClientRect(hWndDraw, &rcClient); + /* Intersect both rectangles. The mag. glass will be limited + to the actual visible part of the page. */ + IntersectRect(&rcClip, &rcClient, &rcPage); + bRet = PtInRect(&rcClip, curPos); + return bRet; +#else + return XQueryPointer(DISP, mane.win, &root, &child, + &root_x, &root_y, xpos, ypos, &keys_buttons); +#endif +} + +#endif /* HTEX */ +#endif /* XHDVI || HTEX */ diff --git a/Build/source/texk/windvi/mfmodes.h b/Build/source/texk/windvi/mfmodes.h new file mode 100644 index 00000000000..9487ad93849 --- /dev/null +++ b/Build/source/texk/windvi/mfmodes.h @@ -0,0 +1,158 @@ +typedef struct _mfmode { + char *name; + char *bdpi; + char *desc; + } mfmode; + +mfmode avail_modes[150] = { + {"agfafzz", "100", "AGFA 400PS (406dpi)"}, + {"agfatfzz", "406", "AGFA P3400PS (400dpi)"}, + {"amiga", "400", "Commodore Amiga (100dpi)"}, + {"aps", "100", "Autologic APS-Micro5 (723dpi)"}, + {"apssixhi", "722.909", "Autologic APS-Micro6 (1016dpi)"}, + {"atariezf", "1016", "Atari ST SLM 804 printer (300dpi)"}, + {"atarinf", "300", "Atari previewer (95dpi)"}, + {"atarins", "95", "Atari previewer (96dpi)"}, + {"atariotf", "96", "Atari ST SM 124 screen (101dpi)"}, + {"bitgraph", "101", "BBN Bitgraph (118dpi)"}, + {"bjtenex", "118", "Canon BubbleJet 10ex (360dpi)"}, + {"bjtzzex", "360", "Canon BubbleJet 200ex (360 dpi)"}, + {"bjtzzs", "360", "Canon BubbleJet 200 (720x360dpi)"}, + {"bjtzzl", "720", "BubbleJet 200 landscape (360x720 dpi)"}, + {"boise", "180", "HP 2680A (180dpi)"}, + {"canonbjc", "360", "Canon BJC-600 (360dpi)"}, + {"canonex", "600", "LaserWriter Pro 630 (600dpi)"}, + {"canonlbp", "240", "Symbolics LGP-10 (240dpi)"}, + {"cg", "1301", "Compugraphic 8600 (1301x1569dpi)"}, + {"cgl", "1200", "Compugraphic 8600 landscape (1569x1302dpi)"}, + {"cgnszz", "300", "Compugraphic 9600 (1200dpi)"}, + {"crs", "70", "Alphatype CRS (5333dpi)"}, + {"cx", "100", "Canon CX, SX, LBP-LX (300dpi)"}, + {"datadisc", "82", "DataDisc (70dpi)"}, + {"newdd", "300", "DataDisc (70x93dpi)"}, + {"declarge", "600", "DEC 19-inch, 1280 x 1024 (100dpi)"}, + {"decsmall", "384", "DEC 17-inch, 1024 x 768 (82dpi)"}, + {"deskjet", "83", "HP DeskJet 500 (300dpi)"}, + {"docutech", "720", "Xerox 8790 or 4045 (600dpi)"}, + {"dover", "120", "Xerox Dover (384dpi)"}, + {"eighthre", "60", "EightThree (83dpi)"}, + {"epscszz", "240", "Epson Stylus Color 600 (720 dpi)"}, + {"epsdrft", "300", "Epson (120x72dpi)"}, + {"epsdrftl", "120", "Epson (72x120dpi)"}, + {"epsfast", "360", "Epson (60x72dpi)"}, + {"epsfastl", "360", "Epson (72x60dpi)"}, + {"epson", "180", "9-pin Epson MX/FX (240x216dpi)"}, + {"epsonl", "720", "9-pin Epson MX/FX landscape (216x240dpi)"}, + {"epsonact", "720", "Epson Action Laser 1500 (300dpi)"}, + {"epsonlo", "360", "Epson (120x216dpi)"}, + {"epsonlol", "44", "Epson landscape (216x120dpi)"}, + {"epsonsq", "204", "Epson SQ 870 (360dpi)"}, + {"epstypro", "204", "Epson Stylus Pro (360dpi)"}, + {"epstyplo", "200", "Epson Stylus Pro (180dpi)"}, + {"epstypmd", "180", "Epson Stylus Pro (720x360dpi)"}, + {"esphi", "240", "Epson Stylus Pro (720dpi)"}, + {"epstylus", "240", "Epson Stylus (360dpi)"}, + {"fourfour", "96", "FourFour (44dpi)"}, + {"gtfax", "300", "G3fax (204x196dpi)"}, + {"gtfaxl", "600", "G3fax landscape (196x204dpi)"}, + {"gtfaxlo", "240", "G3fax (204x98dpi)"}, + {"gtfaxlol", "118", "G3fax landscape (98x204dpi)"}, + {"highfax", "240", "G3fax (200dpi)"}, + {"hprugged", "240", "HP RuggedWriter 480 (180dpi)"}, + {"ibm_a", "240", "IBM 38xx (240dpi)"}, + {"ibmd", "100", "IBM 38xx (240dpi)"}, + {"ibmega", "87", "IBM EGA monitor (96x81dpi)"}, + {"ibmegal", "110", "IBM EGA monitor landscape (81x96dpi)"}, + {"ibmfzon", "160", "IBM 4019 (300dpi)"}, + {"ibmfztn", "240", "IBM 4029-30-39, 4250 (600dpi)"}, + {"ibmpp", "144", "IBM ProPrinter (240x216dpi)"}, + {"ibmppl", "300", "IBM ProPrinter (216x240dpi)"}, + {"ibmsoff", "144", "IBM 6154 display (118dpi)"}, + {"sherpa", "1200", "IBM 6670 (Sherpa) (240dpi)"}, + {"ibmteot", "1200", "IBM 3812 (240dpi)"}, + {"ibmtetz", "600", "IBM 3820 (240dpi)"}, + {"ibmtont", "635", "IBM 3193 screen (100dpi)"}, + {"ibmtosn", "3386", "IBM 3179 screen (87x65dpi)"}, + {"ibmtosnl", "1270", "IBM 3179 screen landscape (65x87dpi)"}, + {"ibmvga", "2540", "IBM VGA monitor (110dpi)"}, + {"ibx", "600", "Chelgraph IBX (9600dpi)"}, + {"itoh", "600", "CItoh 8510A (160x144dpi)"}, + {"itohl", "600", "CItoh 8510A landscape (144x160dpi)"}, + {"itohtoz", "1200", "CItoh 310 (240x144dpi)"}, + {"itohtozl", "600", "CItoh 310 landscape (144x240dpi)"}, + {"iw", "150", "Apple ImageWriter (144dpi)"}, + {"jetiiisi", "1000", "HP Laser Jet IIISi (300dpi)"}, + {"lasf", "300", "DEC LA75 (144dpi)"}, + {"lexmarkr", "300", "Lexmark Optra R 4049 (1200dpi)"}, + {"lexmarks", "300", "Lexmark Optra S 1250/1650/2450 (1200dpi)"}, + {"lexmarku", "180", "Lexmark Optra R+ 4049 (600dpi)"}, + {"linolo", "360", "Linotype Linotronic [13]00 (635dpi)"}, + {"linolttz", "118.06", "Linotronic L-300 with RIP-50 (3386dpi)"}, + {"linoone", "800", "Linotronic [13]00 (1270dpi)"}, + {"linotzzh", "86.4", "Linotype Linotronic 300 (2540dpi)"}, + {"ljfive", "72", "HP LaserJet 5 (600dpi)"}, + {"ljfivemp", "95", "HP LaserJet 5MP (600 dpi)"}, + {"ljfour", "180", "HP LaserJet 4 (600dpi)"}, + {"ljfzzz", "360", "LaserJet 4000N, ProRes mode (1200dpi)"}, + {"ljfzzzfr", "320", "HP LaserJet 4000 FastRes (600dpi)"}, + {"ljlo", "160", "HP LaserJet (150dpi)"}, + {"lmaster", "400", "LaserMaster (1000dpi)"}, + {"lnotr", "100", "DEC LN03R Scriptprinter (300dpi)"}, + {"lnzo", "91", "DEC LN01 (300dpi)"}, + {"lpstz", "101", "DEC lps20 (300dpi)"}, + {"lqlores", "120", "Epson LQ-500 (180dpi)"}, + {"lqmed", "508", "Epson LQ-500 (360x180dpi)"}, + {"lqmedl", "240", "Epson LQ-500 landscape (180x360dpi)"}, + {"lview", "600", "Sigma L-View monitor (118x109dpi)"}, + {"lwpro", "118", "Apple LaserWriterPro 810 (800dpi)"}, + {"macmag", "118", "Mac screens at magstep 1 (86dpi)"}, + {"mactrue", "300", "Mac screen (72dpi)"}, + {"ncd", "1200", "NCD 19-inch (95dpi)"}, + {"nec", "600", "NEC (180dpi)"}, + {"nechi", "72.27", "NEC-P6 (360dpi)"}, + {"neclm", "1200", "NEC PC-PR406LM (320dpi)"}, + {"nectzo", "300", "NEC PC-PR201 series (160dpi)"}, + {"nexthi", "600", "NeXT Newgen (400dpi)"}, + {"nextscrn", "600", "NeXT monitor (100dpi)"}, + {"nineone", "1200", "NineOne (91x91) (91dpi)"}, + {"nullmode", "300", "TFM files only (101dpi)"}, + {"onetz", "300", "OneTwoZero (120/120) (120dpi)"}, + {"ocessfz", "300", "OCE 6750-PS (508dpi)"}, + {"okidata", "600", "Okidata (240x288dpi)"}, + {"okidatal", "400", "Okidata landscape (288x240dpi)"}, + {"okifte", "240", "Okidata 410e in 600DPI mode (600dpi)"}, + {"pcscreen", "360", "also, e.g., high-resolution Suns (118dpi)"}, + {"pcprevw", "85", "PC screen preview (118dpi)"}, + {"phaser", "2400", "Tektronix Phaser PXi (300dpi)"}, + {"phaserfs", "180", "Tektronix Phaser 560 (1200dpi)"}, + {"phasertf", "1200", "Tektronix Phaser 350 (600x300dpi)"}, + {"pixpt", "78", "one pixel per point (72.27dpi)"}, + {"prntware", "1800", "Printware 720IQ (1200dpi)"}, + {"qms", "2400", "QMS (Xerox engine) (300dpi)"}, + {"qmsostf", "1200", "QMS 1725 (600dpi)"}, + {"qmsoszz", "600", "QMS 1700 (600dpi)"}, + {"qmstftf", "600", "QMS 2425 (1200dpi)"}, + {"ricoh", "300", "e.g., TI Omnilaser (300dpi)"}, + {"ricoha", "300", "e.g., IBM 4216 (300dpi)"}, + {"ricohlp", "300", "e.g., DEC LN03 (300dpi)"}, + {"ricohsp", "300", "Ricoh sp10ps/lp7200-ux (600dpi)"}, + {"sparcptr", "", "Sun SPARCprinter (400dpi)"}, + {"starnlt", "", "Star NL-10 (240x216dpi)"}, + {"starnltl", "", "Star NL-10 landscape (216x240dpi)"}, + {"stylewri", "", "Apple StyleWriter (360dpi)"}, + {"sun", "", "Sun and BBN Bitgraph (85dpi)"}, + {"supre", "", "Ultre*setter (2400dpi)"}, + {"toshiba", "", "Toshiba 13XX, EpsonLQ (180dpi)"}, + {"ultre", "", "Ultre*setter (1200dpi)"}, + {"vs", "", "VAXstation monitor (78dpi)"}, + {"vtftzz", "", "Varityper 4200 B-P (1800dpi)"}, + {"vtftzzhi", "", "Varityper 4300P (2400dpi)"}, + {"vtftzzlo", "", "Varityper 4300P (1200dpi)"}, + {"vtfzszw", "", "Varitype 5060W, APS 6 (600dpi)"}, + {"vtszz", "", "Varityper Laser 600 (600dpi)"}, + {"xrxesnz", "", "Xerox 8790 or 4045 (300dpi)"}, + {"xrxfzfz", "", "Xerox 4050/4075/4090/4700 (300dpi)"}, + {"xrxnszz", "", "Xerox 9700 (300dpi)"}, + {"xrxtszz", "", "Xerox 3700 (300dpi)"}, + {"help", "", "What modes are available?"} + }; diff --git a/Build/source/texk/windvi/mime.c b/Build/source/texk/windvi/mime.c new file mode 100644 index 00000000000..a0106c8ae59 --- /dev/null +++ b/Build/source/texk/windvi/mime.c @@ -0,0 +1,368 @@ +/* Copyright (c) 1994-1999 All rights reserved. */ +/* Written from scratch July 30, 1994, by A. P. Smith. */ +/* Open up the ~/.mime-types and ~/.mailcap files to check what + viewers to try to call on a new file (if they don't exist look for + MIMELIBDIR/mime.types and MAILCAPLIBDIR/mailcap). + + Patch by Allin Cottrell (cottrell@ricardo.ecn.wfu.edu) to + invokeviewer applied 30/11/98. + + Patched further in january 1999 by Nicolai Langfeldt + (janl@math.uio.no) to allow saner mime typing. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL PAUL VOJTA OR ANYONE ELSE BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*/ +#define HAVE_BOOLEAN + +#include "xdvi-config.h" +#if defined(HTEX) || defined(XHDVI) + +#include <kpathsea/c-ctype.h> +#include <kpathsea/c-fopen.h> +#include <kpathsea/variable.h> + +#ifndef MIMELIBDIR +#define MIMELIBDIR "/usr/local/etc" +#endif +#ifndef MAILCAPLIBDIR +#define MAILCAPLIBDIR "/usr/local/etc" +#endif + + +typedef struct _mimemap { + char *content_type; + char *extensions; +} Mimemap; + +Mimemap mime_defaults[] = { +{ "application/octet-stream", "bin", }, +{ "application/oda", "oda", }, +{ "application/pdf", "pdf", }, +{ "application/postscript", "ai eps epsf ps", }, +{ "application/rtf", "rtf", }, +{ "application/x-mif", "mif", }, +{ "application/x-csh", "csh", }, +{ "application/x-dvi", "dvi Dvi DVI", }, +{ "application/x-hdf", "hdf", }, +{ "application/x-latex", "latex", }, +{ "application/x-netcdf", "nc cdf", }, +{ "application/x-sh", "sh", }, +{ "application/x-tcl", "tcl", }, +{ "application/x-tex", "tex", }, +{ "application/x-texinfo", "texinfo texi", }, +{ "application/x-troff", "t tr roff", }, +{ "application/x-troff-man", "man", }, +{ "application/x-troff-me", "me", }, +{ "application/x-troff-ms", "ms", }, +{ "application/x-wais-source", "src", }, +{ "application/zip", "zip", }, +{ "application/x-bcpio", "bcpio", }, +{ "application/x-cpio", "cpio", }, +{ "application/x-gtar", "gtar", }, +{ "application/x-shar", "shar", }, +{ "application/x-sv4cpio", "sv4cpio", }, +{ "application/x-sv4crc", "sv4crc", }, +{ "application/x-tar", "tar", }, +{ "application/x-ustar", "ustar", }, +{ "audio/basic", "au snd", }, +{ "audio/x-aiff", "aif aiff aifc", }, +{ "audio/x-wav", "wav", }, +{ "image/gif", "gif", }, +{ "image/ief", "ief", }, +{ "image/jpeg", "jpeg jpg jpe", }, +{ "image/tiff", "tiff tif", }, +{ "image/x-cmu-raster", "ras", }, +{ "image/x-portable-anymap", "pnm", }, +{ "image/x-portable-bitmap", "pbm", }, +{ "image/x-portable-graymap", "pgm", }, +{ "image/x-portable-pixmap", "ppm", }, +{ "image/x-rgb", "rgb", }, +{ "image/x-xbitmap", "xbm", }, +{ "image/x-xpixmap", "xpm", }, +{ "image/x-xwindowdump", "xwd", }, +{ "text/html", "html htm sht shtml", }, +{ "text/plain", "txt", }, +{ "text/richtext", "rtx", }, +{ "text/tab-separated-values", "tsv", }, +{ "text/x-setext", "etx", }, +{ "video/mpeg", "mpeg mpg mpe", }, +{ "video/quicktime", "qt mov", }, +{ "video/x-msvideo", "avi", }, +{ "video/x-sgi-movie", "movie", }, +{ "application/gzip", "gz", } , +{ "application/compress", "Z", } , +{ "application/bzip", "bz", } , +{ "application/bzip2", "bz2", } , +}; + +Mimemap *curmimemap = mime_defaults; +int nmime, maxnmime = 0; + +typedef struct _mailcap { + char *content_type; + char *viewer; + Boolean needs_base; +} Mailcap; + +Mailcap mailcap_defaults[] = { +{ "audio/*", "showaudio %s", False, }, +{ "image/*", "xv %s", False, }, +{ "video/mpeg", "mpeg_play %s", False, }, +{ "application/pdf", "acroread %s", False, }, +{ "application/postscript", "ghostview %s", False, }, +{ "application/x-dvi", "xdvi -base %s %s", True, }, +}; + +Mailcap *curmailcap = mailcap_defaults; +int nmailcap, maxnmailcap = 0; + +#define LINE 1024 +#define MIMESTEP 50 + +int +parsemimes () +{ + int i; + char buf[LINE], *cp, *cp2; + FILE *strm; + static int already_called = 0; + + if (already_called) return 1; + already_called = 1; + + sprintf(buf, "%s/.mime-types", getenv("HOME")); + if ((strm = xfopen_local(buf, FOPEN_R_MODE)) == NULL) { + string mimelibdir = kpse_var_value ("MIMELIBDIR"); + if (!mimelibdir) + mimelibdir = MIMELIBDIR; + sprintf(buf, "%s/mime.types", mimelibdir); + if ((strm = xfopen_local(buf, FOPEN_R_MODE)) == NULL) { + nmime = sizeof(mime_defaults)/sizeof(Mimemap); + return 0; + } + } + curmimemap = xmalloc(MIMESTEP*sizeof(Mimemap)); + maxnmime = MIMESTEP; + for (i=0; i < maxnmime; i++) { + curmimemap[i].content_type = curmimemap[i].extensions = NULL; + } + nmime = 0; + while (fgets(buf, LINE, strm) != NULL) { + cp = buf; + while (isspace(*cp)) cp++; + if (*cp == '#') continue; + if ((cp2 = strchr(cp, ' ')) == NULL) + if ((cp2 = strchr(cp, '\t')) == NULL) continue; + *cp2 = '\0'; /* Terminate cp string */ + cp2++; + while (isspace(*cp2)) cp2++; + if (*cp2 == '\0') continue; /* No extensions list */ + if (nmime >= maxnmime) { + maxnmime += MIMESTEP; + curmimemap = (Mimemap *) realloc(curmimemap, + maxnmime*sizeof(Mimemap)); + for (i=nmime; i < maxnmime; i++) { + curmimemap[i].content_type = + curmimemap[i].extensions = NULL; + } + } + MyStrAllocCopy(&(curmimemap[nmime].content_type), cp); + MyStrAllocCopy(&(curmimemap[nmime].extensions), cp2); + nmime++; + } + return 1; +} + +int +parsemailcap() +{ + int i; + char buf[LINE], *cp, *cp2; + FILE *strm; + static int already_called = 0; + + if (already_called) return 1; + already_called = 1; + sprintf(buf, "%s/.mailcap", getenv("HOME")); + if ((strm = xfopen_local(buf, FOPEN_R_MODE)) == NULL) { + string mailcaplibdir = kpse_var_value ("MAILCAPLIBDIR"); + if (!mailcaplibdir) + mailcaplibdir = MAILCAPLIBDIR; + sprintf(buf, "%s/mailcap", MAILCAPLIBDIR); + if ((strm = xfopen_local(buf, FOPEN_R_MODE)) == NULL) { + nmailcap = sizeof(mailcap_defaults)/sizeof(Mailcap); + return 0; + } + } + curmailcap = (Mailcap *) malloc(MIMESTEP*sizeof(Mailcap)); + maxnmailcap = MIMESTEP; + for (i=0; i < maxnmailcap; i++) { + curmailcap[i].content_type = curmailcap[i].viewer = NULL; + } + nmailcap = 0; + while (fgets(buf, LINE, strm) != NULL) { + cp = strrchr(buf, '\n'); + if (cp != NULL) *cp = '\0'; /* Get rid of trailing \n */ + cp = buf; + while (isspace(*cp)) cp++; + if (*cp == '#') continue; + if ((cp2 = strchr(cp, ';')) == NULL) continue; + *cp2 = '\0'; /* Terminate cp string */ + cp2++; + while (isspace(*cp2)) cp2++; + if (*cp2 == '\0') continue; /* No viewer info? */ + if (nmailcap >= maxnmailcap) { + maxnmailcap += MIMESTEP; + curmailcap = (Mailcap *) realloc(curmailcap, + maxnmailcap*sizeof(Mailcap)); + for (i=nmailcap; i < maxnmailcap; i++) { + curmailcap[i].content_type = + curmailcap[i].viewer = NULL; + } + } + MyStrAllocCopy(&(curmailcap[nmailcap].content_type), cp); + MyStrAllocCopy(&(curmailcap[nmailcap].viewer), cp2); + curmailcap[nmailcap].needs_base = False; + if ((cp = strstr(curmailcap[nmailcap].viewer, "%s")) == NULL) + continue; /* Not valid viewer info? */ + if (strstr(cp+2, "%s") != NULL) /* Needs two strings */ + curmailcap[nmailcap].needs_base = True; + nmailcap++; + } + return 0; +} + + +char *figure_mime_type(filename) + char *filename; + +{ + /* + Separated this code from invoke_viewer on the rationale that If + we have all this fancy code to determine mime types WE'LL DAMN + WELL USE IT! + + BUG: It would be better yet to use the code to do the same things + in libwww but I'd rather not have to figure out libwww. + + -janl 21/1/1999 + */ + + int i, j; + char *extension, *cp; + char *content_type = NULL; + char *viewer = NULL; + char viewingcommand[LINE]; + /* It's reasonable to assume that an extensionles file is a dvi file + when the application name is xdvi and the applicaton name _is_ + xdvi! */ + static char *default_type="application/x-dvi"; + + /* First check for the mailcap and mime files */ + (void) parsemimes(); + (void) parsemailcap(); + + if (debug & DBG_HYPER) + fprintf(stderr,"figure_mime_type: Called to find type of %s\n",filename); + + /* See if this is a directory */ + if (filename[strlen(filename)-1]=='/') { + if (debug & DBG_HYPER) + fprintf(stderr,"It's a directory, returning www/unknown\n"); + return "www/unknown"; + } + + /* See if filename extension is on the mime list: */ + extension = strrchr(filename,'.'); + if (extension == NULL) { + if (debug & DBG_HYPER) + fprintf(stderr,"No extension, defaulting to %s\n",default_type); + return default_type; + } + extension++; + for (i=0; i < nmime; i++) { /* Compare with space sep. list of exts */ + cp = curmimemap[i].extensions; + while ((cp = strstr(cp, extension)) != NULL) { + if ((cp - curmimemap[i].extensions > 0) && + (cp[-1] != ' ')) { + cp ++; + continue; + } + cp += strlen(extension); + if ((*cp != ' ') && (*cp != '\0')) continue; + content_type = curmimemap[i].content_type; + break; + } + if (content_type != NULL) break; + } + + /* no such mime extension */ + if (content_type == NULL) content_type=default_type; + + if (debug & DBG_HYPER) + fprintf(stderr,"The type of %s is %s\n",filename,content_type); + + return content_type; +} + + +int +invokeviewer(filename) + char *filename; +{ + int i, j; + char *content_type = NULL; + char *viewer = NULL; + char viewingcommand[LINE]; + + content_type=figure_mime_type(filename); + + for (i=0; i < nmailcap; i++) { + if (!strcmp(curmailcap[i].content_type, content_type)) { + viewer = curmailcap[i].viewer; + j = i; + break; + } + } + if (viewer == NULL) return 0; + /* Turn the (possibly URL) filename into a local file */ + i = fetch_relative_url(URLbase, filename, temporary_dir); + if (i < 0) return 0; + wait_for_urls(); + if (curmailcap[j].needs_base) { + sprintf(viewingcommand, viewer, + (URLbase == NULL)? "none":filelist[i].url, filelist[i].file); + } else { + sprintf(viewingcommand, viewer, filelist[i].file); + } +#ifndef WIN32 + strcat(viewingcommand, " &"); +#endif + if (debug & DBG_HYPER) { + fprintf(stderr, "Executing: %s\n", viewingcommand); + } +#ifdef WIN32 + win32_system(viewingcommand); +#else + system(viewingcommand); +#endif + return 1; +} +#endif /* HTEX || XHDVI */ diff --git a/Build/source/texk/windvi/mksedscript b/Build/source/texk/windvi/mksedscript new file mode 100644 index 00000000000..d7f94968e08 --- /dev/null +++ b/Build/source/texk/windvi/mksedscript @@ -0,0 +1,114 @@ +#! /bin/sh + +# Values from c-auto.h + +mk_NOTOOL= +mk_GREY= +mk_BUTTONS= +mk_PS_GS= +mk_GS_PATH='gs' +mk_PS_DPS= +mk_PS_NEWS= +mk_A4= + +# HyperTeX: There appears to be no (easy) way to disable this +mk_HTEX=1 + +# Kpathsea defaults, they are #if'ed in the source but there is no +# config option to disable them. +mk_SELFILE=1 +mk_KPATHSEA=1 + +# Optional values from CFLAGS + +mk_MFMODE='unspecified' +mk_BDPI=600 +mk_DEFAULT_FONT_SIZES='m0:m0.5:m1:m2:m3:m4:m5' +mk_SHRINK=8 + +# Get arguments from CFLAGS + +for mk_arg +do + case "$mk_arg" in + -D*=*) + eval "`echo \"$mk_arg\" | sed 's/^-D/mk_/'`" + ;; + -D*) + eval "`echo \"$mk_arg\" | sed 's/^-D/mk_/'`=1" + ;; + esac +done + +# Get arguments from c-auto.h + +eval "`awk '/^#define/ { print "mk_"$2"="$3 }' c-auto.h`" + +# eval "`cat c-auto.h \ +# | grep '^[ ]*#[ ]*define[ ]' \ +# | sed 's/^[ ]*#[ ]*define[ ][ ]*/mk_/' \ +# | sed 's/[ ][ ]*/=/'`" + +# Process simple boolean arguments. Their values are empty or nonempty + +if test -n "$mk_NOTOOL"; then mk_BUTTONS=; fi +if test -z "$mk_GREY"; then echo '/^#ifgrey/,/^#/d'; fi +if test -z "$mk_BUTTONS"; then echo '/^#ifbuttons/,/^#/d'; fi +if test -z "$mk_PS_DPS"; then echo '/^#ifdps/,/^#/d'; fi +if test -z "$mk_PS_NEWS"; then echo '/^#ifnews/,/^#/d'; fi +if test -z "$mk_HTEX"; then echo '/^#ifhyper/,/^#/d'; fi +if test -n "$mk_NOGRID"; then echo '/^#ifgrid/,/^#/d'; fi + +if test -z "$mk_KPATHSEA"; then echo '/^#ifkpathsea/,/^#/d'; + else echo '/^#ifnokpathsea/,/^#/d'; fi + +# -DNOSELFILE is supposed to override everything +case $mk_SELFILE:$mk_NOSELFILE in + *:1) echo '/^#ifselfile/,/^#/d';; + 1:*) echo '/^#ifnoselfile/,/^#/d'; +esac + +# See HTEX comment above +# if test -z "$mk_HAVE_LIBWWW" || test -z "$mk_HAVE_WWWLIB_H"; +# then echo '/^#ifhyper/,/^#/d'; fi + +# Process remaining PostScript emulation arguments + +if test -z "$mk_PS_GS"; then + echo '/^#ifghost/,/^#/d' +else + echo "s^@GS_PATH@^$mk_GS_PATH^" +fi + +if test -n "$mk_PS_GS" || test -n "$mk_PS_DPS" || test -n "$mk_PS_NEWS"; then + mk_PS=y + echo '/^#ifnops/,/^#/d' +else + mk_PS= + echo '/^#ifps/,/^#/d' +fi + +# Miscellaneous args + +if test -n "$mk_A4"; then + echo 's/@DEFAULT_PAGE_SIZE@/21 x 29.7 cm (A4 size)/' + echo 's/@DEFAULT_UNIT@/cm " (centimeters)"/' +else + echo 's/@DEFAULT_PAGE_SIZE@/8.5 x 11 inches/' + echo 's/@DEFAULT_UNIT@/in " (inches)"/' +fi + +echo "s^@MFMODE@^$mk_MFMODE^" +echo "s/@BDPI@/$mk_BDPI/" +echo "s/@SHRINK@/$mk_SHRINK/" + +echo "s/@DEFAULT_FONT_SIZES@/$mk_DEFAULT_FONT_SIZES/" | sed -e "s/:/ :\\\\\\ +/g" + +# Remove all remaining '#' lines + +echo '/^#/d' + +# Done + +exit 0 diff --git a/Build/source/texk/windvi/mksedscript.perl b/Build/source/texk/windvi/mksedscript.perl new file mode 100644 index 00000000000..2934e612445 --- /dev/null +++ b/Build/source/texk/windvi/mksedscript.perl @@ -0,0 +1,144 @@ +# Values from c-auto.h + +$mk_NOTOOL=''; +$mk_GREY=''; +$mk_BUTTONS=''; +$mk_PS_GS=''; +$mk_GS_PATH='gswin32c'; +$mk_PS_DPS=''; +$mk_PS_NEWS=''; +$mk_A4=''; + +# HyperTeX: There appears to be no (easy) way to disable this +$mk_HTEX=1; + +# Kpathsea defaults, they are #if'ed in the source but there is no +# config option to disable them. +$mk_SELFILE=1; +$mk_KPATHSEA=1; + +# Optional values from CFLAGS + +$mk_MFMODE='unspecified'; +$mk_BDPI=600; +$mk_DEFAULT_FONT_SIZES='m0:m0.5:m1:m2:m3:m4:m5'; +$mk_SHRINK=8; + +&main; + +exit 0; + +sub arg_cflags +{ + while(<@ARGV>) { + if ($_ =~ m/-D(.*)=(.*)/) { + eval ("\$mk_$1=$2\n"); + } + elsif ($_ =~ m/-D(.*)/ ) { + eval ("\$mk_$1=1\n"); + } + } +} + +sub cauto_cflags +{ + open IN, "<c-auto.h"; + while (<IN>) { + if ($_ =~ m/#define\s+(\S+)\s*=\s*(\S+)/ ) { + eval("\$mk_$1=$2"); + } + } + close IN; +} + +sub main +{ + &arg_cflags(); + &cauto_cflags(); + + if ($mk_NOTOOL ne '') { + $mk_BUTTONS=''; + } + if ($mk_GREY eq '') { + print "/^#ifgrey/,/^#/d\n"; + } + if ($mk_BUTTONS eq '') { + print "/^#ifbuttons/,/^#/d\n"; + } + if ($mk_PS_DPS eq '') { + print "/^#ifdps/,/^#/d\n"; + } + if ($mk_PS_NEWS eq '') { + print "/^#ifnews/,/^#/d\n"; + } + if ($mk_HTEX eq '') { + print "/^#ifhyper/,/^#/d\n"; + } + if ($mk_NOGRID ne '') { + print "/^#ifgrid/,/^#/d\n"; + } + + if ($mk_KPATHSEA eq '') { + print "/^#ifkpathsea/,/^#/d\n"; + } + else { + print "/^#ifnokpathsea/,/^#/d\n"; + } + +# -DNOSELFILE is supposed to override everything + if ($mk_NOSELFILE == 1) { + print "/^#ifselfile/,/^#/d\n"; + } + elsif ($$mk_SELFILE == 1) { + print "/^#ifnoselfile/,/^#/d\n"; + } + +# See HTEX comment above +# if test -z "$mk_HAVE_LIBWWW" || test -z "$mk_HAVE_WWWLIB_H"; +# then echo '/^#ifhyper/,/^#/d'; fi + +# Process remaining PostScript emulation arguments + + if ($mk_PS_GS eq '') { + print "/^#ifghost/,/^#/d\n"; + } + else { + print "s^\@GS_PATH\@^$mk_GS_PATH^\n"; + } + + if ($mk_PS_GS ne '' || $mk_PS_DPS ne '' || $mk_PS_NEWS ne '') { + $mk_PS='y'; + print "/^#ifnops/,/^#/d\n"; + } + else { + $mk_PS=''; + print "/^#ifps/,/^#/d\n"; + } + +# Miscellaneous args + + if ($mk_A4 ne '') { + print "s/\@DEFAULT_PAGE_SIZE\@/21 x 29.7 cm (A4 size)/\n"; + print "s/\@DEFAULT_UNIT\@/cm \" (centimeters)\"/\n"; + } + else { + print "s/\@DEFAULT_PAGE_SIZE\@/8.5 x 11 inches/\n"; + print "s/\@DEFAULT_UNIT\@/in \" (inches)\"/\n"; + } + + print "s^\@MFMODE\@^$mk_MFMODE^\n"; + print "s/\@BDPI\@/$mk_BDPI/\n"; + print "s/\@SHRINK\@/$mk_SHRINK/\n"; + + $tmp = "s/\@DEFAULT_FONT_SIZES\@/$mk_DEFAULT_FONT_SIZES/"; + $tmp =~ s/:/ :\\\\\\/g; + print "$tmp\n"; +# Remove all remaining '#' lines + + print "/^#/d\n"; + +# Done + + exit 0; +} + diff --git a/Build/source/texk/windvi/patchlevel.h b/Build/source/texk/windvi/patchlevel.h new file mode 100644 index 00000000000..37c7e3100a1 --- /dev/null +++ b/Build/source/texk/windvi/patchlevel.h @@ -0,0 +1 @@ +#define PATCHLEVEL 20 diff --git a/Build/source/texk/windvi/pk.c b/Build/source/texk/windvi/pk.c new file mode 100644 index 00000000000..35f2239ea14 --- /dev/null +++ b/Build/source/texk/windvi/pk.c @@ -0,0 +1,377 @@ +/*========================================================================*\ + +Copyright (c) 1990-1999 Paul Vojta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +PAUL VOJTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +NOTE: + xdvi is based on prior work, as noted in the modification history + in xdvi.c. + +\*========================================================================*/ + +/* + * PK font reading routines. + * Public routines are read_PK_index and read_PK_char. + */ +#define HAVE_BOOLEAN +#include "xdvi-config.h" + +#define PK_ID 89 +#define PK_CMD_START 240 +#define PK_X1 240 +#define PK_X2 241 +#define PK_X3 242 +#define PK_X4 243 +#define PK_Y 244 +#define PK_POST 245 +#define PK_NOOP 246 +#define PK_PRE 247 + +static int PK_flag_byte; +static unsigned PK_input_byte; +static int PK_bitpos; +static int PK_dyn_f; +static int PK_repeat_count; + +static int +PK_get_nyb(fp) + FILE *fp; +{ + unsigned temp; + if (PK_bitpos < 0) { + PK_input_byte = one(fp); + PK_bitpos = 4; + } + temp = PK_input_byte >> PK_bitpos; + PK_bitpos -= 4; + return (temp & 0xf); +} + + +static int +PK_packed_num(fp) + FILE *fp; +{ + int i,j; + + if ((i = PK_get_nyb(fp)) == 0) { + do { + j = PK_get_nyb(fp); + ++i; + } + while (j == 0); + while (i > 0) { + j = (j << 4) | PK_get_nyb(fp); + --i; + } + return (j - 15 + ((13 - PK_dyn_f) << 4) + PK_dyn_f); + } + else { + if (i <= PK_dyn_f) return i; + if (i < 14) + return (((i - PK_dyn_f - 1) << 4) + PK_get_nyb(fp) + + PK_dyn_f + 1); + if (i == 14) PK_repeat_count = PK_packed_num(fp); + else PK_repeat_count = 1; + return PK_packed_num(fp); + } +} + + +static void +PK_skip_specials(fontp) + struct font *fontp; +{ + int i,j; + FILE *fp = fontp->file; + + do { + PK_flag_byte = one(fp); + if (PK_flag_byte >= PK_CMD_START) { + switch (PK_flag_byte) { + case PK_X1 : + case PK_X2 : + case PK_X3 : + case PK_X4 : + i = 0; + for (j = PK_CMD_START; j <= PK_flag_byte; ++j) + i = (i << 8) | one(fp); + while (i--) (void) one(fp); + break; + case PK_Y : + (void) four(fp); + case PK_POST : + case PK_NOOP : + break; + default : + oops("Unexpected %d in PK file %s", PK_flag_byte, + fontp->filename); + break; + } + } + } + while (PK_flag_byte != PK_POST && PK_flag_byte >= PK_CMD_START); +} + +/* + * Public routines + */ + +static void +#if NeedFunctionPrototypes +read_PK_char(struct font *fontp, wide_ubyte ch) +#else /* !NeedFunctionPrototypes */ +read_PK_char(fontp, ch) + struct font *fontp; + ubyte ch; +#endif /* NeedFunctionPrototypes */ +{ + int i, j; + int n; + int row_bit_pos; + Boolean paint_switch; + BMUNIT *cp; + struct glyph *g; + FILE *fp = fontp->file; + long fpwidth; + BMUNIT word; + int word_weight, bytes_wide; + int rows_left, h_bit, count; + + g = &fontp->glyph[ch]; + PK_flag_byte = g->x2; + PK_dyn_f = PK_flag_byte >> 4; + paint_switch = ((PK_flag_byte & 8) != 0); + PK_flag_byte &= 0x7; + if (PK_flag_byte == 7) n = 4; + else if (PK_flag_byte > 3) n = 2; + else n = 1; + + if (debug & DBG_PK) Printf("loading pk char %d, char type %d ", ch, n); + + /* + * now read rest of character preamble + */ + if (n != 4) fpwidth = num(fp, 3); + else { + fpwidth = sfour(fp); + (void) four(fp); /* horizontal escapement */ + } + (void) num(fp, n); /* vertical escapement */ + { + unsigned long w, h; + + w = num(fp, n); + h = num(fp, n); + if (w > 0x7fff || h > 0x7fff) + oops("Character %d too large in file %s", ch, fontp->fontname); + g->bitmap.w = w; + g->bitmap.h = h; + } + g->x = snum(fp, n); + g->y = snum(fp, n); + g->dvi_adv = fontp->dimconv * fpwidth; + + if (debug & DBG_PK) { + if (g->bitmap.w != 0) + Printf(", size=%dx%d, dvi_adv=%ld", g->bitmap.w, g->bitmap.h, + g->dvi_adv); + Putchar('\n'); + } + + alloc_bitmap(&g->bitmap); + cp = (BMUNIT *) g->bitmap.bits; + + /* + * read character data into *cp + */ + bytes_wide = ROUNDUP((int) g->bitmap.w, BMBITS) * BMBYTES; + PK_bitpos = -1; + if (PK_dyn_f == 14) { /* get raster by bits */ + bzero(g->bitmap.bits, (int) g->bitmap.h * bytes_wide); + for (i = 0; i < (int) g->bitmap.h; i++) { /* get all rows */ + cp = ADD(g->bitmap.bits, i * bytes_wide); +#ifndef WORDS_BIGENDIAN + row_bit_pos = -1; +#else + row_bit_pos = BMBITS; +#endif + for (j = 0; j < (int) g->bitmap.w; j++) { /* get one row */ + if (--PK_bitpos < 0) { + word = one(fp); + PK_bitpos = 7; + } +#ifndef WORDS_BIGENDIAN + if (++row_bit_pos >= BMBITS) { + cp++; + row_bit_pos = 0; + } +#else + if (--row_bit_pos < 0) { + cp++; + row_bit_pos = BMBITS - 1; + } +#endif + if (word & (1 << PK_bitpos)) *cp |= 1 << row_bit_pos; + } + } + } + else { /* get packed raster */ + rows_left = g->bitmap.h; + h_bit = g->bitmap.w; + PK_repeat_count = 0; + word_weight = BMBITS; + word = 0; + while (rows_left > 0) { + count = PK_packed_num(fp); + while (count > 0) { + if (count < word_weight && count < h_bit) { +#ifndef WORDS_BIGENDIAN + if (paint_switch) + word |= bit_masks[count] << (BMBITS - word_weight); +#endif + h_bit -= count; + word_weight -= count; +#ifdef WORDS_BIGENDIAN + if (paint_switch) + word |= bit_masks[count] << word_weight; +#endif + count = 0; + } + else if (count >= h_bit && h_bit <= word_weight) { + if (paint_switch) + word |= bit_masks[h_bit] << +#ifndef WORDS_BIGENDIAN + (BMBITS - word_weight); +#else + (word_weight - h_bit); +#endif + *cp++ = word; + /* "output" row(s) */ + for (i = PK_repeat_count * bytes_wide / BMBYTES; + i > 0; --i) { + *cp = *SUB(cp, bytes_wide); + ++cp; + } + rows_left -= PK_repeat_count + 1; + PK_repeat_count = 0; + word = 0; + word_weight = BMBITS; + count -= h_bit; + h_bit = g->bitmap.w; + } + else { + if (paint_switch) +#ifndef WORDS_BIGENDIAN + word |= bit_masks[word_weight] << + (BMBITS - word_weight); +#else + word |= bit_masks[word_weight]; +#endif + *cp++ = word; + word = 0; + count -= word_weight; + h_bit -= word_weight; + word_weight = BMBITS; + } + } + paint_switch = 1 - paint_switch; + } + if (cp != ((BMUNIT *) (g->bitmap.bits + bytes_wide * g->bitmap.h))) + oops("Wrong number of bits stored: char. %d, font %s", ch, + fontp->fontname); + if (rows_left != 0 || h_bit != g->bitmap.w) + oops("Bad pk file (%s), too many bits", fontp->fontname); + } +#ifdef WIN32 + g->bitmap.endian_permuted = 0; +#endif +} + +void +read_PK_index(fontp, hushcs) + struct font *fontp; + wide_bool hushcs; +{ + int hppp, vppp; + long checksum; + + fontp->read_char = read_PK_char; + if (debug & DBG_PK) + Printf("Reading PK pixel file %s\n", fontp->filename); + + Fseek(fontp->file, (long) one(fontp->file), 1); /* skip comment */ + + (void) four(fontp->file); /* skip design size */ + checksum = four(fontp->file); + if (checksum != fontp->checksum && checksum != 0 && fontp->checksum != 0 + && !hushcs) + Fprintf(stderr, + "Checksum mismatch (dvi = %lu, pk = %lu) in font file %s\n", + fontp->checksum, checksum, fontp->filename); + hppp = sfour(fontp->file); + vppp = sfour(fontp->file); + if (hppp != vppp && (debug & DBG_PK)) + Printf("Font has non-square aspect ratio %d:%d\n", vppp, hppp); + /* + * Prepare glyph array. + */ + fontp->glyph = xmalloc(256 * sizeof(struct glyph)); + bzero((char *) fontp->glyph, 256 * sizeof(struct glyph)); + /* + * Read glyph directory (really a whole pass over the file). + */ + for (;;) { + int bytes_left, flag_low_bits; + unsigned int ch; + + PK_skip_specials(fontp); + if (PK_flag_byte == PK_POST) break; + flag_low_bits = PK_flag_byte & 0x7; + if (flag_low_bits == 7) { + bytes_left = four(fontp->file); + ch = four(fontp->file); + } else if (flag_low_bits > 3) { + bytes_left = ((flag_low_bits - 4) << 16) + two(fontp->file); + ch = one(fontp->file); + } else { + bytes_left = (flag_low_bits << 8) + one(fontp->file); + ch = one(fontp->file); + } + fontp->glyph[ch].addr = ftell(fontp->file); + fontp->glyph[ch].x2 = PK_flag_byte; +#ifdef linux +#ifndef SHORTSEEK +#define SHORTSEEK 2048 +#endif + /* A bug in Linux libc (as of 18oct94) makes a short read faster + than a short forward seek. Totally non-intuitive. */ + if (bytes_left > 0 && bytes_left < SHORTSEEK) { + char *dummy = xmalloc (bytes_left); + Fread (dummy, 1, bytes_left, fontp->file); + free (dummy); + } else + /* seek backward, or long forward */ +#endif /* linux */ + Fseek(fontp->file, (long) bytes_left, 1); + if (debug & DBG_PK) + Printf("Scanning pk char %u, at %ld.\n", ch, + fontp->glyph[ch].addr); + } +} diff --git a/Build/source/texk/windvi/psdps.c b/Build/source/texk/windvi/psdps.c new file mode 100644 index 00000000000..fe84883c19d --- /dev/null +++ b/Build/source/texk/windvi/psdps.c @@ -0,0 +1,740 @@ +/*========================================================================*\ + +Copyright (c) 1994-1999 Paul Vojta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +PAUL VOJTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +NOTES: + This code was originally written by Ricardo Telichevesky + (ricardo@rle-vlsi-mit.edu) and Luis Miguel Silveira + (lms@rle-vlsi-mit.edu). + It was largely influenced by similar code in the SeeTeX/XTeX + package by Dirk Grunwald (grunwald@colorado.edu). + +\*========================================================================*/ + +#ifdef PS_DPS /* whole file */ + +#include "xdvi-config.h" +#include <signal.h> +#include <X11/X.h> +#include <X11/Xlib.h> +#include <DPS/XDPSlib.h> +#include <DPS/dpsXclient.h> +#include <DPS/dpsexcept.h> +#include <DPS/dpsclient.h> + + /* + * This string reads chunks (delimited by %%xdvimark). + * The first character of a chunk tells whether a given chunk + * is to be done within save/restore or not. + * The `H' at the end tells it that the first group is a + * header; i.e., no save/restore. + */ +#ifndef SUNHACK +static char preamble[] = "\ +/xdvi$line 81 string def \ +/xdvi$run {{$error null ne {$error /newerror false put}if \ + currentfile cvx stopped \ + $error null eq {false} {$error /newerror get} ifelse and \ + {handleerror} if} stopped pop} def \ +/xdvi$dslen countdictstack def \ +{currentfile read not {exit} if 72 eq \ + {xdvi$run} \ + {/xdvi$sav save def xdvi$run \ + clear countdictstack xdvi$dslen sub {end} repeat xdvi$sav restore} \ + ifelse \ + {(%%xdvimark) currentfile xdvi$line {readline} stopped \ + {clear} {pop eq {exit} if} ifelse }loop \ + (xdvi$Ack\n) print flush \ +}loop\nH"; +#else /* SUNHACK */ +static char preamble[] = "\ +/xdvi$line 81 string def \ +/xdvi$run {{$error null ne {$error /newerror false put}if \ + currentfile cvx stopped \ + $error null eq {false} {$error /newerror get} ifelse and \ + {handleerror} if} stopped pop} def \ +/xdvi$dslen countdictstack def \ +/xdvi$ack {{(%%xdvimark) currentfile xdvi$line {readline} stopped \ + {clear} {pop eq {exit} if} ifelse }loop \ + (xdvi$Ack\n) print flush} bind def \ +errordict begin /interrupt{(xdvi$Int\n) print flush stop}bind def \ +end \ +{{currentfile read not {exit} if 72 eq \ + {xdvi$run} \ + {/xdvi$sav save def xdvi$run \ + clear countdictstack xdvi$dslen sub {end} repeat xdvi$sav restore} \ + ifelse \ + xdvi$ack \ + }loop \ +xdvi$ack \ +}loop\nH"; +#endif /* SUNHACK */ + +extern char psheader[]; +extern int psheaderlen; + +#define postscript resource._postscript + + +/* global procedures (besides initDPS) */ + +static void toggleDPS ARGS((void)); +static void destroyDPS ARGS((void)); +static void interruptDPS ARGS((void)); +static void endpageDPS ARGS((void)); +static void drawbeginDPS ARGS((int, int, _Xconst char *)); +static void drawrawDPS ARGS((_Xconst char *)); +static void drawfileDPS ARGS((_Xconst char *, FILE *)); +static void drawendDPS ARGS((_Xconst char *)); +static void beginheaderDPS ARGS((void)); +static void endheaderDPS ARGS((void)); +static void newdocDPS ARGS((void)); + +static struct psprocs dps_procs = { + /* toggle */ toggleDPS, + /* destroy */ destroyDPS, + /* interrupt */ interruptDPS, + /* endpage */ endpageDPS, + /* drawbegin */ drawbeginDPS, + /* drawraw */ drawrawDPS, + /* drawfile */ drawfileDPS, + /* drawend */ drawendDPS, + /* beginheader */ beginheaderDPS, + /* endheader */ endheaderDPS, + /* newdoc */ newdocDPS}; + +static DPSContext DPS_ctx = NULL; +static DPSSpace DPS_space = NULL; +static int DPS_mag; /* magnification currently in use */ +static int DPS_shrink; /* shrink factor currently in use */ +static Boolean DPS_active; /* if we've started a page */ +static int DPS_pending; /* number of ack's we're expecting */ +static Boolean DPS_in_header; /* if we're sending a header */ +static Boolean DPS_in_doc; /* if we've sent header information */ + + +#if 0 +static void DPSErrorProcHandler(); +#else +#define DPSErrorProcHandler DPSDefaultErrorProc +#endif + + +static char ackstr[] = "xdvi$Ack\n"; +#ifdef SUNHACK +static char intstr[] = "xdvi$Int\n"; +#endif + +#define LINELEN 81 +#define BUFLEN (LINELEN + sizeof(ackstr)) +static char line[BUFLEN + 1]; +static char *linepos = line; + +static void +TextProc(ctxt, buf, count) + DPSContext ctxt; + char *buf; + unsigned long count; +{ + int i; + char *p; + char *p0; + + while (count > 0) { + i = line + BUFLEN - linepos; + if (i > count) i = count; + (void) bcopy(buf, linepos, i); + linepos += i; + buf += i; + count -= i; + p0 = line; + for (;;) { + if (p0 >= linepos) { + linepos = line; + break; + } + p = memchr(p0, '\n', linepos - p0); + if (p == NULL) { + if (p0 != line) { + (void) bcopy(p0, line, linepos - p0); + linepos -= p0 - line; + } + else if (linepos == line + BUFLEN) { + char c; + + c = line[LINELEN]; + line[LINELEN] = '\0'; + Printf("DPS: %s\n", line); + line[LINELEN] = c; + linepos -= LINELEN; + (void) bcopy(line + LINELEN, line, linepos - line); + } + break; + } + if (p >= p0 + 8 && memcmp(p - 8, ackstr, 9) == 0) { + --DPS_pending; + if (debug & DBG_PS) + Printf("Got DPS ack; %d pending.\n", DPS_pending); + ++p; + (void) bcopy(p, p - 9, linepos - p); + linepos -= 9; + continue; + } +#ifdef SUNHACK + if (p >= p0 + 8 && memcmp(p - 8, intstr, 9) == 0) { + DPS_pending = 1; + if (debug & DBG_PS) + Puts("Got DPS int."); + ++p; + (void) bcopy(p, p - 9, linepos - p); + linepos -= 9; + continue; + } +#endif /* SUNHACK */ + *p = '\0'; + Printf("DPS: %s\n", p0); + p0 = p + 1; + } + } +} + + +/*---------------------------------------------------------------------------* + waitack() + + Arguments: none. + + Returns: (void) + + Description: + Waits until the requisite number of acknowledgements has been received from + the context. + ++----------------------------------------------------------------------------*/ + +static void +waitack() +{ + while (DPS_pending > 0) { + (void) XEventsQueued(DISP, QueuedAfterFlush); + ps_read_events(False, False); + if (DPS_ctx == NULL) break; /* if interrupt occurred */ + } +} + + +/*---------------------------------------------------------------------------* + initDPS() + + Arguments: (none) + Returns: (void) + Side-Effects: DPS_ctx may be set as well as other static variables. + + Description: + Initializes variables from the application main loop. Checks to see if + a connection to the DPS server can be opened. + ++----------------------------------------------------------------------------*/ + +static int +get_shift(mask) + Pixel mask; +{ + int k; + + for (k = 0; (mask & 1) == 0; ++k) + mask >>= 1; + return k; +} + +Boolean +initDPS() +{ + + /* Try to create a context */ + +#if GREY + + if (our_colormap == DefaultColormapOfScreen(SCRN)) + DPS_ctx = XDPSCreateSimpleContext(DISP, mane.win, ruleGC, 0, 0, + TextProc, DPSDefaultErrorProc, NULL); + else { + static XStandardColormap *ccube = NULL; + static XStandardColormap *grayramp = NULL; + int shift; + + if (grayramp == NULL) { + grayramp = XAllocStandardColormap(); + if (grayramp == NULL) + return False; + } + + if (ccube == NULL) { + ccube = XAllocStandardColormap(); + if (ccube == NULL) + return False; + } + + shift = get_shift(our_visual->red_mask); + ccube->red_max = our_visual->red_mask >> shift; + ccube->red_mult = 1 << shift; + + shift = get_shift(our_visual->green_mask); + ccube->green_max = our_visual->green_mask >> shift; + ccube->green_mult = 1 << shift; + + shift = get_shift(our_visual->blue_mask); + ccube->blue_max = our_visual->blue_mask >> shift; + ccube->blue_mult = 1 << shift; + + grayramp->red_max = ccube->red_max & ccube->green_max + & ccube->blue_max; + grayramp->red_mult = ccube->red_mult + ccube->green_mult + + ccube->blue_mult; + + ccube->colormap = grayramp->colormap = our_colormap; + ccube->visualid = grayramp->visualid = our_visual->visualid; + + DPS_ctx = XDPSCreateContext(DISP, mane.win, ruleGC, 0, 0, + 0, grayramp, ccube, + /* actual */ (ccube->red_max + 1) * (ccube->green_max + 1) + * (ccube->blue_max + 1), + TextProc, DPSDefaultErrorProc, NULL); + } + +#else /* not GREY */ + + DPS_ctx = XDPSCreateSimpleContext(DISP, mane.win, ruleGC, 0, 0, + TextProc, DPSDefaultErrorProc, NULL); + +#endif /* not GREY */ + + if (DPS_ctx == NULL) + return False; + + DPS_mag = DPS_shrink = -1; + DPS_active = False; + DPS_pending = 1; + + DPS_space = DPSSpaceFromContext(DPS_ctx); + DPSWritePostScript(DPS_ctx, preamble, sizeof(preamble) - 1); + DPSWritePostScript(DPS_ctx, psheader, psheaderlen); + DPSPrintf(DPS_ctx, "matrix setmatrix stop\n%%%%xdvimark\n"); + DPSFlushContext(DPS_ctx); + + psp = dps_procs; + return True; +} + + +/*---------------------------------------------------------------------------* + toggleDPS() + + Arguments: none + Returns: (void) + Side-Effects: psp.drawbegin is changed. + + Description: + Used to toggle the rendering of PostScript by the DPS server + ++----------------------------------------------------------------------------*/ + +static void +toggleDPS() +{ + if (debug & DBG_PS) Puts("Toggling DPS on or off"); + if (postscript) psp.drawbegin = drawbeginDPS; + else { + interruptDPS(); + psp.drawbegin = drawbegin_none; + } +} + + +/*---------------------------------------------------------------------------* + destroyDPS() + + Arguments: none + Returns: (void) + Side-Effects: the context is nulled out and destroyed. + + Description: + Close the connection to the DPS server; used when rendering is terminated + in any way. + ++----------------------------------------------------------------------------*/ + +static void +destroyDPS() +{ + if (debug & DBG_PS) + Puts("Calling destroyDPS()"); + if (linepos > line) { + *linepos = '\0'; + Printf("DPS: %s\n", line); + } + DPSDestroySpace(DPS_space); + psp = no_ps_procs; + scanned_page = scanned_page_bak = scanned_page_reset; +} + + +/*---------------------------------------------------------------------------* + interruptDPS() + + Arguments: none + Returns: (void) + Side-Effects: the context may be nulled out and destroyed. + + Description: + Close the connection to the DPS server; used when rendering is terminated + because of an interruption in the viewing of the current page. + ++----------------------------------------------------------------------------*/ + +static void +interruptDPS() +{ +#ifdef SUNHACK + static Boolean interrupting = False; +#endif + + if (debug & DBG_PS) + Puts("Running interruptDPS()"); + +#ifndef SUNHACK + if (DPS_pending > 0) +#else /* SUNHACK */ + if (DPS_pending > 0 && !interrupting) +#endif /* SUNHACK */ + { + if (debug & DBG_PS) + Printf("interruptDPS: code is now %d\n", XDPSGetContextStatus(DPS_ctx)); + + /* + * I would really like to use DPSInterruptContext() here, but (at least + * on an RS6000) I can't get it to work. + */ + +#ifdef SUNHACK + /* + * On the other hand, under OpenWindows 3.3 (at least), destroying and + * re-creating contexts has a nasty habit of crashing the server. + */ + + interrupting = True; + DPSInterruptContext(DPS_ctx); + DPS_pending = 32767; + DPSPrintf(DPS_ctx, "%%%%xdvimark\n"); + DPSFlushContext(DPS_ctx); + DPS_active = False; + waitack(); + interrupting = False; +#else /* SUNHACK */ + DPSDestroyContext(DPS_ctx); + DPS_ctx = NULL; + DPS_active = False; + DPS_pending = 0; +#endif /* SUNHACK */ + } +} + + +/*---------------------------------------------------------------------------* + endpageDPS() + + Arguments: none + Returns: (void) + Side-Effects: the DPS_active variable is cleared. + + Description: + Should be called at the end of a page to end this chunk for the DPS server. + ++----------------------------------------------------------------------------*/ + +static void +endpageDPS() +{ + if (DPS_active) { + if (debug & DBG_PS) + Puts("Endpage sent to context"); + DPSPrintf(DPS_ctx, "stop\n%%%%xdvimark\n"); + DPSFlushContext(DPS_ctx); + DPS_active = False; + waitack(); + } +} + + +/*---------------------------------------------------------------------------* + drawbeginDPS () + + Arguments: xul, yul - coordinates of the upper left corner of the figure + cp - string with the bounding box line data + Returns: (void) + Side-Effects: DPS_ctx is set is set and connection to DPS server is + opened. + + Description: + Opens a connection to the DPS server and send in the preamble and the + bounding box information after correctly computing resolution factors. + In case no rendering is to be done, outlines the figure. + An outline is also generated whenever the a context cannot be allocated + ++----------------------------------------------------------------------------*/ + +static void +drawbeginDPS(xul, yul, cp) + int xul, yul; + _Xconst char *cp; +{ + /* static char faulty_display_vs[] + * ="DECWINDOWS DigitalEquipmentCorporation UWS4.2LA"; */ + + if (debug & DBG_PS) + Printf("Begin drawing at xul= %d, yul= %d.\n", xul, yul); + + /* we assume that I cannot write the file to the postscript context */ + if (DPS_ctx == NULL) { + DPS_ctx = XDPSCreateSimpleContext(DISP, mane.win, ruleGC, 0, 0, + TextProc, DPSErrorProcHandler, DPS_space); + if (DPS_ctx == NULL) { + psp = no_ps_procs; + draw_bbox(); + return; + } + DPSWritePostScript(DPS_ctx, preamble, sizeof(preamble) - 1); + /* it already has psheader */ + DPSPrintf(DPS_ctx, "matrix setmatrix stop\n%%%%xdvimark\n"); + DPS_mag = DPS_shrink = -1; + DPS_active = False; + DPS_pending = 1; + } + + if (!DPS_active) { + /* send initialization to context */ + if (magnification != DPS_mag) { + DPSPrintf(DPS_ctx, "H TeXDict begin /DVImag %d 1000 div def \ +end stop\n%%%%xdvimark\n", + DPS_mag = magnification); + ++DPS_pending; + } + if (mane.shrinkfactor != DPS_shrink) { + DPSPrintf(DPS_ctx, "H TeXDict begin %d %d div dup \ +/Resolution X /VResolution X \ +end stop\n%%%%xdvimark\n", + pixels_per_inch, DPS_shrink = mane.shrinkfactor); + ++DPS_pending; + } + DPSPrintf(DPS_ctx, " TeXDict begin\n"); + DPS_active = True; + ++DPS_pending; + } + + DPSPrintf(DPS_ctx, "%d %d moveto\n", xul, yul); + DPSPrintf(DPS_ctx, "%s\n", cp); +} + + +/*---------------------------------------------------------------------------* + + drawrawDPS() + + Arguments: cp - the raw string to be sent to the postscript interpreter + Returns: (void) + Side-Effects: (none) + + Description: + If there is a valid postscript context, just send the string to the + interpreter, else leave. + ++----------------------------------------------------------------------------*/ + +static void +drawrawDPS(cp) + _Xconst char *cp; +{ + if (!DPS_active) + return; + + if (debug & DBG_PS) + Printf("Sending raw PS to context: %s\n", cp); + + read_events(False); + DPSPrintf(DPS_ctx,"%s\n", cp); +} + + +/*---------------------------------------------------------------------------* + drawfileDPS() + + Arguments: cp - string with the postscript file pathname + psfile - opened file pointer + Returns: (void) + Side-Effects: none + + Description: + Postscript file containing the figure is opened and sent to the DPS server. + ++----------------------------------------------------------------------------*/ + +static void +drawfileDPS(cp, psfile) + _Xconst char *cp; + FILE *psfile; +{ + char buffer[1025]; + int blen; + + if (!DPS_active) { + Fclose(psfile); + ++n_files_left; + return; + } + + if (debug & DBG_PS) + Printf("sending file %s\n", cp); + for (;;) { + ps_read_events(False, False); + if (canit || !DPS_active) break; /* alt_canit is not a factor here */ + blen = fread(buffer, sizeof(char), 1024, psfile); + if (blen == 0) break; + DPSWritePostScript(DPS_ctx, buffer, blen); + } + Fclose(psfile); + ++n_files_left; + if (canit) { + interruptDPS(); + longjmp(canit_env, 1); + } +} + + +/*---------------------------------------------------------------------------* + drawendDPS() + + Arguments: cp - string with indication of the end of the special + Returns: (void) + Side-Effects: none + + Description: + Sends the indication of end of the figure PostScript code. + ++----------------------------------------------------------------------------*/ + +static void +drawendDPS(cp) + _Xconst char *cp; +{ + if (!DPS_active) + return; + + if (debug & DBG_PS) + Printf("End PS: %s\n", cp); + read_events(False); + DPSPrintf(DPS_ctx,"%s\n", cp); +} + + +/*---------------------------------------------------------------------------* + beginheaderDPS() + + Arguments: none + Returns: (void) + + Description: + Prepares the PostScript interpreter for receipt of header code. + ++----------------------------------------------------------------------------*/ + +static void +beginheaderDPS() +{ + if (debug & DBG_PS) Puts("Running beginheaderDPS()"); + + if (DPS_active) { + if (!DPS_in_header) + oops("Internal error in beginheaderDPS().\n"); + return; + } + + DPS_in_header = True; + if (DPS_in_doc) + DPSPrintf(DPS_ctx, "H"); + else { + DPSPrintf(DPS_ctx, "Hsave /xdvi$doc exch def\n"); + DPS_in_doc = True; + } + DPS_active = True; + ++DPS_pending; +} + + +/*---------------------------------------------------------------------------* + endheaderDPS() + + Arguments: none + Returns: (void) + + Description: + Prepares the PostScript interpreter for receipt of header code. + ++----------------------------------------------------------------------------*/ + +static void +endheaderDPS() +{ + if (debug & DBG_PS) Puts("Running endheaderDPS()"); + + if (DPS_active) { + DPSPrintf(DPS_ctx, "stop\n%%%%xdvimark\n"); + DPS_active = False; + DPS_in_header = False; + DPSFlushContext(DPS_ctx); + waitack(); + } +} + + +/*---------------------------------------------------------------------------* + newdocDPS() + + Arguments: none + Returns: (void) + + Description: + Clears out headers stored from the previous document. + ++----------------------------------------------------------------------------*/ + +static void +newdocDPS() +{ + if (debug & DBG_PS) Puts("Running newdocDPS()"); + + if (DPS_in_doc) { + DPSPrintf(DPS_ctx, "H xdvi$doc restore stop\n%%%%xdvimark\n"); + ++DPS_pending; + DPS_mag = DPS_shrink = -1; + DPS_in_doc = False; + } +} + +#endif /* PS_DPS */ diff --git a/Build/source/texk/windvi/psgs.c b/Build/source/texk/windvi/psgs.c new file mode 100644 index 00000000000..6bd13208150 --- /dev/null +++ b/Build/source/texk/windvi/psgs.c @@ -0,0 +1,854 @@ +/*========================================================================*\ + +Copyright (c) 1994-1999 Paul Vojta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +PAUL VOJTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +\*========================================================================*/ + +#ifdef PS_GS /* whole file */ + +#include "xdvi-config.h" +#include "kpathsea/c-pathmx.h" +#include <X11/Xatom.h> +#include <sys/time.h> /* for timeval */ + +#include <signal.h> +#include <sys/file.h> /* this defines FASYNC */ + +/* if POSIX O_NONBLOCK is not available, use O_NDELAY */ +#if !defined(O_NONBLOCK) && defined(O_NDELAY) +#define O_NONBLOCK O_NDELAY +#endif + +#ifdef EWOULDBLOCK +#ifdef EAGAIN +#define AGAIN_CONDITION (errno == EWOULDBLOCK || errno == EAGAIN) +#else /* EAGAIN */ +#define AGAIN_CONDITION (errno == EWOULDBLOCK) +#endif /* EAGAIN */ +#else /* EWOULDBLOCK */ +#ifdef EAGAIN +#define AGAIN_CONDITION (errno == EAGAIN) +#endif /* EAGAIN */ +#endif /* EWOULDBLOCK */ + +#if HAVE_POLL +# include <poll.h> +#else +# if HAVE_SYS_SELECT_H +# include <sys/select.h> +# else +# if HAVE_SELECT_H +# include <select.h> +# endif +# endif +#endif + +#if !defined(FLAKY_SIGPOLL) && !HAVE_STREAMS && !defined(FASYNC) +#define FLAKY_SIGPOLL 1 +#endif + +#if HAVE_VFORK_H +# include <vfork.h> +#endif + +#ifndef X_GETTIMEOFDAY +#define X_GETTIMEOFDAY(t) gettimeofday(t, (struct timezone*) NULL) +#endif + +#ifndef timercmp +#define timercmp(a, b, cmp) ((a)->tv_sec cmp (b)->tv_sec || \ + ((a)->tv_sec == (b)->tv_sec && (a)->tv_usec cmp (b)->tv_usec)) +#endif /* timercmp */ + +extern _Xconst char psheader[]; +extern int psheaderlen; + +#define postscript resource._postscript +#define fore_Pixel resource._fore_Pixel +#define back_Pixel resource._back_Pixel + +/* global procedures (besides initGS) */ + +static void toggle_gs ARGS((void)); +static void destroy_gs ARGS((void)); +static void interrupt_gs ARGS((void)); +static void endpage_gs ARGS((void)); +static void drawbegin_gs ARGS((int, int, _Xconst char *)); +static void drawraw_gs ARGS((_Xconst char *)); +static void drawfile_gs ARGS((_Xconst char *, FILE *)); +static void drawend_gs ARGS((_Xconst char *)); +static void beginheader_gs ARGS((void)); +static void endheader_gs ARGS((void)); +static void newdoc_gs ARGS((void)); + +static struct psprocs gs_procs = { + /* toggle */ toggle_gs, + /* destroy */ destroy_gs, + /* interrupt */ interrupt_gs, + /* endpage */ endpage_gs, + /* drawbegin */ drawbegin_gs, + /* drawraw */ drawraw_gs, + /* drawfile */ drawfile_gs, + /* drawend */ drawend_gs, + /* beginheader */ beginheader_gs, + /* endheader */ endheader_gs, + /* newdoc */ newdoc_gs}; + +static int std_in[2]; +static int std_out[2]; + +#define GS_in (std_in[1]) +#define GS_out (std_out[0]) + + /* some arguments are filled in later */ +static char arg4[] = "-dDEVICEWIDTH=xxxxxxxxxx"; +static char arg5[] = "-dDEVICEHEIGHT=xxxxxxxxxx"; + +static _Xconst char *argv[] = {NULL, NULL, "-dNOPAUSE", "-q", arg4, arg5, + "-dDEVICEXRESOLUTION=72", + "-dDEVICEYRESOLUTION=72", + NULL, NULL, NULL}; + +static pid_t GS_pid; +static unsigned int GS_page_w; /* how big our current page is */ +static unsigned int GS_page_h; +static Boolean GS_alpha; /* if we are using the alpha driver */ +static int GS_mag; /* magnification currently in use */ +static int GS_shrink; /* shrink factor currently in use */ +static Boolean GS_active; /* if we've started a page yet */ +static int GS_pending; /* number of ack's we're expecting */ +static _Xconst char *GS_send_byte; /* next byte to send to gs */ +static _Xconst char *GS_send_end; /* last + 1 byte to send to gs */ +static Boolean GS_in_header; /* if we're sending a header */ +static Boolean GS_in_doc; /* if we've sent header information */ +static Boolean GS_pending_int; /* if interrupt rec'd while in gs_io()*/ +static Boolean GS_timeout_set; /* if there's a timeout set */ +static struct timeval GS_timeout; /* when to time out */ +static Boolean GS_old; /* if we're using gs 2.xx */ + +static Atom gs_atom; +static Atom gs_colors_atom; + +#define Landscape 90 + +/* + * ghostscript I/O code. This should send PS code to ghostscript, + * receive acknowledgements, and receive X events in the meantime. + * It also checks for SIGPIPE errors. + */ + +#if HAVE_POLL +static struct pollfd fds[3] = {{0, POLLOUT, 0}, + {0, POLLIN, 0}, + {0, POLLIN, 0}}; +#define XDVI_ISSET(a, b, c) (fds[c].revents) +#else +static int numfds; +static fd_set readfds; +static fd_set writefds; +#define XDVI_ISSET(a, b, c) FD_ISSET(a, b) +#endif + +#define LINELEN 81 +static char line[LINELEN + 1]; +static char *linepos = line; +static char ackstr[] = "\347\310\376"; +static char oldstr[] = "\347\310\375"; + +static void +showto(q) + char *q; +{ + char *p = line; + char *p1; + + while (p < q) { + p1 = memchr(p, '\n', q - p); + if (p1 == NULL) p1 = q; + *p1 = '\0'; + Printf("gs: %s\n", p); + p = p1 + 1; + } +} + +static void +read_from_gs() { + int bytes; + char *line_end; + char *p; + + bytes = read(GS_out, linepos, line + LINELEN - linepos); + if (bytes < 0) return; + line_end = linepos + bytes; + /* Check for ack strings */ + for (p = line; p < line_end - 2; ++p) { + p = memchr(p, '\347', line_end - p - 2); + if (p == NULL) break; + if (memcmp(p, ackstr, 3) == 0) { + --GS_pending; + if (debug & DBG_PS) + Printf("Got GS ack; %d pending.\n", GS_pending); + } + else if (memcmp(p, oldstr, 3) == 0) { + if (debug & DBG_PS) + Puts("Using old GS version."); + GS_old = True; + } + else continue; + + showto(p); + p += 3; + (void) bcopy(p, line, line_end - p); + line_end -= p - line; + linepos = p = line; + --p; + } + *line_end = '\0'; + p = strrchr(linepos, '\n'); + if (p != NULL) { + ++p; + showto(p); + (void) bcopy(p, line, line_end - p); + line_end -= p - line; + } + linepos = line_end; + /* + * Normally we'd hold text until a newline character, but the buffer + * is full. So we flush it, being careful not to cut up an ack string. + */ + if (linepos >= line + LINELEN) { + p = line + LINELEN; + if ((*--p != '\347' && *--p != '\347' && *--p != '\347') + || (memcmp(p, ackstr, line + LINELEN - p) != 0 + && memcmp(p, oldstr, line + LINELEN - p) != 0)) + p = line + LINELEN; + *p = '\0'; + Printf("gs: %s\n", line); + *p = '\347'; + linepos = line; + while (p < line + LINELEN) *linepos++ = *p++; + } +} + +/* + * For handling of SIGPIPE signals from gs_io() + */ + +static Boolean sigpipe_error = False; + +/* ARGSUSED */ +static RETSIGTYPE +gs_sigpipe_handler(sig, code, scp, addr) + int sig; + int code; + struct sigcontext *scp; + char *addr; +{ + sigpipe_error = True; +} + +#if HAVE_SIGACTION +static struct sigaction sigpipe_handler_struct; + /* initialized to {gs_sigpipe_handler, (sigset_t) 0, 0} in initGS */ +#endif + +/* + * Clean up after gs_io() + */ + +static void +post_send() +{ + if (sigpipe_error) { + Fputs("ghostscript died unexpectedly.\n", stderr); + destroy_gs(); + draw_bbox(); + } + + if (GS_pending_int) { + GS_pending_int = False; + interrupt_gs(); + } +} + +/* + * This routine does two things. It either sends a string of bytes to + * the GS interpreter, or waits for acknowledgement from GS. + */ + +#define waitack() gs_io(NULL, 0) + +static void +gs_io(cp, len) + _Xconst char *cp; + int len; +{ + int bytes; +#if HAVE_SIGACTION + struct sigaction orig; +#else + RETSIGTYPE (*orig)(); +#endif + struct timeval tv; +#if HAVE_POLL + int timeout = -1; + int retval; + int offset = 0; +#else + struct timeval *timeout = (struct timeval *) NULL; +#endif +#if !defined(FLAKY_SIGPOLL) && defined(FASYNC) + int oldflags; +#endif + + if (GS_pid < 0) + return; + + if (cp != NULL) { /* if sending bytes */ +#if HAVE_SIGACTION + (void) sigaction(SIGPIPE, &sigpipe_handler_struct, &orig); +#else + orig = signal(SIGPIPE, gs_sigpipe_handler); +#endif + sigpipe_error = False; + GS_send_byte = cp; + GS_send_end = cp + len; + } + else { /* if waiting for acknowledgement */ + if (GS_pending == 0) + return; +#if HAVE_POLL + offset = 1; +#endif + } + +#if !defined(FLAKY_SIGPOLL) && defined(FASYNC) + oldflags = fcntl(ConnectionNumber(DISP), F_GETFL, 0); + (void) fcntl(ConnectionNumber(DISP), F_SETFL, oldflags & ~FASYNC); +#endif + + for (;;) { + + /* Handle timeout. */ + + if (GS_timeout_set) { + (void) X_GETTIMEOFDAY(&tv); +#if HAVE_POLL + timeout = 1000 * (int) (GS_timeout.tv_sec - tv.tv_sec) + + ((long) GS_timeout.tv_usec - (long) tv.tv_usec) / 1000; + if (timeout <= 0) { + destroy_gs(); + break; + } +#else + if (!timercmp(&tv, &GS_timeout, <)) { + destroy_gs(); + break; + } + tv.tv_sec = GS_timeout.tv_sec - tv.tv_sec; + tv.tv_usec = GS_timeout.tv_usec + 1000000 - tv.tv_usec; + if (tv.tv_usec >= 1000000) tv.tv_usec -= 1000000; + else --tv.tv_sec; + timeout = &tv; +#endif + } + + if (terminate_flag) { + ps_destroy(); + exit(0); + } + +#if HAVE_POLL + fds[0].revents = 0; + for (;;) { + retval = poll(fds + offset, XtNumber(fds) - offset, timeout); + if (retval >= 0 || errno != EAGAIN) break; + } + if (retval < 0) { + if (errno == EINTR) + continue; + else { + perror("poll (xdvik gs_io)"); + break; + } + } +#else + FD_ZERO(&readfds); + FD_SET(ConnectionNumber(DISP), &readfds); + FD_SET(GS_out, &readfds); + + FD_ZERO(&writefds); + if (GS_send_byte != NULL) FD_SET(GS_in, &writefds); + + if (select(numfds, &readfds, &writefds, (fd_set *) NULL, timeout) + < 0 && errno != EINTR) { + perror("select (xdvik gs_io)"); + break; + } +#endif + + if (XDVI_ISSET(GS_out, &readfds, 1)) { + read_from_gs(); + if (GS_pending <= 0) { + GS_timeout_set = False; + break; + } + } + if (XDVI_ISSET(GS_in, &writefds, 0)) { + bytes = write(GS_in, GS_send_byte, GS_send_end - GS_send_byte); + if (bytes == -1) { + if (!AGAIN_CONDITION) perror("xdvik gs_io"); + } + else { + GS_send_byte += bytes; + if (GS_send_byte == GS_send_end) { + GS_send_byte = NULL; + break; + } + } + if (sigpipe_error) break; + } + if (XDVI_ISSET(ConnectionNumber(DISP), &readfds, 2)) { + ps_read_events(False, False); + if (GS_pid < 0) break; /* if timeout occurred */ + if (GS_pending <= 0) { + GS_timeout_set = False; + break; + } + } + } + +#if !defined(FLAKY_SIGPOLL) && defined(FASYNC) + (void) fcntl(ConnectionNumber(DISP), F_SETFL, oldflags); +#endif + + if (cp != NULL) { + /* put back generic handler for SIGPIPE */ +#if HAVE_SIGACTION + (void) sigaction(SIGPIPE, &orig, (struct sigaction *) NULL); +#else + (void) signal(SIGPIPE, orig); +#endif + if (!GS_in_header) + post_send(); + } +} + +/* + * Fork a process to run ghostscript. This is done using the + * x11 device (which needs to be compiled in). Normally the x11 + * device uses ClientMessage events to communicate with the calling + * program, but we don't do this. The reason for using the ClientMessage + * events is that otherwise ghostview doesn't know when a non-conforming + * postscript program calls showpage. That doesn't affect us here, + * since in fact we disable showpage. + */ + +Boolean +initGS() +{ + char buf[100]; + static Boolean did_putenv = False; + /* + * This string reads chunks (delimited by %%xdvimark). + * The first character of a chunk tells whether a given chunk + * is to be done within save/restore or not. + * The `H' at the end tells it that the first group is a + * header; i.e., no save/restore. + * `execute' is unique to ghostscript. + */ + static _Xconst char str1[] = "\ +/xdvi$run {$error /newerror false put {currentfile cvx execute} stopped pop} \ + def \ +/xdvi$ack (\347\310\376) def \ +/xdvi$dslen countdictstack def \ +{currentfile read pop 72 eq \ + {xdvi$run} \ + {xdvi$run \ + clear countdictstack xdvi$dslen sub {end} repeat } \ + ifelse \ + {(%%xdvimark) currentfile =string {readline} stopped \ + {clear} {pop eq {exit} if} ifelse }loop \ + flushpage xdvi$ack print flush \ +}loop\nH"; + static _Xconst char str2[] = "[0 1 1 0 0 0] concat\n\ +revision 300 lt{(\347\310\375) print flush}if\n\ +stop\n%%xdvimark\n"; + + gs_atom = XInternAtom(DISP, "GHOSTVIEW", False); + /* send bpixmap, orientation, bbox (in pixels), and h & v resolution */ + Sprintf(buf, "%ld %d 0 0 %u %u 72 72", + None, /* bpixmap */ + Landscape, /* orientation */ + GS_page_h = page_h, GS_page_w = page_w); + XChangeProperty(DISP, mane.win, gs_atom, XA_STRING, 8, + PropModeReplace, (unsigned char *) buf, strlen(buf)); + GS_alpha = resource.gs_alpha; + + gs_colors_atom = XInternAtom(DISP, "GHOSTVIEW_COLORS", False); + Sprintf(buf, "%s %ld %ld", resource.gs_palette, fore_Pixel, back_Pixel); + XChangeProperty(DISP, mane.win, gs_colors_atom, XA_STRING, 8, + PropModeReplace, (unsigned char *) buf, strlen(buf)); + + if (!did_putenv) { + Sprintf(buf, "%ld", mane.win); + xputenv("GHOSTVIEW", buf); + xputenv("DISPLAY", XDisplayString(DISP)); + did_putenv = True; + } + + XSync(DISP, False); /* update the window */ + + if (xpipe(std_in) != 0 || xpipe(std_out) != 0) { + perror("[xdvik] pipe"); + return False; + } + Fflush(stderr); /* to avoid double flushing */ + GS_pid = vfork(); + if (GS_pid == 0) { /* child */ + _Xconst char **argvp = argv + 8; + + argv[1] = resource.gs_alpha ? "-sDEVICE=x11alpha" : "-sDEVICE=x11"; + Sprintf(arg4 + 14, "%u", GS_page_w); + Sprintf(arg5 + 15, "%u", GS_page_h); + if (resource.gs_safer) *argvp++ = "-dSAFER"; + *argvp = "-"; + (void) close(std_in[1]); + (void) dup2(std_in[0], 0); + (void) close(std_in[0]); + (void) close(std_out[0]); + (void) dup2(std_out[1], 1); + (void) dup2(std_out[1], 2); + (void) close(std_out[1]); + (void) execvp(argv[0] = resource.gs_path, (char * _Xconst *) argv); + Fprintf(stderr, "Execvp of %s failed.\n", argv[0]); + Fflush(stderr); + _exit(1); + } + + (void) close(std_in[0]); + (void) close(std_out[1]); + + if (GS_pid == -1) { /* error */ + perror("[xdvik] vfork"); + (void) close(GS_in); + (void) close(GS_out); + return False; + } + + /* Set std_in for non-blocking I/O */ + (void) fcntl(std_in[1], F_SETFL, + fcntl(std_in[1], F_GETFL, 0) | O_NONBLOCK); + +#ifdef _POSIX_SOURCE + sigpipe_handler_struct.sa_handler = gs_sigpipe_handler; + sigemptyset(&sigpipe_handler_struct.sa_mask); +#endif + +#if HAVE_POLL + fds[0].fd = std_in[1]; + fds[1].fd = std_out[0]; + fds[2].fd = ConnectionNumber(DISP); +#else + numfds = ConnectionNumber(DISP); + if (numfds < std_in[1]) numfds = std_in[1]; + if (numfds < std_out[0]) numfds = std_out[0]; + ++numfds; +#endif + + psp = gs_procs; + GS_active = GS_pending_int = GS_timeout_set = False; + GS_send_byte = NULL; + GS_in_header = True; + GS_pending = 1; + GS_mag = GS_shrink = -1; + + gs_io(str1, sizeof(str1) - 1); + gs_io(psheader, psheaderlen); + gs_io(str2, sizeof(str2) - 1); + GS_in_header = False; + post_send(); + waitack(); + + if (GS_pid < 0) { /* if something happened */ + destroy_gs(); + return False; + } + if (!postscript) toggle_gs(); /* if we got a 'v' already */ + else { + canit = True; /* ||| redraw the page */ + scanned_page = scanned_page_bak = scanned_page_reset; + longjmp(canit_env, 1); + } + return True; +} + +static void +toggle_gs() +{ + if (debug & DBG_PS) Puts("Toggling GS on or off"); + if (postscript) psp.drawbegin = drawbegin_gs; + else { + interrupt_gs(); + psp.drawbegin = drawbegin_none; + } +} + +static void +destroy_gs() +{ + if (debug & DBG_PS) Puts("Destroying GS process"); + if (linepos > line) { + *linepos = '\0'; + Printf("gs: %s\n", line); + linepos = line; + } + if (GS_pid >= 0) { + if (kill(GS_pid, SIGKILL) < 0 && errno != ESRCH) + perror("xdvik destroy_gs"); + GS_pid = -1; + scanned_page = scanned_page_bak = scanned_page_reset; + (void) close(GS_in); + (void) close(GS_out); + } + GS_active = GS_pending_int = GS_timeout_set = GS_in_doc = False; + GS_send_byte = NULL; + GS_pending = 0; +} + +static void +interrupt_gs() +{ + static _Xconst char str[] = " stop\n%%xdvimark\n"; + + if (debug & DBG_PS) Puts("Running interrupt_gs()"); + if (GS_pending <= 0) return; /* nothing to do */ + if (GS_timeout_set) return; /* we've done this already */ + (void) X_GETTIMEOFDAY(&GS_timeout); /* set timeout */ + GS_timeout.tv_sec += 5; + GS_timeout_set = True; + if (GS_send_byte != NULL) GS_pending_int = True; + else { + if (GS_active) { + /* + * ||| what I'd really like to do here is cause gs to execute + * the interrupt routine in errordict. But so far (gs 2.6.1) + * that has not been implemented in ghostscript. + */ + gs_io(str, sizeof(str) - 1); + GS_active = False; + } + psp.interrupt = NullProc; /* prevent deep recursion in waitack */ + waitack(); + psp.interrupt = interrupt_gs; + } +} + +static void +endpage_gs() +{ + static _Xconst char str[] = "stop\n%%xdvimark\n"; + + if (debug & DBG_PS) Puts("Running endpage_gs()"); + if (GS_active) { + gs_io(str, sizeof(str) - 1); + GS_active = False; + waitack(); + } +} + +/* + * Checks that the GS interpreter is running correctly. + */ + +static void +checkgs(in_header) + Boolean in_header; +{ + char buf[150]; + + /* For gs 2, we pretty much have to start over to enlarge the window. */ + if ((GS_old && (page_w > GS_page_w || page_h > GS_page_h)) + || GS_alpha != resource.gs_alpha) + destroy_gs(); + + if (GS_pid < 0) + (void) initGS(); + + if (!GS_active) { + /* check whether page_w or page_h have increased */ + if (page_w > GS_page_w || page_h > GS_page_h) { + ++GS_pending; + Sprintf(buf, "H mark /HWSize [%d %d] /ImagingBBox [0 0 %d %d] \ +currentdevice putdeviceprops pop\n\ +initgraphics [0 1 1 0 0 0] concat stop\n%%%%xdvimark\n", + GS_page_w = page_w, GS_page_h = page_h, page_h, page_w); + gs_io(buf, strlen(buf)); + if (!in_header) { + canit = True; /* ||| redraw the page */ + longjmp(canit_env, 1); + } + } + + if (magnification != GS_mag) { + ++GS_pending; + Sprintf(buf, "H TeXDict begin /DVImag %d 1000 div def \ +end stop\n%%%%xdvimark\n", + GS_mag = magnification); + gs_io(buf, strlen(buf)); + } + + if (mane.shrinkfactor != GS_shrink) { + ++GS_pending; + Sprintf(buf, + "H TeXDict begin %d %d div dup \ +/Resolution X /VResolution X \ +end stop\n%%%%xdvimark\n", + pixels_per_inch, GS_shrink = mane.shrinkfactor); + gs_io(buf, strlen(buf)); + } + } +} + +static void +drawbegin_gs(xul, yul, cp) + int xul, yul; + _Xconst char *cp; +{ + char buf[32]; + static _Xconst char str[] = " TeXDict begin\n"; + + checkgs(False); + + if (!GS_active) { + ++GS_pending; + gs_io(str, sizeof(str) - 1); + GS_active = True; + } + + /* This allows the X side to clear the page */ + XSync(DISP, False); + + Sprintf(buf, "%d %d moveto\n", xul, yul); + gs_io(buf, strlen(buf)); + if (debug & DBG_PS) + Printf("drawbegin at %d,%d: sending `%s'\n", xul, yul, cp); + gs_io(cp, strlen(cp)); +} + +static void +drawraw_gs(cp) + _Xconst char *cp; +{ + if (!GS_active) + return; + if (debug & DBG_PS) Printf("raw ps sent to context: %s\n", cp); + gs_io(cp, strlen(cp)); + gs_io("\n", 1); +} + +static void +drawfile_gs(cp, f) + _Xconst char *cp; + FILE *f; +{ + Fclose(f); /* don't need it */ + ++n_files_left; + + if (!GS_active) + return; + + if (debug & DBG_PS) Printf("printing file %s\n", cp); + + gs_io("(", 1); + gs_io(cp, strlen(cp)); + gs_io(")run\n", 5); +} + +static void +drawend_gs(cp) + _Xconst char *cp; +{ + if (!GS_active) + return; + if (debug & DBG_PS) Printf("end ps: %s\n", cp); + gs_io(cp, strlen(cp)); + gs_io("\n", 1); +} + +static void +beginheader_gs() +{ + static _Xconst char str[] = "Hsave /xdvi$doc exch def\n"; + + if (debug & DBG_PS) Puts("Running beginheader_gs()"); + + checkgs(True); + + if (GS_active) { + if (!GS_in_header) + oops("Internal error in beginheader_gs().\n"); + return; + } + + GS_in_header = True; + ++GS_pending; + if (GS_in_doc) + gs_io("H", 1); + else { + gs_io(str, sizeof(str) - 1); + GS_in_doc = True; + } + GS_active = True; +} + +static void +endheader_gs() +{ + static _Xconst char str[] = "stop\n%%xdvimark\n"; + + if (debug & DBG_PS) Puts("Running endheader_gs()"); + + if (GS_active) { + gs_io(str, sizeof(str) - 1); + GS_active = False; + GS_in_header = False; + post_send(); + waitack(); + } +} + +static void +newdoc_gs() +{ + static _Xconst char str[] = + "Hxdvi$doc restore stop\n%%xdvimark\n"; + + if (debug & DBG_PS) Puts("Running newdoc_gs()"); + + if (GS_in_doc) { + ++GS_pending; + gs_io(str, sizeof(str) - 1); + GS_mag = GS_shrink = -1; + GS_in_doc = False; + } +} + +#endif /* PS_GS */ diff --git a/Build/source/texk/windvi/psgsw32.c b/Build/source/texk/windvi/psgsw32.c new file mode 100644 index 00000000000..024d0ab0b73 --- /dev/null +++ b/Build/source/texk/windvi/psgsw32.c @@ -0,0 +1,949 @@ +/* + psgsw32.c : implementation file + Time-stamp: "03/05/12 22:30:37 popineau" + + Copyright (C) 1999 + Fabrice Popineau <Fabrice.Popineau@supelec.fr> + + This file is part of Windvi. + + Windvi 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. + + Windvi 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 Windvi; if not, write to the Free Software Foundation, 59 + Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + +/*========================================================================*\ + +Copyright (c) 1994-1999 Paul Vojta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +PAUL VOJTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +\*========================================================================*/ + +/* + FP: 22/07/99 + All this mess should be cleaned up. + Two instances of gsdll are needed for windvi. + One for displaying PS code in hWndDraw, + the other one for the magnifying glass or the band printing. + A third one might be needed for sending code from dvips to printer, + but I expect it to be different. + + So trying to sort out what is needed to get 2 instances + of gsdll, and which variables must be duplicated. + + Now: we can wonder if it is realistic to allow PS code in the + mag. glass. This could be done however. + + OK. Yap does not draw specials either in the magnifying glass. + + The result would probably be far too slow to be useful. + + So up to now, stick with rules and glyphs unless we are printing. + That does not mean the code should not be made more modular and clean ! + + */ + +#include <win32lib.h> + +#define HAVE_BOOLEAN +#include "xdvi-config.h" + +#if defined(PS_GS) && defined(WIN32) /* whole file */ + +#ifdef KPATHSEA +#include <kpathsea/c-proto.h> +#include <kpathsea/c-pathmx.h> +#include <kpathsea/fn.h> +#endif +#ifndef PATH_MAX +#define PATH_MAX 512 +#endif + +#define _Windows +#include "gsdll.h" + +#if 0 +extern _Xconst char *psheader[]; +extern int psheaderlen; +#endif + +char buf[2048]; + +#define postscript resource._postscript +#define fore_Pixel resource._fore_Pixel +#define back_Pixel resource._back_Pixel + +/* global procedures (besides initGS) */ + +static void toggle_gs ARGS((void)); +static void destroy_gs ARGS((void)); +static void interrupt_gs ARGS((void)); +static void endpage_gs ARGS((void)); +static void drawbegin_gs ARGS((int, int, _Xconst char *)); +static void drawraw_gs ARGS((_Xconst char *)); +static void drawfile_gs ARGS((_Xconst char *, FILE *, _Xconst char *)); +static void drawend_gs ARGS((_Xconst char *)); +static void beginheader_gs ARGS((void)); +static void endheader_gs ARGS((void)); +static void newdoc_gs ARGS((void)); + +struct psprocs gs_procs = { + /* toggle */ toggle_gs, + /* destroy */ destroy_gs, + /* interrupt */ interrupt_gs, + /* endpage */ endpage_gs, + /* drawbegin */ drawbegin_gs, + /* drawraw */ drawraw_gs, + /* drawfile */ drawfile_gs, + /* drawend */ drawend_gs, + /* beginheader */ beginheader_gs, + /* endheader */ endheader_gs, + /* newdoc */ newdoc_gs}; + +/* some arguments are filled in later */ +static char arg2[] = "-sDEVICE=xxxxxxxx"; +static char arg4[] = "-dDEVICEWIDTH=xxxxxxxxxx"; +static char arg5[] = "-dDEVICEHEIGHT=xxxxxxxxxx"; +static char arg6[] = "-dDEVICEXRESOLUTION=xxxxxxxxxx"; +static char arg7[] = "-dDEVICEYRESOLUTION=xxxxxxxxxx"; + +static char *argv[] = {"gswin32", arg2, "-dNOPAUSE", + "-dMaxBitmap=16000000", "-q", + arg4, arg5, arg6, arg7, + NULL, NULL, NULL, NULL}; + +static pid_t GS_pid; +static unsigned int GS_page_w; /* how big our current page is */ +static unsigned int GS_page_h; +static Boolean GS_alpha; /* if we are using the alpha driver */ +static int GS_mag; /* magnification currently in use */ +static int GS_shrink; /* shrink factor currently in use */ +static Boolean GS_active; /* if we've started a page yet */ +static Boolean GS_in_header; /* if we're sending a header */ +static Boolean GS_in_doc; /* if we've sent header information */ +static Boolean GS_old; /* if we're using gs 2.xx */ + +#if 0 +The messages used by the callback are: +#define GSDLL_STDIN 1 /* get count characters to str from stdin */ +/* return number of characters read */ +#define GSDLL_STDOUT 2 /* put count characters from str to stdout*/ +/* return number of characters written */ +#define GSDLL_DEVICE 3 /* device = str has been opened if count=1 */ +/* or closed if count=0 */ +#define GSDLL_SYNC 4 /* sync_output for device str */ +#define GSDLL_PAGE 5 /* output_page for device str */ +#define GSDLL_SIZE 6 /* resize for device str */ +/* LOWORD(count) is new xsize */ +/* HIWORD(count) is new ysize */ +#define GSDLL_POLL 7 /* Called from gp_check_interrupt */ +/* Can be used by caller to poll the message queue */ +/* Normally returns 0 */ +/* To abort gsdll_execute_cont(), return a */ +/* non zero error code until gsdll_execute_cont() */ +/* returns */ +#endif + +unsigned char *gs_device = NULL; +Boolean psToDisplay = False; + +HANDLE hGsEvent = NULL; + +/* + Transformation matrix + */ + +extern XFORM xfrmTransf; +extern XFORM xfrmUnit; + +int __cdecl +gsdll_callback(int message, char *str, unsigned long count) +{ + char *p; + + switch (message) { + case GSDLL_STDIN: + p = fgets(str, count, stdin); +#if 0 + fprintf(stderr, "gs read: %s\n", p); +#endif + if (p) + return strlen(str); + else + return 0; + case GSDLL_STDOUT: + if (str != (char *)NULL) { +#ifdef TRANSFORM + /* try to parse the current matrix */ + if (*str == '[' + && sscanf(str+1, "%f %f %f %f %f %f", + &xfrmTransf.eM11, &xfrmTransf.eM12, + &xfrmTransf.eM21, &xfrmTransf.eM22, + &xfrmTransf.eDx, &xfrmTransf.eDy) == 6) { + /* [ 1.0 0.0 0.0 -1.0 0.0 page_h ] is the default matrix for PS + Not for Win32 ! + However, those transformation matrices are easy to invert + because almost idempotent. + */ + xfrmTransf.eM12 = - xfrmTransf.eM12; + xfrmTransf.eM22 = - xfrmTransf.eM22; + xfrmTransf.eDy = (isPrinting ? /* mane.base_y + */ mane.max_y - mane.min_y : page_h) - xfrmTransf.eDy; + bMatrixUnit = (fabs(xfrmTransf.eM11 - 1.0) + + fabs(xfrmTransf.eM12) + + fabs(xfrmTransf.eM21) + + fabs(xfrmTransf.eM22 - 1.0) + + fabs(xfrmTransf.eDx) + + fabs(xfrmTransf.eDy)) < .001 ; + if (bMatrixUnit) { + xfrmTransf.eM11 = xfrmUnit.eM11; + xfrmTransf.eM12 = xfrmUnit.eM12; + xfrmTransf.eM21 = xfrmUnit.eM21; + xfrmTransf.eM22 = xfrmUnit.eM22; + xfrmTransf.eDx = xfrmUnit.eDx; + xfrmTransf.eDy = xfrmUnit.eDy; + } +#if 0 + fprintf(stderr, "New %s matrix(%x) : [%f %f %f %f %f %f]\nw = %d h = %d %s\n", + &xfrmTransf, + (bMatrixUnit ? "" : "(not unit)"), + xfrmTransf.eM11, xfrmTransf.eM12, + xfrmTransf.eM21, xfrmTransf.eM22, + xfrmTransf.eDx, xfrmTransf.eDy, + (isPrinting ? mane.max_x - mane.min_x : page_w), + (isPrinting ? mane.max_y - mane.min_y : page_h), + (isPrinting ? "(print)" : "(display)")); +#endif + /* Synchronize gs32dll with windvi */ +/* SetEvent(hGsEvent); */ + } + else { + fwrite(str, 1, count, stdout); + } +#else + fwrite(str, 1, count, stdout); +#endif + } + return count; + case GSDLL_DEVICE: + gs_device = str; +#if 0 + fprintf(stdout,"Callback: DEVICE %p %s\n", str, + count ? "open" : "close"); +#endif + break; + case GSDLL_SYNC: +#if 0 + fprintf(stdout,"Callback: SYNC %p\n", str); +#endif + break; + case GSDLL_PAGE: + fprintf(stdout,"Callback: PAGE %p\n", str); + break; + case GSDLL_SIZE: +#if 0 + fprintf(stdout,"Callback: SIZE %p width=%d height=%d\n", str, + (int)(count & 0xffff), (int)((count>>16) & 0xffff) ); +#endif + break; + case GSDLL_POLL: +#if 0 + fprintf(stderr, "GS: Poll sent!\n"); +#endif + return 0; /* no error */ + default: + fprintf(stdout,"Callback: Unknown message=%d\n",message); + break; + } + return 0; +} + +extern HWND hWndDraw; + +/* + * Clean up after gs_io() + */ + +#define post_send() + +#define gs_stop() { gs_io("\nstop\n%%xdvimark\n"); } + +/* + * This routine does two things. It either sends a string of bytes to + * the GS interpreter, or waits for acknowledgement from GS. + */ + +#define waitack() + +void +gs_io(const char *cp) +{ + int ret; + +#if 0 + if (cp && !(*cp == '\n' && *(cp+1) == '\0')) + fprintf(stderr, "gs: sending %s\n", cp); +#endif + + if ((ret = (*pgsdll_execute_cont)(cp, strlen(cp))) != 0) { + fprintf(stderr, "gs: error in executing\n%s\n", cp); + if (ret <= -100) { + fprintf(stderr, "gs: fatal error, exiting\n"); + (*pgsdll_exit)(); + GS_active = GS_in_doc = False; + } + else if (ret < 0) { + fprintf(stderr, "gs: error, exiting\n"); + (*pgsdll_execute_end)(); + (*pgsdll_exit)(); + GS_active = GS_in_doc = False; + } + } +} + +#ifdef TRANSFORM +XFORM *gs_getmatrix() +{ + if (!GS_active || !resource.use_xform) return NULL; + +/* ResetEvent(hGsEvent); */ + fprintf(stderr, "requesting current matrix...\n"); + gs_io(" matrix currentmatrix == flush\n"); +/* switch (WaitForSingleObject(hGsEvent, 100)) { */ +/* case WAIT_OBJECT_0: */ +/* #if 0 */ +/* fprintf(stderr, "gs_getmatrix() succeeded.\n"); */ +/* #endif */ +/* break; */ +/* case WAIT_TIMEOUT: */ +/* fprintf(stderr, "Gs did not return on time from getmatrix.\n"); */ +/* break; */ +/* case WAIT_FAILED: */ +/* break; */ +/* default: */ +/* fprintf(stderr, "WaitForSingleObject failed for unknown reason.\n"); */ +/* } */ +#if 0 + fprintf(stderr, "gs_getmatrix() : new %s matrix(%x) : [%f %f %f %f %f %f]\nw = %d h = %d %s\n", + &xfrmTransf, + (bMatrixUnit ? "" : "(not unit)"), + xfrmTransf.eM11, xfrmTransf.eM12, + xfrmTransf.eM21, xfrmTransf.eM22, + xfrmTransf.eDx, xfrmTransf.eDy, + (isPrinting ? mane.max_x - mane.min_x : page_w), + (isPrinting ? mane.max_y - mane.min_y : page_h), + (isPrinting ? "(print)" : "(display)")); +#endif + return &xfrmTransf; +} +#else +#define gs_getmatrix() +#endif + +void +init_gs_colors() +{ + float fore_red, fore_green, fore_blue; + float back_red, back_green, back_blue; + COLORREF new_back_Pixel; + extern COLORREF get_back_color(int); + static _Xconst char str3[] = + " erasepage newpath 0 0 moveto %d 0 rlineto\n\ +0 %d rlineto %d 0 rlineto %f %f %f setrgbcolor fill\n\ +%f %f %f setrgbcolor\n\ +TeXDict begin\n"; + + new_back_Pixel = get_back_color(current_page); + +#if 0 + fprintf(stderr, "init_gs_colors back %-8x fore %-8x\n", + new_back_Pixel, fore_Pixel); + /* FIXME : fore_Pixel is not taken into account. + Maybe try to send the order way before. Does not seem + to be ok :-( */ +#endif + + fore_red = GetRValue(fore_Pixel)/255; + fore_green = GetGValue(fore_Pixel)/255; + fore_blue = GetBValue(fore_Pixel)/255; + back_red = GetRValue(new_back_Pixel)/255; + back_green = GetGValue(new_back_Pixel)/255; + back_blue = GetBValue(new_back_Pixel)/255; + + if (isPrinting) + sprintf(buf, str3, page_w, mane.max_y - mane.min_y, -page_w, + back_red, back_green, back_blue, + fore_red, fore_green, fore_blue); + else + sprintf(buf, str3, page_w, page_h, -page_w, + back_red, back_green, back_blue, + fore_red, fore_green, fore_blue); + gs_io(buf); +} + +void +init_ps_page(int llx, int lly, int urx, int ury, int height) +{ + const char str[] = + " mark /HWSize [%d %d] /ImagingBBox [%d %d %d %d]\n\ +/TextAlphaBits %d /GraphicsAlphaBits %d currentdevice putdeviceprops setdevice \n\ +[1.0 0.0 0.0 -1.0 0 %u] setmatrix\n"; + sprintf(buf, str, GS_page_w, GS_page_h, llx, lly, urx, ury, + (use_grey && resource.gs_alpha ? 4 : 1), +(use_grey && resource.gs_alpha ? 4 : 1), height); + gs_io(buf); +#if 0 + fprintf(stderr, "init_ps_page (%d x %d) h = %d, isPrinting = %d\n", urx - llx, ury - lly, height, isPrinting); + if (isPrinting) + __asm int 3; +#endif +} + +void +feed_gs_with (char *filename) +{ + FILE *f; + static char buf[1024]; + int c, c_prev; + unsigned long i = 0, doseps = 0, dosepsbegin = 0, dosepsend = 0; + + if (!filename) { + fprintf(stderr, "Can't feed gs with (null)!\n"); + return; + } + f = fopen(filename, FOPEN_RBIN_MODE); + if (!f) { + fprintf(stderr, "Can't feed gs with %s: %s\n", filename, strerror(errno)); + return; + } +#if 0 + fprintf(stderr, "opening %s\n", filename); +#endif + + i = 0; c_prev = '\0'; + while ((c = fgetc(f)) != EOF) { + if (c == '\n') { + if (c_prev == '\r') { + i--; + } + buf[i++] = '\n'; + buf[i] = '\0'; + gs_io(buf); + i = 0; + c_prev = '\0'; + } + else if (i == sizeof(buf) - 1) { + buf[i] = '\0'; + gs_io(buf); + i = 0; + buf[i] = c; + c_prev = c; + } + else { + buf[i++] = c; + c_prev = c; + } + } + if (!feof(f)) { + fprintf(stderr, "Can't feed gs with %s: %s\n", filename, strerror(errno)); + } + fclose(f); +#if 0 + fprintf(stderr, "closing %s\n", filename); +#endif +} + +Boolean +initGS() +{ + int ret, i; + char **argvp = argv+9; + char *gs_dir; + + /* + * This string reads chunks (delimited by %%xdvimark). + * The first character of a chunk tells whether a given chunk + * is to be done within save/restore or not. + * The `H' at the end tells it that the first group is a + * header; i.e., no save/restore. + * `execute' is unique to ghostscript. + */ + static const char str1[] = "\ +/xdvi$run {$error /newerror false put {currentfile cvx execute} stopped pop} def \ +/xdvi$dslen countdictstack def \ +{currentfile read not {exit} if 72 eq \ +{xdvi$run} \ +{xdvi$run \ +clear countdictstack xdvi$dslen sub {end} repeat } \ +ifelse \ +{(%%xdvimark) currentfile =string {readline} stopped \ +{clear} {pop eq {exit} if} ifelse }loop \ +flushpage \ +} loop\nH"; + +#if 0 + debug = DBG_PS; +#endif + + if (!hGsDll) { + if (gs_locate() == NULL) { + Win32Error("initGS: Can't find gsdll32.dll."); + return False; + } + + gs_dll_initialize(); + } + +#if 0 + fprintf(stderr, "Initializing GS width = %d, height = %d\n", + page_w, + (isPrinting ? mane.max_y - mane.min_y : page_h)); +#endif + if (isPrinting && isPrintingDvips) { + Sprintf(arg2+strlen("-sDEVICE="), "%s", "mswinpr2"); + Sprintf(arg4+strlen("-dDEVICEWIDTH="), "%u", GS_page_w = page_w); + Sprintf(arg5+strlen("-dDEVICEHEIGHT="), "%u", GS_page_h = page_h); + Sprintf(arg6+strlen("-dDEVICEXRESOLUTION="), "%u", resource._pixels_per_inch /* maneLogPixelsX */); + Sprintf(arg7+strlen("-dDEVICEYRESOLUTION="), "%u", resource._pixels_per_inch /* maneLogPixelsY */); + } + else { + Sprintf(arg2+strlen("-sDEVICE="), "%s", "mswindll"); + Sprintf(arg4+strlen("-dDEVICEWIDTH="), "%u", GS_page_w = page_w); + Sprintf(arg5+strlen("-dDEVICEHEIGHT="), "%u", GS_page_h = (isPrinting ? mane.max_y - mane.min_y : page_h)); + Sprintf(arg6+strlen("-dDEVICEXRESOLUTION="), "%u", 72 /* maneLogPixelsX */); + Sprintf(arg7+strlen("-dDEVICEYRESOLUTION="), "%u", 72 /* maneLogPixelsY */); + } + + GS_alpha = resource.gs_alpha; + + if (resource.gs_safer) *argvp++ = "-dSAFER"; + *argvp++ = "-dNOEPS"; + *argvp++ = "-"; + +#if 0 + fprintf(stderr, "gsdll_init :\n"); + for(i = 0; i < argvp - argv; i++) + fprintf(stderr, "argv[%d] = %s\n", i, argv[i]); +#endif + + hGsEvent = CreateEvent(NULL, FALSE, FALSE, "gsEvent"); + + if ((ret = (*pgsdll_init)(gsdll_callback, + hWndDraw, argvp - argv - 1, argv)) != 0) { + fprintf(stderr, "gsdll_init returned %d\n", ret); + return False; + } + (*pgsdll_execute_begin)(); + + psp = gs_procs; + GS_active = False; + GS_in_header = True; + GS_mag = GS_shrink = -1; + + gs_io(str1); + +#if 1 + /* Since GS 8.00, files can't be opened from any location. */ + feed_gs_with(kpse_find_file("tex.pro", kpse_tex_ps_header_format, True)); + feed_gs_with(kpse_find_file("special.pro", kpse_tex_ps_header_format, True)); + feed_gs_with(kpse_find_file("color.pro", kpse_tex_ps_header_format, True)); +#else +#if 0 + for(i = 0; psheader[i]; i++) { + gs_io(psheader[i]); + gs_io("\n"); + } +#else + /* FIXME : better ensure that the files are found ! */ + Sprintf(buf, "(%s) run\n", kpse_find_file("tex.pro", kpse_tex_ps_header_format, True)); + gs_io(buf); + Sprintf(buf, "(%s) run\n", kpse_find_file("special.pro", kpse_tex_ps_header_format, True)); + gs_io(buf); + Sprintf(buf, "(%s) run\n", kpse_find_file("color.pro", kpse_tex_ps_header_format, True)); + gs_io(buf); +#endif +#endif + + if (isPrinting) + init_ps_page(0, 0, + mane.max_x - mane.min_x, + mane.max_y - mane.min_y, + mane.base_y + mane.max_y); + else + init_ps_page(0, 0, page_w, page_h, page_h); + + gs_io("revision 300 lt{(GS version ok.) print flush}if \n"); + + gs_stop(); + + if (!postscript) toggle_gs(); /* if we got a 'v' already */ + else { +#if 0 + /* FP : Makes the prescanning fail in case of psfrag for example ... */ + canit = True; /* ||| redraw the page */ + scanned_page = scanned_page_bak = scanned_page_reset; + fprintf(stderr, "scanned_page = %d, scanned_page_reset = %d\n", + scanned_page, scanned_page_reset); + /* longjmp(canit_env, 1); */ +#endif + } + return True; +} + +static void +toggle_gs() +{ + if (debug & DBG_PS) Puts("Toggling GS on or off"); + if (postscript) psp.drawbegin = drawbegin_gs; + else { + interrupt_gs(); + psp.drawbegin = drawbegin_none; + } +} + +static void +destroy_gs() +{ + int ret; + + if (debug & DBG_PS) Puts("Destroying GS process"); + + interrupt_gs(); + + if ((ret = (*pgsdll_execute_end)()) != 0) { + fprintf(stderr, "gsdll_execute_end returns %d\n", ret); + } + if ((ret = (*pgsdll_exit)()) != 0) { + fprintf(stderr, "gsdll_exit returns %d\n", ret); + } + GS_active = GS_in_doc = False; + + if (hGsEvent) + CloseHandleAndClear(&hGsEvent); + +} + +static void +interrupt_gs() +{ + if (debug & DBG_PS) Puts("Running interrupt_gs()"); + if (GS_active) { + gs_stop(); + GS_active = False; + } +} + +static void +endpage_gs() +{ + if (debug & DBG_PS) Puts("Running endpage_gs()"); + if (GS_active) { + gs_stop(); + GS_active = False; + waitack(); + } +} + +/* + * Checks that the GS interpreter is running correctly. + */ + +static void +checkgs(in_header) + Boolean in_header; +{ + static BOOL old_use_grey = False, + old_gs_alpha = False; + + if (!GS_active) { + /* check whether page_w or page_h have increased */ + /* if (page_w > GS_page_w || page_h > GS_page_h) { */ + + if (page_w != GS_page_w + || page_h != GS_page_h + || old_use_grey != use_grey + || old_gs_alpha != resource.gs_alpha) { + gs_io("H initgraphics\n"); + + if (isPrinting) { + GS_page_w = page_w; + GS_page_h = mane.max_y - mane.min_y; + init_ps_page(0,0, + mane.max_x - mane.min_x, + mane.max_y - mane.min_y, + mane.base_y + mane.max_y); + } + else { + GS_page_w = page_w; + GS_page_h = page_h; + init_ps_page(0, 0, page_w, page_h, page_h); + } + gs_stop(); + +#if 0 + if (!in_header) { + canit = True; /* ||| redraw the page */ + longjmp(canit_env, 1); + } +#endif + } + + if (magnification != GS_mag) { + Sprintf(buf, "H TeXDict begin /DVImag %d 1000 div def \ +end\n", + GS_mag = magnification); + gs_io(buf); + gs_stop(); + } + if (mane.shrinkfactor != GS_shrink) { + Sprintf(buf, "H TeXDict begin %d %d div dup \ +/Resolution X /VResolution X end\n", + pixels_per_inch, GS_shrink = mane.shrinkfactor); + gs_io(buf); + gs_stop(); + } + } +} + +static void +drawbegin_gs(xul, yul, cp) + int xul, yul; + char *cp; +{ + checkgs(False); + + if (!GS_active) { + init_gs_colors(); + GS_active = True; + } + + Sprintf(buf, "%d %d moveto\n", xul, yul); + gs_io(buf); + if (debug & DBG_PS) + Printf("drawbegin at %d,%d: sending `%s'\n", xul, yul, cp); + gs_io(cp); + /* gs_getmatrix(); */ +} + +static void +drawraw_gs(cp) + char *cp; +{ + if (!GS_active) + return; + if (debug & DBG_PS) Printf("raw ps sent to context: %s\n", cp); +#if 0 + gs_io("TeXDict begin @defspecial\n"); +#endif + gs_io(cp); + gs_io("\n"); +#if 0 + gs_io("@fedspecial end\n"); +#endif + /* gs_getmatrix(); */ +} + +static void +drawfile_gs(cp, f, truename) + char *cp; + FILE *f; + char *truename; +{ + char *p; + struct + { + unsigned char magic[4]; + unsigned char start[4]; + unsigned char length[4]; + } epsfheader; + unsigned long start; + unsigned long length; + Boolean binary; + + if (!GS_active) + return; + + /* cp should be open, f pointing on it */ + + /* Is it a dos epsf file ? */ + if (fread (&epsfheader, sizeof (epsfheader), 1, f) == 1 + && epsfheader.magic[0] == 'E' + 0x80 + && epsfheader.magic[1] == 'P' + 0x80 + && epsfheader.magic[2] == 'S' + 0x80 + && epsfheader.magic[3] == 'F' + 0x80) { + binary = True; + start = epsfheader.start[0]; + start += epsfheader.start[1] * 256; + start += epsfheader.start[2] * 256 * 256; + start += epsfheader.start[3] * 256 * 256 * 256; + length = epsfheader.length[0]; + length += epsfheader.length[1] * 256; + length += epsfheader.length[2] * 256 * 256; + length += epsfheader.length[3] * 256 * 256 * 256; + length -= start; +#if 0 + fprintf(stderr, "File %s has a DOS binary header starting at %lu (length = %lu).\n", cp, start, length); +#endif + } + else { + binary = False; + start = length = 0; + } + + if (fseek (f, start, SEEK_SET) != 0) { + fprintf(stderr, "drawfile_gs: problem seeking to %ld in %s, aborting\n", + start, cp); + if (f) Fclose(f); /* don't need it */ + ++n_files_left; + return; + } + +#if 0 + if (!binary) { + if (f) Fclose(f); /* don't need it */ + ++n_files_left; + /* in case there are '\\' in the file name, replace them by '/' */ + for (p = cp; p && *p; p++) + *p = (*p == '\\' ? '/' : *p); + if (debug & DBG_PS) Printf("Drawing file %s\n", cp); + Sprintf(buf, "(%s) run\n", cp); + gs_io(buf); + } + else +#endif + { + unsigned long readsofar = 0; + fn_type theline = fn_init(); + int ch, line_count = 0; + + while ((ch = fgetc (f)) != EOF && (! binary || (readsofar < length))) { + readsofar++; + if (ch == '\r' || ch == '\n') { + if (ch == '\r') { + ch = fgetc (f); + if (ch == '\n') + readsofar++; + else if (ch != EOF) + ungetc (ch, f); + } + fn_1grow(&theline, '\n'); + fn_1grow(&theline, '\0'); + gs_io(FN_STRING(theline)); + line_count++; + if (binary && readsofar + line_count == length) break; + fn_free(&theline); + theline = fn_init(); + } + else { + fn_1grow(&theline, ch); + /* FIXME: is it safe ??? */ + if (binary && strncmp(FN_STRING(theline), "%%EOF", 5) == 0) break; + } + } + if (FN_LENGTH(theline) > 0) { + fn_1grow(&theline, '\n'); + fn_1grow(&theline, '\0'); + gs_io(FN_STRING(theline)); + } + + if (f) Fclose(f); /* don't need it */ + ++n_files_left; + } +} + +static void +drawend_gs(cp) + char *cp; +{ + if (!GS_active) + return; + if (debug & DBG_PS) Printf("end ps: %s\n", cp); + gs_io(cp); + gs_io("\n"); + /* If we get there, allowDrawingChars is false ! */ + if (!bMagDisp) psToDisplay = True; + psToDisplay = True; + /* gs_getmatrix(); */ +} + +static void +beginheader_gs() +{ + static char str[] = "Hsave /xdvi$doc exch def\n"; + + if (debug & DBG_PS) Puts("Running beginheader_gs()"); + + checkgs(True); + + if (GS_active) { + if (!GS_in_header) + oops("Internal error in beginheader_gs().\n"); + return; + } + + GS_in_header = True; + if (GS_in_doc) + gs_io("H"); + else { + gs_io(str); + GS_in_doc = True; + } + + GS_active = True; +} + +static void +endheader_gs() +{ + if (debug & DBG_PS) Puts("Running endheader_gs()"); + + if (GS_active) { + gs_stop(); + GS_active = False; + GS_in_header = False; + post_send(); + waitack(); + } +} + +static void +newdoc_gs() +{ + static char str[] = "Hxdvi$doc restore\n"; + + if (debug & DBG_PS) Puts("Running newdoc_gs()"); + + if (GS_in_doc) { + gs_io(str); + gs_stop(); + GS_mag = GS_shrink = -1; + GS_in_doc = False; + } +} + +#endif /* PS_GS && WIN32 */ diff --git a/Build/source/texk/windvi/psheader.sed b/Build/source/texk/windvi/psheader.sed new file mode 100644 index 00000000000..22f1394af41 --- /dev/null +++ b/Build/source/texk/windvi/psheader.sed @@ -0,0 +1,3 @@ +/^_Xconst /s/psheader\[\] = "\\/*psheader[] = {/ +/^\/TeXDict/,$s/^\(.*\)\\n\\$/"\1",/ +/^\(.*"\);/s//"\1, 0 };/
\ No newline at end of file diff --git a/Build/source/texk/windvi/psheader.txt b/Build/source/texk/windvi/psheader.txt new file mode 100644 index 00000000000..784e54801df --- /dev/null +++ b/Build/source/texk/windvi/psheader.txt @@ -0,0 +1,312 @@ +%% These are from tex.lpro +/TeXDict 250 dict def % define a working dictionary ( IBM: color - 200->250 ) +TeXDict begin % start using it. +/N {def} def +/B {bind def} N +/S {exch} N +/X { S N } B +/TR {translate} N +/vsize 11 72 mul N +end % TeXDict + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% header for the \special command +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% The structure of the PostScript produced by dvips for \special is: +% @beginspecial +% - any number of @hsize, @hoffset, @hscale, etc., commands +% @setspecial +% - the user's file of PostScript commands +% @endspecial + +TeXDict begin +/SDict 200 dict N +SDict begin + +/@SpecialDefaults + { /hs 612 N + /vs 792 N + /ho 0 N + /vo 0 N + /hsc 1 N + /vsc 1 N + /ang 0 N + /CLIP 0 N + /rwiSeen false N + /rhiSeen false N + /letter {} N /note {} N /a4 {} N /legal {} N + } B + +% +% The following definition sets up the units that hscale/vscale are in. +% For certain sites this might require change, but it is +% recommended instead that any macro packages that require +% hscale/vscale set the units appropriately via +% +% \special{! /@scaleunit 1 def } +% +% if global, or +% +% \special{" /@scaleunit 1 def } +% +% before each instance if multiple macro packages with +% different requirements are being used. +% +/@scaleunit 100 N +% s @hscale - set scale factor +/@hscale {@scaleunit div /hsc X} B +/@vscale {@scaleunit div /vsc X} B + +% d @hsize - specify a horizontal clipping dimension +/@hsize {/hs X /CLIP 1 N} B +/@vsize {/vs X /CLIP 1 N} B + +/@clip {/CLIP 2 N} B + +% d @hoffset - specify a shift for the figure +/@hoffset {/ho X} B +/@voffset {/vo X} B + +% a @angle - set rotation angle +/@angle {/ang X} B + +% +% Here we handle bounding box calculations, if necessary. +% +/@rwi { 10 div /rwi X /rwiSeen true N } B % rwi will be real width after scaling +/@rhi { 10 div /rhi X /rhiSeen true N } B % rhi will be real height after scaling +/@llx { /llx X } B +/@lly { /lly X } B +/@urx { /urx X } B +/@ury { /ury X } B + +/magscale true def + +end % of SDict + +/@MacSetUp + { userdict /md known % if md is defined + { userdict /md get type /dicttype eq % and if it is a dictionary + { + userdict begin % expand it if necessary + md length 10 add md maxlength ge + {/md md dup length 20 add dict copy def}if + end + md begin % then redefine some stuff + /letter {} N + /note {} N + /legal {} N + /od{txpose + 1 0 mtx defaultmatrix dtransform S atan/pa X + newpath clippath mark + {transform{itransform moveto}} + {transform{itransform lineto}} + { 6 -2 roll transform + 6 -2 roll transform + 6 -2 roll transform + { itransform 6 2 roll + itransform 6 2 roll + itransform 6 2 roll + curveto + } + } + {{closepath}} + pathforall newpath counttomark array astore /gc xdf + pop ct 39 0 put + 10 fz 0 fs 2 F/|______Courier fnt invertflag{PaintBlack}if + }N + /txpose{ + pxs pys scale ppr aload pop + por { + noflips { + pop S neg S TR pop 1 -1 scale + }if + xflip yflip and { + pop S neg S TR 180 rotate 1 -1 scale + ppr 3 get ppr 1 get neg sub neg ppr 2 get + ppr 0 get neg sub neg TR + }if + xflip yflip not and { + pop S neg S TR pop 180 rotate + ppr 3 get ppr 1 get neg sub neg 0 TR + }if + yflip xflip not and { + ppr 1 get neg ppr 0 get neg TR + }if + } + { + noflips { + TR pop pop 270 rotate 1 -1 scale + }if + xflip yflip and { + TR pop pop 90 rotate 1 -1 scale + ppr 3 get ppr 1 get neg sub neg ppr 2 get + ppr 0 get neg sub neg TR + }if + xflip yflip not and { + TR pop pop 90 rotate ppr 3 get + ppr 1 get neg sub neg 0 TR + }if + yflip xflip not and { + TR pop pop 270 rotate ppr 2 get + ppr 0 get neg sub neg 0 S TR + }if + }ifelse + scaleby96 { + ppr aload pop 4 -1 roll add 2 div 3 1 roll add 2 div 2 copy + TR .96 dup scale neg S neg S TR + }if + }N + /cp {pop pop showpage pm restore}N + end + }if + } if + } N + +% +% The following procedure brings us back to PostScript size. It takes +% into account the current global dvi magnification, so graphics +% scale with the document. +% +/normalscale { + Resolution 72 div VResolution 72 div neg scale + magscale { DVImag dup scale } if + 0 setgray +} N +% +% We need the psfig macros. +% +% All software, documentation, and related files in this distribution of +% psfig/tex are Copyright (c) 1987 Trevor J. Darrell +% +% Permission is granted for use and non-profit distribution of psfig/tex +% providing that this notice be clearly maintained, but the right to +% distribute any portion of psfig/tex for profit or as part of any commercial +% product is specifically reserved for the author. +% +% +% psfigTeX PostScript Prolog +% $Header: /usr/local/src/TeX/Dvips-5.0.2/RCS/special.lpro,v 1.1 90/03/10 20:32:57 grunwald Exp $ +% +/psfts { S 65781.76 div N } N + +% x y bb-llx bb-lly bb-urx bb-ury startTexFig - +/startTexFig { + /psf$SavedState save N + userdict maxlength dict begin + + /magscale true def + normalscale + currentpoint TR %set the current point as the user's origin + + /psf$ury psfts + /psf$urx psfts + /psf$lly psfts + /psf$llx psfts + /psf$y psfts + /psf$x psfts + + /psf$sx psf$x psf$urx psf$llx sub div N % scaling for x + /psf$sy psf$y psf$ury psf$lly sub div N % scaling for y + + psf$sx psf$sy scale % scale by (sx,sy) + + psf$llx neg psf$ury neg TR + + /showpage { + } N + /erasepage { + } N + /copypage { + } N + /p 3 def % necessary to get around a bug in Adobe Illustrator + @MacSetUp +} N + +% llx lly urx ury doclip - (args in figure coordinates) +/doclip { + psf$llx psf$lly psf$urx psf$ury + currentpoint 6 2 roll + newpath 4 copy + 4 2 roll moveto + 6 -1 roll S lineto + S lineto + S lineto + closepath clip + newpath + moveto +} N +% - endTexFig - +/endTexFig { end psf$SavedState restore } N + +% this will be invoked as the result of a \special command (for the +% inclusion of PostScript graphics). The basic idea is to change all +% scaling and graphics back to defaults, but to shift the origin +% to the current position on the page. + +/@beginspecial % - @beginspecial - -- enter special mode + { + /SpecialSave save N + SDict begin + gsave + normalscale + currentpoint TR %set the current point as the user's origin + @SpecialDefaults % setup default offsets, scales, sizes, and angle + count /ocount X /dcount countdictstack N + } N + +/@setspecial % to setup user specified offsets, scales, sizes (for clipping) + { + CLIP 1 eq + { newpath 0 0 moveto hs 0 rlineto 0 vs rlineto hs neg 0 rlineto + closepath clip } + if + ho vo TR + hsc vsc scale + ang rotate + rwiSeen { + rwi urx llx sub div + rhiSeen { rhi ury lly sub div } { dup } ifelse + scale llx neg lly neg TR + } { + rhiSeen { rhi ury lly sub div dup scale llx neg lly neg TR } if + } ifelse + CLIP 2 eq + { newpath llx lly moveto urx lly lineto urx ury lineto llx ury lineto + closepath clip } + if + /showpage {} N + /erasepage {} N + /copypage {} N + newpath + } N + +/@endspecial % - @endspecial - -- leave special mode + { count ocount sub {pop} repeat + countdictstack dcount sub {end} repeat + grestore SpecialSave restore + end + } N + +% xdvik special treatment for saving definitions made in SDict (while using +% the bang special; try to guarantee that the dictionary stack is ok! +% xdvik should not systematically bracket code within save/restore pairs, +% anyway: such bracketing breaks a lot of code (many packages do change +% TeXDict from with ps: specials for instance) and we should only guarantee +% that bracketing is done within @beginspecial and @endspecial. -- YA + +/@xdvisavestate + { + userdict /xdvi$sav save put + } N + +/@defspecial + { + SDict begin + } N +/@fedspecial + { + end + @xdvisavestate + } B +end % revert to previous dictionary diff --git a/Build/source/texk/windvi/psnews.c b/Build/source/texk/windvi/psnews.c new file mode 100644 index 00000000000..4e66e6ca588 --- /dev/null +++ b/Build/source/texk/windvi/psnews.c @@ -0,0 +1,969 @@ +/*========================================================================*\ + +Copyright (c) 1994-1999 Paul Vojta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +PAUL VOJTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +NOTES: + This code was originally written by Ricardo Telichevesky + (ricardo@rle-vlsi-mit.edu) and Luis Miguel Silveira + (lms@rle-vlsi-mit.edu). + It was largely influenced by similar code in the SeeTeX/XTeX + package by Dirk Grunwald (grunwald@colorado.edu). + +\*========================================================================*/ + +/* ||| To do: + * ALWAYS_CLOSE_SERVER_CONNECTION? + * Is there some way of interrupting a process? + * fork + * extra bytes on input + */ + +#ifdef PS_NEWS /* whole file */ + +#include "xdvi-config.h" +#include <signal.h> +#include <sys/file.h> /* this defines FASYNC */ +#include <X11/X.h> +#include <X11/Xlib.h> +#undef SYSV /* To avoid defined SYSV_{WAIT,UCONTEXT} in xview/notify.h. */ +#include <NeWS/psio.h> +#include <xvps/pscanvas.h> + +/* if POSIX O_NONBLOCK is not available, use O_NDELAY */ +#if !defined(O_NONBLOCK) && defined(O_NDELAY) +#define O_NONBLOCK O_NDELAY +#endif + +/* Condition for retrying a write */ +#include <errno.h> + +#ifdef X_NOT_STDC_ENV +extern int errno; +#endif + +#ifdef EWOULDBLOCK +#ifdef EAGAIN +#define AGAIN_CONDITION (errno == EWOULDBLOCK || errno == EAGAIN) +#else /* EAGAIN */ +#define AGAIN_CONDITION (errno == EWOULDBLOCK) +#endif /* EAGAIN */ +#else /* EWOULDBLOCK */ +#ifdef EAGAIN +#define AGAIN_CONDITION (errno == EAGAIN) +#endif /* EAGAIN */ +#endif /* EWOULDBLOCK */ + +#if HAVE_POLL +# include <poll.h> +#else +# if HAVE_SYS_SELECT_H +# include <sys/select.h> +# else +# if HAVE_SELECT_H +# include <select.h> +# endif +# endif +#endif + +#if !defined(FLAKY_SIGPOLL) && !HAVE_STREAMS && !defined(FASYNC) +#define FLAKY_SIGPOLL 1 +#endif + +char *strtok ARGS((char *, _Xconst char *)); + +#define Fprintf (void) fprintf + + +/* define ALWAYS_CLOSE_SERVER_CONNECTION if you want to close the server + connection all the time */ +#undef ALWAYS_CLOSE_SERVER_CONNECTION + + + /* + * Some setup code. + */ +static _Xconst char str0[] = "\ +/OW2? version cvi 2 eq def \ +OW2? \ +{ /setlinewidth { pop } def} \ +{ /NeWS 3 0 findpackage beginpackage \ + /X11 3 0 findpackage beginpackage} \ +ifelse \ +currentcanvas /Color get \ +currentcanvas /Colormap get getcubedescription null eq and \ + {8 {{currentcanvas /Colormap get 1 index dup dup dup newcube} stopped \ + {pop pop pop pop pop} {exit} ifelse \ + 2 div cvi dup 1 eq {exit} if} loop pop} \ +if\n"; + /* + * This string reads chunks (delimited by %%xdvimark). + * The first character of a chunk tells whether a given chunk + * is to be done within save/restore or not. + * The `H' at the end tells it that the first group is a + * header; i.e., no save/restore. + */ +static _Xconst char preamble[] = "\ +/xdvi$line 81 string def \ +/xdvi$run {$error null ne {$error /newerror false put} if \ + {currentfile cvx stopped \ + $error null eq {false} {$error /newerror get} ifelse and \ + {handleerror} if} stopped pop} def \ +/xdvi$dslen countdictstack def \ +{currentfile read not {exit} if 72 eq \ + {xdvi$run} \ + {/xdvi$sav save def xdvi$run \ + clear countdictstack xdvi$dslen sub {end} repeat xdvi$sav restore} \ + ifelse \ + {(%%xdvimark) currentfile xdvi$line {readline} stopped \ + {clear} {{eq {false exit} if} {true exit} ifelse} ifelse }loop {exit} if \ + 58 tagprint flush \ +}loop\nH"; + +extern _Xconst char psheader[]; +extern int psheaderlen; + +static _Xconst char preamble2[] = " stop\n%%xdvimark\n"; +#define stopstring preamble2 + +#define postscript resource._postscript + + +/* global procedures (besides initNeWS) */ + +static void toggleNeWS ARGS((void)); +static void destroyNeWS ARGS((void)); +static void interruptNeWS ARGS((void)); +static void endpageNeWS ARGS((void)); +static void drawbeginNeWS ARGS((int, int, _Xconst char *)); +static void drawrawNeWS ARGS((_Xconst char *)); +static void drawfileNeWS ARGS((_Xconst char *, FILE *)); +static void drawendNeWS ARGS((_Xconst char *)); +static void beginheaderNeWS ARGS((void)); +static void endheaderNeWS ARGS((void)); +static void newdocNeWS ARGS((void)); + +static struct psprocs news_procs = { + /* toggle */ toggleNeWS, + /* destroy */ destroyNeWS, + /* interrupt */ interruptNeWS, + /* endpage */ endpageNeWS, + /* drawbegin */ drawbeginNeWS, + /* drawraw */ drawrawNeWS, + /* drawfile */ drawfileNeWS, + /* drawend */ drawendNeWS, + /* beginheader */ beginheaderNeWS, + /* endheader */ endheaderNeWS, + /* newdoc */ newdocNeWS}; + +/* signal handler to hairy PostScript code */ +static RETSIGTYPE psio_sigpipe_handler(); + +/* define local static variables */ +static int NeWS_mag; /* magnification currently in use */ +static int NeWS_shrink; /* shrink factor currently in use */ +static unsigned int NeWS_page_w; /* how big our current page is */ +static unsigned int NeWS_page_h; +static Boolean NeWS_active; /* if we've started a page yet */ +static int NeWS_pending; /* number of ack's we're expecting */ +static int NeWS_sending; /* level of nesting in send() */ +static Boolean NeWS_in_header; /* if we're sending a header */ +static Boolean NeWS_in_doc; /* if we've sent header information */ +static Boolean NeWS_pending_int; /* if interrupt rec'd while in send() */ +static Boolean NeWS_destroyed = False; + + +/* + * NeWS I/O code. This should send PS code to NeWS, + * receive acknowledgements, and receive X events in the meantime. + * It also checks for SIGPIPE errors. + */ + +#if HAVE_POLL +static struct pollfd fds[3] = {{0, POLLOUT, 0}, + {0, POLLIN, 0}, + {0, POLLIN, 0}}; +#define XDVI_ISSET(a, b, c) (fds[c].revents) +#else +static int numfds; +static fd_set readfds; +static fd_set writefds; +#define XDVI_ISSET(a, b, c) FD_ISSET(a, b) +#endif + + +/*---------------------------------------------------------------------------* + psio_sigpipe_handler () + + Arguments: sig, code, scp, addr (see man page for signal) + Returns: (void) + Side-Effects: SIGPIPE signal is flagged as sigpipe_error variable is set. + + Description: + Handler for SIGPIPE error generated by a broken pipe in the connection + to the NeWS server; this may be duer to some abnormal condition, or some + hairy PostScript code containing commands not implemented by the server. + ++----------------------------------------------------------------------------*/ + +static Boolean sigpipe_error = False; + +static struct sigaction psio_sigpipe_handler_struct; + /* initialized to {psio_sigpipe_handler, (sigset_t) 0, 0} in initNeWS */ + +/* ARGSUSED */ +static RETSIGTYPE +psio_sigpipe_handler(sig, code, scp, addr) + int sig; + int code; + struct sigcontext *scp; + char *addr; +{ + sigpipe_error = True; +} + + +/* + * read_from_NeWS - This does the actual retrieving of acknowledgements. + * If other bytes appear on the file - tough. + */ + +static void +read_from_NeWS() +{ + for (;;) { + int retval; + + retval = ps_checkfor(PostScriptInput, PSIO_FIND_TAG, 58); + if (retval == 0) break; + if (retval < 0) { + Fprintf(stderr, "[xdvik] ps_checkfor: %d\n", retval); + return; + } + (void) ps_checkfor(PostScriptInput, PSIO_WAIT_TAG, 58); + --NeWS_pending; + if (debug & DBG_PS) + Printf("Got NeWS ack; %d pending.\n", NeWS_pending); + } +} + + +/* + * Clean up after send() + */ + +static void +post_send() +{ + if (sigpipe_error) { + Fputs("NeWS died unexpectedly.\n", stderr); + destroyNeWS(); + draw_bbox(); + } + + if (NeWS_pending_int) { + NeWS_pending_int = False; + interruptNeWS(); + } +} + + +/* + * This actually sends the bytes to NeWS. + */ + +static void +send(cp, len) + _Xconst char *cp; + int len; +{ + struct sigaction orig; +#if HAVE_POLL + int retval; +#endif + + if (PostScript == (PSFILE *) NULL) return; + + if (!NeWS_sending) { + (void) sigaction(SIGPIPE, &psio_sigpipe_handler_struct, &orig); + sigpipe_error = False; + } + ++NeWS_sending; + +#ifndef FLAKY_SIGPOLL + (void) fcntl(ConnectionNumber(DISP), F_SETFL, + fcntl(ConnectionNumber(DISP), F_GETFL, 0) & ~FASYNC); +#endif + +#if ! HAVE_POLL + FD_ZERO(&readfds); + FD_ZERO(&writefds); +#endif + + for (;;) { + + if (terminate_flag) { + ps_destroy(); + exit(0); + } + +#if HAVE_POLL + for (;;) { + retval = poll(fds, XtNumber(fds), -1); + if (retval >= 0 || errno != EAGAIN) break; + } + if (retval < 0) { + if (errno == EINTR) + continue; + else { + perror("poll (xdvi NeWS_send)"); + break; + } + } +#else + FD_SET(ConnectionNumber(DISP), &readfds); + FD_SET(PostScript->file, &writefds); + FD_SET(PostScriptInput->file, &readfds); + + if (select(numfds, &readfds, &writefds, (fd_set *) NULL, + (struct timeval *) NULL) < 0 && errno != EINTR) { + perror("select (xdvi NeWS_send)"); + break; + } +#endif + + if (XDVI_ISSET(PostScriptInput->file, &readfds, 1)) + read_from_NeWS(); + if (XDVI_ISSET(PostScript->file, &writefds, 0)) { + int old_flags; + int bytes; + + old_flags = fcntl(PostScript->file, F_GETFL, 0); + if (old_flags < 0) break; + /* set to be non-blocking */ + if (fcntl(PostScript->file, F_SETFL, old_flags | O_NONBLOCK) + < 0) + break; + bytes = write(PostScript->file, cp, len); + if (bytes == -1) { + if (!AGAIN_CONDITION) perror("xdvi NeWS_send"); + } + else { + cp += bytes; + len -= bytes; + } + if (fcntl(PostScript->file, F_SETFL, old_flags) < 0) break; + if (len == 0 || sigpipe_error) break; + } + if (XDVI_ISSET(ConnectionNumber(DISP), &readfds, 2)) { + ps_read_events(False, False); + if (PostScript == (PSFILE *) NULL) break; /* if timeout occurred */ + } + } + +#ifndef FLAKY_SIGPOLL + (void) fcntl(ConnectionNumber(DISP), F_SETFL, + fcntl(ConnectionNumber(DISP), F_GETFL, 0) | FASYNC); +#endif + + if (--NeWS_sending == 0) { + /* put back generic handler for SIGPIPE */ + (void) sigaction(SIGPIPE, &orig, (struct sigaction *) NULL); + + if (!NeWS_in_header) post_send(); + } +} + +/* + * Wait for acknowledgement from NeWS. With NeWS we have no choice but + * to wait (||| I think). + */ + +static void +waitack() +{ +#if HAVE_POLL + int retval; +#endif +#ifndef FLAKY_SIGPOLL + int oldflags; +#endif + + if (PostScript == (PSFILE *) NULL) return; + +#ifndef FLAKY_SIGPOLL + oldflags = fcntl(ConnectionNumber(DISP), F_GETFL, 0); + (void) fcntl(ConnectionNumber(DISP), F_SETFL, oldflags & ~FASYNC); +#endif +#if ! HAVE_POLL + FD_ZERO(&readfds); +#endif + while (NeWS_pending > 0) { +#if HAVE_POLL + for (;;) { + retval = poll(fds + 1, XtNumber(fds) - 1, -1); + if (retval >= 0 || errno != EAGAIN) break; + } + if (retval < 0) { + if (errno == EINTR) + continue; + else { + perror("poll (xdvi NeWS_waitack)"); + break; + } + } +#else + FD_SET(ConnectionNumber(DISP), &readfds); + FD_SET(PostScriptInput->file, &readfds); + if (select(numfds, &readfds, (fd_set *) NULL, (fd_set *) NULL, + (struct timeval *) NULL) < 0 && errno != EINTR) { + perror("select (xdvi NeWS_waitack)"); + break; + } +#endif + + + if (XDVI_ISSET(PostScriptInput->file, &readfds, 1)) + read_from_NeWS(); + if (XDVI_ISSET(ConnectionNumber(DISP), &readfds, 2)) { + ps_read_events(False, False); + if (PostScript == (PSFILE *) NULL) /* if timeout occurred*/ + break; + } + } +#ifndef FLAKY_SIGPOLL + (void) fcntl(ConnectionNumber(DISP), F_SETFL, oldflags); +#endif +} + + +/*---------------------------------------------------------------------------* + initNeWS() + + Arguments: None. + Returns: True if and only if initialization succeeded + Side-Effects: Static variables may be set. + + Description: + Initializes variables for the application main loop. + ++----------------------------------------------------------------------------*/ + +Boolean +initNeWS() +{ + static NeWStoken newstoken; + + /* now try to open the connection to the NeWS server */ + if (ps_open_PostScript() == (PSFILE *) NULL) + return False; + +#if HAVE_POLL + fds[0].fd = PostScript->file; + fds[1].fd = PostScriptInput->file; + fds[2].fd = ConnectionNumber(DISP); +#else + numfds = ConnectionNumber(DISP); + if (numfds < PostScript->file) numfds = PostScript->file; + if (numfds < PostScriptInput->file) numfds = PostScriptInput->file; + ++numfds; +#endif + + psio_sigpipe_handler_struct.sa_handler = psio_sigpipe_handler; + sigemptyset(&psio_sigpipe_handler_struct.sa_mask); + + NeWS_active = NeWS_pending_int = False; + NeWS_sending = 0; + NeWS_in_header = True; + NeWS_pending = 1; + + ps_flush_PostScript(); + send(str0, sizeof(str0) - 1); + /* get xid of window, then make this window the NeWS canvas */ + (void) ps_token_from_xid(mane.win, &newstoken); + if (newstoken != -1) { + ps_setcanvas(newstoken); + ps_flush_PostScript(); + send(preamble, sizeof(preamble) - 1); + send(psheader, psheaderlen); + send(preamble2, sizeof(preamble2) - 1); + NeWS_in_header = False; + post_send(); + waitack(); + } + + if (NeWS_destroyed) return False; + + /* success */ + + NeWS_mag = NeWS_shrink = -1; + NeWS_page_w = page_w; + NeWS_page_h = page_h; + + psp = news_procs; + if (!postscript) toggleNeWS(); /* if we got a 'v' already */ + + return True; +} + + +/*---------------------------------------------------------------------------* + toggleNeWS() + + Arguments: none + Returns: (void) + Side-Effects: psp.drawbegin is changed + + Description: + Used to toggle the rendering of PostScript by the NeWS server + ++----------------------------------------------------------------------------*/ + +static void +toggleNeWS() +{ + if (postscript) psp.drawbegin = drawbeginNeWS; + else { + interruptNeWS(); + psp.drawbegin = drawbegin_none; + } +} + + +/*---------------------------------------------------------------------------* + destroyNeWS() + + Arguments: none + Returns: (void) + Side-Effects: the pointer to the NeWS file is nulled + + Description: + Close the connection to the NeWS server; used when rendering is terminated + in any way. + ++----------------------------------------------------------------------------*/ + +static void +destroyNeWS() +{ + psp = no_ps_procs; + NeWS_destroyed = True; + scanned_page = scanned_page_bak = scanned_page_reset; +} + + +/*---------------------------------------------------------------------------* + interruptNeWS() + + Arguments: none + Returns: void + + Description: + Close the connection to the NeWS server; used when rendering is terminated + because of an interruption in the viewing of the current page. + ||| It would be nice if we could asynchronously ``wake up'' a NeWS process + (preferably by sending something along the X socket); then we could do + better than just to wait. + ++----------------------------------------------------------------------------*/ + +static void +interruptNeWS() +{ + if (debug & DBG_PS) Puts("Running interruptNeWS()"); + if (NeWS_sending) NeWS_pending_int = True; + else { + if (NeWS_active) { + send(stopstring, sizeof(stopstring) - 1); + NeWS_active = False; + } + psp.interrupt = NullProc; /* prevent deep recursion in waitack */ + waitack(); + psp.interrupt = interruptNeWS; + } +} + + +/*---------------------------------------------------------------------------* + endpageNeWS() + + Arguments: none + Returns: (void) + Side-Effects: the NeWS_active variable is cleared. + + Description: + Should be called at the end of a page to end this chunk for the NeWS server. + ++----------------------------------------------------------------------------*/ + +static void +endpageNeWS() +{ + if (debug & DBG_PS) + Puts("endpage sent to NeWS Server"); + if (NeWS_active) { + send(stopstring, sizeof(stopstring) - 1); + NeWS_active = False; + waitack(); + } +} + + +/*---------------------------------------------------------------------------* + drawbeginNeWS () + + Arguments: xul, yul - coordinates of the upper left corner of the figure + cp - string with the bounding box line data + Returns: (void) + + Description: + Opens a connection to the NeWS server and send in the preamble and the + bounding box information after correctly computing resolution factors. + In case no rendering is to be done, outlines the figure. An outline is + also generated whenever the PostScript code is too hairy and generates + a SIGPIPE signal. + ++----------------------------------------------------------------------------*/ + +static void +drawbeginNeWS(xul, yul, cp) + int xul, yul; + _Xconst char *cp; +{ + char buf[100]; + static _Xconst char str[] = " TeXDict begin\n"; + static _Xconst char str2[] = "Hinitgraphics stop\n%%xdvimark\n"; + + if (debug & DBG_PS) { + Printf("xul= %d yul= %d\n", xul, yul); + Printf("String = < %s >\n", cp); + } + + /* catch up on the X side */ + XSync(DISP, False); + + if (!NeWS_active) { + /* send initialization to NeWS server */ + if (NeWS_page_w < page_w || NeWS_page_h < page_h) { + NeWS_page_w = page_w; + NeWS_page_h = page_h; + send(str2, sizeof(str2) - 1); + ++NeWS_pending; + } + if (magnification != NeWS_mag) { + Sprintf(buf, "H TeXDict begin /DVImag %d 1000 div def \ +end stop\n%%%%xdvimark\n", + NeWS_mag = magnification); + send(buf, strlen(buf)); + ++NeWS_pending; + } + if (mane.shrinkfactor != NeWS_shrink) { + Sprintf(buf, "H TeXDict begin %d %d div dup \ +/Resolution X /VResolution X \ +end stop\n%%%%xdvimark\n", + pixels_per_inch, NeWS_shrink = mane.shrinkfactor); + send(buf, strlen(buf)); + ++NeWS_pending; + } + send(str, sizeof(str) - 1); + NeWS_active = True; + ++NeWS_pending; + } + + Sprintf(buf, "%d %d moveto\n", xul, yul); + send(buf, strlen(buf)); + send(cp, strlen(cp)); +} + + +/*---------------------------------------------------------------------------* + drawrawNeWS() + + Arguments: origcp - the raw string to be sent to the postscript interpreter + Returns: (void) + Side-Effects: (none) + + Description: + If there is a valid connection to the NeWS server, just send the string to + the interpreter, else leave. + ++----------------------------------------------------------------------------*/ + +static void +drawrawNeWS(origcp) + _Xconst char *origcp; +{ + _Xconst char *pt, *ptm1, *ocp1; + static char *cp; + char *cp1; + static unsigned int cplen = 0; + unsigned int len; + double angle; + Boolean found = False; + + if (!NeWS_active) + return; + + if (debug & DBG_PS) + Printf("Raw PS sent to context: <%s>\n", origcp); + + /* take a look at the string: NeWS bums on certain rotations */ + len = strlen(origcp) + 4; + if (cplen < len) { + if (cplen != 0) free(cp); + cplen = len; + cp = xmalloc(cplen); + } + ocp1 = origcp; + pt = origcp; + while (*pt == ' ' || *pt == '\t') ++pt; + cp1 = cp; + for (;;) { + ptm1 = pt; + while (*pt != '\0' && *pt != ' ' && *pt != '\t') ++pt; + if (*pt == '\0') break; + while (*pt == ' ' || *pt == '\t') ++pt; + if (strncmp(pt, "rotate", 6) == 0 + && (pt[6] == '\0' || pt[6] == ' ' || pt[6] == '\t')) { + /* found rotate; check angle */ + if (sscanf(ptm1, "%lf", &angle) >= 1) { + found = True; + while (angle > 360.0) + angle -= 360; + while (angle < -360.0) + angle += 360; + if (angle == 90.0) { + angle = 89.999; + (void) memcpy(cp1, ocp1, ptm1 - ocp1); + cp1 += ptm1 - ocp1; + Strcpy(cp1, "89.999 rotate "); + cp1 += strlen(cp1); + while (*pt != '\0' && *pt != ' ' && *pt != '\t') ++pt; + while (*pt == ' ' || *pt == '\t') ++pt; + ocp1 = pt; + } else if (angle == -90.0) { + angle = -89.999; + (void) memcpy(cp1, ocp1, ptm1 - ocp1); + cp1 += ptm1 - ocp1; + Strcpy(cp1, "-89.999 rotate "); + cp1 += strlen(cp1); + while (*pt != '\0' && *pt != ' ' && *pt != '\t') ++pt; + while (*pt == ' ' || *pt == '\t') ++pt; + ocp1 = pt; + } else if (angle == 0.0) { + (void) memcpy(cp1, ocp1, ptm1 - ocp1); + cp1 += ptm1 - ocp1; + while (*pt != '\0' && *pt != ' ' && *pt != '\t') ++pt; + while (*pt == ' ' || *pt == '\t') ++pt; + ocp1 = pt; + } + } + } + } + Strcpy(cp1, ocp1); + if ((debug & DBG_PS) && found) { + Printf("String is now <%s>\n", cp); + Printf("Found rotate string. Angle is %g degrees.\n", angle); + } + + len = strlen(cp); + cp[len] = '\n'; + send(cp, len + 1); +} + + +/*---------------------------------------------------------------------------* + drawfileNeWS() + + Arguments: cp - string with the postscript file pathname + psfile - file, already opened + Returns: (void) + Side-Effects: none + + Description: + Postscript file containing the figure is opened and sent to the NeWS server. + Figure is outlined in case hairy code produces a SIGPIPE signal. + ++----------------------------------------------------------------------------*/ + +static void +drawfileNeWS(cp, psfile) + _Xconst char *cp; + FILE *psfile; +{ + char buffer[1025]; + int blen; + struct sigaction orig; + + if (!NeWS_active) { + Fclose(psfile); + ++n_files_left; + return; + } + + if (debug & DBG_PS) + Printf("printing file %s\n", cp); + /* some hairy PS code generates SIGPIPE signals; handle them */ + (void) sigaction(SIGPIPE, &psio_sigpipe_handler_struct, &orig); + sigpipe_error = False; + NeWS_sending = 1; + if (!sigpipe_error) + for (;;) { + blen = fread(buffer, sizeof(char), 1024, psfile); + if (blen == 0) break; + send(buffer, blen); + if (sigpipe_error) break; + } + Fclose(psfile); + ++n_files_left; + + --NeWS_sending; + /* put back generic handler for SIGPIPE */ + (void) sigaction(SIGPIPE, &orig, (struct sigaction *) NULL); + + if (sigpipe_error) { + Fputs("NeWS died unexpectedly.\n", stderr); + destroyNeWS(); + draw_bbox(); + } + + if (NeWS_pending_int) { + NeWS_pending_int = False; + interruptNeWS(); + } +} + + +/*---------------------------------------------------------------------------* + drawendNeWS() + + Arguments: cp - string with indication of the end of the special + Returns: (void) + + Description: + Sends the indication of end of the figure PostScript code. + ++----------------------------------------------------------------------------*/ + +static void +drawendNeWS(cp) + _Xconst char *cp; +{ + if (!NeWS_active) + return; + + if (debug & DBG_PS) + Puts("drawend sent to NeWS Server"); + send(cp, strlen(cp)); + send("\n", 1); +} + + +/*---------------------------------------------------------------------------* + beginheaderNeWS() + + Arguments: none + Returns: (void) + + Description: + Prepares the PostScript interpreter for receipt of header code. + ++----------------------------------------------------------------------------*/ + +static void +beginheaderNeWS() +{ + static _Xconst char str[] = "Hsave /xdvi$doc exch def\n"; + + if (debug & DBG_PS) Puts("Running beginheaderNeWS()"); + + if (NeWS_active) { + if (!NeWS_in_header) + oops("Internal error in beginheaderNeWS().\n"); + return; + } + + NeWS_in_header = True; + if (NeWS_in_doc) + send("H", 1); + else { + send(str, sizeof(str) - 1); + NeWS_in_doc = True; + } + NeWS_active = True; + ++NeWS_pending; +} + + +/*---------------------------------------------------------------------------* + endheaderNeWS() + + Arguments: none + Returns: (void) + + Description: + Prepares the PostScript interpreter for receipt of header code. + ++----------------------------------------------------------------------------*/ + +static void +endheaderNeWS() +{ + static _Xconst char str[] = "stop\n%%xdvimark\n"; + + if (debug & DBG_PS) Puts("Running endheaderNeWS()"); + + if (NeWS_active) { + send(str, sizeof(str) - 1); + NeWS_active = False; + NeWS_in_header = False; + post_send(); + waitack(); + } +} + + +/*---------------------------------------------------------------------------* + newdocNeWS() + + Arguments: none + Returns: (void) + + Description: + Clears out headers stored from the previous document. + ++----------------------------------------------------------------------------*/ + +static void +newdocNeWS() +{ + static _Xconst char str[] = + "H xdvi$doc restore stop\n%%xdvimark\n"; + + if (debug & DBG_PS) Puts("Running newdocNeWS()"); + + if (NeWS_in_doc) { + send(str, sizeof(str) - 1); + ++NeWS_pending; + NeWS_mag = NeWS_shrink = -1; + NeWS_in_doc = False; + } +} + +#endif /* PS_NEWS */ diff --git a/Build/source/texk/windvi/render.ps b/Build/source/texk/windvi/render.ps new file mode 100644 index 00000000000..0c2ed0ffa38 --- /dev/null +++ b/Build/source/texk/windvi/render.ps @@ -0,0 +1,310 @@ +% render.ps - write font bitmaps and metric information to standard output. +% Version 1.15. + +% Copyright (c) 1994, 1997 Paul Vojta. +% +% Redistribution and use in source and binary forms, with or without +% modification, are permitted provided that the following conditions +% are met: +% 1. Redistributions of source code must retain the above copyright +% notice, this list of conditions and the following disclaimer. +% 2. Redistributions in binary form must reproduce the above copyright +% notice, this list of conditions and the following disclaimer in the +% documentation and/or other materials provided with the distribution. +% +% THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +% ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +% ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +% FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +% DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +% OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +% HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +% LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +% OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +% SUCH DAMAGE. + +%%% +% Usage: gs -DNODISPLAY -q -- render.ps fontname dlstring specinfo dpi +% Then, it will read standard input to get: +% pointsize +% charset + +% Example: +% % gs -DNODISPLAY -q -- render.ps Helvetica "(phvr.gsf) run" \ +% > ".5 ExtendFont" 300 +% GS> 10 +% GS> 97 98 99 + +/TeXDict currentdict def % needed by dotlessj.pro + +%% +% +% Standard file definitions + +/.stdin where { pop } { /.stdin (%stdin) (r) file def } ifelse + +/bad-stdout false def +/.stdout where + { pop } + { { /.stdout (%stdout) (w) file def } stopped + { /bad-stdout true def } + if + } ifelse + +/bad-stderr false def +/.stderr where + { pop } + { { /.stderr (%stderr) (w) file def } stopped + { /bad-stderr true def } + if + } ifelse + +%% +% +% Define some routines first + +% (string) fatal - +% Print string to stderr and quit. + +/fatal + bad-stderr + {{ + (render.ps: ) exch concatstrings + print flush 1 .quit + }} + {{ + (render.ps: ) exch concatstrings + .stderr exch writestring .stderr flushfile 1 .quit + }} + ifelse +bind def + +% (string) brun - +% Load a font in .pfb format. + +/brun + { + (r) file false /PFBDecode filter cvx exec + } +bind def + +% (exec) getbbox - +% Get bounding box of the executable object and save it in char-urx, +% char-ury, etc. + +/getbbox + { + gsave + nulldevice + erasepage + newpath + exec + pathbbox % returns llx lly urx ury + /char-ury exch ceiling cvi def + /char-urx exch ceiling cvi def + /char-lly exch floor cvi def + /char-llx exch floor cvi def + grestore + } +bind def + +% - drawfontbbox - +% Draw the font's bbox. + +/drawfontbbox + { + currentfont /FontBBox get + dup dup 0 get exch 1 get currentfont /FontMatrix get transform moveto + dup dup 0 get exch 3 get currentfont /FontMatrix get transform lineto + dup dup 2 get exch 1 get currentfont /FontMatrix get transform lineto + dup 2 get exch 3 get currentfont /FontMatrix get transform lineto + } +bind def + +% (exec) mkbboxdev - +% Get bounding box of the executable object and make a device a few +% pixels larger on each side. If pathbbox fails for the object, +% then use the font's bbox. + +/mkbboxdev + { + getbbox + + char-llx char-urx sub round 0 eq char-lly char-ury sub round 0 eq or + { + {drawfontbbox} getbbox + } + if + + matrix + char-urx char-llx sub 4 add % width + dup /width exch def + char-ury char-lly sub 4 add % height + dup /height exch def + <ff 00> + makeimagedevice setdevice + 2 char-llx sub 2 char-lly sub translate + } +bind def + +%% +% +% These may be called by the "specinfo" string. + +/usefontbbox false def + +% These do things to a transformation array; called by entries in psfonts.map. +% +/ObliqueSlant {dup sin exch cos div neg} bind def +/SlantFont {font-size mul add} def +/ExtendFont {3 -1 roll mul exch} def +/ReEncodeFont {/Encoding exch def} def + +% Define writeppmfile, if it's not provided, or if the symbol .stdout is not +% available. + +/our-writeppmfile + + bad-stdout + systemdict /writeppmfile known not + or + {{ + (P4\n) print + width =string cvs print + ( ) print + height =string cvs print + (\n) print + + width 7 add 8 div cvi string + 0 1 height 1 sub + { + currentdevice exch 2 index copyscanlines + print + } + for + pop % discard string + }} + {{ + .stdout currentdevice writeppmfile + }} + ifelse +def + + +%% +% +% Main program begins now. Just interpret it. + +% Get arguments. + +shellarguments not + { + (You must provide arguments to the shell!\n) fatal + } +if + +/dpi exch cvr def +/specinfo exch def +/dlstring exch def +/fontname exch def + +% Return the gs version number to the calling program. + +(V ) print revision = + +% Open the font. + +dlstring () ne + { + dlstring cvx exec + Fontmap fontname cvn known + FontDirectory fontname cvn known or + } + { + Fontmap fontname cvn known + } +ifelse + +not + { + (font ) fontname concatstrings ( is not defined.\n) concatstrings + fatal + } +if + +% Get arguments from stdin. Just leave the character list on the stack. + +/font-size + .stdin 20 string readline pop cvr % get pointsize + 72.27 div dpi mul % let's work in (TeX) points +def +[ .stdin 1024 string readline pop cvx exec ] % character list + +% Define the font, and make it current. + + % Get the font. +fontname cvlit findfont + % Copy over the font dictionary to make it writable; + % this makes ReEncodeFont easier, and is needed for dotless j processing. + dup length 1 add dict begin + {1 index /FID ne {def}{pop pop} ifelse} forall + % Now do the transformations specified in psfonts.map. + [ font-size 0 specinfo cvx exec 0 exch font-size 0 0 ] + % End the current dictionary, and make it a font. + /TargetFont currentdict end definefont + % Apply the tranformation matrix and make the font current. +exch makefont dup /TargetFont exch def setfont + +% If the font's bounding box is zero, then do not use it. + +usefontbbox + { currentfont /FontBBox get + true exch {0 eq and} forall + {/usefontbbox false def}if + } +if + +% If we are to use the font's bounding box, then get it and transform it. + +usefontbbox + { + {drawfontbbox} mkbboxdev + } +if + +% Begin loop over characters. + + { + /charno exch def + /charstring 1 string dup 0 charno put def + /charwidth charstring stringwidth pop def + + % Get the character's bounding box. This also makes the device. + usefontbbox not + { + { 0 0 moveto charstring true charpath } mkbboxdev + } + if + + % Print the metric info. + (#^ ) print + charno =string cvs print + ( ) print + char-llx =string cvs print + ( ) print + char-lly =string cvs print + ( ) print + char-urx =string cvs print + ( ) print + char-ury =string cvs print + ( ) print + charwidth =string cvs print + (\n) print + + % Now write the bitmap. + erasepage 0 0 moveto + charstring show + our-writeppmfile + } +forall diff --git a/Build/source/texk/windvi/resource.h b/Build/source/texk/windvi/resource.h new file mode 100644 index 00000000000..0bccdd829ac --- /dev/null +++ b/Build/source/texk/windvi/resource.h @@ -0,0 +1,133 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by windvi.rc +// +#define IDS_APPNAME 1 +#define IDS_DESCRIPTION 2 +#define IDD_VERFIRST 100 +#define IDI_APPICON 101 +#define IDM_STATUSBAR 102 +#define IDR_TOOLBAR1 113 +#define DLGCONFIG 119 +#define IDD_MAGNIFY_DIALOG 122 +#define IDD_VERDESC 201 +#define IDD_VERVERSION 202 +#define IDD_VERCOPY 203 +#define IDD_VERLAST 204 +#define IDD_TEXT 205 +#define IDD_CANCEL 206 +#define IDD_FILE 207 +#define IDM_HELPTOPICS 304 +#define IDS_NO_HELP 504 +#define IDB_BMP 700 +#define IDS_SYSMENU 900 +#define IDS_FILEMENU 1000 +#define IDC_CHECKALIASING 1001 +#define IDC_CHECKALLOWSHELL 1002 +#define IDC_CHECKGSALPHA 1003 +#define IDC_CHECKHUSHCHARS 1004 +#define IDC_CHECKHUSHCHECKSUMS 1005 +#define IDC_CHECKHUSHSPECIALS 1006 +#define IDC_CHECKINMEMORY 1007 +#define IDC_CHECKLISTFONTS 1008 +#define IDC_CHECKMAKEPK 1009 +#define IDC_CHECKPOSTSCRIPT 1010 +#define IDC_CHECKREVIDEO 1011 +#define IDC_CHECKSCAN 1012 +#define IDC_CHECKSINGLE 1013 +#define IDC_CHECKXFORM 1014 +#define IDC_COMBOMFMODE 1015 +#define IDC_COMBOPAPER 1016 +#define IDC_COMBO_BACK_COLOR 1017 +#define IDC_COMBO_FORE_COLOR 1018 +#define IDC_EDITALTFONT 1019 +#define IDC_EDITBDPI 1020 +#define IDC_EDITDENSITY 1021 +#define IDC_EDITGAMMA 1022 +#define IDC_EDITMGS1 1023 +#define IDC_EDITMGS2 1024 +#define IDC_EDITMGS3 1025 +#define IDC_LOG_EDIT 1026 +#define IDC_PAGE_NUMBER 1027 +#define IDC_SPIN_PAGE_NUMBER 1028 +#define IDC_PRINT_PROGRESS_PAGE 1029 +#define IDC_PRINT_PROGRESS_BAND 1030 +#define IDC_MAG_CURSOR_CHECK 1031 +#define IDC_MAG_RULERS_CHECK 1032 +#define IDC_CHECKLOG 1033 +#define IDM_ABOUT 2001 +#define IDM_EXIT 2002 +#define IDM_FILECLOSE 2003 +#define IDM_FILEOPEN 2004 +#define IDM_FILEPAGESU 2005 +#define IDM_FILEPRINT 2006 +#define IDM_FILEPRINTDVIPS 2007 +#define IDM_FILEPRINTSU 2008 +#define IDM_FIRSTPAGE 2009 +#define IDM_GOTOPAGE 2010 +#define IDM_KEEPPOS 2011 +#define IDM_LASTPAGE 2012 +#define IDM_NEXT10 2013 +#define IDM_NEXT5 2014 +#define IDM_NEXTPAGE 2015 +#define IDM_PREVIOUS10 2016 +#define IDM_PREVIOUS5 2017 +#define IDM_PREVIOUSPAGE 2018 +#define IDM_TOGGLEPS 2019 +#define IDM_ZOOMIN 2020 +#define IDM_ZOOMOUT 2021 +#define IDS_HELPMENU 2022 +#define IDS_MOVEMENU 2023 +#define IDS_VIEWMENU 2024 +#define IDM_FILE_RECENT 2100 +#define IDM_FILE_RECENT1 2101 +#define IDM_FILE_RECENT2 2102 +#define IDM_FILE_RECENT3 2103 +#define IDM_FILE_RECENT4 2104 +#define IDM_FILE_RECENT5 2105 +#define IDM_FILE_RECENT6 2106 +#define IDM_FILE_RECENT7 2107 +#define IDM_FILE_RECENT8 2108 +#define IDM_FILE_RECENT9 2109 +#define ID_BUTTON40028 40028 +#define ID_BUTTON40029 40029 +#define ID_BUTTON40030 40030 +#define ID_BUTTON40031 40031 +#define ID_BUTTON40032 40032 +#define ID_BUTTON40033 40033 +#define ID_BUTTON40034 40034 +#define ID_BUTTON40035 40035 +#define ID_BUTTON40036 40036 +#define ID_BUTTON40037 40037 +#define ID_BUTTON40038 40038 +#define IDM_TOGGLEGRID 40039 +#define IDM_REDRAWPAGE 40040 +#define IDM_VIEW_LOG 40043 +#define ID_OPTIONS_TEXCONFIG 40046 +#define ID_OPTIONS_WINDVI 40047 +#define ID_BUTTON40048 40048 +#define IDM_NAVIGATEBACK 40048 +#define IDM_URLBACK 40049 +#define IDM_BOOKMODE 40050 +#define IDM_SRCSPECIALS 40051 +#define IDS_SCSIZE 61440 +#define IDS_SCMOVE 61456 +#define IDS_SCMINIMIZE 61472 +#define IDS_SCMAXIMIZE 61488 +#define IDS_SCCLOSE 61536 +#define IDS_SCRESTORE 61728 +#define IDS_SCTASKLIST 61744 +#define IDC_STATIC -1 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NO_MFC 1 +#define _APS_3D_CONTROLS 1 +#define _APS_NEXT_RESOURCE_VALUE 123 +#define _APS_NEXT_COMMAND_VALUE 40052 +#define _APS_NEXT_CONTROL_VALUE 1033 +#define _APS_NEXT_SYMED_VALUE 102 +#endif +#endif diff --git a/Build/source/texk/windvi/samples.lst b/Build/source/texk/windvi/samples.lst new file mode 100644 index 00000000000..4af1b7f170d --- /dev/null +++ b/Build/source/texk/windvi/samples.lst @@ -0,0 +1,11 @@ +fab.eps +fab.jpg +fab.jpg.bb +ws_gzip.ps.bb +ws_gzip.ps.gz +ws_gzip.ps.bz2 +wsample.ps +wtest.dvi +wtest.ps +wtest.tex +pspicture.ps
\ No newline at end of file diff --git a/Build/source/texk/windvi/sfDir.c b/Build/source/texk/windvi/sfDir.c new file mode 100644 index 00000000000..2a4e4306257 --- /dev/null +++ b/Build/source/texk/windvi/sfDir.c @@ -0,0 +1,163 @@ +/* + * Copyright 1989 Software Research Associates, Inc., Tokyo, Japan + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Software Research Associates not be used + * in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. Software Research Associates + * makes no representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * SOFTWARE RESEARCH ASSOCIATES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, + * IN NO EVENT SHALL SOFTWARE RESEARCH ASSOCIATES BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * Author: Erik M. van der Poel + * Software Research Associates, Inc., Tokyo, Japan + * erik@sra.co.jp + */ + +#ifdef HAVE_CONFIG_H +#include "c-auto.h" +#endif + +#if !defined (NOSELFILE) && !defined (NOTOOL) /* for xdvik */ + +#include <stdio.h> + +#ifdef SEL_FILE_IGNORE_CASE +#include <ctype.h> +#endif /* def SEL_FILE_IGNORE_CASE */ + +#include "sfinternal.h" + +#include <kpathsea/c-auto.h> +#include <kpathsea/config.h> +#include <kpathsea/c-dir.h> +#include <kpathsea/c-stat.h> + +#ifdef SEL_FILE_IGNORE_CASE +int +SFcompareEntries(p, q) + SFEntry *p; + SFEntry *q; +{ + register char *r, *s; + register char c1, c2; + + r = p->real; + s = q->real; + + c1 = *r++; + if (islower(c1)) { + c1 = toupper(c1); + } + c2 = *s++; + if (islower(c2)) { + c2 = toupper(c2); + } + + while (c1 == c2) { + if (!c1) { + return strcmp(p->real, q->real); + } + c1 = *r++; + if (islower(c1)) { + c1 = toupper(c1); + } + c2 = *s++; + if (islower(c2)) { + c2 = toupper(c2); + } + } + + return c1 - c2; +} +#else /* def SEL_FILE_IGNORE_CASE */ +int +SFcompareEntries(p, q) + SFEntry *p; + SFEntry *q; +{ + return strcmp(p->real, q->real); +} +#endif /* def SEL_FILE_IGNORE_CASE */ + +int +SFgetDir(dir) + SFDir *dir; +{ + SFEntry *result = NULL; + int alloc = 0; + int i; + DIR *dirp; + struct dirent *dp; + char *str; + int len; + int maxChars; + struct stat statBuf; + + maxChars = strlen(dir->dir) - 1; + + dir->entries = NULL; + dir->nEntries = 0; + dir->nChars = 0; + + result = NULL; + i = 0; + + dirp = opendir("."); + if (!dirp) { + return 1; + } + + (void) stat(".", &statBuf); + dir->mtime = statBuf.st_mtime; + + (void) readdir(dirp); /* throw away "." */ + +#ifndef S_IFLNK + (void) readdir(dirp); /* throw away ".." */ +#endif /* ndef S_IFLNK */ + + while ((dp = readdir(dirp))) { + if (i >= alloc) { + alloc = 2 * (alloc + 1); + result = (SFEntry *) XtRealloc((char *) result, + (unsigned) (alloc * sizeof(SFEntry))); + } + result[i].statDone = 0; + str = dp->d_name; + len = strlen(str); + result[i].real = XtMalloc((unsigned) (len + 2)); + (void) strcat(strcpy(result[i].real, str), " "); + if (len > maxChars) { + maxChars = len; + } + result[i].shown = result[i].real; + i++; + } + +#if defined(SVR4) || defined(SYSV) || defined(USG) + qsort((char *) result, (unsigned) i, sizeof(SFEntry), SFcompareEntries); +#else /* defined(SVR4) || defined(SYSV) || defined(USG) */ + qsort((char *) result, i, sizeof(SFEntry), SFcompareEntries); +#endif /* defined(SVR4) || defined(SYSV) || defined(USG) */ + + dir->entries = result; + dir->nEntries = i; + dir->nChars = maxChars + 1; + + closedir(dirp); + + return 0; +} + +#endif /* not NOSELFILE and not NOTOOL */ diff --git a/Build/source/texk/windvi/sfDraw.c b/Build/source/texk/windvi/sfDraw.c new file mode 100644 index 00000000000..45f67157800 --- /dev/null +++ b/Build/source/texk/windvi/sfDraw.c @@ -0,0 +1,938 @@ +/* + * Copyright 1989 Software Research Associates, Inc., Tokyo, Japan + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Software Research Associates not be used + * in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. Software Research Associates + * makes no representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * SOFTWARE RESEARCH ASSOCIATES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, + * IN NO EVENT SHALL SOFTWARE RESEARCH ASSOCIATES BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * Author: Erik M. van der Poel + * Software Research Associates, Inc., Tokyo, Japan + * erik@sra.co.jp + */ + +#ifdef HAVE_CONFIG_H +#include "c-auto.h" +#endif + +#if !defined (NOSELFILE) && !defined (NOTOOL) /* for xdvik */ + +#include <kpathsea/c-auto.h> +#include <kpathsea/config.h> +#include <kpathsea/c-stat.h> + +#include <stdio.h> +#include "sfinternal.h" +#include <X11/StringDefs.h> +#include <X11/Xaw/Scrollbar.h> +#include <X11/Xaw/Cardinals.h> + +#define SF_DEFAULT_FONT "9x15" + +#ifdef ABS +#undef ABS +#endif +#define ABS(x) (((x) < 0) ? (-(x)) : (x)) + +typedef struct { + char *fontname; +} TextData, *textPtr; + +int SFcharWidth, SFcharAscent, SFcharHeight; + +int SFcurrentInvert[3] = { -1, -1, -1 }; + +static GC SFlineGC, SFscrollGC, SFinvertGC, SFtextGC; + +static XtResource textResources[] = { + {XtNfont, XtCFont, XtRString, sizeof (char *), + XtOffset(textPtr, fontname), XtRString, SF_DEFAULT_FONT}, +}; + +static XFontStruct *SFfont; + +static int SFcurrentListY; + +static XtIntervalId SFscrollTimerId; + +void +SFinitFont() +{ + TextData *data; + + data = XtNew(TextData); + + XtGetApplicationResources(selFileForm, (XtPointer) data, textResources, + XtNumber(textResources), (Arg *) NULL, ZERO); + + SFfont = XLoadQueryFont(SFdisplay, data->fontname); + if (!SFfont) { + SFfont = XLoadQueryFont(SFdisplay, SF_DEFAULT_FONT); + if (!SFfont) { + char sbuf[256]; + + (void) sprintf(sbuf, "XsraSelFile: can't get font %s", + SF_DEFAULT_FONT); + + XtAppError(SFapp, sbuf); + } + } + + SFcharWidth = (SFfont->max_bounds.width + SFfont->min_bounds.width) / 2; + SFcharAscent = SFfont->max_bounds.ascent; + SFcharHeight = SFcharAscent + SFfont->max_bounds.descent; +} + +void +SFcreateGC() +{ + XGCValues gcValues; + XRectangle rectangles[1]; + + gcValues.foreground = SFfore; + + SFlineGC = XtGetGC( + selFileLists[0], + (XtGCMask) + GCForeground | + 0, + &gcValues + ); + + SFscrollGC = XtGetGC( + selFileLists[0], + (XtGCMask) + 0, + &gcValues + ); + + gcValues.function = GXinvert; + gcValues.plane_mask = (SFfore ^ SFback); + + SFinvertGC = XtGetGC( + selFileLists[0], + (XtGCMask) + GCFunction | + GCPlaneMask | + 0, + &gcValues + ); + + gcValues.foreground = SFfore; + gcValues.background = SFback; + gcValues.font = SFfont->fid; + + SFtextGC = XCreateGC( + SFdisplay, + XtWindow(selFileLists[0]), + (unsigned long) + GCForeground | + GCBackground | + GCFont | + 0, + &gcValues + ); + + rectangles[0].x = SFlineToTextH + SFbesideText; + rectangles[0].y = 0; + rectangles[0].width = SFcharsPerEntry * SFcharWidth; + rectangles[0].height = SFupperY + 1; + + XSetClipRectangles( + SFdisplay, + SFtextGC, + 0, + 0, + rectangles, + 1, + Unsorted + ); +} + +void +SFclearList(n, doScroll) + int n; + int doScroll; +{ + SFDir *dir; + + SFcurrentInvert[n] = -1; + + XClearWindow(SFdisplay, XtWindow(selFileLists[n])); + + XDrawSegments(SFdisplay, XtWindow(selFileLists[n]), SFlineGC, SFsegs, + 2); + + if (doScroll) { + dir = &(SFdirs[SFdirPtr + n]); + + if ((SFdirPtr + n < SFdirEnd) && dir->nEntries && dir->nChars) { + XawScrollbarSetThumb( + selFileVScrolls[n], + (float) (((double) dir->vOrigin) / + dir->nEntries), + (float) (((double) ((dir->nEntries < SFlistSize) + ? dir->nEntries : SFlistSize)) / + dir->nEntries) + ); + + XawScrollbarSetThumb( + selFileHScrolls[n], + (float) (((double) dir->hOrigin) / dir->nChars), + (float) (((double) ((dir->nChars < + SFcharsPerEntry) ? dir->nChars : + SFcharsPerEntry)) / dir->nChars) + ); + } else { + XawScrollbarSetThumb(selFileVScrolls[n], (float) 0.0, + (float) 1.0); + XawScrollbarSetThumb(selFileHScrolls[n], (float) 0.0, + (float) 1.0); + } + } +} + +static void +SFdeleteEntry(dir, entry) + SFDir *dir; + SFEntry *entry; +{ + register SFEntry *e; + register SFEntry *end; + int n; + int idx; + + idx = entry - dir->entries; + + if (idx < dir->beginSelection) { + dir->beginSelection--; + } + if (idx <= dir->endSelection) { + dir->endSelection--; + } + if (dir->beginSelection > dir->endSelection) { + dir->beginSelection = dir->endSelection = -1; + } + + if (idx < dir->vOrigin) { + dir->vOrigin--; + } + + XtFree(entry->real); + + end = &(dir->entries[dir->nEntries - 1]); + + for (e = entry; e < end; e++) { + *e = *(e + 1); + } + + if (!(--dir->nEntries)) { + return; + } + + n = dir - &(SFdirs[SFdirPtr]); + if ((n < 0) || (n > 2)) { + return; + } + + XawScrollbarSetThumb( + selFileVScrolls[n], + (float) (((double) dir->vOrigin) / dir->nEntries), + (float) (((double) ((dir->nEntries < SFlistSize) ? + dir->nEntries : SFlistSize)) / dir->nEntries) + ); +} + +static void +SFwriteStatChar(name, last, statBuf) + char *name; + int last; + struct stat *statBuf; +{ + name[last] = SFstatChar(statBuf); +} + +static int +SFstatAndCheck(dir, entry) + SFDir *dir; + SFEntry *entry; +{ + struct stat statBuf; + char save; + int last; + extern int SFchdir (); + + /* + * must be restored before returning + */ + save = *(dir->path); + *(dir->path) = 0; + + if (!SFchdir(SFcurrentPath)) { + last = strlen(entry->real) - 1; + entry->real[last] = 0; + entry->statDone = 1; + if ( + (!stat(entry->real, &statBuf)) + +#ifdef S_IFLNK + + || (!lstat(entry->real, &statBuf)) + +#endif /* ndef S_IFLNK */ + + ) { + if (SFfunc) { + char *shown; + + shown = NULL; + if (SFfunc(entry->real, &shown, &statBuf)) { + if (shown) { + int len; + + len = strlen(shown); + entry->shown = XtMalloc( + (unsigned) (len + 2) + ); + (void) strcpy(entry->shown, + shown); + SFwriteStatChar( + entry->shown, + len, + &statBuf + ); + entry->shown[len + 1] = 0; + } + } else { + SFdeleteEntry(dir, entry); + + *(dir->path) = save; + return 1; + } + } + SFwriteStatChar(entry->real, last, &statBuf); + } else { + entry->real[last] = ' '; + } + } + + *(dir->path) = save; + return 0; +} + +static void +SFdrawStrings(w, dir, from, to) + register Window w; + register SFDir *dir; + register int from; + register int to; +{ + register int i; + register SFEntry *entry; + int x; + + x = SFtextX - dir->hOrigin * SFcharWidth; + + if (dir->vOrigin + to >= dir->nEntries) { + to = dir->nEntries - dir->vOrigin - 1; + } + for (i = from; i <= to; i++) { + entry = &(dir->entries[dir->vOrigin + i]); + if (!(entry->statDone)) { + if (SFstatAndCheck(dir, entry)) { + if (dir->vOrigin + to >= dir->nEntries) { + to = dir->nEntries - dir->vOrigin - 1; + } + i--; + continue; + } + } + XDrawImageString( + SFdisplay, + w, + SFtextGC, + x, + SFtextYoffset + i * SFentryHeight, + entry->shown, + strlen(entry->shown) + ); + if (dir->vOrigin + i == dir->beginSelection) { + XDrawLine( + SFdisplay, + w, + SFlineGC, + SFlineToTextH + 1, + SFlowerY + i * SFentryHeight, + SFlineToTextH + SFentryWidth - 2, + SFlowerY + i * SFentryHeight + ); + } + if ( + (dir->vOrigin + i >= dir->beginSelection) && + (dir->vOrigin + i <= dir->endSelection) + ) { + SFcompletionSegs[0].y1 = SFcompletionSegs[1].y1 = + SFlowerY + i * SFentryHeight; + SFcompletionSegs[0].y2 = SFcompletionSegs[1].y2 = + SFlowerY + (i + 1) * SFentryHeight - 1; + XDrawSegments( + SFdisplay, + w, + SFlineGC, + SFcompletionSegs, + 2 + ); + } + if (dir->vOrigin + i == dir->endSelection) { + XDrawLine( + SFdisplay, + w, + SFlineGC, + SFlineToTextH + 1, + SFlowerY + (i + 1) * SFentryHeight - 1, + SFlineToTextH + SFentryWidth - 2, + SFlowerY + (i + 1) * SFentryHeight - 1 + ); + } + } +} + +void +SFdrawList(n, doScroll) + int n; + int doScroll; +{ + SFDir *dir; + Window w; + + SFclearList(n, doScroll); + + if (SFdirPtr + n < SFdirEnd) { + dir = &(SFdirs[SFdirPtr + n]); + w = XtWindow(selFileLists[n]); + XDrawImageString( + SFdisplay, + w, + SFtextGC, + SFtextX - dir->hOrigin * SFcharWidth, + SFlineToTextV + SFaboveAndBelowText + SFcharAscent, + dir->dir, + strlen(dir->dir) + ); + SFdrawStrings(w, dir, 0, SFlistSize - 1); + } +} + +void +SFdrawLists(doScroll) + int doScroll; +{ + int i; + + for (i = 0; i < 3; i++) { + SFdrawList(i, doScroll); + } +} + +static void +SFinvertEntry(n) + register int n; +{ + XFillRectangle( + SFdisplay, + XtWindow(selFileLists[n]), + SFinvertGC, + SFlineToTextH, + SFcurrentInvert[n] * SFentryHeight + SFlowerY, + SFentryWidth, + SFentryHeight + ); +} + +static unsigned long +SFscrollTimerInterval() +{ + static int maxVal = 200; + static int varyDist = 50; + static int minDist = 50; + int t; + int dist; + + if (SFcurrentListY < SFlowerY) { + dist = SFlowerY - SFcurrentListY; + } else if (SFcurrentListY > SFupperY) { + dist = SFcurrentListY - SFupperY; + } else { + return (unsigned long) 1; + } + + t = maxVal - ((maxVal / varyDist) * (dist - minDist)); + + if (t < 1) { + t = 1; + } + + if (t > maxVal) { + t = maxVal; + } + + return (unsigned long) t; +} + +static void +SFscrollTimer(p, id) + XtPointer p; + XtIntervalId *id; +{ + SFDir *dir; + int save; + int n; + + n = (int) p; + + dir = &(SFdirs[SFdirPtr + n]); + save = dir->vOrigin; + + if (SFcurrentListY < SFlowerY) { + if (dir->vOrigin > 0) { + SFvSliderMovedCallback(selFileVScrolls[n], n, + dir->vOrigin - 1); + } + } else if (SFcurrentListY > SFupperY) { + if (dir->vOrigin < dir->nEntries - SFlistSize) { + SFvSliderMovedCallback(selFileVScrolls[n], n, + dir->vOrigin + 1); + } + } + + if (dir->vOrigin != save) { + if (dir->nEntries) { + XawScrollbarSetThumb( + selFileVScrolls[n], + (float) (((double) dir->vOrigin) / dir->nEntries), + (float) (((double) ((dir->nEntries < SFlistSize) ? + dir->nEntries : SFlistSize)) / dir->nEntries) + ); + } + } + + if (SFbuttonPressed) { + SFscrollTimerId = XtAppAddTimeOut(SFapp, + SFscrollTimerInterval(), SFscrollTimer, (XtPointer) n); + } +} + +static int +SFnewInvertEntry(n, event) + register int n; + register XMotionEvent *event; +{ + register int x, y; + register int new; + static int SFscrollTimerAdded = 0; + + x = event->x; + y = event->y; + + if (SFdirPtr + n >= SFdirEnd) { + return -1; + } else if ( + (x >= 0) && (x <= SFupperX) && + (y >= SFlowerY) && (y <= SFupperY) + ) { + register SFDir *dir = &(SFdirs[SFdirPtr + n]); + + if (SFscrollTimerAdded) { + SFscrollTimerAdded = 0; + XtRemoveTimeOut(SFscrollTimerId); + } + + new = (y - SFlowerY) / SFentryHeight; + if (dir->vOrigin + new >= dir->nEntries) { + return -1; + } + return new; + } else { + if (SFbuttonPressed) { + SFcurrentListY = y; + if (!SFscrollTimerAdded) { + SFscrollTimerAdded = 1; + SFscrollTimerId = XtAppAddTimeOut(SFapp, + SFscrollTimerInterval(), SFscrollTimer, + (XtPointer) n); + } + } + + return -1; + } +} + +/* ARGSUSED */ +void +SFenterList(w, n, event) + Widget w; + register int n; + register XEnterWindowEvent *event; +{ + register int new; + + /* sanity */ + if (SFcurrentInvert[n] != -1) { + SFinvertEntry(n); + SFcurrentInvert[n] = -1; + } + + new = SFnewInvertEntry(n, (XMotionEvent *) event); + if (new != -1) { + SFcurrentInvert[n] = new; + SFinvertEntry(n); + } +} + +/* ARGSUSED */ +void +SFleaveList(w, n, event) + Widget w; + register int n; + XEvent *event; +{ + if (SFcurrentInvert[n] != -1) { + SFinvertEntry(n); + SFcurrentInvert[n] = -1; + } +} + +/* ARGSUSED */ +void +SFmotionList(w, n, event) + Widget w; + register int n; + register XMotionEvent *event; +{ + register int new; + + new = SFnewInvertEntry(n, event); + + if (new != SFcurrentInvert[n]) { + if (SFcurrentInvert[n] != -1) { + SFinvertEntry(n); + } + SFcurrentInvert[n] = new; + if (new != -1) { + SFinvertEntry(n); + } + } +} + +/* ARGSUSED */ +void +SFvFloatSliderMovedCallback(w, n, fnew) + Widget w; + int n; + float *fnew; +{ + int new; + + new = (*fnew) * SFdirs[SFdirPtr + n].nEntries; + + SFvSliderMovedCallback(w, n, new); +} + +/* ARGSUSED */ +void +SFvSliderMovedCallback(w, n, new) + Widget w; + int n; + int new; +{ + int old; + register Window win; + SFDir *dir; + + dir = &(SFdirs[SFdirPtr + n]); + + old = dir->vOrigin; + dir->vOrigin = new; + + if (old == new) { + return; + } + + win = XtWindow(selFileLists[n]); + + if (ABS(new - old) < SFlistSize) { + if (new > old) { + XCopyArea( + SFdisplay, + win, + win, + SFscrollGC, + SFlineToTextH, + SFlowerY + (new - old) * SFentryHeight, + SFentryWidth + SFlineToTextH, + (SFlistSize - (new - old)) * SFentryHeight, + SFlineToTextH, + SFlowerY + ); + XClearArea( + SFdisplay, + win, + SFlineToTextH, + SFlowerY + (SFlistSize - (new - old)) * + SFentryHeight, + SFentryWidth + SFlineToTextH, + (new - old) * SFentryHeight, + False + ); + SFdrawStrings(win, dir, SFlistSize - (new - old), + SFlistSize - 1); + } else { + XCopyArea( + SFdisplay, + win, + win, + SFscrollGC, + SFlineToTextH, + SFlowerY, + SFentryWidth + SFlineToTextH, + (SFlistSize - (old - new)) * SFentryHeight, + SFlineToTextH, + SFlowerY + (old - new) * SFentryHeight + ); + XClearArea( + SFdisplay, + win, + SFlineToTextH, + SFlowerY, + SFentryWidth + SFlineToTextH, + (old - new) * SFentryHeight, + False + ); + SFdrawStrings(win, dir, 0, old - new); + } + } else { + XClearArea( + SFdisplay, + win, + SFlineToTextH, + SFlowerY, + SFentryWidth + SFlineToTextH, + SFlistSize * SFentryHeight, + False + ); + SFdrawStrings(win, dir, 0, SFlistSize - 1); + } +} + +/* ARGSUSED */ +void +SFvAreaSelectedCallback(w, n, pnew) + Widget w; + int n; + int pnew; +{ + SFDir *dir; + int new; + + dir = &(SFdirs[SFdirPtr + n]); + + new = dir->vOrigin + + (((double) pnew) / SFvScrollHeight) * dir->nEntries; + + if (new > dir->nEntries - SFlistSize) { + new = dir->nEntries - SFlistSize; + } + + if (new < 0) { + new = 0; + } + + if (dir->nEntries) { + float f; + + f = ((double) new) / dir->nEntries; + + XawScrollbarSetThumb( + w, + f, + (float) (((double) ((dir->nEntries < SFlistSize) ? + dir->nEntries : SFlistSize)) / dir->nEntries) + ); + } + + SFvSliderMovedCallback(w, n, new); +} + +/* ARGSUSED */ +void +SFhSliderMovedCallback(w, n, new) + Widget w; + int n; + float *new; +{ + SFDir *dir; + int save; + + dir = &(SFdirs[SFdirPtr + n]); + save = dir->hOrigin; + dir->hOrigin = (*new) * dir->nChars; + if (dir->hOrigin == save) { + return; + } + + SFdrawList(n, SF_DO_NOT_SCROLL); +} + +/* ARGSUSED */ +void +SFhAreaSelectedCallback(w, n, pnew) + Widget w; + int n; + int pnew; +{ + SFDir *dir; + int new; + + dir = &(SFdirs[SFdirPtr + n]); + + new = dir->hOrigin + + (((double) pnew) / SFhScrollWidth) * dir->nChars; + + if (new > dir->nChars - SFcharsPerEntry) { + new = dir->nChars - SFcharsPerEntry; + } + + if (new < 0) { + new = 0; + } + + if (dir->nChars) { + float f; + + f = ((double) new) / dir->nChars; + + XawScrollbarSetThumb( + w, + f, + (float) (((double) ((dir->nChars < SFcharsPerEntry) ? + dir->nChars : SFcharsPerEntry)) / dir->nChars) + ); + + SFhSliderMovedCallback(w, n, &f); + } +} + +/* ARGSUSED */ +void +SFpathSliderMovedCallback(w, client_data, new) + Widget w; + XtPointer client_data; + float *new; +{ + SFDir *dir; + int n; + XawTextPosition pos; + int SFdirPtrSave; + + SFdirPtrSave = SFdirPtr; + SFdirPtr = (*new) * SFdirEnd; + if (SFdirPtr == SFdirPtrSave) { + return; + } + + SFdrawLists(SF_DO_SCROLL); + + n = 2; + while (SFdirPtr + n >= SFdirEnd) { + n--; + } + + dir = &(SFdirs[SFdirPtr + n]); + + pos = dir->path - SFcurrentPath; + + if (!strncmp(SFcurrentPath, SFstartDir, strlen(SFstartDir))) { + pos -= strlen(SFstartDir); + if (pos < 0) { + pos = 0; + } + } + + XawTextSetInsertionPoint(selFileField, pos); +} + +/* ARGSUSED */ + +void +SFpathAreaSelectedCallback(w, client_data, pnew) + Widget w; + XtPointer client_data; + int pnew; +{ + int new; + float f; + + new = SFdirPtr + (((double) pnew) / SFpathScrollWidth) * SFdirEnd; + + if (new > SFdirEnd - 3) { + new = SFdirEnd - 3; + } + + if (new < 0) { + new = 0; + } + + f = ((double) new) / SFdirEnd; + + XawScrollbarSetThumb( + w, + f, + (float) (((double) ((SFdirEnd < 3) ? SFdirEnd : 3)) / + SFdirEnd) + ); + + SFpathSliderMovedCallback(w, (XtPointer) NULL, &f); +} + +Boolean +SFworkProc() +{ + register SFDir *dir; + register SFEntry *entry; + + for (dir = &(SFdirs[SFdirEnd - 1]); dir >= SFdirs; dir--) { + if (!(dir->nEntries)) { + continue; + } + for ( + entry = &(dir->entries[dir->nEntries - 1]); + entry >= dir->entries; + entry-- + ) { + if (!(entry->statDone)) { + (void) SFstatAndCheck(dir, entry); + return False; + } + } + } + + SFworkProcAdded = 0; + + return True; +} + +#endif /* not NOSELFILE and not NOTOOL */ + diff --git a/Build/source/texk/windvi/sfPath.c b/Build/source/texk/windvi/sfPath.c new file mode 100644 index 00000000000..87cfa29683e --- /dev/null +++ b/Build/source/texk/windvi/sfPath.c @@ -0,0 +1,923 @@ +/* + * Copyright 1989 Software Research Associates, Inc., Tokyo, Japan + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Software Research Associates not be used + * in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. Software Research Associates + * makes no representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * SOFTWARE RESEARCH ASSOCIATES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, + * IN NO EVENT SHALL SOFTWARE RESEARCH ASSOCIATES BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * Author: Erik M. van der Poel + * Software Research Associates, Inc., Tokyo, Japan + * erik@sra.co.jp + */ + +#ifdef HAVE_CONFIG_H +#include "c-auto.h" +#endif + +#if !defined (NOSELFILE) && !defined (NOTOOL) /* for xdvik */ + +#include <stdio.h> + +#ifdef SEL_FILE_IGNORE_CASE +#include <ctype.h> +#endif /* def SEL_FILE_IGNORE_CASE */ + +#include <kpathsea/c-auto.h> +#include <kpathsea/config.h> +#include <kpathsea/c-stat.h> +#ifndef S_IXUSR +#define S_IXUSR 0100 +#endif +#ifndef S_IXGRP +#define S_IXGRP 0010 +#endif +#ifndef S_IXOTH +#define S_IXOTH 0001 +#endif + +#define S_ISXXX(m) ((m) & (S_IXUSR | S_IXGRP | S_IXOTH)) + +#include <X11/Xos.h> +#include <pwd.h> +#include "sfinternal.h" +#include <X11/Xaw/Scrollbar.h> + +extern void SFsetText (), SFtextChanged (); +extern int SFgetDir (); + extern void SFdrawLists (), SFdrawList (), SFclearList (); + +typedef struct { + char *name; + char *dir; +} SFLogin; + +SFDir *SFdirs = NULL; + +int SFdirEnd; + +int SFdirPtr; + +int SFbuttonPressed = 0; + +static int SFdoNotTouchDirPtr = 0; + +static int SFdoNotTouchVorigin = 0; + +static SFDir SFrootDir, SFhomeDir; + +static SFLogin *SFlogins; + +static int SFtwiddle = 0; + +int +SFchdir(path) + char *path; +{ + int result; + + result = 0; + + if (strcmp(path, SFcurrentDir)) { + result = chdir(path); + if (!result) { + (void) strcpy(SFcurrentDir, path); + } + } + + return result; +} + +static void +SFfree(i) + int i; +{ + register SFDir *dir; + register int j; + + dir = &(SFdirs[i]); + + for (j = dir->nEntries - 1; j >= 0; j--) { + if (dir->entries[j].shown != dir->entries[j].real) { + XtFree(dir->entries[j].shown); + } + XtFree(dir->entries[j].real); + } + + XtFree((char *) dir->entries); + + XtFree(dir->dir); + + dir->dir = NULL; +} + +static void +SFstrdup(s1, s2) + char **s1; + char *s2; +{ + *s1 = strcpy(XtMalloc((unsigned) (strlen(s2) + 1)), s2); +} + +static void +SFunreadableDir(dir) + SFDir *dir; +{ + char *cannotOpen = "<cannot open> "; + + dir->entries = (SFEntry *) XtMalloc(sizeof(SFEntry)); + dir->entries[0].statDone = 1; + SFstrdup(&dir->entries[0].real, cannotOpen); + dir->entries[0].shown = dir->entries[0].real; + dir->nEntries = 1; + dir->nChars = strlen(cannotOpen); +} + +#ifdef SEL_FILE_IGNORE_CASE +static +SFstrncmp(p, q, n) + register char *p, *q; + register int n; +{ + register char c1, c2; + char *psave, *qsave; + int nsave; + + psave = p; + qsave = q; + nsave = n; + + c1 = *p++; + if (islower(c1)) { + c1 = toupper(c1); + } + c2 = *q++; + if (islower(c2)) { + c2 = toupper(c2); + } + + while ((--n >= 0) && (c1 == c2)) { + if (!c1) { + return strncmp(psave, qsave, nsave); + } + c1 = *p++; + if (islower(c1)) { + c1 = toupper(c1); + } + c2 = *q++; + if (islower(c2)) { + c2 = toupper(c2); + } + } + + if (n < 0) { + return strncmp(psave, qsave, nsave); + } + + return c1 - c2; +} +#endif /* def SEL_FILE_IGNORE_CASE */ + +static void +SFreplaceText(dir, str) + SFDir *dir; + char *str; +{ + int len; + + *(dir->path) = 0; + len = strlen(str); + if (str[len - 1] == '/') { + (void) strcat(SFcurrentPath, str); + } else { + (void) strncat(SFcurrentPath, str, len - 1); + } + if (strncmp(SFcurrentPath, SFstartDir, strlen(SFstartDir))) { + SFsetText(SFcurrentPath); + } else { + SFsetText(&(SFcurrentPath[strlen(SFstartDir)])); + } + + SFtextChanged(); +} + +static void +SFexpand(str) + char *str; +{ + int len; + int cmp; + char *name, *growing; + SFDir *dir; + SFEntry *entry, *max; + + len = strlen(str); + + dir = &(SFdirs[SFdirEnd - 1]); + + if (dir->beginSelection == -1) { + SFstrdup(&str, str); + SFreplaceText(dir, str); + XtFree(str); + return; + } else if (dir->beginSelection == dir->endSelection) { + SFreplaceText(dir, dir->entries[dir->beginSelection].shown); + return; + } + + max = &(dir->entries[dir->endSelection + 1]); + + name = dir->entries[dir->beginSelection].shown; + SFstrdup(&growing, name); + + cmp = 0; + while (!cmp) { + entry = &(dir->entries[dir->beginSelection]); + while (entry < max) { + if ((cmp = strncmp(growing, entry->shown, len))) { + break; + } + entry++; + } + len++; + } + + /* + * SFreplaceText() expects filename + */ + growing[len - 2] = ' '; + + growing[len - 1] = 0; + SFreplaceText(dir, growing); + XtFree(growing); +} + +static int +SFfindFile(dir, str) + SFDir *dir; + register char *str; +{ + register int i, last, max; + register char *name, save; + SFEntry *entries; + int len; + int begin, end; + int result; + + len = strlen(str); + + if (str[len - 1] == ' ') { + SFexpand(str); + return 1; + } else if (str[len - 1] == '/') { + len--; + } + + max = dir->nEntries; + + entries = dir->entries; + + i = 0; + while (i < max) { + name = entries[i].shown; + last = strlen(name) - 1; + save = name[last]; + name[last] = 0; + +#ifdef SEL_FILE_IGNORE_CASE + result = SFstrncmp(str, name, len); +#else /* def SEL_FILE_IGNORE_CASE */ + result = strncmp(str, name, len); +#endif /* def SEL_FILE_IGNORE_CASE */ + + name[last] = save; + if (result <= 0) { + break; + } + i++; + } + begin = i; + while (i < max) { + name = entries[i].shown; + last = strlen(name) - 1; + save = name[last]; + name[last] = 0; + +#ifdef SEL_FILE_IGNORE_CASE + result = SFstrncmp(str, name, len); +#else /* def SEL_FILE_IGNORE_CASE */ + result = strncmp(str, name, len); +#endif /* def SEL_FILE_IGNORE_CASE */ + + name[last] = save; + if (result) { + break; + } + i++; + } + end = i; + + if (begin != end) { + if ( + (dir->beginSelection != begin) || + (dir->endSelection != end - 1) + ) { + dir->changed = 1; + dir->beginSelection = begin; + if (str[strlen(str) - 1] == '/') { + dir->endSelection = begin; + } else { + dir->endSelection = end - 1; + } + } + } else { + if (dir->beginSelection != -1) { + dir->changed = 1; + dir->beginSelection = -1; + dir->endSelection = -1; + } + } + + if ( + SFdoNotTouchVorigin || + ((begin > dir->vOrigin) && (end < dir->vOrigin + SFlistSize)) + ) { + SFdoNotTouchVorigin = 0; + return 0; + } + + i = begin - 1; + if (i > max - SFlistSize) { + i = max - SFlistSize; + } + if (i < 0) { + i = 0; + } + + if (dir->vOrigin != i) { + dir->vOrigin = i; + dir->changed = 1; + } + + return 0; +} + +static void +SFunselect() +{ + SFDir *dir; + + dir = &(SFdirs[SFdirEnd - 1]); + if (dir->beginSelection != -1) { + dir->changed = 1; + } + dir->beginSelection = -1; + dir->endSelection = -1; +} + +static int +SFcompareLogins(p, q) + SFLogin *p, *q; +{ + return strcmp(p->name, q->name); +} + +static void +SFgetHomeDirs() +{ + struct passwd *pw; + int alloc; + int i; + SFEntry *entries = NULL; + int len; + int maxChars; + + { + alloc = 1; + i = 1; + entries = (SFEntry *) XtMalloc(sizeof(SFEntry)); + SFlogins = (SFLogin *) XtMalloc(sizeof(SFLogin)); + entries[0].real = XtMalloc(3); + (void) strcpy(entries[0].real, "~"); + entries[0].shown = entries[0].real; + entries[0].statDone = 1; + SFlogins[0].name = ""; + pw = getpwuid((int) getuid()); + SFstrdup(&SFlogins[0].dir, pw ? pw->pw_dir : "/"); + maxChars = 0; + } + + (void) setpwent(); + + while ((pw = (struct passwd *) getpwent()) && (*(pw->pw_name))) { + if (i >= alloc) { + alloc *= 2; + entries = (SFEntry *) XtRealloc( + (char *) entries, + (unsigned) (alloc * sizeof(SFEntry)) + ); + SFlogins = (SFLogin *) XtRealloc( + (char *) SFlogins, + (unsigned) (alloc * sizeof(SFLogin)) + ); + } + len = strlen(pw->pw_name); + entries[i].real = XtMalloc((unsigned) (len + 3)); + (void) strcat(strcpy(entries[i].real, "~"), + pw->pw_name); + entries[i].shown = entries[i].real; + entries[i].statDone = 1; + if (len > maxChars) { + maxChars = len; + } + SFstrdup(&SFlogins[i].name, pw->pw_name); + SFstrdup(&SFlogins[i].dir, pw->pw_dir); + i++; + } + + SFhomeDir.dir = XtMalloc(1) ; + SFhomeDir.dir[0] = 0 ; + SFhomeDir.path = SFcurrentPath ; + SFhomeDir.entries = entries ; + SFhomeDir.nEntries = i ; + SFhomeDir.vOrigin = 0 ; /* :-) */ + SFhomeDir.nChars = maxChars + 2 ; + SFhomeDir.hOrigin = 0 ; + SFhomeDir.changed = 1 ; + SFhomeDir.beginSelection = -1 ; + SFhomeDir.endSelection = -1 ; + +#if defined(SVR4) || defined(SYSV) || defined(USG) + qsort((char *) entries, (unsigned)i, sizeof(SFEntry), SFcompareEntries); + qsort((char *) SFlogins, (unsigned)i, sizeof(SFLogin), SFcompareLogins); +#else /* defined(SVR4) || defined(SYSV) || defined(USG) */ + qsort((char *) entries, i, sizeof(SFEntry), SFcompareEntries); + qsort((char *) SFlogins, i, sizeof(SFLogin), SFcompareLogins); +#endif /* defined(SVR4) || defined(SYSV) || defined(USG) */ + + for (i--; i >= 0; i--) { + (void) strcat(entries[i].real, "/"); + } +} + +static int +SFfindHomeDir(begin, end) + char *begin, *end; +{ + char save; + char *theRest; + int i; + + save = *end; + *end = 0; + + for (i = SFhomeDir.nEntries - 1; i >= 0; i--) { + if (!strcmp(SFhomeDir.entries[i].real, begin)) { + *end = save; + SFstrdup(&theRest, end); + (void) strcat(strcat(strcpy(SFcurrentPath, + SFlogins[i].dir), "/"), theRest); + XtFree(theRest); + SFsetText(SFcurrentPath); + SFtextChanged(); + return 1; + } + } + + *end = save; + + return 0; +} + +void +SFupdatePath() +{ + static int alloc; + static int wasTwiddle = 0; + char *begin, *end; + int i, j; + int prevChange; + int SFdirPtrSave, SFdirEndSave; + SFDir *dir; + + if (!SFdirs) { + SFdirs = (SFDir *) XtMalloc((alloc = 10) * sizeof(SFDir)); + dir = &(SFdirs[0]); + SFstrdup(&dir->dir, "/"); + (void) SFchdir("/"); + (void) SFgetDir(dir); + for (j = 1; j < alloc; j++) { + SFdirs[j].dir = NULL; + } + dir->path = SFcurrentPath + 1; + dir->vOrigin = 0; + dir->hOrigin = 0; + dir->changed = 1; + dir->beginSelection = -1; + dir->endSelection = -1; + SFhomeDir.dir = NULL; + } + + SFdirEndSave = SFdirEnd; + SFdirEnd = 1; + + SFdirPtrSave = SFdirPtr; + SFdirPtr = 0; + + begin = NULL; + + if (SFcurrentPath[0] == '~') { + if (!SFtwiddle) { + SFtwiddle = 1; + dir = &(SFdirs[0]); + SFrootDir = *dir; + if (!SFhomeDir.dir) { + SFgetHomeDirs(); + } + *dir = SFhomeDir; + dir->changed = 1; + } + end = SFcurrentPath; + SFdoNotTouchDirPtr = 1; + wasTwiddle = 1; + } else { + if (SFtwiddle) { + SFtwiddle = 0; + dir = &(SFdirs[0]); + *dir = SFrootDir; + dir->changed = 1; + } + end = SFcurrentPath + 1; + } + + i = 0; + + prevChange = 0; + + while (*end) { + while (*end++ == '/') { + ; + } + end--; + begin = end; + while ((*end) && (*end++ != '/')) { + ; + } + if ((end - SFcurrentPath <= SFtextPos) && (*(end - 1) == '/')) { + SFdirPtr = i - 1; + if (SFdirPtr < 0) { + SFdirPtr = 0; + } + } + if (*begin) { + if (*(end - 1) == '/') { + char save = *end; + + if (SFtwiddle) { + if (SFfindHomeDir(begin, end)) { + return; + } + } + *end = 0; + i++; + SFdirEnd++; + if (i >= alloc) { + SFdirs = (SFDir *) XtRealloc( + (char *) SFdirs, + (unsigned) ((alloc *= 2) * + sizeof(SFDir)) + ); + for (j = alloc / 2; j < alloc; j++) { + SFdirs[j].dir = NULL; + } + } + dir = &(SFdirs[i]); + if ( + (!(dir->dir)) || + prevChange || + strcmp(dir->dir, begin) + ) { + if (dir->dir) { + SFfree(i); + } + prevChange = 1; + SFstrdup(&dir->dir, begin); + dir->path = end; + dir->vOrigin = 0; + dir->hOrigin = 0; + dir->changed = 1; + dir->beginSelection = -1; + dir->endSelection = -1; + (void) SFfindFile(dir - 1, begin); + if ( + SFchdir(SFcurrentPath) || + SFgetDir(dir) + ) { + SFunreadableDir(dir); + break; + } + } + *end = save; + if (!save) { + SFunselect(); + } + } else { + if (SFfindFile(&(SFdirs[SFdirEnd-1]), begin)) { + return; + } + } + } else { + SFunselect(); + } + } + + if ((end == SFcurrentPath + 1) && (!SFtwiddle)) { + SFunselect(); + } + + for (i = SFdirEnd; i < alloc; i++) { + if (SFdirs[i].dir) { + SFfree(i); + } + } + + if (SFdoNotTouchDirPtr) { + if (wasTwiddle) { + wasTwiddle = 0; + SFdirPtr = SFdirEnd - 2; + if (SFdirPtr < 0) { + SFdirPtr = 0; + } + } else { + SFdirPtr = SFdirPtrSave; + } + SFdoNotTouchDirPtr = 0; + } + + if ((SFdirPtr != SFdirPtrSave) || (SFdirEnd != SFdirEndSave)) { + XawScrollbarSetThumb( + selFileHScroll, + (float) (((double) SFdirPtr) / SFdirEnd), + (float) (((double) ((SFdirEnd < 3) ? SFdirEnd : 3)) / + SFdirEnd) + ); + } + + if (SFdirPtr != SFdirPtrSave) { + SFdrawLists(SF_DO_SCROLL); + } else { + for (i = 0; i < 3; i++) { + if (SFdirPtr + i < SFdirEnd) { + if (SFdirs[SFdirPtr + i].changed) { + SFdirs[SFdirPtr + i].changed = 0; + SFdrawList(i, SF_DO_SCROLL); + } + } else { + SFclearList(i, SF_DO_SCROLL); + } + } + } +} + +void +SFsetText(path) + char *path; +{ + XawTextBlock text; + + text.firstPos = 0; + text.length = strlen(path); + text.ptr = path; + text.format = FMT8BIT; + + XawTextReplace(selFileField, 0, strlen(SFtextBuffer), &text); + XawTextSetInsertionPoint(selFileField, strlen(SFtextBuffer)); +} + +/* ARGSUSED */ +void +SFbuttonPressList(w, n, event) + Widget w; + int n; + XButtonPressedEvent *event; +{ + SFbuttonPressed = 1; +} + +/* ARGSUSED */ +void +SFbuttonReleaseList(w, n, event) + Widget w; + int n; + XButtonReleasedEvent *event; +{ + SFDir *dir; + + SFbuttonPressed = 0; + + if (SFcurrentInvert[n] != -1) { + if (n < 2) { + SFdoNotTouchDirPtr = 1; + } + SFdoNotTouchVorigin = 1; + dir = &(SFdirs[SFdirPtr + n]); + SFreplaceText( + dir, + dir->entries[dir->vOrigin + SFcurrentInvert[n]].shown + ); + SFmotionList(w, n, event); + } +} + +static int +SFcheckDir(n, dir) + int n; + SFDir *dir; +{ + struct stat statBuf; + int i; + + if ( + (!stat(".", &statBuf)) && + (statBuf.st_mtime != dir->mtime) + ) { + + /* + * If the pointer is currently in the window that we are about + * to update, we must warp it to prevent the user from + * accidentally selecting the wrong file. + */ + if (SFcurrentInvert[n] != -1) { + XWarpPointer( + SFdisplay, + None, + XtWindow(selFileLists[n]), + 0, + 0, + 0, + 0, + 0, + 0 + ); + } + + for (i = dir->nEntries - 1; i >= 0; i--) { + if (dir->entries[i].shown != dir->entries[i].real) { + XtFree(dir->entries[i].shown); + } + XtFree(dir->entries[i].real); + } + XtFree((char *) dir->entries); + if (SFgetDir(dir)) { + SFunreadableDir(dir); + } + if (dir->vOrigin > dir->nEntries - SFlistSize) { + dir->vOrigin = dir->nEntries - SFlistSize; + } + if (dir->vOrigin < 0) { + dir->vOrigin = 0; + } + if (dir->hOrigin > dir->nChars - SFcharsPerEntry) { + dir->hOrigin = dir->nChars - SFcharsPerEntry; + } + if (dir->hOrigin < 0) { + dir->hOrigin = 0; + } + dir->beginSelection = -1; + dir->endSelection = -1; + SFdoNotTouchVorigin = 1; + if ((dir + 1)->dir) { + (void) SFfindFile(dir, (dir + 1)->dir); + } else { + (void) SFfindFile(dir, dir->path); + } + + if (!SFworkProcAdded) { + (void) XtAppAddWorkProc(SFapp, SFworkProc, NULL); + SFworkProcAdded = 1; + } + + return 1; + } + + return 0; +} + +static int +SFcheckFiles(dir) + SFDir *dir; +{ + int from, to; + int result; + char old, new; + int i; + char *str; + int last; + struct stat statBuf; + + result = 0; + + from = dir->vOrigin; + to = dir->vOrigin + SFlistSize; + if (to > dir->nEntries) { + to = dir->nEntries; + } + + for (i = from; i < to; i++) { + str = dir->entries[i].real; + last = strlen(str) - 1; + old = str[last]; + str[last] = 0; + if (stat(str, &statBuf)) { + new = ' '; + } else { + new = SFstatChar(&statBuf); + } + str[last] = new; + if (new != old) { + result = 1; + } + } + + return result; +} + +void +SFdirModTimer(cl, id) + XtPointer cl; + XtIntervalId *id; +{ + static int n = -1; + static int f = 0; + char save; + SFDir *dir; + + if ((!SFtwiddle) && (SFdirPtr < SFdirEnd)) { + n++; + if ((n > 2) || (SFdirPtr + n >= SFdirEnd)) { + n = 0; + f++; + if ((f > 2) || (SFdirPtr + f >= SFdirEnd)) { + f = 0; + } + } + dir = &(SFdirs[SFdirPtr + n]); + save = *(dir->path); + *(dir->path) = 0; + if (SFchdir(SFcurrentPath)) { + *(dir->path) = save; + + /* + * force a re-read + */ + *(dir->dir) = 0; + + SFupdatePath(); + } else { + *(dir->path) = save; + if ( + SFcheckDir(n, dir) || + ((f == n) && SFcheckFiles(dir)) + ) { + SFdrawList(n, SF_DO_SCROLL); + } + } + } + + SFdirModTimerId = XtAppAddTimeOut(SFapp, (unsigned long) 1000, + SFdirModTimer, (XtPointer) NULL); +} + +/* Return a single character describing what kind of file STATBUF is. */ + +char +SFstatChar (statBuf) + struct stat *statBuf; +{ + if (S_ISDIR (statBuf->st_mode)) { + return '/'; + } else if (S_ISREG (statBuf->st_mode)) { + return S_ISXXX (statBuf->st_mode) ? '*' : ' '; +#ifdef S_ISSOCK + } else if (S_ISSOCK (statBuf->st_mode)) { + return '='; +#endif /* S_ISSOCK */ + } else { + return ' '; + } +} + +#endif /* not NOSELFILE and not NOTOOL */ diff --git a/Build/source/texk/windvi/sfSelFile.c b/Build/source/texk/windvi/sfSelFile.c new file mode 100644 index 00000000000..3c0fe4e951e --- /dev/null +++ b/Build/source/texk/windvi/sfSelFile.c @@ -0,0 +1,940 @@ +/* + * Copyright 1989 Software Research Associates, Inc., Tokyo, Japan + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Software Research Associates not be used + * in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. Software Research Associates + * makes no representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * SOFTWARE RESEARCH ASSOCIATES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, + * IN NO EVENT SHALL SOFTWARE RESEARCH ASSOCIATES BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * Author: Erik M. van der Poel + * Software Research Associates, Inc., Tokyo, Japan + * erik@sra.co.jp + */ + +#ifdef HAVE_CONFIG_H +#include "c-auto.h" +#endif + +#if !defined (NOSELFILE) && !defined (NOTOOL) /* for xdvik */ + +/* + * Author's address: + * + * erik@sra.co.jp + * OR + * erik%sra.co.jp@uunet.uu.net + * OR + * erik%sra.co.jp@mcvax.uucp + * OR + * try junet instead of co.jp + * OR + * Erik M. van der Poel + * Software Research Associates, Inc. + * 1-1-1 Hirakawa-cho, Chiyoda-ku + * Tokyo 102 Japan. TEL +81-3-234-2692 + */ + +#include "xdvi-config.h" +#include <kpathsea/c-stat.h> + +#include <sys/param.h> +#include <X11/cursorfont.h> +#include <X11/Intrinsic.h> +#include <X11/StringDefs.h> +#include <X11/Composite.h> +#include <X11/Shell.h> +#include <X11/Xaw/Form.h> +#include <X11/Xaw/Command.h> +#include <X11/Xaw/Scrollbar.h> +#include <X11/Xaw/Label.h> +#include <X11/Xaw/Cardinals.h> + +#include "sfinternal.h" + +#ifndef MAXPATHLEN +#define MAXPATHLEN 1024 +#endif /* ndef MAXPATHLEN */ + +extern int SFchdir (); + +int SFstatus = SEL_FILE_NULL; + +char + SFstartDir[MAXPATHLEN], + SFcurrentPath[MAXPATHLEN], + SFcurrentDir[MAXPATHLEN]; + +Widget + selFile, + selFileCancel, + selFileField, + selFileForm, + selFileHScroll, + selFileHScrolls[3], + selFileLists[3], + selFileOK, + selFilePrompt, + selFileVScrolls[3]; + +/* For file filter. */ +Widget selFileLabel, selFileMask, selFileHide; +#define MASKWIDTH 10 +char fileMask[MASKWIDTH+2] = "*.dvi"; + +Display *SFdisplay; + +Pixel SFfore, SFback; + +Atom SFwmDeleteWindow; + +XSegment SFsegs[2], SFcompletionSegs[2]; + +XawTextPosition SFtextPos; + +int SFupperX, SFlowerY, SFupperY; + +int SFtextX, SFtextYoffset; + +int SFentryWidth, SFentryHeight; + +int SFlineToTextH = 3; + +int SFlineToTextV = 3; + +int SFbesideText = 3; + +int SFaboveAndBelowText = 2; + +int SFcharsPerEntry = 15; + +int SFlistSize = 10; + +int SFworkProcAdded = 0; + +XtAppContext SFapp; + +int SFpathScrollWidth, SFvScrollHeight, SFhScrollWidth; + +char SFtextBuffer[MAXPATHLEN]; + +XtIntervalId SFdirModTimerId; + +int (*SFfunc)(); + +static char *oneLineTextEditTranslations = "\ + <Key>Return: redraw-display()\n\ + Ctrl<Key>M: redraw-display()\n\ +"; +#if !defined (HAVE_STRERROR) && !defined (strerror) +static char * +strerror (errnum) + int errnum; +{ + extern char *sys_errlist[]; + extern int sys_nerr; + + return 0 < errnum && errnum <= sys_nerr + ? sys_errlist[errnum] : "Unknown system error"; +} +#endif /* not HAVE_STRERROR && not strerror */ + +/* ARGSUSED */ +static void +SFexposeList(w, n, event, cont) + Widget w; + XtPointer n; + XEvent *event; + Boolean *cont; +{ + extern void SFdrawList (); + + if ((event->type == NoExpose) || event->xexpose.count) { + return; + } + + SFdrawList(n, SF_DO_NOT_SCROLL); +} + +/* ARGSUSED */ +static void +SFmodVerifyCallback(w, client_data, event, cont) + Widget w; + XtPointer client_data; + XEvent *event; + Boolean *cont; +{ + char buf[2]; + + if ( + (XLookupString(&(event->xkey), buf, 2, NULL, NULL) == 1) && + ((*buf) == '\r') + ) { + SFstatus = SEL_FILE_OK; + } else { + SFstatus = SEL_FILE_TEXT; + } +} + +/* ARGSUSED */ +static void +SFokCallback(w, cl, cd) + Widget w; + XtPointer cl, cd; +{ + SFstatus = SEL_FILE_OK; +} + +static XtCallbackRec SFokSelect[] = { + { SFokCallback, (XtPointer) NULL }, + { NULL, (XtPointer) NULL }, +}; + +/* ARGSUSED */ +static void +SFcancelCallback(w, cl, cd) + Widget w; + XtPointer cl, cd; +{ + SFstatus = SEL_FILE_CANCEL; +} + +static XtCallbackRec SFcancelSelect[] = { + { SFcancelCallback, (XtPointer) NULL }, + { NULL, (XtPointer) NULL }, +}; + +/* ARGSUSED */ +static void +SFdismissAction(w, event, params, num_params) + Widget w; + XEvent *event; + String *params; + Cardinal *num_params; +{ + if (event->type == ClientMessage && + event->xclient.data.l[0] != SFwmDeleteWindow) return; + + SFstatus = SEL_FILE_CANCEL; +} + +static char *wmDeleteWindowTranslation = "\ + <Message>WM_PROTOCOLS: SelFileDismiss()\n\ +"; + +static XtActionsRec actions[] = { + {"SelFileDismiss", SFdismissAction}, +}; + +/* Don't show files that don't get through the filter. */ + +int +maskFile(mask, filename) + char *mask, *filename; +/* return 1 if file is masked (mask does not match filename), 0 otherwise */ +{ +int c, c1; + + while ((c = *mask++)) { + if (c == '*') { + while ((c1 = *mask++)) { + if (c1 != '*') { + if (!(*filename)) return 1; + if (c1 != '?') { + while ((filename = strchr(filename, c1))) { + if (!maskFile(mask, ++filename)) return 0; + } + return 1; + } + else filename++; + } + } + return 0; + } + if (c == '?') { if (!*filename) return 1; } + else if (c != *filename) return 1; + filename++; + } + return (*filename)? 1 : 0; +} + +int hideFlag = 1; +int +showEntry(entryReal, entryShown, statBuf) + char *entryReal, **entryShown; + struct stat *statBuf; +{ + if (!(S_ISDIR(statBuf->st_mode))) { + if (hideFlag) + if (entryReal[0] == '.') return 0; + if (maskFile(fileMask, entryReal)) return 0; + } + entryReal[strlen(entryReal)] = SFstatChar(statBuf); + return 1; +} + +/* ARGSUSED */ +void +maskChanged(w, client_data, event) + Widget w; + XtPointer client_data; + XKeyPressedEvent *event; +{ + char buf[2]; + register SFDir *dir; + extern void SFupdatePath (); + + if ((XLookupString(event, buf, 2, NULL, NULL) == 1) && + ((*buf) == '\r')) { + for (dir = &(SFdirs[SFdirEnd - 1]); dir >= SFdirs; dir--) + *(dir->dir) = 0; /* force a re-read */ + SFupdatePath(); + } +} + +/* ARGSUSED */ +void +hideFiles(w, client_data, event) + Widget w; + XtPointer client_data; + XEvent *event; +{ + register SFDir *dir; + register SFEntry *entry; + extern void SFupdatePath (), SFdrawLists (); + + hideFlag = 1 - hideFlag; + if (hideFlag) { + XtVaSetValues(w, XtNlabel, "hidden", NULL); + for (dir = &(SFdirs[SFdirEnd - 1]); dir >= SFdirs; dir--) { + if (!(dir->nEntries)) continue; + dir->vOrigin = 0; + for (entry = &(dir->entries[dir->nEntries - 1]); + entry >= dir->entries; entry--) + entry->statDone = 0; + SFdrawLists(SF_DO_SCROLL); + } + } else { + XtVaSetValues(w, XtNlabel, "shown", NULL); + for (dir = &(SFdirs[SFdirEnd - 1]); dir >= SFdirs; dir--) + *(dir->dir) = 0; /* force a re-read */ + SFupdatePath(); + } +} + + +static void +SFcreateWidgets(toplevel, prompt, ok, cancel) + Widget toplevel; + char *prompt; + char *ok; + char *cancel; +{ + Cardinal i, n; + int listWidth, listHeight; + int listSpacing = 10; + int scrollThickness = 15; + int hScrollX, hScrollY; + int vScrollX, vScrollY; + Cursor + xtermCursor, + sbRightArrowCursor, + dotCursor; + Arg arglist[20]; + extern void SFinitFont (), SFcreateGC (); + + i = 0; + XtSetArg(arglist[i], XtNtransientFor, toplevel); i++; + + selFile = XtAppCreateShell("selFile", "SelFile", + transientShellWidgetClass, SFdisplay, arglist, i); + + /* Add WM_DELETE_WINDOW protocol */ + XtAppAddActions(XtWidgetToApplicationContext(selFile), + actions, XtNumber(actions)); + XtOverrideTranslations(selFile, + XtParseTranslationTable(wmDeleteWindowTranslation)); + + i = 0; + XtSetArg(arglist[i], XtNdefaultDistance, 30); i++; + selFileForm = XtCreateManagedWidget("selFileForm", + formWidgetClass, selFile, arglist, i); + + i = 0; + XtSetArg(arglist[i], XtNlabel, prompt); i++; + XtSetArg(arglist[i], XtNresizable, True); i++; + XtSetArg(arglist[i], XtNtop, XtChainTop); i++; + XtSetArg(arglist[i], XtNbottom, XtChainTop); i++; + XtSetArg(arglist[i], XtNleft, XtChainLeft); i++; + XtSetArg(arglist[i], XtNright, XtChainLeft); i++; + XtSetArg(arglist[i], XtNborderWidth, 0); i++; + selFilePrompt = XtCreateManagedWidget("selFilePrompt", + labelWidgetClass, selFileForm, arglist, i); + + i = 0; + XtSetArg(arglist[i], XtNforeground, &SFfore); i++; + XtSetArg(arglist[i], XtNbackground, &SFback); i++; + XtGetValues(selFilePrompt, arglist, i); + + SFinitFont(); + + SFentryWidth = SFbesideText + SFcharsPerEntry * SFcharWidth + + SFbesideText; + SFentryHeight = SFaboveAndBelowText + SFcharHeight + + SFaboveAndBelowText; + + listWidth = SFlineToTextH + SFentryWidth + SFlineToTextH + 1 + + scrollThickness; + listHeight = SFlineToTextV + SFentryHeight + SFlineToTextV + 1 + + SFlineToTextV + SFlistSize * SFentryHeight + + SFlineToTextV + 1 + scrollThickness; + + SFpathScrollWidth = 3 * listWidth + 2 * listSpacing + 4; + + hScrollX = -1; + hScrollY = SFlineToTextV + SFentryHeight + SFlineToTextV + 1 + + SFlineToTextV + SFlistSize * SFentryHeight + + SFlineToTextV; + SFhScrollWidth = SFlineToTextH + SFentryWidth + SFlineToTextH; + + vScrollX = SFlineToTextH + SFentryWidth + SFlineToTextH; + vScrollY = SFlineToTextV + SFentryHeight + SFlineToTextV; + SFvScrollHeight = SFlineToTextV + SFlistSize * SFentryHeight + + SFlineToTextV; + + SFupperX = SFlineToTextH + SFentryWidth + SFlineToTextH - 1; + SFlowerY = SFlineToTextV + SFentryHeight + SFlineToTextV + 1 + + SFlineToTextV; + SFupperY = SFlineToTextV + SFentryHeight + SFlineToTextV + 1 + + SFlineToTextV + SFlistSize * SFentryHeight - 1; + + SFtextX = SFlineToTextH + SFbesideText; + SFtextYoffset = SFlowerY + SFaboveAndBelowText + SFcharAscent; + + SFsegs[0].x1 = 0; + SFsegs[0].y1 = vScrollY; + SFsegs[0].x2 = vScrollX - 1; + SFsegs[0].y2 = vScrollY; + SFsegs[1].x1 = vScrollX; + SFsegs[1].y1 = 0; + SFsegs[1].x2 = vScrollX; + SFsegs[1].y2 = vScrollY - 1; + + SFcompletionSegs[0].x1 = SFcompletionSegs[0].x2 = SFlineToTextH; + SFcompletionSegs[1].x1 = SFcompletionSegs[1].x2 = + SFlineToTextH + SFentryWidth - 1; + + i = 0; + XtSetArg(arglist[i], XtNwidth, 3 * listWidth + 2 * listSpacing + 4); + i++; + XtSetArg(arglist[i], XtNborderColor, SFfore); i++; + + XtSetArg(arglist[i], XtNfromVert, selFilePrompt); i++; + XtSetArg(arglist[i], XtNvertDistance, 10); i++; + XtSetArg(arglist[i], XtNresizable, True); i++; + XtSetArg(arglist[i], XtNtop, XtChainTop); i++; + XtSetArg(arglist[i], XtNbottom, XtChainTop); i++; + XtSetArg(arglist[i], XtNleft, XtChainLeft); i++; + XtSetArg(arglist[i], XtNright, XtChainLeft); i++; + XtSetArg(arglist[i], XtNstring, SFtextBuffer); i++; + XtSetArg(arglist[i], XtNlength, MAXPATHLEN); i++; + XtSetArg(arglist[i], XtNeditType, XawtextEdit); i++; + XtSetArg(arglist[i], XtNwrap, XawtextWrapWord); i++; + XtSetArg(arglist[i], XtNresize, XawtextResizeHeight); i++; + XtSetArg(arglist[i], XtNuseStringInPlace, True); i++; + selFileField = XtCreateManagedWidget("selFileField", + asciiTextWidgetClass, selFileForm, arglist, i); + + XtOverrideTranslations(selFileField, + XtParseTranslationTable(oneLineTextEditTranslations)); +/* XtSetKeyboardFocus(selFileForm, selFileField); + need focus for selFileMask wigget to set the filter */ + + i = 0; + XtSetArg(arglist[i], XtNorientation, XtorientHorizontal); i++; + XtSetArg(arglist[i], XtNwidth, SFpathScrollWidth); i++; + XtSetArg(arglist[i], XtNheight, scrollThickness); i++; + XtSetArg(arglist[i], XtNborderColor, SFfore); i++; + XtSetArg(arglist[i], XtNfromVert, selFileField); i++; + XtSetArg(arglist[i], XtNvertDistance, 30); i++; + XtSetArg(arglist[i], XtNtop, XtChainTop); i++; + XtSetArg(arglist[i], XtNbottom, XtChainTop); i++; + XtSetArg(arglist[i], XtNleft, XtChainLeft); i++; + XtSetArg(arglist[i], XtNright, XtChainLeft); i++; + selFileHScroll = XtCreateManagedWidget("selFileHScroll", + scrollbarWidgetClass, selFileForm, arglist, i); + + XtAddCallback(selFileHScroll, XtNjumpProc, + SFpathSliderMovedCallback, (XtPointer) NULL); + XtAddCallback(selFileHScroll, XtNscrollProc, + SFpathAreaSelectedCallback, (XtPointer) NULL); + + i = 0; + XtSetArg(arglist[i], XtNwidth, listWidth); i++; + XtSetArg(arglist[i], XtNheight, listHeight); i++; + XtSetArg(arglist[i], XtNborderColor, SFfore); i++; + XtSetArg(arglist[i], XtNfromVert, selFileHScroll); i++; + XtSetArg(arglist[i], XtNvertDistance, 10); i++; + XtSetArg(arglist[i], XtNtop, XtChainTop); i++; + XtSetArg(arglist[i], XtNbottom, XtChainTop); i++; + XtSetArg(arglist[i], XtNleft, XtChainLeft); i++; + XtSetArg(arglist[i], XtNright, XtChainLeft); i++; + selFileLists[0] = XtCreateManagedWidget("selFileList1", + compositeWidgetClass, selFileForm, arglist, i); + + i = 0; + XtSetArg(arglist[i], XtNwidth, listWidth); i++; + XtSetArg(arglist[i], XtNheight, listHeight); i++; + XtSetArg(arglist[i], XtNborderColor, SFfore); i++; + XtSetArg(arglist[i], XtNfromHoriz, selFileLists[0]); i++; + XtSetArg(arglist[i], XtNfromVert, selFileHScroll); i++; + XtSetArg(arglist[i], XtNhorizDistance, listSpacing); i++; + XtSetArg(arglist[i], XtNvertDistance, 10); i++; + XtSetArg(arglist[i], XtNtop, XtChainTop); i++; + XtSetArg(arglist[i], XtNbottom, XtChainTop); i++; + XtSetArg(arglist[i], XtNleft, XtChainLeft); i++; + XtSetArg(arglist[i], XtNright, XtChainLeft); i++; + selFileLists[1] = XtCreateManagedWidget("selFileList2", + compositeWidgetClass, selFileForm, arglist, i); + + i = 0; + XtSetArg(arglist[i], XtNwidth, listWidth); i++; + XtSetArg(arglist[i], XtNheight, listHeight); i++; + XtSetArg(arglist[i], XtNborderColor, SFfore); i++; + XtSetArg(arglist[i], XtNfromHoriz, selFileLists[1]); i++; + XtSetArg(arglist[i], XtNfromVert, selFileHScroll); i++; + XtSetArg(arglist[i], XtNhorizDistance, listSpacing); i++; + XtSetArg(arglist[i], XtNvertDistance, 10); i++; + XtSetArg(arglist[i], XtNtop, XtChainTop); i++; + XtSetArg(arglist[i], XtNbottom, XtChainTop); i++; + XtSetArg(arglist[i], XtNleft, XtChainLeft); i++; + XtSetArg(arglist[i], XtNright, XtChainLeft); i++; + selFileLists[2] = XtCreateManagedWidget("selFileList3", + compositeWidgetClass, selFileForm, arglist, i); + + for (n = 0; n < 3; n++) { + + i = 0; + XtSetArg(arglist[i], XtNx, vScrollX); i++; + XtSetArg(arglist[i], XtNy, vScrollY); i++; + XtSetArg(arglist[i], XtNwidth, scrollThickness); i++; + XtSetArg(arglist[i], XtNheight, SFvScrollHeight); i++; + XtSetArg(arglist[i], XtNborderColor, SFfore); i++; + selFileVScrolls[n] = XtCreateManagedWidget("selFileVScroll", + scrollbarWidgetClass, selFileLists[n], arglist, i); + + XtAddCallback(selFileVScrolls[n], XtNjumpProc, + SFvFloatSliderMovedCallback, (XtPointer) n); + XtAddCallback(selFileVScrolls[n], XtNscrollProc, + SFvAreaSelectedCallback, (XtPointer) n); + + i = 0; + + XtSetArg(arglist[i], XtNorientation, XtorientHorizontal); + i++; + XtSetArg(arglist[i], XtNx, hScrollX); i++; + XtSetArg(arglist[i], XtNy, hScrollY); i++; + XtSetArg(arglist[i], XtNwidth, SFhScrollWidth); i++; + XtSetArg(arglist[i], XtNheight, scrollThickness); i++; + XtSetArg(arglist[i], XtNborderColor, SFfore); i++; + selFileHScrolls[n] = XtCreateManagedWidget("selFileHScroll", + scrollbarWidgetClass, selFileLists[n], arglist, i); + + XtAddCallback(selFileHScrolls[n], XtNjumpProc, + SFhSliderMovedCallback, (XtPointer) n); + XtAddCallback(selFileHScrolls[n], XtNscrollProc, + SFhAreaSelectedCallback, (XtPointer) n); + } + + i = 0; + XtSetArg(arglist[i], XtNlabel, ok); i++; + XtSetArg(arglist[i], XtNresizable, True); i++; + XtSetArg(arglist[i], XtNcallback, SFokSelect); i++; + XtSetArg(arglist[i], XtNborderColor, SFfore); i++; + XtSetArg(arglist[i], XtNfromVert, selFileLists[0]); i++; + XtSetArg(arglist[i], XtNvertDistance, 30); i++; + XtSetArg(arglist[i], XtNtop, XtChainTop); i++; + XtSetArg(arglist[i], XtNbottom, XtChainTop); i++; + XtSetArg(arglist[i], XtNleft, XtChainLeft); i++; + XtSetArg(arglist[i], XtNright, XtChainLeft); i++; + selFileOK = XtCreateManagedWidget("selFileOK", commandWidgetClass, + selFileForm, arglist, i); + + i = 0; + XtSetArg(arglist[i], XtNlabel, cancel); i++; + XtSetArg(arglist[i], XtNresizable, True); i++; + XtSetArg(arglist[i], XtNcallback, SFcancelSelect); i++; + XtSetArg(arglist[i], XtNborderColor, SFfore); i++; + XtSetArg(arglist[i], XtNfromHoriz, selFileOK); i++; + XtSetArg(arglist[i], XtNfromVert, selFileLists[0]); i++; + XtSetArg(arglist[i], XtNhorizDistance, 30); i++; + XtSetArg(arglist[i], XtNvertDistance, 30); i++; + XtSetArg(arglist[i], XtNtop, XtChainTop); i++; + XtSetArg(arglist[i], XtNbottom, XtChainTop); i++; + XtSetArg(arglist[i], XtNleft, XtChainLeft); i++; + XtSetArg(arglist[i], XtNright, XtChainLeft); i++; + selFileCancel = XtCreateManagedWidget("selFileCancel", + commandWidgetClass, selFileForm, arglist, i); + + /* Do the file filter stuff. */ + selFileLabel = XtVaCreateManagedWidget("selFileLabel", + labelWidgetClass, selFileForm, + XtNfromVert, selFileLists[0], + XtNvertDistance, 30, + XtNfromHoriz, selFileCancel, + XtNhorizDistance, 60, + XtNlabel, "File Mask:", + XtNborderWidth, 0, + XtNtop, XtChainTop, + XtNbottom, XtChainTop, + NULL); + + selFileMask = XtVaCreateManagedWidget("selFileMask", + asciiTextWidgetClass, selFileForm, + XtNwidth, MASKWIDTH*SFcharWidth, + XtNfromVert, selFileLists[0], + XtNvertDistance, 30, + XtNfromHoriz, selFileLabel, + XtNhorizDistance, 0, + XtNtop, XtChainTop, + XtNbottom, XtChainTop, + XtNstring, fileMask, + XtNlength, sizeof(fileMask), + XtNeditType, XawtextEdit, + XtNwrap, XawtextWrapNever, + XtNuseStringInPlace, True, + NULL); + + for (i = 0; i < 3; i++) + XtSetKeyboardFocus(selFileLists[i], selFileField); + + XtOverrideTranslations(selFileMask, + XtParseTranslationTable(oneLineTextEditTranslations)); + + XtAddEventHandler(selFileMask, KeyPressMask, False, + maskChanged, (XtPointer) NULL); + + selFileLabel = XtVaCreateManagedWidget("selFileLabel", + labelWidgetClass, selFileForm, + XtNfromVert, selFileLists[0], + XtNvertDistance, 30, + XtNfromHoriz, selFileMask, + XtNhorizDistance, 40, + XtNlabel, "dot files", + XtNborderWidth, 0, + XtNtop, XtChainTop, + XtNbottom, XtChainTop, + NULL); + + selFileHide = XtVaCreateManagedWidget("selFileHide", + commandWidgetClass, selFileForm, + XtNfromVert, selFileLists[0], + XtNvertDistance, 30, + XtNfromHoriz, selFileLabel, + XtNhorizDistance, 2, + XtNlabel, "hidden", + XtNborderWidth, 0, + XtNtop, XtChainTop, + XtNbottom, XtChainTop, +#if 0 /* missing in R4, says + pete@lovelace.thi.informatik.uni-frankfurt.de (Peter Dyballa) */ + XtNcursorName, "dot", +#endif + NULL); + XtAddCallback(selFileHide, XtNcallback, hideFiles, NULL); + + XtSetMappedWhenManaged(selFile, False); + XtRealizeWidget(selFile); + + /* Add WM_DELETE_WINDOW protocol */ + SFwmDeleteWindow = XInternAtom(SFdisplay, "WM_DELETE_WINDOW", False); + XSetWMProtocols(SFdisplay, XtWindow(selFile), &SFwmDeleteWindow, 1); + + SFcreateGC(); + + xtermCursor = XCreateFontCursor(SFdisplay, XC_xterm); + + sbRightArrowCursor = XCreateFontCursor(SFdisplay, XC_sb_right_arrow); + dotCursor = XCreateFontCursor(SFdisplay, XC_dot); + + XDefineCursor(SFdisplay, XtWindow(selFileForm), xtermCursor); + XDefineCursor(SFdisplay, XtWindow(selFileField), xtermCursor); + + for (n = 0; n < 3; n++) { + XDefineCursor(SFdisplay, XtWindow(selFileLists[n]), + sbRightArrowCursor); + } + XDefineCursor(SFdisplay, XtWindow(selFileOK), dotCursor); + XDefineCursor(SFdisplay, XtWindow(selFileCancel), dotCursor); + + for (n = 0; n < 3; n++) { + XtAddEventHandler(selFileLists[n], ExposureMask, True, + SFexposeList, (XtPointer) n); + XtAddEventHandler(selFileLists[n], EnterWindowMask, False, + SFenterList, (XtPointer) n); + XtAddEventHandler(selFileLists[n], LeaveWindowMask, False, + SFleaveList, (XtPointer) n); + XtAddEventHandler(selFileLists[n], PointerMotionMask, False, + SFmotionList, (XtPointer) n); + XtAddEventHandler(selFileLists[n], ButtonPressMask, False, + SFbuttonPressList, (XtPointer) n); + XtAddEventHandler(selFileLists[n], ButtonReleaseMask, False, + SFbuttonReleaseList, (XtPointer) n); + } + + XtAddEventHandler(selFileField, KeyPressMask, False, + SFmodVerifyCallback, (XtPointer) NULL); + + SFapp = XtWidgetToApplicationContext(selFile); + +} + +/* position widget under the cursor */ +void +SFpositionWidget(w) + Widget w; +{ + Arg args[3]; + Cardinal num_args; + Dimension width, height, b_width; + int x, y, max_x, max_y; + Window root, child; + int dummyx, dummyy; + unsigned int dummymask; + + XQueryPointer(XtDisplay(w), XtWindow(w), &root, &child, &x, &y, + &dummyx, &dummyy, &dummymask); + num_args = 0; + XtSetArg(args[num_args], XtNwidth, &width); num_args++; + XtSetArg(args[num_args], XtNheight, &height); num_args++; + XtSetArg(args[num_args], XtNborderWidth, &b_width); num_args++; + XtGetValues(w, args, num_args); + + width += 2 * b_width; + height += 2 * b_width; + + x -= ( (Position) width/2 ); + if (x < 0) x = 0; + if ( x > (max_x = (Position) (XtScreen(w)->width - width)) ) x = max_x; + + y -= ( (Position) height/2 ); + if (y < 0) y = 0; + if ( y > (max_y = (Position) (XtScreen(w)->height - height)) ) y = max_y; + + num_args = 0; + XtSetArg(args[num_args], XtNx, x); num_args++; + XtSetArg(args[num_args], XtNy, y); num_args++; + XtSetValues(w, args, num_args); +} + +FILE * +SFopenFile(name, mode, prompt, failed) + char *name; + char *mode; + char *prompt; + char *failed; +{ + Arg args[1]; + FILE *fp; + + SFchdir(SFstartDir); + errno = 0; + if (!name || *name == 0 || (fp = fopen(name, mode)) == NULL) { + char *buf; + char *msg = errno ? strerror (errno) : ""; + buf = XtMalloc(strlen (failed) + strlen (msg) + strlen (prompt) + 2); + strcpy(buf, failed); + strcat(buf, msg); + strcat(buf, " "); + strcat(buf, prompt); + XtSetArg(args[0], XtNlabel, buf); + XtSetValues(selFilePrompt, args, ONE); + XtFree(buf); + fp = NULL; + } + + return fp; +} + +void +SFtextChanged() +{ + extern void SFupdatePath (); + + if ((SFtextBuffer[0] == '/') || (SFtextBuffer[0] == '~')) { + (void) strcpy(SFcurrentPath, SFtextBuffer); + + SFtextPos = XawTextGetInsertionPoint(selFileField); + } else { + (void) strcat(strcpy(SFcurrentPath, SFstartDir), SFtextBuffer); + + SFtextPos = XawTextGetInsertionPoint(selFileField) + + strlen(SFstartDir); + } + + if (!SFworkProcAdded) { + (void) XtAppAddWorkProc(SFapp, SFworkProc, NULL); + SFworkProcAdded = 1; + } + + SFupdatePath(); +} + +static char * +SFgetText() +{ + return strcpy(XtMalloc((unsigned) (strlen(SFtextBuffer) + 1)), + SFtextBuffer); +} + +static void +SFprepareToReturn() +{ + SFstatus = SEL_FILE_NULL; + XtRemoveGrab(selFile); + XtUnmapWidget(selFile); + XtRemoveTimeOut(SFdirModTimerId); + if (SFchdir(SFstartDir)) { + XtAppError( + SFapp, + "XsraSelFile: can't return to current directory" + ); + } +} + +FILE * +XsraSelFile(toplevel, prompt, ok, cancel, failed, + init_path, mode, show_entry, name_return) + Widget toplevel; + char *prompt; + char *ok; + char *cancel; + char *failed; + char *init_path; + char *mode; + int (*show_entry)(); + char **name_return; +{ + extern void SFsetText (); + static int firstTime = 1; + Cardinal i; + Arg arglist[20]; + XEvent event; + FILE *fp; + + if (!prompt) { + prompt = "Pathname:"; + } + + if (!ok) { + ok = "OK"; + } + + if (!cancel) { + cancel = "Cancel"; + } + + if (firstTime) { + firstTime = 0; + SFdisplay = XtDisplay(toplevel); + SFcreateWidgets(toplevel, prompt, ok, cancel); + } else { + i = 0; + + XtSetArg(arglist[i], XtNlabel, prompt); i++; + XtSetValues(selFilePrompt, arglist, i); + + i = 0; + XtSetArg(arglist[i], XtNlabel, ok); i++; + XtSetValues(selFileOK, arglist, i); + + i = 0; + XtSetArg(arglist[i], XtNlabel, cancel); i++; + XtSetValues(selFileCancel, arglist, i); + } + + SFpositionWidget(selFile); + XtMapWidget(selFile); + + { + char *cwd = xgetcwd (); + strcpy (SFstartDir, cwd); + free (cwd); + } + if (SFstartDir[0] == 0) { + XtAppError(SFapp, "XsraSelFile: can't get current directory"); + } + (void) strcat(SFstartDir, "/"); + (void) strcpy(SFcurrentDir, SFstartDir); + + if (init_path) { + if (init_path[0] == '/') { + (void) strcpy(SFcurrentPath, init_path); + if (strncmp( + SFcurrentPath, + SFstartDir, + strlen(SFstartDir) + )) { + SFsetText(SFcurrentPath); + } else { + SFsetText(&(SFcurrentPath[strlen(SFstartDir)])); + } + } else { + (void) strcat(strcpy(SFcurrentPath, SFstartDir), + init_path); + SFsetText(&(SFcurrentPath[strlen(SFstartDir)])); + } + } else { + (void) strcpy(SFcurrentPath, SFstartDir); + } + +/* SFfunc = show_entry; + disabled in order to implement file filter */ + SFfunc = showEntry; + + SFtextChanged(); + + XtAddGrab(selFile, True, True); + + SFdirModTimerId = XtAppAddTimeOut(SFapp, (unsigned long) 1000, + SFdirModTimer, (XtPointer) NULL); + + while (1) { + XtAppNextEvent(SFapp, &event); + XtDispatchEvent(&event); + switch (SFstatus) { + case SEL_FILE_TEXT: + SFstatus = SEL_FILE_NULL; + SFtextChanged(); + break; + case SEL_FILE_OK: + *name_return = SFgetText(); + if ((fp = SFopenFile(*name_return, mode, + prompt, failed))) { + SFprepareToReturn(); + return fp; + } + SFstatus = SEL_FILE_NULL; + break; + case SEL_FILE_CANCEL: + SFprepareToReturn(); + return NULL; + case SEL_FILE_NULL: + break; + } + } +} + +#endif /* not NOSELFILE and not NOTOOL */ diff --git a/Build/source/texk/windvi/sfinternal.h b/Build/source/texk/windvi/sfinternal.h new file mode 100644 index 00000000000..da4703bd589 --- /dev/null +++ b/Build/source/texk/windvi/sfinternal.h @@ -0,0 +1,146 @@ +/* + * Copyright 1989 Software Research Associates, Inc., Tokyo, Japan + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Software Research Associates not be used + * in advertising or publicity pertaining to distribution of the software + * without specific, written prior permission. Software Research Associates + * makes no representations about the suitability of this software for any + * purpose. It is provided "as is" without express or implied warranty. + * + * SOFTWARE RESEARCH ASSOCIATES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, + * IN NO EVENT SHALL SOFTWARE RESEARCH ASSOCIATES BE LIABLE FOR ANY SPECIAL, + * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * Author: Erik M. van der Poel + * Software Research Associates, Inc., Tokyo, Japan + * erik@sra.co.jp + */ + +#include <X11/Intrinsic.h> +#include <X11/StringDefs.h> +#include <X11/Xos.h> +#include <X11/Xaw/Text.h> +#include <X11/Xaw/AsciiText.h> +#undef wchar_t + +#define SEL_FILE_CANCEL -1 +#define SEL_FILE_OK 0 +#define SEL_FILE_NULL 1 +#define SEL_FILE_TEXT 2 + +#define SF_DO_SCROLL 1 +#define SF_DO_NOT_SCROLL 0 + +typedef struct { + int statDone; + char *real; + char *shown; +} SFEntry; + +typedef struct { + char *dir; + char *path; + SFEntry *entries; + int nEntries; + int vOrigin; + int nChars; + int hOrigin; + int changed; + int beginSelection; + int endSelection; + time_t mtime; +} SFDir; + +extern int SFstatus; + +extern char SFcurrentPath[], SFstartDir[], SFcurrentDir[]; + +extern Widget + selFile, + selFileCancel, + selFileField, + selFileForm, + selFileHScroll, + selFileHScrolls[], + selFileLists[], + selFileOK, + selFilePrompt, + selFileVScrolls[]; + +extern Display *SFdisplay; + +extern int SFcharWidth, SFcharHeight, SFcharAscent; + +extern SFDir *SFdirs; + +extern int SFdirEnd, SFdirPtr; + +extern Pixel SFfore, SFback; + +extern Atom SFwmDeleteWindow; + +extern XSegment SFsegs[], SFcompletionSegs[]; + +extern XawTextPosition SFtextPos; + +extern void + SFenterList(), + SFleaveList(), + SFmotionList(), + SFbuttonPressList(), + SFbuttonReleaseList(); + +extern void + SFvSliderMovedCallback(), + SFvFloatSliderMovedCallback(), + SFhSliderMovedCallback(), + SFpathSliderMovedCallback(), + SFvAreaSelectedCallback(), + SFhAreaSelectedCallback(), + SFpathAreaSelectedCallback(); + +extern int SFupperX, SFlowerY, SFupperY; + +extern int SFtextX, SFtextYoffset; + +extern int SFentryWidth, SFentryHeight; + +extern int SFlineToTextH, SFlineToTextV; + +extern int SFbesideText, SFaboveAndBelowText; + +extern int SFcharsPerEntry; + +extern int SFlistSize; + +extern int SFcurrentInvert[]; + +extern int SFworkProcAdded; + +extern Boolean SFworkProc(); + +extern XtAppContext SFapp; + +extern int SFpathScrollWidth, SFvScrollHeight, SFhScrollWidth; + +extern char SFtextBuffer[]; + +extern int SFbuttonPressed; + +extern int SFcompareEntries(); + +extern void SFdirModTimer(); + +extern char SFstatChar(); + +extern XtIntervalId SFdirModTimerId; + +extern int (*SFfunc)(); diff --git a/Build/source/texk/windvi/special.c b/Build/source/texk/windvi/special.c new file mode 100644 index 00000000000..c4a9aa76be6 --- /dev/null +++ b/Build/source/texk/windvi/special.c @@ -0,0 +1,2040 @@ +/*========================================================================*\ + +Copyright (c) 1990-1999 Paul Vojta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +PAUL VOJTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +NOTE: + This module is based on prior work as noted below. + +\*========================================================================*/ + +/* + * Support drawing routines for TeXsun and TeX + * + * Copyright, (C) 1987, 1988 Tim Morgan, UC Irvine + * Adapted for xdvi by Jeffrey Lee, U. of Toronto + * + * At the time these routines are called, the values of hh and vv should + * have been updated to the upper left corner of the graph (the position + * the \special appears at in the dvi file). Then the coordinates in the + * graphics commands are in terms of a virtual page with axes oriented the + * same as the Imagen and the SUN normally have: + * + * 0,0 + * +-----------> +x + * | + * | + * | + * \ / + * +y + * + * Angles are measured in the conventional way, from +x towards +y. + * Unfortunately, that reverses the meaning of "counterclockwise" + * from what it's normally thought of. + * + * A lot of floating point arithmetic has been converted to integer + * arithmetic for speed. In some places, this is kind-of kludgy, but + * it's worth it. + */ + +#ifdef WIN32 +#define WIN32_LEAN_AND_MEAN 1 +#include "wingui.h" +#endif +#undef HAVE_BOOLEAN +#include "xdvi-config.h" +#include <kpathsea/c-fopen.h> +#include <kpathsea/c-ctype.h> +#include <kpathsea/c-pathmx.h> +#include <kpathsea/c-stat.h> +#include <kpathsea/line.h> +#include <kpathsea/tex-file.h> +#ifndef S_IRUSR +#define S_IRUSR 0400 +#endif +#ifndef S_IWUSR +#define S_IWUSR 0200 +#endif +#include "dvi.h" // added SU + +#ifdef WIN32 +#include <zlib.h> +#include <bzlib.h> +#else +# if HAVE_SYS_WAIT_H +# include <sys/wait.h> +# endif +# ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +# endif +# ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +# endif +extern char *tempnam ARGS((_Xconst char *, _Xconst char *)); +extern double floor ARGS((double)); +#endif + +#define MAXPOINTS 300 /* Max points in a path */ +#define MAX_PEN_SIZE 72 /* Max pixels of pen width */ +#define TWOPI (3.14159265359 * 2.0) + +#define rint(x) floor((x) + 0.5) + +static double shadetp = 0.5; + /* shading level, initialized as requested by tpic 2.0 -- MJ */ + +static int xx[MAXPOINTS], yy[MAXPOINTS]; /* Path in milli-inches */ +static int path_len = 0; /* # points in current path */ +/* static */ int pen_size = 1; /* Pixel width of lines drawn */ + +static Boolean whiten = False; +static Boolean shade = False; +static Boolean blacken = False; +static Boolean begin_path = False; + +/* Unfortunately, these values also appear in dvisun.c */ +#define xRESOLUTION (pixels_per_inch/shrink_factor) +#define yRESOLUTION (pixels_per_inch/shrink_factor) + +# if HAVE_VFORK_H +# include <vfork.h> +# endif + +#define CMD(x, y) ((x) << 8 | (y)) + +/* + * Issue warning messages + */ + +static void +Warning(fmt, msg) + char *fmt, *msg; +{ + Fprintf(stderr, "%s: ", prog); + Fprintf(stderr, fmt, msg); + (void) fputc('\n', stderr); +} + + +/* + * X drawing routines + */ + +#define toint(x) ((int) ((x) + 0.5)) +#define xconv(x) (toint(tpic_conv*(x))/shrink_factor + PXL_H) +#define yconv(y) (toint(tpic_conv*(y))/shrink_factor + PXL_V) + +/* + * Draw a line from (fx,fy) to (tx,ty). + * Right now, we ignore pen_size. + */ +static void +line_btw(fx, fy, tx, ty) +int fx, fy, tx, ty; +{ + int fcx = xconv(fx), + tcx = xconv(tx), + fcy = yconv(fy), + tcy = yconv(ty); + + HPEN oldPen; + oldPen = SelectObject(ruleGC, foreTPicPen); + + if ((fcx < max_x || tcx < max_x) && (fcx >= min_x || tcx >= min_x) && + (fcy < max_y || tcy < max_y) && (fcy >= min_y || tcy >= min_y)) + XDrawLine(DISP, currwin.win, ruleGC, + fcx - currwin.base_x, fcy - currwin.base_y, + tcx - currwin.base_x, tcy - currwin.base_y); + + SelectObject(ruleGC, oldPen); +} + +/* + * Draw a dot at (x,y) + */ +static void +dot_at(x, y) + int x, y; +{ + int cx = xconv(x), + cy = yconv(y); + HPEN oldPen; + oldPen = SelectObject(ruleGC, foreTPicPen); + + if (cx < max_x && cx >= min_x && cy < max_y && cy >= min_y) + XDrawPoint(DISP, currwin.win, ruleGC, + cx - currwin.base_x, cy - currwin.base_y); + + SelectObject(ruleGC, oldPen); + +} + +/* + * Apply the requested attributes to the last path (box) drawn. + * Attributes are reset. + * (Not currently implemented.) + */ + /* ARGSUSED */ +static void +do_attribute_path(last_min_x, last_max_x, last_min_y, last_max_y) +int last_min_x, last_max_x, last_min_y, last_max_y; +{ + HPEN oldPen; + HBRUSH oldBrush; + + if (!begin_path) { + Warning("%s", "Tpic specials: no Beginpath encountered!\n"); + return; + } + + begin_path = False; +#if DEBUG_TPIC + fprintf(stderr, "Flushing path\n"); +#endif + if (EndPath(ruleGC) == 0) { + Win32Error("do_attribute_path/EndPath"); + return; + } + + oldPen = SelectObject(ruleGC, foreTPicPen); + oldBrush = SelectObject(ruleGC, foreTPicBrush); + + if (blacken || whiten || shade) { +#if DEBUG_TPIC + fprintf(stderr, "Filling ...\n"); +#endif + blacken = whiten = shade = False; + if (StrokeAndFillPath(ruleGC) == 0) { + Win32Error("do_attribute_path/StrokeAndFillPath"); + } + } + else { +#if DEBUG_TPIC + fprintf(stderr, "Empty ...\n"); +#endif + if (StrokePath(ruleGC) == 0) { + Win32Error("do_attribute_path/StrokePath"); + } + } + + SelectObject(ruleGC, oldPen); + SelectObject(ruleGC, oldBrush); +} + +/* + * Set the size of the virtual pen used to draw in milli-inches + */ + +/* ARGSUSED */ +static void +set_pen_size(cp) + char *cp; +{ + int ps; + HPEN newForePen, newBackPen; + + if (sscanf(cp, " %d ", &ps) != 1) { + Warning("invalid .ps command format: %s", cp); + return; + } + pen_size = ((float)ps * ((float)pixels_per_inch / 1000.0) + 0.5) / shrink_factor; + +#if DEBUG_TPIC + fprintf(stderr, "Pen size is %d\n", pen_size); +#endif + if (pen_size < 1) pen_size = 1; + else if (pen_size > MAX_PEN_SIZE) pen_size = MAX_PEN_SIZE; + if (foreTPicPen) + if (!DeleteObject(foreTPicPen)) + Win32Error("set_pen_size/DeleteObject/foreTPicPen"); + foreTPicPen = CreatePen(PS_SOLID, pen_size, fore_Pixel); + if (backTPicPen) + if (!DeleteObject(backTPicPen)) + Win32Error("set_pen_size/DeleteObject/backTPicPen"); + backTPicPen = CreatePen(PS_NULL, pen_size, back_Pixel); +#if DEBUG_TPIC + fprintf(stderr, "Pen size set to %d points\n", pen_size); +#endif +} + + +/* + * Print the line defined by previous path commands + */ + +static void +flush_path() +{ + int i; + int last_min_x, last_max_x, last_min_y, last_max_y; + +#if 0 + HPEN oldPen; + HBRUSH oldBrush; + + oldPen = SelectObject(ruleGC, foreTPicPen); + oldBrush = SelectObject(ruleGC, foreTPicBrush); +#endif + + last_min_x = 30000; + last_min_y = 30000; + last_max_x = -30000; + last_max_y = -30000; + for (i = 1; i < path_len; i++) { + if (xx[i] > last_max_x) last_max_x = xx[i]; + if (xx[i] < last_min_x) last_min_x = xx[i]; + if (yy[i] > last_max_y) last_max_y = yy[i]; + if (yy[i] < last_min_y) last_min_y = yy[i]; + line_btw(xx[i], yy[i], xx[i+1], yy[i+1]); + } + if (xx[path_len] > last_max_x) last_max_x = xx[path_len]; + if (xx[path_len] < last_min_x) last_min_x = xx[path_len]; + if (yy[path_len] > last_max_y) last_max_y = yy[path_len]; + if (yy[path_len] < last_min_y) last_min_y = yy[path_len]; + path_len = 0; + do_attribute_path(last_min_x, last_max_x, last_min_y, last_max_y); + +#if 0 + SelectObject(ruleGC, oldPen); + SelectObject(ruleGC, oldBrush); +#endif +} + + +/* + * Print a dashed line along the previously defined path, with + * the dashes/inch defined. + */ + +static void +flush_dashed(cp, dotted) + char *cp; + Boolean dotted; +{ + int i, k; + int numdots; + int lx0, ly0, lx1, ly1; + int cx0, cy0, cx1, cy1; + float inchesperdash; + double d, spacesize, a, b, dx, dy, milliperdash; + int last_min_x, last_max_x, last_min_y, last_max_y; + HPEN oldPen; + + if (sscanf(cp, " %f ", &inchesperdash) != 1) { + Warning("invalid format for dotted/dashed line: %s", cp); + return; + } + if (path_len <= 1 || inchesperdash <= 0.0) { + Warning("invalid conditions for dotted/dashed line", ""); + return; + } + + if (begin_path) { + begin_path = False; + EndPath(ruleGC); + } + + oldPen = SelectObject(ruleGC, backTPicPen); + + if (whiten || blacken || shade) { + /* FIXME : add checks to win32 calls ! */ + BeginPath(ruleGC); + for (i = 1; i < path_len; i++) { + line_btw(xx[i], yy[i], xx[i+1], yy[i+1]); + } + EndPath(ruleGC); + FillPath(ruleGC); + whiten = blacken = shade = False; + + } + + SelectObject(ruleGC, foreTPicPen); + + milliperdash = inchesperdash * 1000.0; + + for (k = 1; k < path_len; k++) { + lx0 = xx[k]; ly0 = yy[k]; + lx1 = xx[k+1];ly1 = yy[k+1]; + dx = lx1 - lx0; + dy = ly1 - ly0; + if (dotted) { + numdots = sqrt(dx*dx + dy*dy) / milliperdash + 0.5; + if (numdots == 0) numdots = 1; + for (i = 0; i <= numdots; i++) { + a = (float) i / (float) numdots; + cx0 = lx0 + a * dx + 0.5; + cy0 = ly0 + a * dy + 0.5; + dot_at(cx0, cy0); + } + } + else { + d = sqrt(dx*dx + dy*dy); + numdots = d / (2.0 * milliperdash) + 1.0; + if (numdots <= 1) + line_btw(lx0, ly0, lx1, ly1); + else { + spacesize = (d - numdots * milliperdash) / (numdots - 1); + for (i = 0; i < numdots - 1; i++) { + a = i * (milliperdash + spacesize) / d; + b = a + milliperdash / d; + cx0 = lx0 + a * dx + 0.5; + cy0 = ly0 + a * dy + 0.5; + cx1 = lx0 + b * dx + 0.5; + cy1 = ly0 + b * dy + 0.5; + line_btw(cx0, cy0, cx1, cy1); + b += spacesize / d; + } + cx0 = lx0 + b * dx + 0.5; + cy0 = ly0 + b * dy + 0.5; + line_btw(cx0, cy0, lx1, ly1); + } + } + } + path_len = 0; + + SelectObject(ruleGC, oldPen); +} + + +/* + * Add a point to the current path + */ + +static void +add_path(cp) + char *cp; +{ + int pathx, pathy; + HPEN oldPen; + +#if 0 + oldPen = SelectObject(ruleGC, foreTPicPen); +#endif + if (path_len == 0 && !begin_path) { + BeginPath(ruleGC); + begin_path = True; + } + + if (++path_len >= MAXPOINTS) oops("Too many points"); + if (sscanf(cp, " %d %d ", &pathx, &pathy) != 2) + oops("Malformed path command"); + xx[path_len] = pathx; + yy[path_len] = pathy; + +#if 0 + SelectObject(ruleGC, oldPen); +#endif +} + + +/* + * Draw to a floating point position + */ + +static void +im_fdraw(x, y) + double x,y; +{ + if (++path_len >= MAXPOINTS) oops("Too many arc points"); + xx[path_len] = x + 0.5; + yy[path_len] = y + 0.5; +} + + +/* + * Draw an ellipse with the indicated center and radices. + */ + +static void +draw_ellipse(xc, yc, xr, yr) + int xc, yc, xr, yr; +{ + double angle, theta; + int n; + int px0, py0, px1, py1; + HPEN oldPen; + + oldPen = SelectObject(ruleGC, foreTPicPen); + + angle = (xr + yr) / 2.0; + theta = sqrt(1.0 / angle); + n = TWOPI / theta + 0.5; + if (n < 12) n = 12; + else if (n > 80) n = 80; + n /= 2; + theta = TWOPI / n; + + angle = 0.0; + px0 = xc + xr; /* cos(0) = 1 */ + py0 = yc; /* sin(0) = 0 */ + while ((angle += theta) <= TWOPI) { + px1 = xc + xr*cos(angle) + 0.5; + py1 = yc + yr*sin(angle) + 0.5; + line_btw(px0, py0, px1, py1); + px0 = px1; + py0 = py1; + } + line_btw(px0, py0, xc + xr, yc); + flush_path(); + + SelectObject(ruleGC, oldPen); +} + +/* + * Draw an arc + */ + +static void +arc(cp, invis) + char *cp; + Boolean invis; +{ + int xc, yc, xrad, yrad, n; + float start_angle, end_angle, angle, theta, r; + double xradius, yradius, xcenter, ycenter; + HPEN oldPen; + HBRUSH oldBrush; + + if (sscanf(cp, " %d %d %d %d %f %f ", &xc, &yc, &xrad, &yrad, + &start_angle, &end_angle) != 6) { + Warning("invalid arc specification: %s", cp); + return; + } + + /* FIXME: the interior might need to be filled in */ + if (invis) return; + + oldPen = SelectObject(ruleGC, foreTPicPen); + oldBrush = SelectObject(ruleGC, foreTPicBrush); + + if (!begin_path) { + BeginPath(ruleGC); + begin_path = True; + } + + /* We have a specialized fast way to draw closed circles/ellipses */ + if (start_angle <= 0.0 && end_angle >= 6.282) { + draw_ellipse(xc, yc, xrad, yrad); + return; + } + xcenter = xc; + ycenter = yc; + xradius = xrad; + yradius = yrad; + r = (xradius + yradius) / 2.0; + theta = sqrt(1.0 / r); + n = 0.3 * TWOPI / theta + 0.5; + if (n < 12) n = 12; + else if (n > 80) n = 80; + n /= 2; + theta = TWOPI / n; + flush_path(); + + if (!begin_path) { + BeginPath(ruleGC); + begin_path = True; + } + + im_fdraw(xcenter + xradius * cos(start_angle), + ycenter + yradius * sin(start_angle)); + angle = start_angle + theta; + if (end_angle < start_angle) end_angle += TWOPI; + while (angle < end_angle) { + im_fdraw(xcenter + xradius * cos(angle), + ycenter + yradius * sin(angle)); + angle += theta; + } + im_fdraw(xcenter + xradius * cos(end_angle), + ycenter + yradius * sin(end_angle)); + flush_path(); + + SelectObject(ruleGC, oldPen); + SelectObject(ruleGC, oldBrush); + +} + + +/* + * APPROXIMATE integer distance between two points + */ + +#define dist(x0, y0, x1, y1) (abs(x0 - x1) + abs(y0 - y1)) + + +/* + * Draw a spline along the previously defined path + */ + +static void +flush_spline(char *cp) +{ + int xp, yp; + int N; + int lastx, lasty; + Boolean lastvalid = False; + int t1, t2, t3; + int steps; + int j; + int i, w; + int last_min_x, last_max_x, last_min_y, last_max_y; + + HPEN oldPen; + HBRUSH oldBrush; + + oldPen = SelectObject(ruleGC, foreTPicPen); + oldBrush = SelectObject(ruleGC, foreTPicBrush); + +#ifdef lint + lastx = lasty = -1; +#endif + + last_min_x = 30000; + last_min_y = 30000; + last_max_x = -30000; + last_max_y = -30000; + for (i = 1; i <= path_len; i++) { + if (xx[i] > last_max_x) last_max_x = xx[i]; + if (xx[i] < last_min_x) last_min_x = xx[i]; + if (yy[i] > last_max_y) last_max_y = yy[i]; + if (yy[i] < last_min_y) last_min_y = yy[i]; + } + + + N = path_len + 1; + xx[0] = xx[1]; + yy[0] = yy[1]; + xx[N] = xx[N-1]; + yy[N] = yy[N-1]; + for (i = 0; i < N - 1; i++) { /* interval */ + steps = (dist(xx[i], yy[i], xx[i+1], yy[i+1]) + + dist(xx[i+1], yy[i+1], xx[i+2], yy[i+2])) / 80; + for (j = 0; j < steps; j++) { /* points within */ + w = (j * 1000 + 500) / steps; + t1 = w * w / 20; + w -= 500; + t2 = (750000 - w * w) / 10; + w -= 500; + t3 = w * w / 20; + xp = (t1*xx[i+2] + t2*xx[i+1] + t3*xx[i] + 50000) / 100000; + yp = (t1*yy[i+2] + t2*yy[i+1] + t3*yy[i] + 50000) / 100000; + if (lastvalid) line_btw(lastx, lasty, xp, yp); + lastx = xp; + lasty = yp; + lastvalid = True; + } + } + path_len = 0; + do_attribute_path(last_min_x, last_max_x, last_min_y, last_max_y); + + SelectObject(ruleGC, oldPen); + SelectObject(ruleGC, oldBrush); +} + + +/* + * Shade the last box, circle, or ellipse + */ + +static void +shade_last(char *cp) +{ + blacken = whiten = False; + shade = True; + + if (*cp) { + float tempShadetp; + + if (sscanf(cp, "%f ", &tempShadetp) != 1) { + Warning ("Illegal format for shade level: %s", cp); + return; + } + else if (tempShadetp < 0.0 || tempShadetp > 1.0) { + Warning ("Invalid shade level: %s", cp); + return; + } + else + /* if "sh" has an argument we can safely assume that tpic 2.0 is used + so that all subsequent "sh" commands will come with an explicit + argument. Hence we may overwrite shadetp's old value */ + /* Also note the inversion of gray levels for tpic 2.0 (0 = white, + 1 = black) w.r.t. PostScript (0 = black, 1 = white) */ + shadetp = 1.0 - tempShadetp; + } + if (foreTPicBrush) + if (!DeleteObject(foreTPicBrush)) + Win32Error("shade_last/DeleteObject/foreTPicBrush"); + foreTPicBrush = CreateSolidBrush(RGB((shadetp*255), (shadetp*255), (shadetp*255))); + + +} + + +/* + * Make the last box, circle, or ellipse, white inside (shade with white) + */ + +static void +whiten_last() +{ + whiten = True; + blacken = shade = False; + if (foreTPicBrush) + if (!DeleteObject(foreTPicBrush)) + Win32Error("whiten_last/DeleteObject/foreTPicBrush"); + foreTPicBrush = CreateSolidBrush(back_Pixel); +} + + +/* + * Make last box, etc, black inside + */ + +static void +blacken_last() +{ + blacken = True; + whiten = shade = False; + if (foreTPicBrush) + if (!DeleteObject(foreTPicBrush)) + Win32Error("blacken_last/DeleteObject/foreTPicBrush"); + foreTPicBrush = CreateSolidBrush(fore_Pixel); +} + +/* + * Set current shading factor + */ + +/* Taken from dvips ! */ +/* set shading level (used with Fig 1.4-TFX). priol@irisa.fr, 89/04 */ +/* A better trial at setting shading level -- jourdan@minos.inria.fr */ +/* Count number of black bits in the pattern together with total number, */ +/* compute the average and use this as the PostScript gray level */ +static void +set_shade (char *cp) +{ + int blackbits = 0, totalbits = 0; + + while (*cp) { + switch (*cp) { + case '0': + totalbits += 4; + break; + case '1': + case '2': + case '4': + case '8': + blackbits += 1; + totalbits += 4; + break; + case '3': + case '5': + case '6': + case '9': + case 'a': + case 'A': + case 'c': + case 'C': + blackbits += 2; + totalbits += 4; + break; + case '7': + case 'b': + case 'B': + case 'd': + case 'D': + case 'e': + case 'E': + blackbits += 3; + totalbits += 4; + break; + case 'f': + case 'F': + blackbits += 4; + totalbits += 4; + break; + case ' ': + break; + default: + Warning("Invalid character in .tx patte: %s\n", cp); + return; + break; + } + cp++; + } + shadetp = 1.0 - ((double) blackbits / (double) totalbits); + if (foreTPicBrush) + if (!DeleteObject(foreTPicBrush)) + Win32Error("set_shade/DeleteObject/foreTPicBrush"); + foreTPicBrush = CreateSolidBrush(RGB((shadetp*255), (shadetp*255), (shadetp*255))); +} /* end of SetShade */ + +/* + * Code for PostScript<tm> specials begins here. + */ + +#if PS + +/* + * Information on how to search for PS header and figure files. + */ + +static _Xconst char no_f_str_ps[] = "/%f"; + +static void ps_startup ARGS((int, int, _Xconst char *)); +static void ps_startup2 ARGS((void)); +void NullProc ARGS((void)) {} +/* ARGSUSED */ +static void NullProc2 ARGS((_Xconst char *)); + +struct psprocs psp = { /* used for lazy startup of the ps machinery */ + /* toggle */ NullProc, + /* destroy */ NullProc, + /* interrupt */ NullProc, + /* endpage */ NullProc, + /* drawbegin */ ps_startup, + /* drawraw */ NullProc2, + /* drawfile */ NULL, + /* drawend */ NullProc2, + /* beginheader */ ps_startup2, + /* endheader */ NullProc, + /* newdoc */ NullProc}; + +struct psprocs no_ps_procs = { /* used if postscript is unavailable */ + /* toggle */ NullProc, + /* destroy */ NullProc, + /* interrupt */ NullProc, + /* endpage */ NullProc, + /* drawbegin */ drawbegin_none, + /* drawraw */ NullProc2, + /* drawfile */ NULL, + /* drawend */ NullProc2, + /* beginheader */ NullProc, + /* endheader */ NullProc, + /* newdoc */ NullProc}; + +#endif /* PS */ + +static Boolean bbox_valid; +static unsigned int bbox_width; +static unsigned int bbox_height; +static int bbox_angle; +static int bbox_voffset; + +void +draw_bbox() +{ + int xcorner, ycorner; + + if (bbox_valid) { + + xcorner = PXL_H - currwin.base_x; + ycorner = PXL_V - currwin.base_y; + + if (bbox_angle == 0) { + ycorner -= bbox_voffset; + XDrawLine(DISP, currwin.win, ruleGC, + xcorner, ycorner, + xcorner + bbox_width, ycorner); + XDrawLine(DISP, currwin.win, ruleGC, + xcorner + bbox_width, ycorner, + xcorner + bbox_width, ycorner + bbox_height); + XDrawLine(DISP, currwin.win, ruleGC, + xcorner + bbox_width, ycorner + bbox_height, + xcorner, ycorner + bbox_height); + XDrawLine(DISP, currwin.win, ruleGC, + xcorner, ycorner + bbox_height, + xcorner, ycorner); + } + else { + float sin_a = sin(bbox_angle * (TWOPI / 360)); + float cos_a = cos(bbox_angle * (TWOPI / 360)); + float a, b, c, d; + + a = cos_a * bbox_width; + b = -sin_a * bbox_width; + c = -sin_a * bbox_height; + d = -cos_a * bbox_height; + + XDrawLine(DISP, currwin.win, ruleGC, + xcorner, ycorner, + xcorner + (int) rint(a), ycorner + (int) rint(b)); + XDrawLine(DISP, currwin.win, ruleGC, + xcorner + (int) rint(a), ycorner + (int) rint(b), + xcorner + (int) rint(a + c), ycorner + (int) rint(b + d)); + XDrawLine(DISP, currwin.win, ruleGC, + xcorner + (int) rint(a + c), ycorner + (int) rint(b + d), + xcorner + (int) rint(c), ycorner + (int) rint(d)); + XDrawLine(DISP, currwin.win, ruleGC, + xcorner + (int) rint(c), ycorner + (int) rint(d), + xcorner, ycorner); + } + bbox_valid = False; + } +} + +#if PS + +static void +actual_startup() +{ + /* + * Figure out what we want to use to display postscript figures + * and set at most one of the following to True: + * resource.useGS, resource.useDPS, resource.useNeWS + * + * Choose DPS then NEWS then Ghostscript if they are available + */ + if (!( +#ifdef PS_DPS + (resource.useDPS && initDPS()) +#if defined(PS_NEWS) || defined(PS_GS) + || +#endif +#endif /* PS_DPS */ + +#ifdef PS_NEWS + (resource.useNeWS && initNeWS()) +#ifdef PS_GS + || +#endif +#endif /* PS_NEWS */ + +#ifdef PS_GS + (resource.useGS && initGS()) +#endif + + )) + psp = no_ps_procs; +} + +static void +ps_startup(xul, yul, cp) + int xul, yul; + _Xconst char *cp; +{ + if (!resource._postscript) { + psp.toggle = actual_startup; + draw_bbox(); + return; + } + actual_startup(); + psp.drawbegin(xul, yul, cp); +} + +static void +ps_startup2() +{ + actual_startup(); + psp.beginheader(); +} + +/* ARGSUSED */ +static void +NullProc2(cp) + _Xconst char *cp; +{} + +static void +ps_parseraw(PostScript_cmd) + _Xconst char *PostScript_cmd; +{ + _Xconst char *p; + + /* dumb parsing of PostScript - search for rotation H. Zeller 1/97 */ + bbox_angle = 0; + p = strstr(PostScript_cmd, "rotate"); + if (p != NULL) { + while (*p != '\0' && !isdigit(*p)) --p; + while (*p != '\0' && isdigit(*p)) --p; + if (*p != '+' && *p != '-') ++p; + sscanf(p, "%d neg rotate", &bbox_angle); + } +} + + +/* ARGSUSED */ +void +#if NeedFunctionPrototypes +drawbegin_none(int xul, int yul, _Xconst char *cp) +#else /* !NeedFunctionPrototypes */ +drawbegin_none(xul, yul, cp) + int xul, yul; + _Xconst char *cp; +#endif /* NeedFunctionPrototypes */ +{ + draw_bbox(); +} + + +struct tickrec { + struct tickrec *next; + int pageno; + char *command; + _Xconst char *tmpname; +}; + +static struct tickrec *tickhead = NULL; /* head of linked list of */ + /* cached information */ +static int nticks = 0; /* number of records total */ + +#ifndef TICKCACHESIZE +#define TICKCACHESIZE 3 +#endif + +#ifndef TICKTMP +#define TICKTMP "/tmp" +#endif + +#ifdef WIN32 +char tick_tmp[PATH_MAX]; +#endif + +static struct tickrec * +cachetick(filename, pathinfo, fp) + _Xconst char *filename; + kpse_file_format_type pathinfo; + FILE **fp; +{ + struct tickrec **linkp; + struct tickrec *tikp; + struct tickrec **freerecp; + + static int fileno=0; + + linkp = &tickhead; + freerecp = NULL; + for (;;) { /* see if we have it already */ + tikp = *linkp; + if (tikp == NULL) { /* if end of list */ + if (nticks >= TICKCACHESIZE && freerecp != NULL) { + tikp = *freerecp; + *freerecp = tikp->next; + free(tikp->command); + unlink(tikp->tmpname); + } + else { + /* This will overflow when we get 10^9 temporary files. + If we have to worry I worry */ + char *buffer=malloc(strlen(temporary_dir)+10); + + tikp = (struct tickrec *) + xmalloc(sizeof(struct tickrec)); + + sprintf(buffer,"%s/%d",temporary_dir,fileno); + + fileno++; + + tikp->tmpname = buffer; + tikp->pageno = -1; + if (tikp->tmpname == NULL) { + Fputs("Cannot create temporary file name.\n", stderr); + free((char *) tikp); + return NULL; + } + ++nticks; + } + tikp->command = xmalloc((unsigned) strlen(filename) + 1); + Strcpy(tikp->command, filename); + *fp = NULL; + break; + } + if (strcmp(filename, tikp->command) == 0) { /* found it */ + *linkp = tikp->next; /* unlink it */ + *fp = xfopen(tikp->tmpname, OPEN_MODE); + if (*fp == NULL) { + fprintf(stderr,"%s: ("__FILE__" at line %d) ", prog, __LINE__); + perror(tikp->tmpname); + } + break; + } + if (tikp->pageno != current_page) freerecp = linkp; + linkp = &tikp->next; + } + tikp->next = tickhead; /* link it in */ + tickhead = tikp; + tikp->pageno = + pathinfo != kpse_tex_ps_header_format ? current_page : -1; + return tikp; +} + +#ifndef UNCOMPRESS +#define UNCOMPRESS "uncompress" +#endif + +#ifndef GUNZIP +#define GUNZIP "gunzip" +#endif + +#ifndef BUNZIP2 +#define BUNZIP2 "bunzip2" +#endif + +#ifdef WIN32 +/* =========================================================================== + * Uncompress input to output then close both files. + */ +void gz_uncompress(gzFile in, FILE *out) +{ + char buf[16384]; + int len; + int err; + + for (;;) { + len = gzread(in, buf, sizeof(buf)); + if (len < 0) { + fprintf(stderr, "gunzip: %s\n", (gzerror(in, &err))); + return; + } + if (len == 0) break; + + if ((int)fwrite(buf, 1, (unsigned)len, out) != len) { + fprintf(stderr, "gunzip: failed fwrite\n"); + return; + } + } + if (fclose(out)) { + fprintf(stderr, "gunzip: failed fclose\n"); + return; + } + + if (gzclose(in) != Z_OK) { + fprintf(stderr, "gunzip: failed gzclose\n"); + return; + } +} +#endif + +#ifdef USE_POPEN +static char buf_popen[1024]; +#endif + +static void +send_ps_file(filename, pathinfo) + _Xconst char *filename; + kpse_file_format_type pathinfo; +{ + FILE *f; + static _Xconst char *argv[] = {NULL, "-c", NULL, NULL}; + _Xconst char *bufp; + struct tickrec *tikp; + int len; + char magic1, magic2, magic3; + + if (psp.drawfile == NULL || !resource._postscript) return; + +#ifdef HTEX + + filename=urlocalize(filename); + + if (((URLbase != NULL) && htex_is_url(urlocalize(URLbase))) || + (htex_is_url(filename))) { + /* xfopen knows how to fetch url things */ + URL_aware=1; + f = xfopen(filename, OPEN_MODE); + bufp=filelist[lastwwwopen].file; + URL_aware=0; + } else +#endif + if (filename[0] == '`') { + if (!resource.allow_shell) { + if (warn_spec_now) + Fprintf(stderr, + "%s: shell escape disallowed for special \"%s\"\n", + prog, filename); + return; + } + + tikp = cachetick(filename, pathinfo, &f); + if (tikp == NULL) + return; + if (f == NULL) { +#ifdef USE_POPEN + FILE *in, *out; + int nb_read, nb_written; + in = popen(filename+1, OPEN_MODE); + out = xfopen(tikp->tmpname, "wb"); + if (!in) { + fclose(out); + fprintf(stderr, "Can't popen %s\n", filename+1); + return; + } + /* Copying the result of popen to tmpname */ + for ( ; !feof(in); ) { + nb_read = fread(buf_popen, 1, sizeof(buf_popen), in); + if (ferror(in)) { + perror(filename+1); + break; + } + nb_written = fwrite(buf_popen, 1, nb_read, out); + if (ferror(out)) { + perror(tikp->tmpname); + break; + } + } + pclose(in); + fclose(out); +#else + len = strlen(filename) + strlen(tikp->tmpname) + (4 - 1); + if (len > ffline_len) + expandline(len); + Sprintf(ffline, "%s > %s", filename + 1, tikp->tmpname); + (void) system(ffline); +#endif + f = xfopen(tikp->tmpname, OPEN_MODE); + if (f == NULL) { + fprintf(stderr,"%s: ("__FILE__" at line %d) ", prog, __LINE__); + perror(tikp->tmpname); + return; + } + } + bufp = tikp->tmpname; + } + else { + + bufp = kpse_find_file (filename, pathinfo, True); + f = bufp ? xfopen (bufp, OPEN_MODE) : NULL; + + /* if still no luck, complain */ + if (f == NULL) { + Fprintf(stderr, "%s: cannot find PS file `%s'.\n", + prog, filename); + draw_bbox(); + return; + } + +#ifdef WIN32 + /* check for compressed files */ + len = strlen(filename); + magic1 = '\037'; + magic3 = '\0'; + if ((len > 2 && _stricmp(filename + len - 2, ".Z") == 0 && (magic2 = '\235', True)) + || (len > 3 && _stricmp(filename + len - 3, ".gz") == 0 && (magic2 = '\213', True))) { + /* Uncompress or Gzip */ + if (getc(f) != magic1 || (char) getc(f) != magic2) + rewind(f); + else { + Fclose(f); + ++n_files_left; + tikp = cachetick(filename, pathinfo, &f); + if (tikp == NULL) + return; + if (f == NULL) { + FILE *outfile; + gzFile *infile; + infile = gzopen(bufp, "rb"); + if (infile == NULL) { + fprintf(stderr, "%s: can't gzopen %s\n", prog, bufp); + return; + } + /* FIXME: Check that this is correct wrt to the unix case, + tmpname are reused. */ + if ((outfile = fopen(tikp->tmpname, "wb")) == NULL) { + perror(tikp->tmpname); + return; + } + gz_uncompress(infile, outfile); + /* Files closing is cared of by gz_uncompress ! */ + f = xfopen(tikp->tmpname, OPEN_MODE); + if (f == NULL) { + fprintf(stderr,"%s: ("__FILE__" at line %d) ", + prog, __LINE__); + perror(tikp->tmpname); + return; + } + } + bufp = tikp->tmpname; + } + } + else if (len > 4 && _stricmp(filename + len - 4, ".bz2") == 0) { + /* Bunzip2 */ + magic1 = 'B'; + magic2 = 'Z'; + magic3 = 'h'; + if (getc(f) != magic1 || (char) getc(f) != magic2 + || getc(f) != magic3) + rewind(f); + else { + Fclose(f); + ++n_files_left; + tikp = cachetick(filename, pathinfo, &f); + if (tikp == NULL) + return; + if (f == NULL) { + FILE *outfile; + BZFILE *infile; + unsigned char buf[4096]; + size_t len; + infile = BZ2_bzopen(bufp, "rb"); + if (infile == NULL) { + fprintf(stderr, "%s: can't BZ2_bzopen %s\n", prog, bufp); + return; + } + /* FIXME: Check that this is correct wrt to the unix case, + tmpname are reused. */ + if ((outfile = fopen(tikp->tmpname, "wb")) == NULL) { + perror(tikp->tmpname); + return; + } + while ((len = BZ2_bzread(infile, buf, sizeof(buf))) > 0) + fwrite (buf, 1, len, outfile); + BZ2_bzclose (infile); + fclose(outfile); + f = xfopen(tikp->tmpname, OPEN_MODE); + if (f == NULL) { + fprintf(stderr,"%s: ("__FILE__" at line %d) ", + prog, __LINE__); + perror(tikp->tmpname); + return; + } + } + bufp = tikp->tmpname; + } + } + else if (len > 3 && _stricmp(filename + len - 2, ".zip") == 0) { + fprintf(stderr, "%s: Zip files are not supported (%s)\n", prog, filename); + Fclose(f); + return; + } + else { + /* Not a compressed file ? */ + rewind(f); + } + } +#else + /* check for compressed files */ + len = strlen(filename); + magic1 = '\037'; + magic3 = '\0'; + if ((len > 2 && strcmp(filename + len - 2, ".Z") == 0 + && (argv[0] = UNCOMPRESS, magic2 = '\235', True)) + || (len > 3 && strcmp(filename + len - 3, ".gz") == 0 + && (argv[0] = GUNZIP, magic2 = '\213', True)) + || (len > 4 && strcmp(filename + len - 4, ".bz2") == 0 + && (argv[0] = BUNZIP2, magic1 = 'B', magic2 = 'Z', + magic3 = 'h', True))) { + if (getc(f) != magic1 || (char) getc(f) != magic2 + || (magic3 != '\0' && getc(f) != magic3)) + rewind(f); + else { + Fclose(f); + ++n_files_left; + tikp = cachetick(filename, pathinfo, &f); + if (tikp == NULL) + return; + if (f == NULL) { + pid_t pid; + int handle; + int status; + + argv[2] = bufp; + handle = open(tikp->tmpname, O_RDWR | O_CREAT | O_EXCL, + S_IRUSR | S_IWUSR); + if (handle == -1 && errno == EEXIST) { + /* The tmpnames are reused for each page so + unlink the tmpname file from the previous page */ + unlink(tikp->tmpname); + handle = open(tikp->tmpname, O_RDWR | O_CREAT | + O_EXCL, S_IRUSR | S_IWUSR); + } + if (handle == -1) { + fprintf(stderr,"%s: ("__FILE__" at line %d) ", prog, __LINE__); + perror(tikp->tmpname); + return; + } + Fflush(stderr); /* avoid double flushing */ + pid = vfork(); + if (pid == 0) { /* if child */ + (void) dup2(handle, 1); + (void) execvp(argv[0], (char **) argv); + Fprintf(stderr, "Execvp of %s failed.\n", argv[0]); + Fflush(stderr); + _exit(1); + } + (void) close(handle); + for (;;) { +#if HAVE_WAITPID + if (waitpid(pid, &status, 0) != -1) break; +#else +# if HAVE_WAIT4 + if (wait4(pid, &status, 0, (struct rusage *) NULL) + != -1) + break; +# else + int retval; + + retval = wait(&status); + if (retval == pid) break; + if (retval != -1) continue; +# endif /* HAVE_WAIT4 */ +#endif /* HAVE_WAITPID */ + if (errno == EINTR) continue; + perror("[xdvi] waitpid"); + return; + } + f = xfopen(tikp->tmpname, OPEN_MODE); + if (f == NULL) { + fprintf(stderr,"%s: ("__FILE__" at line %d) ", + prog, __LINE__); + perror(tikp->tmpname); + return; + } + } + bufp = tikp->tmpname; + } + } + } +#endif + + /* Success! */ + psp.drawfile(bufp, f, filename); /* this is supposed to close the file */ +} + + +void +ps_newdoc() +{ + struct tickrec *tikp; + + scanned_page = scanned_page_bak = scanned_page_reset = + resource.prescan ? -1 : total_pages; + for (tikp = tickhead; tikp != NULL; tikp = tikp->next) + tikp->pageno = -1; + psp.newdoc(); +} + + +void +ps_destroy() +{ + struct tickrec *tikp; + + /* Note: old NeXT systems (at least) lack atexit/on_exit. */ + psp.destroy(); + for (tikp = tickhead; tikp != NULL; tikp = tikp->next) + if (unlink(tikp->tmpname) < 0) { + fprintf(stderr,"%s: ("__FILE__" at line %d) ", prog, __LINE__); + perror(tikp->tmpname); + } +} + +#endif /* PS */ + + +static void +psfig_special(cp) + char *cp; +{ + char *filename; + int raww, rawh; + + if (strncmp(cp, ":[begin]", 8) == 0) { + cp += 8; + bbox_valid = False; + bbox_angle = 0; + if (sscanf(cp,"%d %d\n", &raww, &rawh) >= 2) { + bbox_valid = True; + bbox_width = pixel_conv(spell_conv(raww)); + bbox_height = pixel_conv(spell_conv(rawh)); + bbox_voffset = 0; + } + if (currwin.win == mane.win) +#if PS + if (isPrinting) + psp.drawbegin(PXL_H, PXL_V, + cp); + else + psp.drawbegin(PXL_H - currwin.base_x, PXL_V - currwin.base_y, + cp); +#else + draw_bbox(); +#endif + psfig_begun = True; + } else if (strncmp(cp, " plotfile ", 10) == 0) { + cp += 10; + while (isspace(*cp)) cp++; + /* handle "`zcat file". Borrowed from dvipsk...*/ + if (*cp == '"') { + cp++; + for (filename = cp; *cp && (*cp != '"'); ++cp); + } else { + for (filename = cp; *cp && !isspace(*cp); ++cp); + } + *cp = '\0'; +#if PS + if (currwin.win == mane.win) + send_ps_file(filename, kpse_pict_format); +#endif + } else if (strncmp(cp, ":[end]", 6) == 0) { + cp += 6; +#if PS + if (currwin.win == mane.win) psp.drawend(cp); +#endif + bbox_valid = False; + psfig_begun = False; + } else { /* I am going to send some raw postscript stuff */ + if (*cp == ':') + ++cp; /* skip second colon in ps:: */ +#if PS + if (currwin.win == mane.win) { + ps_parseraw(cp); + if (psfig_begun) psp.drawraw(cp); + else { + if (isPrinting) + psp.drawbegin(PXL_H, PXL_V, cp); + else + psp.drawbegin(PXL_H - currwin.base_x, + PXL_V - currwin.base_y, cp); + psp.drawend(""); + } + } +#endif + } +} + + +/* Keys for epsf specials */ + +static _Xconst char *keytab[] = {"clip", + "llx", + "lly", + "urx", + "ury", + "rwi", + "rhi", + "hsize", + "vsize", + "hoffset", + "voffset", + "hscale", + "vscale", + "angle"}; + +#define KEY_LLX keyval[0] +#define KEY_LLY keyval[1] +#define KEY_URX keyval[2] +#define KEY_URY keyval[3] +#define KEY_RWI keyval[4] +#define KEY_RHI keyval[5] + +#define NKEYS (sizeof(keytab)/sizeof(*keytab)) +#define N_ARGLESS_KEYS 1 + +static void +epsf_special(cp) + char *cp; +{ + char *filename; + static char *buffer; + static unsigned int buflen = 0; + unsigned int len; + char *q; + int flags = 0; + double keyval[6]; + + filename = cp; + if (*cp == '\'' || *cp == '"') { + do ++cp; + while (*cp != '\0' && *cp != *filename); + ++filename; + } + else + while (*cp != '\0' && *cp != ' ' && *cp != '\t') ++cp; + if (*cp != '\0') *cp++ = '\0'; + while (*cp == ' ' || *cp == '\t') ++cp; + len = strlen(cp) + NKEYS + 30; + if (buflen < len) { + if (buflen != 0) free(buffer); + buflen = len; + buffer = xmalloc(buflen); + } + Strcpy(buffer, "@beginspecial"); + q = buffer + strlen(buffer); + while (*cp != '\0') { + char *p1 = cp; + int keyno; + + while (*p1 != '=' && !isspace(*p1) && *p1 != '\0') ++p1; + for (keyno = 0;; ++keyno) { + if (keyno >= NKEYS) { + if (warn_spec_now) + Fprintf(stderr, + "%s: unknown keyword (%*s) in \\special will be ignored\n", + prog, (int) (p1 - cp), cp); + break; + } + if (memcmp(cp, keytab[keyno], p1 - cp) == 0) { + if (keyno >= N_ARGLESS_KEYS) { + while (isspace(*p1)) ++p1; + if (*p1 == '=') { + ++p1; + while (isspace(*p1)) ++p1; + } + if (keyno < N_ARGLESS_KEYS + 6) { + keyval[keyno - N_ARGLESS_KEYS] = atof(p1); + flags |= (1 << (keyno - N_ARGLESS_KEYS)); + } + *q++ = ' '; + while (!isspace(*p1) && *p1 != '\0') *q++ = *p1++; + } + *q++ = ' '; + *q++ = '@'; + Strcpy(q, keytab[keyno]); + q += strlen(q); + break; + } + } + cp = p1; + while (!isspace(*cp) && *cp != '\0') ++cp; + while (isspace(*cp)) ++cp; + } + Strcpy(q, " @setspecial\n"); + + bbox_valid = False; + if ((flags & 0x30) == 0x30 || ((flags & 0x30) && (flags & 0xf) == 0xf)){ + bbox_valid = True; + bbox_width = 0.1 * ((flags & 0x10) ? KEY_RWI + : KEY_RHI * (KEY_URX - KEY_LLX) / (KEY_URY - KEY_LLY)) + * dimconv / shrink_factor + 0.5; + bbox_voffset = bbox_height = 0.1 * ((flags & 0x20) ? KEY_RHI + : KEY_RWI * (KEY_URY - KEY_LLY) / (KEY_URX - KEY_LLX)) + * dimconv / shrink_factor + 0.5; + } + + if (filename && currwin.win == mane.win) { +#if PS + if (isPrinting) + psp.drawbegin(PXL_H, PXL_V, buffer); + else + psp.drawbegin(PXL_H - currwin.base_x, PXL_V - currwin.base_y, + buffer); + /* talk directly with the DPSHandler here */ + send_ps_file(filename, kpse_pict_format); + psp.drawend(" @endspecial"); +#else + draw_bbox(); +#endif + } + bbox_valid = False; +} + + +static void +quote_special(cp) + char *cp; +{ + bbox_valid = False; + +#if PS + if (currwin.win == mane.win) { + if (isPrinting) + psp.drawbegin(PXL_H, PXL_V, + "@beginspecial @setspecial "); + else + psp.drawbegin(PXL_H - currwin.base_x, PXL_V - currwin.base_y, + "@beginspecial @setspecial "); + /* talk directly with the DPSHandler here */ + psp.drawraw(cp + 1); + psp.drawend(" @endspecial"); + } +#endif + + /* nothing else to do--there's no bbox here */ +} + +#if PS + +static void +scan_header(cp) + char *cp; +{ + char *filename; + + filename = cp; + if (*cp == '\'' || *cp == '"') { + do ++cp; + while (*cp != '\0' && *cp != *filename); + *cp = '\0'; + ++filename; + } + + psp.beginheader(); + send_ps_file(filename, kpse_tex_ps_header_format); +} + +static void +scan_bang(cp) + char *cp; +{ + psp.beginheader(); + psp.drawraw(cp + 1); +} + +#endif /* PS */ + +/* + Color support. + Basically, the primitives supported by dvips. + Still do not work when printing. Colors are mixed up because we can't do + transparent blt directly on the printer dc. +*/ + + +void +background P1C(char *, p) +{ + /* this should be valid only for the current page */ + while ( *p <= ' ' ) p++ ; +#if DEBUG_COLOR + fprintf(stderr, "Special : background %s\n", p); +#endif + SetBackColor(string_to_colorref(p)); +} + +void +pushcolor P2C(char *, p, Boolean, outtops) +{ + COLORREF c = string_to_colorref(p); + +#if DEBUG_COLOR + fprintf(stderr, "Special : push color %s %8x\n", p, c); +#endif + + CRefPush(color_stack, c); + SetForeColor(c); +} + +void +popcolor P1C(Boolean, outtops) +{ + CRefPop(color_stack); + SetForeColor(CRefTop(color_stack)); +#if DEBUG_COLOR + fprintf(stderr, "Special : pop color %8x\n", fore_Pixel); +#endif +} + +void +resetcolorstack P2C(char *, p, int, outtops) +{ + COLORREF c = string_to_colorref(p); + + CRefResetInit(color_stack, c); + SetForeColor(c); +} + +/* + * The following copyright message applies to the rest of this file. --PV + */ + +/* + * This program is Copyright (C) 1987 by the Board of Trustees of the + * University of Illinois, and by the author Dirk Grunwald. + * + * This program may be freely copied, as long as this copyright + * message remaines affixed. It may not be sold, although it may + * be distributed with other software which is sold. If the + * software is distributed, the source code must be made available. + * + * No warranty, expressed or implied, is given with this software. + * It is presented in the hope that it will prove useful. + * + * Hacked in ignorance and desperation by jonah@db.toronto.edu + */ + +/* + * The code to handle the \specials generated by tpic was modified + * by Dirk Grunwald using the code Tim Morgan at Univ. of Calif, Irvine + * wrote for TeXsun. + */ + +static char * +endofcommand(cp) + char *cp; +{ + while (isspace(*cp)) ++cp; + if (*cp != '=') return NULL; + do ++cp; while (isspace(*cp)); + return cp; +} + + +// addition SU: copied from dvi-draw.c +#define xtell(pos) ((long) (lseek(fileno(dvi_file), 0L, SEEK_CUR) - \ + (currinf.end - (pos)))) + + +void +applicationDoSpecial(cp, maybe_src) + char *cp; + int maybe_src; +{ + char *p; + boolean gs_allowed; + struct drawinf oldinfo; + ubyte ch; + float pt_size; + off_t file_pos; + static Position remember_H, remember_V; +#ifdef TRANSFORM + extern XFORM *gs_getmatrix(void); + extern void xfrm_record(XFORM *); + extern void xfrm_apply(void); +#endif + + /* Skip white space */ + while (*cp == ' ' || *cp == '\t') ++cp; + + if (allowDrawingChars && maybe_src) { +/* BEGIN CHUNK special.c 1 */ +#ifdef SRC_SPECIALS + if (memicmp(cp, "src:", 4) == 0) { + /* oldinfo = currinf; + file_pos = xtell(currinf.pos); + pt_size = src_look_forward(dimconv); + fprintf(stderr, "returning.\n"); + currinf = oldinfo; + (void) lseek(fileno(dvi_file), file_pos, SEEK_SET); + src_eval_special(cp + 4, PXL_H, PXL_V, pt_size); */ +#if 0 + fprintf(stderr, "executing %d, %d for %s\n", remember_H, remember_V, cp + 4); +#endif + src_eval_special(cp + 4, remember_H, remember_V); + delay_src = False; + } + return; +#endif +/* END CHUNK special.c 1 */ + } + + /* PostScript specials */ + + gs_allowed = !allowDrawingChars && ((mane.shrinkfactor > 1) || isPrinting); +#if 0 + fprintf(stderr, "special found at %ld: %s, isPrinting = %d, gs_allowed = %d\n", + currinf.pos, cp, isPrinting, gs_allowed); +#endif + /* We do not allow to use gs at magnification 1 */ + if (*cp == '"') { + if (gs_allowed) { + quote_special(cp); +#ifdef TRANSFORM + xfrm_record(gs_getmatrix()); +#endif + } +#ifdef TRANSFORM + else if (allowDrawingChars) { + xfrm_apply(); + } +#endif + return; + } + if (memicmp(cp, "ps:", 3) == 0) { + if (gs_allowed) { + psfig_special(cp + 3); +#ifdef TRANSFORM + xfrm_record(gs_getmatrix()); +#endif + } +#ifdef TRANSFORM + else if (allowDrawingChars) { + xfrm_apply(); + } +#endif + return; + } + + + if (memicmp(cp, "src:", 4) == 0) { + if (allowDrawingChars) { +#ifdef SRC_SPECIALS + remember_V = PXL_V; + remember_H = PXL_H; +#if 0 + fprintf(stderr, "remembering %d, %d for %s\n", remember_H, remember_V, cp + 4); +#endif + delay_src = True; +#else + fprintf(stderr, "special not handled: %s\n", cp); +#endif + } + return; + } + + if (memicmp(cp, "psfile", 6) == 0 + && (p = endofcommand(cp + 6)) != NULL) { + if (gs_allowed) { + epsf_special(p); +#ifdef TRANSFORM + xfrm_record(gs_getmatrix()); +#endif + } +#ifdef TRANSFORM + else if (allowDrawingChars) { + xfrm_apply(); + } +#endif + return; + } + + /* these should have been scanned */ + + if (*cp == '!' + || (memicmp(cp, "header", 6) == 0 + && endofcommand(cp + 6) != NULL)) { +#if PS + if (resource._postscript && scanned_page_reset >= 0) { + /* turn on scanning and redraw the page */ + scanned_page = scanned_page_bak = scanned_page_reset = -1; + psp.interrupt(); + canit = True; + /* longjmp(canit_env, 1); */ + SendMessage(hWndDraw, WM_COMMAND, IDM_REDRAWPAGE, 0); + } +#endif + return; + } + + /* Color specials */ + + if (memicmp(cp, "background", 10) == 0) { +#if 0 + if (scanned_page_reset >= 0) { + p = cp + 11; + while ( *p <= ' ' ) p++ ; + background(p) ; + scanned_page = scanned_page_bak = scanned_page_reset = -1; + if (! isPrinting) + SendMessage(hWndDraw, WM_COMMAND, IDM_REDRAWPAGE, 0); + } +#else + p = cp + 11; + while ( *p <= ' ' ) p++ ; + background(p) ; +#endif + return ; + } + + if (memicmp(cp, "landscape", 9) == 0) { + fprintf(stderr, "special not handled: %s\n", cp); + return; + } + + if (memicmp(cp, "papersize", 9) == 0) { + fprintf(stderr, "special not handled: %s\n", cp); + return; + } + + if (memicmp(cp, "pos:", 4) == 0) { + /* ignore positional specials */ + return; + } + + if (memicmp(cp, "xtex:", 5) == 0) { + return; + } + + if (memicmp(cp, "em:", 3) == 0) { + if (currwin.win == hWndDraw) + emspecial(cp+3, PXL_H, PXL_V); + return; + } + + if (memicmp(cp, "color", 5) == 0) { + p = cp + 6; + while ( *p <= ' ' ) p++ ; + if (memicmp(p, "push", 4) == 0) { + p += 5; + while ( *p <= ' ' ) p++ ; + pushcolor(p, 0) ; + } else if (memicmp(p, "pop", 3) == 0) { + popcolor(0) ; + } else { + resetcolorstack(p,0) ; + } + return; + } /* IBM: color - end changes */ + +#ifdef HTEX + if (checkHyperTeX(cp, current_page)) return; +#endif + + /* tpic specials */ + + if (*cp >= 'a' && *cp <= 'z' && cp[1] >= 'a' && cp[1] <= 'z' && + (isspace(cp[2]) || cp[2] == '\0')) { +#if DEBUG_TPIC + fprintf(stderr, "Tpic special : %s\n", cp); +#endif + switch (CMD(*cp, cp[1])) { + case CMD('p','n'): set_pen_size(cp + 2); return; + case CMD('f','p'): flush_path(); return; + case CMD('d','a'): flush_dashed(cp + 2, False); return; + case CMD('d','t'): flush_dashed(cp + 2, True); return; + case CMD('p','a'): add_path(cp + 2); return; + case CMD('a','r'): arc(cp + 2, False); return; + case CMD('i','a'): arc(cp + 2, True); return; + case CMD('s','p'): flush_spline(cp+2); return; + case CMD('s','h'): shade_last(cp+2); return; + case CMD('w','h'): whiten_last(); return; + case CMD('b','k'): blacken_last(); return; + case CMD('i','p'): /* throw away the path -- jansteen */ + path_len = 0; return; + case CMD('t','x'): set_shade(cp+2); return; + } + } + + if (warn_spec_now) + Fprintf(stderr, "%s: special \"%s\" not implemented\n", prog, cp); +} + +#undef CMD + +#if PS +void +scan_special(cp) + char *cp; +{ + char *p; + /* Skip white space */ + while (*cp == ' ' || *cp == '\t') ++cp; + + if (debug & DBG_PS) + Printf("Scanning special `%s'.\n", cp); + + if (*cp == '"' + || memicmp(cp, "ps:", 3) == 0 + || (memicmp(cp, "psfile", 6) == 0 && (p = endofcommand(cp + 6)) != NULL) + || ((memicmp(cp, "header", 6) == 0) && ((p = endofcommand(cp + 6)) != NULL))) { + psToDisplay = TRUE; + } + + /* these should have been scanned */ + + if (*cp == '!') + scan_bang(cp); + else if ((memicmp(cp, "header", 6) == 0) + && ((p = endofcommand(cp + 6)) != NULL)) + scan_header(p); + else if (memicmp(cp, "background", 10) == 0 + || memicmp(cp, "color", 5) == 0) { + scan_colors(cp); + } + +} +#endif /* PS */ diff --git a/Build/source/texk/windvi/squeeze.c b/Build/source/texk/windvi/squeeze.c new file mode 100644 index 00000000000..247ce82e9ca --- /dev/null +++ b/Build/source/texk/windvi/squeeze.c @@ -0,0 +1,195 @@ +/*========================================================================*\ + +Copyright (c) 1994-1999 Paul Vojta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +PAUL VOJTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +NOTE: + This routine is adapted from the squeeze.c that comes with dvips; + it bears the message: + This software is Copyright 1988 by Radical Eye Software. + Used with permission. + +\*========================================================================*/ + +/* + * This routine squeezes a PostScript file down to its + * minimum. We parse and then output it. + * Adapted for xdvi 1/94. Writes a C program that contains the PS file + * as a constant string. + */ +#include <stdio.h> +#include <kpathsea/c-auto.h> +#include <kpathsea/c-memstr.h> +#define LINELENGTH (72) +#define BUFLENGTH (1000) +#undef putchar +#define putchar(a) (void)putc(a, out) ; +FILE *in, *out ; +static int linepos = 0 ; +static int lastspecial = 1 ; +static int stringlen = 0; +#ifdef WIN32 +#include <stdlib.h> +#include <string.h> +#else +extern int strlen() ; +extern void exit() ; +#endif +/* + * This next routine writes out a `special' character. In this case, + * we simply put it out, since any special character terminates the + * preceding token. + */ +void specialout(c) +char c ; +{ + if (linepos + 1 > LINELENGTH) { + (void)fputs("\\n\\\n", out); + stringlen += linepos + 1; + linepos = 0 ; + } + putchar(c) ; + linepos++ ; + lastspecial = 1 ; +} +void strout(s) +char *s ; +{ + if (linepos + strlen(s) > LINELENGTH) { + (void)fputs("\\n\\\n", out); + stringlen += linepos + 1; + linepos = 0 ; + } + linepos += strlen(s) ; + while (*s != 0) + putchar(*s++) ; + lastspecial = 1 ; +} +void cmdout(s) +char *s ; +{ + int l ; + + l = strlen(s) ; + if (linepos + l + 1 > LINELENGTH) { + (void)fputs("\\n\\\n", out); + stringlen += linepos + 1; + linepos = 0 ; + lastspecial = 1 ; + } + if (! lastspecial) { + putchar(' ') ; + linepos++ ; + } + while (*s != 0) { + putchar(*s++) ; + } + linepos += l ; + lastspecial = 0 ; +} +char buf[BUFLENGTH] ; +#ifndef VMS +int +#endif +main(argc, argv) +int argc ; +char *argv[] ; +{ + int c ; + char *b ; + char seeking ; + + if (argc > 3 || (in=(argc < 2 ? stdin : fopen(argv[1], "r")))==NULL || + (out=(argc < 3 ? stdout : fopen(argv[2], "w")))==NULL) { + (void)fprintf(stderr, "Usage: squeeze [infile [outfile]]\n") ; + exit(1) ; + } + (void)fputs("/*\n\ + * DO NOT EDIT THIS FILE!\n\ + * It was created by squeeze.c from another file (see the Makefile).\n\ + */\n\n\ +#ifndef _Xconst\n\ +#if __STDC__\n\ +#define _Xconst const\n\ +#else\n\ +#define _Xconst\n\ +#endif\n\ +#endif\n\n\ +_Xconst char psheader[] = \"\\\n", out); + while (1) { + c = getc(in) ; + if (c==EOF) + break ; + if (c=='%') { + while ((c=getc(in))!='\n') ; + } + if (c <= ' ') + continue ; + switch (c) { +case '{' : +case '}' : +case '[' : +case ']' : + specialout(c) ; + break ; +case '<' : +case '(' : + if (c=='(') + seeking = ')' ; + else + seeking = '>' ; + b = buf ; + *b++ = c ; + do { + c = getc(in) ; + if (b > buf + BUFLENGTH-2) { + (void)fprintf(stderr, "Overran buffer seeking %c", seeking) ; + exit(1) ; + } + *b++ = c ; + if (c=='\\') + *b++ = getc(in) ; + } while (c != seeking) ; + *b++ = 0 ; + strout(buf) ; + break ; +default: + b = buf ; + while ((c>='A'&&c<='Z')||(c>='a'&&c<='z')|| + (c>='0'&&c<='9')||(c=='/')||(c=='@')|| + (c=='!')||(c=='"')||(c=='&')||(c=='*')||(c==':')|| + (c==',')||(c==';')||(c=='?')||(c=='^')||(c=='~')|| + (c=='-')||(c=='.')||(c=='#')||(c=='|')||(c=='_')|| + (c=='=')||(c=='$')||(c=='+')) { + *b++ = c ; + c = getc(in) ; + } + if (b == buf) { + (void)fprintf(stderr, "Oops! Missed a case: %c.\n", c) ; + exit(1) ; + } + *b++ = 0 ; + (void)ungetc(c, in) ; + cmdout(buf) ; + } + } + (void)fprintf(out, "\\n\";\n\n\ +int\tpsheaderlen\t= %d;\n", stringlen + linepos + 1); + return 0; +} diff --git a/Build/source/texk/windvi/src-spec-1.c b/Build/source/texk/windvi/src-spec-1.c new file mode 100644 index 00000000000..224ac4dfbbb --- /dev/null +++ b/Build/source/texk/windvi/src-spec-1.c @@ -0,0 +1,1514 @@ +/************************************************************************ +src special support for xdvi(k) previewer +written by S. Ulrich (ulrich@cis.uni-muenchen.de) 8/1999 + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +------------------------------------------------------------ + +NOTES ON IMPLEMENTATION + +The method used here for evaluating the src specials is very simple: +During the scan of the .dvi page, applicationDoSpecial will call +src_eval_special which inserts the special just scanned into a +lookup array (in case src specials mode is ON; see below) containing +pointers to the horizontal lists of specials. The length of the +array is dynamically allocated to (page_h * shrink_factor). + +While this data structure isn't terribly efficient because of the +`gaps' in the y-coordinates (\lineskip), it fulfils the following +two requirements which are important in our case: + +- sequential searching has to be possible in case the user clicks + somewhere between two specials, i.e. the structure has to be + order-preserving w.r.t. the coordinates on the page; + +- insertion should be fairly fast because redrawing the page + will cause each special to be checked if it's already contained + in the structure. + +(Note that for these reasons a hash table would probably not +be better suited, because of the requirement of order-preserving +and the `gaps' in the data.) + +This structure should work reasonably with any number of specials on +the page; while it might be wasteful if only few (< 50) specials are +used, it still works well with a large number of specials per page (it +can handle even the pathological case where one special is used for +each glyph on the page). + +To call the editor for a certain special, the x/y coordinates of the +Xevent (mouse position) are handed to a function (src_find_special) +that checks if there is a special just at those coordinates, and if +not, it returns the next special on the current line or the first +special in the next line (doing a search in the horizontal list). + +Here are some examples for this search (where `x' is the point of the +click, `_' the location of the specials, `^' marks the next special +that is found by the search, and dots are marking the baseline of +the text in the .dvi window): + + .x............. + ...._....._.... + ^ + + + ......x........ + ...._....._.... + ^ + + ............... + ...._.x..._.... + ^ + + +The basic idea is that there's a key that takes the user into `src +special' mode: In this mode, the location of the specials on the page +is indicated by little tick marks (indeed the list of specials is only +built and maintained with this mode being active), and a convenient +mouse/keyboard action will do a system() call with some editor command +for the next special found. IMHO the advantages of such a special +mode are: The user gets some visual feedback where the next click will +take him (before he actually clicks somewhere), which is especially +important if the insertion technique for the specials (on the TeX +side) doesn't always produce predictable results; and the performance +in `normal mode' isn't affected by the source specials (list handling, +display stuff, and bugs ;). + +************************************************************************/ + +#ifdef WIN32 +#define XDVIK +#define HAVE_BOOLEAN +#define true True +#define false False +#endif + +#ifdef XDVIK +#include "xdvi-config.h" +#include <kpathsea/c-fopen.h> +#include <kpathsea/c-stat.h> +#include <kpathsea/magstep.h> +#include <kpathsea/tex-file.h> +#include "dvi.h" +#define XMALLOC(x,y) xmalloc(x) +#define XREALLOC(x,y,z) xrealloc(x,y) + +#else /* non-k version of xdvi */ + +#ifndef findrec +#include "filf_app.h" /* application-related defs, etc. */ +#include "filefind.h" +#endif /* findrec */ +#include <errno.h> +#include <stdlib.h> +#include <sys/stat.h> + +#define XMALLOC(x,y) xmalloc(x,y) /* has explanative string as 2nd argument */ +#define XREALLOC(x,y,z) xrealloc(x,y,z) /* has explanative string as 3rd argument */ +#endif /* XDVIK */ + +#include <unistd.h> +#include <limits.h> +#include <ctype.h> + +#ifdef SRC_SPECIALS + +/* + * Define a reasonable maximum length of the lookup array, because + * the variable the value is usually taken from (page_h) might + * overflow on a 32-bit architecture; here are examples for the size + * of page_h at various font resolutions on my Intel Linux box: + * + * resolution page_h (at shrink factor 10) + * + * 600dpi 704 + * 1200dpi 1406 + * 2400dpi 2812 + * 2540dpi 2972 + * 3386dpi 6601 + * 5333dpi 429494415 + * + * It's obvious that the last number results from an overflow at + * that resolution, while all the other values are inside some reasonable + * range << 100 000 (the worst case would be ten times the above values + * for shrink factor 1). (This overflow also shows in the display: + * the vertical scrollbar is very small, and the glyphs below a certain + * y coordinate are not drawn.) + * + * Using (page_w * 2) instead could be a possible workaround, but that's + * no clean solution either (src specials exceeding the y maximum would + * still cause `out of bounds' errors in the `src_insert_into_array' function). + * + * So we simply define the maximum size of the lookup array to be 100000. + */ + +#define ARR_MAX_SIZE 100000 + + +/* from special.c */ +#define xRESOLUTION (pixels_per_inch/shrink_factor) +#define yRESOLUTION (pixels_per_inch/shrink_factor) + +#define src_is_smaller(x,y) ((x->y_coord < y->y_coord) || ((x->y_coord == y->y_coord) && (x->x_coord < y->x_coord))) +#define src_is_equal(x,y) ((x->y_coord == y->y_coord) && (x->x_coord == y->x_coord)) + + +/* get the values of these from Xresources or command-line options */ + + + +#define src_specialFormat resource._src_specialFormat +#define src_tickSize resource._src_tickSize + + + +/* kludgy check if magnifier is off; is this always defined/correct?? */ +#define MAGNIFIER_NOT_ACTIVE (mane.shrinkfactor == currwin.shrinkfactor) + +#define PRELIM_VERSION + + +/* double-linked list structure for src specials + * + * Note: currently only the `next' pointer of the list is used; + * so a single-linked list would also do. Not sure if we might not + * need the `previous' pointer in the future, though. + */ + +struct SRC_special { + char *filename; /* filename contained in the special */ + unsigned int lineno; /* line number contained in the special */ + int pageno; /* number of displayed page on which special is drawn */ + float pt_size; + /* + * pixel coordinates in xdvi display + * (take the values of PXL_H, PXL_V; hence int) + */ + int x_coord; + int y_coord; + /* pointers to next/previous elem in list */ + struct SRC_special *next_special; + struct SRC_special *prev_special; +}; + +/* + * To remember specials that caused warnings, + * for displaying these warnings only once: + */ +struct SRC_warn_special { + char *src_string; + struct SRC_warn_special *next_warn_special; +}; + +#ifndef XDVIK + +static _Xconst char no_f_str_tex[] = "/%f"; + +static struct findrec search_tex = { + /* path1 */ NULL, +#if CFGFILE + /* envptr */ NULL, +#endif + /* path2 */ DEFAULT_HEADER_PATH, + /* type */ "TeX file", + /* fF_etc */ "fF", + /* x_var_char */ 'f', + /* n_var_opts */ 2, + /* no_f_str */ no_f_str_tex, + /* no_f_str_end */ no_f_str_tex + sizeof(no_f_str_tex) - 1, + /* abs_str */ "%f", +#ifdef PK_AND_GF + /* no_f_str_flags */ F_FILE_USED, + /* abs_str_flags */ F_FILE_USED, + /* pk_opt_char */ 'f', + /* pk_gf_addr */ NULL, +#endif + /* pct_s_str */ "%q//", + { + /* v.stephead */ NULL, + /* v.pct_s_head */ NULL, + /* v.pct_s_count */ 0, + /* v.pct_s_atom */ NULL, + /* v.rootp */ NULL, + } +}; +#endif /* not XDVIK */ + +/* + * maximum length of long int in octal representation; compare C FAQ. + * CHAR_BIT is from limits.h (may we assume 8 if it's unavailable?) + * I *think* the +2 is for rounding up the length to include the full triad; + * the / 3 computes the length of the octal digit. + * The + 1 is for the minus sign. Note that the value is the same for int as for + * unsigned int, since there the minus sign might be taken by another digit + * (the maximum value of unsigned being twice as much as the maximum value for signed). + * How about the trailing `\n' ? + */ +#define LONG_SIZE ((sizeof(long) * CHAR_BIT + 2) / 3 + 1) +#define UINT_SIZE ((sizeof(int) * CHAR_BIT + 2) / 3 + 1) + +/* global variables */ +struct SRC_special *head_special = NULL; +struct SRC_warn_special *head_warn_special = NULL; +struct SRC_special *last_active_special = NULL; +int save_shrinkfactor = 0; + +static Boolean specials_not_initialized = True; +static Boolean src_arr_not_initialized = True; +static int corr_fact; +static struct stat statbuf; + +/* + * A global array holding pointers to src special lists. + * The array is implemented using pointers so that its + * size can be set at run-time (inside src_initialize_array). + * Throughout the program, this array will be treated as an + * ordinary array, i.e. we'll write + * src_arr[i] + * instead of + * *(src_arr+i) + */ + +struct SRC_special **src_arr; +static unsigned int src_arr_len; + +/* + ======================================================================== + Private Functions + ======================================================================== +*/ + +/************************************************************************* + small helper function: print out the list of specials + *************************************************************************/ +static void +print_out_list(top) + struct SRC_special *top; +{ + struct SRC_special *curr; + int j; + for (curr = top, j=0; curr != NULL; curr = curr->next_special, j++) { + Fprintf(stderr, "[%d] %s:%u (%d,%d)\n", + j, curr->filename, curr->lineno, curr->x_coord, curr->y_coord); + } + +} + +/* currently unused */ +static void +print_out_warn_list() +{ + struct SRC_warn_special *curr; + int j; + for (curr = head_warn_special, j=0; curr != NULL; curr = curr->next_warn_special, j++) { + Fprintf(stderr, "%d: %s\n", + j, curr->src_string); + } + +} + +/************************************************************************* + print out the list of specials in reverse order + currently unused + *************************************************************************/ +static void +print_out_reverse_list() +{ + struct SRC_special *curr; + int j; + for (curr = head_special, j=0; curr->next_special != NULL; curr = curr->next_special, j++) { ; } + for (; curr != NULL; curr = curr->prev_special, j--) { + Fprintf(stderr, "[%d] %s:%u (%d,%d)\n", + j, curr->filename, curr->lineno, curr->x_coord, curr->y_coord); + if (j > 500) {return;} + } + +} + + +/************************************************************************* + draw glyphs representing the specials on a page + *************************************************************************/ +static void +draw_src_glyph(x_coord, y_coord, gc) + int x_coord, y_coord; + GC gc; +{ + /* + * The height/width of the shapes we're going to draw. + * Height/width have their `natural' meaning only for the rectangle. + * For the equilateral triangle, height is the base of the triangle. + * For the angles, height is the length of the lines, width is twice + * the thickness of the lines. + */ + +#ifdef WIN32 + POINT point1, point2, point3; + POINT triangle_points[3]; + extern int xCurrentScroll, yCurrentScroll; + + x_coord -= xCurrentScroll; + y_coord -= yCurrentScroll; + + switch (src_tickShape) { + case 0: + { + /* rectangle */ + RECT r; + r.left = x_coord; + r.top = y_coord; + r.right = r.left + src_tick_width/mane.shrinkfactor; + r.bottom = r.top + src_tick_height/mane.shrinkfactor; + /* FIXME: this is wrong ! + The use of foreGC / highGC / ruleGC should be sorted out ! */ + FillRect(gc, &r, foreBrush); + } + break; + case 1: + /* equilateral triangle */ + /* + * Since XFillPolygon will be drawn with `CoordModePrevious', each point + * will be specified relative to its predecessor. + */ + /* top */ + point1.x = x_coord; + point1.y = y_coord; + /* lower left corner */ + point2.x = x_coord + (src_tick_height/shrink_factor)/2; + point2.y = y_coord + src_tick_height/shrink_factor; + /* lower right corner */ + point3.x = x_coord + src_tick_height/shrink_factor; + point3.y = y_coord; + + triangle_points[0] = point1; + triangle_points[1] = point2; + triangle_points[2] = point3; + Polygon(gc, triangle_points, 3); + break; + case 2: + /* + * angle: _| + */ + XFillRectangle(DISP, + mane.win, + gc, + x_coord - src_tick_height/mane.shrinkfactor + ((src_tick_width/2) / mane.shrinkfactor), + y_coord, + src_tick_height/mane.shrinkfactor, /* length */ + (src_tick_width/2)/mane.shrinkfactor /* height */ + ); + /* vertical line */ + XFillRectangle(DISP, + mane.win, + gc, + x_coord, + /* + * increase height for (height/10) to compensate for optical error + * that makes vertical lines appear shorter + */ + y_coord - (src_tick_height/mane.shrinkfactor - (src_tick_width/mane.shrinkfactor/2)), + + (src_tick_width/2)/mane.shrinkfactor, /* height */ + /* like before */ + src_tick_height/mane.shrinkfactor - (src_tick_width/mane.shrinkfactor/2) + + ); + break; + case 3: + /* + * angle, rotated 180 degs: _ + * | + */ + XFillRectangle(DISP, + mane.win, + gc, + x_coord, + y_coord, + src_tick_height/mane.shrinkfactor, + src_tick_width/mane.shrinkfactor/2 + ); + /* vertical line */ + XFillRectangle(DISP, + mane.win, + gc, + x_coord, + y_coord + src_tick_width/mane.shrinkfactor/2, + src_tick_width/mane.shrinkfactor/2, + src_tick_height/mane.shrinkfactor - src_tick_width/mane.shrinkfactor/2 + ); + break; + case 4: + /* Ellipse */ + { + /* FIXME: this is wrong ! + The use of foreGC / highGC / ruleGC should be sorted out ! */ + Ellipse(gc, x_coord, y_coord, + x_coord + src_tick_width/mane.shrinkfactor, + y_coord + src_tick_height/mane.shrinkfactor); + } + break; + } +#else + XPoint point1, point2, point3; + XPoint triangle_points[3]; + + /* used to have this initialization which required that height and width are constant: + XPoint points[] = { + {x, y}, + {((-height/shrink_factor)/2), (height/shrink_factor)}, + {(height/shrink_factor), 0} + }; + */ + + + + + + switch (src_tickShape) { + case 0: + /* rectangle */ + XFillRectangle(DISP, mane.win, gc, x_coord, y_coord, src_tick_width/mane.shrinkfactor, src_tick_height/mane.shrinkfactor); + break; + case 1: + /* equilateral triangle */ + /* + * Since XFillPolygon will be drawn with `CoordModePrevious', each point + * will be specified relative to its predecessor. + */ + /* top */ + point1.x = x_coord; + point1.y = y_coord; + /* lower left corner */ + point2.x = (-src_tick_height/shrink_factor)/2; + point2.y = src_tick_height/shrink_factor; + /* lower right corner */ + point3.x = src_tick_height/shrink_factor; + point3.y = 0; + + triangle_points[0] = point1; + triangle_points[1] = point2; + triangle_points[2] = point3; + + XFillPolygon(DISP, + mane.win, + gc, + triangle_points, + (sizeof(triangle_points)/sizeof(XPoint)), + Convex, + CoordModePrevious); + break; + case 2: + /* + * angle: _| + */ + /* horizontal line */ + XFillRectangle(DISP, + mane.win, + gc, + x_coord - src_tick_height/mane.shrinkfactor + ((src_tick_width/2) / mane.shrinkfactor), + y_coord, + src_tick_height/mane.shrinkfactor, /* length */ + (src_tick_width/2)/mane.shrinkfactor /* height */ + ); + /* vertical line */ + XFillRectangle(DISP, + mane.win, + gc, + x_coord, + /* + * increase height for (height/10) to compensate for optical error + * that makes vertical lines appear shorter + */ + y_coord - (src_tick_height/mane.shrinkfactor - (src_tick_width/mane.shrinkfactor/2)), + + (src_tick_width/2)/mane.shrinkfactor, /* height */ + /* like before */ + src_tick_height/mane.shrinkfactor - (src_tick_width/mane.shrinkfactor/2) + + ); + break; + case 3: + /* + * angle, rotated 180 degs: _ + * | + */ + /* horizontal line */ + XFillRectangle(DISP, + mane.win, + gc, + x_coord, + y_coord, + src_tick_height/mane.shrinkfactor, + src_tick_width/mane.shrinkfactor/2 + ); + /* vertical line */ + XFillRectangle(DISP, + mane.win, + gc, + x_coord, + y_coord + src_tick_width/mane.shrinkfactor/2, + src_tick_width/mane.shrinkfactor/2, + src_tick_height/mane.shrinkfactor - src_tick_width/mane.shrinkfactor/2 + ); + break; + } +#endif +} + + +/************************************************************************* + check if string `my_string' occurs already in the SRC_warn_special list + *************************************************************************/ + +static Boolean +occurs_in_warn_specials(my_string) + char *my_string; +{ + struct SRC_warn_special *curr; + for (curr = head_warn_special; curr != NULL; curr = curr->next_warn_special) { + if (strcmp(my_string, curr->src_string) == 0) { /* matched */ + return True; + } + } + return False; +} + +/************************************************************************* + insert SRC_special `new' into list pointed to by *list, return + pointer to head of the list. Assumes that the space for `new' and + its field `filename' have been malloc-ed by the caller. + *************************************************************************/ + +static struct SRC_special * +insert_into_src_specials(top, new) + struct SRC_special *top, *new; +{ + struct SRC_special *curr, *bak; + + + if (top == NULL) { /* list empty */ + if (debug & DBG_SRC_SPECIALS) { + + } + new->next_special = NULL; + new->prev_special = NULL; + + return new; + } + /* arrive here only if list not empty. */ + curr = top; + bak = NULL; + + /* + * advance in list while next item is `smaller' than new item, + * eventually reaching the end of the list. bak is a save pointer + * to the previous item. + */ + while (curr != NULL && src_is_smaller(curr, new)) { + bak = curr; + curr = curr->next_special; + } + + /* don't append elems already in the list; top is unchanged: */ + if (curr != NULL && src_is_equal(curr, new)) { + + free(new->filename); + free(new); + return top; + } + + /* + * now curr is NULL (end of list) or `bigger' item; bak is pointer to + * the previous element (to NULL if we're still at the head of the list). + * Use these to assign prev/next to new (doesn't matter if they are NULL): + */ + new->next_special = curr; + new->prev_special = bak; + if(bak != NULL) { + /* + * we're not not at the head of list. Make `new' the successor of previous; + * top is unchanged: + */ + bak->next_special = new; + } + else { + /* we're at the head of the list; `new' becomes new top: */ + top = new; + } + if(curr != NULL) { + /* + * we're not at the end of the list. Make `new' predecessor of next; + * top is unchanged: + */ + curr->prev_special = new; + } + if (debug & DBG_SRC_SPECIALS) { + + + } + return top; +} + +#ifdef TEST + +/************************************************************************* + delete `elem' from specials list pointed to by `top' + *************************************************************************/ + +static struct SRC_special * +delete_from_src_specials(top, elem) + struct SRC_special *top, *elem; +{ + struct SRC_special *curr, *tmp; + int j; + /* search elem to delete */ + for (curr = top; (curr != NULL) && (!src_is_equal(curr, elem)); curr = curr->next_special) { + ; /* empty */ + } + + if (curr != NULL) { /* found elem */ + if (top == elem) { /* delete from top */ + top = elem->next_special; + if (top) { + top->prev_special = NULL; + } + else { + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "removing last elem in list\n"); + } + + } + } + else { /* delete from middle or end */ + elem->prev_special->next_special = elem->next_special; + if (elem->next_special != NULL) { /* delete from middle */ + elem->next_special->prev_special = elem->prev_special; + } + } + free(elem->filename); + free(elem); + } + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "List after delete:\n"); + for (tmp = top, j=0; tmp != NULL; tmp = tmp->next_special, j++) { + Fprintf(stderr, "[%d] %s:%u (%d,%d)\n", j, tmp->filename, tmp->lineno, tmp->x_coord, tmp->y_coord); + } + } + return top; +} +#endif + +static struct SRC_special * +delete_from_pages(top, page) + struct SRC_special *top; + int page; +{ + struct SRC_special *curr, *tmp; + + + /* loop throuhg list, deleting all elems with pageno == page */ + for (curr = top; curr != NULL; curr = tmp) { + tmp = curr->next_special; + if (curr->pageno == page) { + if (curr == top) { /* delete from top */ + top = curr->next_special; + if (top) { + top->prev_special = NULL; + } + } + else { /* delete from middle or end */ + curr->prev_special->next_special = curr->next_special; + if (curr->next_special != NULL) { /* delete from middle */ + curr->next_special->prev_special = curr->prev_special; + } + } + free(curr->filename); + free(curr); + } + } + return top; +} + + +/************************************************************************* + Print warning or error message (only once) if a special string doesn't + conform to the current format selected. level = 0 is warning, level = 1 + is error. +*************************************************************************/ +static void +src_special_format_error(level, input_string, err_msg) + int level; + char *input_string, *err_msg; +{ + int string_len; + char *bad_src_string; + struct SRC_warn_special *new_warn_special; + static int have_mentioned_man_page = 0; + + if (!occurs_in_warn_specials(input_string)) { + switch(level) { + case 0: + Fprintf(stderr, "\nWarning: src special \"%s\"%s\n", input_string, err_msg); + break; + case 1: + Fprintf(stderr, "\nError: src special \"%s\"%s\n", input_string, err_msg); + break; + } + if (have_mentioned_man_page == 0) { + Fprintf(stderr, "(See the xdvi man page on \"SRC special format\" for more information)\n"); + have_mentioned_man_page++; + } + /* remember this special as warned about */ + string_len = strlen(input_string); + bad_src_string = XMALLOC(string_len + 1, "remember bad special"); + Sprintf(bad_src_string, "%.*s", string_len, input_string); + new_warn_special = (struct SRC_warn_special *) XMALLOC(sizeof(struct SRC_warn_special), "warn special"); + new_warn_special->src_string = bad_src_string; + /* insert new_warn_special at begin of SRC_warn_special list: */ + new_warn_special->next_warn_special = head_warn_special; + head_warn_special = new_warn_special; + } +} + +/********************************************************************** + Parse the special string pointed to by `input_string' and return + pointer to a SRC_special element containing the necessary + information, or NULL if parsing `input_string' failed. + **********************************************************************/ +static struct SRC_special * +src_parse_special_string(input_string, x, y) + char *input_string; + Position x, y; +{ + struct SRC_special *new_special; + char *my_filename, *my_lineno, *save_special; + + int filename_string_len = 0, lineno_string_len = 0; + + unsigned long numtest; /* for testing if line number fits into unsigned int */ + Boolean read_leading_garbage = False; /* true if we had to read over leading garbage */ + /* + * preliminary stuff to account for various formats of the src specials. + * 0 is: `<filename>:<lineno>' + * 1 is: `<lineno> <filename>' + * 2 is: `<lineno>[ ]*<filename>' + * + * where (0) has been used by myself for test purposes, (1) is used + * by YAP, (2) (where there may be any (including 0) number of spaces + * separating lineno and filename) is used by YAP and DVIWIN. + * (note that if there are zero spaces, the filename mustn't start with + * a digit; hence this format isn't really recommendable). + * So (1) is a special case of (2); you might use it if you want to enforce the + * use of white-space as separator. + * + * I still have to find out which format the viewers/editors on some + * (commercial) MAC implementations use. + */ + + new_special = (struct SRC_special *) XMALLOC(sizeof(struct SRC_special), "new special"); + save_special = input_string; + + switch(src_specialFormat) { + case 0: + /* this case is for testing only, so it doesn't contain many sanity checks that + * have been included in the tests below. + */ + if((my_lineno = rindex(input_string, ':')) == NULL) { + src_special_format_error(1, input_string, " doesn't contain a `:' (skipped)"); + return NULL; + } + + /* first char in my_lineno is now `:' - read over it: */ + my_lineno++; + lineno_string_len = strlen(my_lineno); + filename_string_len = strlen(input_string) - lineno_string_len - 1; /* - 1 for the `:' */ + + my_filename = XMALLOC(filename_string_len + 1, "filename in special"); + (void) strncpy(my_filename, input_string, filename_string_len); + my_filename[filename_string_len] = '\0'; + break; + + default: /* treat src_specialFormat == 1 and 2 simultaneously */ + /* + * Delete everything that isn't a digit from the start of + * input_string (including, eventually, minus signs etc.) Will + * check below for read_leading_garbage and issue a warning in + * this case (after fatal errors have been processed). + */ + while(*input_string != '\0' && !isdigit(*input_string)) { + input_string++; + read_leading_garbage = True; + } + my_lineno = input_string; + lineno_string_len = 0; + + if (src_specialFormat == 1) { + /* read line number until finding a space: */ + while (*input_string != '\0' && *input_string != ' ') { + input_string++; + lineno_string_len++; + } + } + else { + while (*input_string != '\0' && isdigit(*input_string)) { + input_string++; + lineno_string_len++; + } + } + + /* did we read a line number? */ + if(lineno_string_len == 0) { + src_special_format_error(1, save_special, " doesn't contain a digit (skipped)"); + return NULL; + } + + if (src_specialFormat == 1) { + /* read over single whitespace */ + if (*input_string != '\0' && *input_string == ' ') { + input_string++; + } + else { + src_special_format_error(1, save_special, " doesn't contain a space (skipped)"); + return NULL; + } + } + else { + /* read over any amount of whitespace */ + while (*input_string != '\0' && isspace(*input_string)) { + input_string++; + } + } + + filename_string_len = strlen(input_string); + + /* is the remaining chunk of input_string empty? */ + if(filename_string_len == 0) { + src_special_format_error(1, save_special, " contains only digits and no filename (skipped)"); + return NULL; + } + + /* if everything else was OK, warn if special had contained leading garbage: */ + if (read_leading_garbage) { + src_special_format_error(0, save_special, ": leading non-digits deleted"); + } + + /* finally, allocate and copy filename */ + my_filename = XMALLOC(filename_string_len + 1, "filename in special"); + (void) strncpy(my_filename, input_string, filename_string_len); + my_filename[filename_string_len] = '\0'; + break; + } + new_special->filename = my_filename; + + /* + * similar to atol(my_lineno), but converts to unsigned long int + * and does additional error checking. First set errno to 0 so that + * it won't contain the result of calls: + */ + errno = 0; + numtest = strtoul((my_lineno), (char **)NULL, 10); + new_special->lineno = (unsigned int)numtest; + + /* + * If number has been too long for unsigned long int (ERANGE), + * it's definitely too long for unsigned int either. + * If not, check if it is too long for unsigned int. + * Note that the test for ERANGE isn't redundant, since on + * Intel Linux UINT_MAX == ULONG_MAX. + */ + if ((errno == ERANGE) || (numtest > UINT_MAX)) { + Fprintf(stderr, "\nWarning: line number %s too long for data type \"unsigned int\";\nchopping to %u\n", + my_lineno, new_special->lineno); + } + /* + * If special is in a text line, currinf.fontp->pt_size + * should contain the pt size of the font. + */ + if (currinf.fontp != NULL) { + new_special->pt_size = currinf.fontp->pt_size; + } + else { + /* + * Assume some reasonable default value. Note that this is not + * critical, since currinf.fontp == NULL means that the current + * special doesn't occur in a text line at all + * (but before all text on the current page). + */ + new_special->pt_size = 12.0; + } + new_special->x_coord = x; + new_special->y_coord = y; + new_special->pageno = current_page; + + if (debug & DBG_SRC_SPECIALS) { + + } + return new_special; +} + + +/************************************************************************* + Build up the editor command for the system call and perform the system + call. + *************************************************************************/ +static void +issue_src_editor_cmd(filename, lineno) + char *filename; + long lineno; +{ + char *cmdstring; + + char *warnmsg; + _Xconst char *kpse_pathname; /* used to hold the expanded path name of the file in the special */ + + + /* + * Here's the very simple algorithm for finding the files contained + * in the specials: First check if file is in current directory; if + * so, open it. Else, use kpse_find_tex (special form of + * kpse_find_file) if kpathsearch library is available, or the + * `filefind' function from non-k xdvi to expand the path name. + * This should nearly always succeed, even if the path may not be + * exactly what you wanted ... however you'll get decent results when + * calling xdvi from the same directory as LaTeX, which is (I hope ;) + * quite common. + */ + if (stat(filename, &statbuf) == 0) { + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "Found file \"%s\" in current dir\n", filename); + } + kpse_pathname = filename; + } + else { +#ifdef XDVIK + /* make a kpathsea search for filename */ + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "file \"%s\" not found in cwd, trying kpathsea expansion\n", filename); + } + kpse_pathname = + kpse_find_tex(filename); + if (stat(kpse_pathname, &statbuf) != 0) { + Fprintf(stderr, "Error: file `%s' not found, couldn't jump to special `%s:%ld'\n", + filename, filename, lineno); + return; + } + else { + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "Found file: `%s'\n", kpse_pathname); + } + } +#else /* XDVIK */ + /* + * search for filename in $TEXINPUTS, using the filefind function from + * non-k xdvi's filefind.c + */ + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "file \"%s\" not found in cwd, trying TEXINPUTS\n", filename); + } + search_tex.path1 = getenv("TEXINPUTS"); +#if CFGFILE + search_tex.envptr = ffgetenv("TEXINPUTS"); + if (search_tex.envptr != NULL && search_tex.envptr->value == NULL) { + search_tex.envptr = NULL; + } +#endif /* CFGFILE */ + (void) filefind(filename, &search_tex, &kpse_pathname); + if (stat(kpse_pathname, &statbuf) != 0) { + Fprintf(stderr, "Error: file `%s' not found, couldn't jump to special `%s:%ld'\n", + filename, filename, lineno); + return; + } + else { + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "Found file: `%s'\n", kpse_pathname); + } + } +#endif /* XDVIK */ + } + /* + * Warn if source file is newer than .dvi file (the line number + * information in the specials might be outdated in this case). + */ + if (statbuf.st_mtime > dvi_time) { + if (src_warn_verbosity >= SRC_WARNINGS_VERBOSE) { + warnmsg = XMALLOC((unsigned)strlen(kpse_pathname) + + (unsigned)strlen("Warning: File %s is newer than dvi file!") + 2, + "warning message"); + Sprintf(warnmsg, "Warning: File %s is newer than dvi file!", kpse_pathname); + showmessage(warnmsg); + free(warnmsg); + XFlush(DISP); + } + else { + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "\nWarning: file \"%s\" is newer than .dvi file;\n", kpse_pathname); + Fprintf(stdout, " line number in special might be wrong!\n\n"); + } + } + } + + /* now allocate space for the command string, and issue the editor command */ + + /* + 1 is for `\n' */ + cmdstring = XMALLOC((unsigned)strlen(src_editorCommand) + (unsigned)strlen(kpse_pathname) + LONG_SIZE + 1, + "editor command string"); + if (src_EditorCmd_filename_first) { /* set inside src_get_settings, called by main() */ + Sprintf(cmdstring, src_editorCommand, kpse_pathname, lineno); + } + else { + Sprintf(cmdstring, src_editorCommand, lineno, kpse_pathname); + } + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf (stderr, "Calling: %s\n", cmdstring); + } + (void) system(cmdstring); + free(cmdstring); +} + +/* + ======================================================================== + Public Functions + ======================================================================== +*/ + + + +static Boolean +src_arr_too_long(len) + unsigned int len; +{ + if (len > ARR_MAX_SIZE) { + Fprintf(stderr, "Error: Requested lookup array size %u exceeds sensible limit of %d\n", len, ARR_MAX_SIZE); + Fprintf(stderr, "(Reason might be an overflow in page_h)\n", ARR_MAX_SIZE); + Fprintf(stderr, "Disabling src specials at this resolution/magnification.\n\n", ARR_MAX_SIZE); + src_arr_len = 0; + return True; + } + return False; +} + +static void +src_initialize_array(len) + unsigned int len; +{ + unsigned int j; + + /* + * Note that src_arr is never free()d. Should we do + * something like `atexit(cleanup_src_arr)? + * However I think every real OS takes care of that + * (and if it doesn't, it probably also doesn't have + * `atexit'; and in any case all this would only work + * in case of normal program termination anyway ...) + */ + + if (src_arr_too_long(len)) { + return; + } + + + fprintf(stderr, "initializing array of len: %u; page_h: %u; shrink_factor: %d\n", src_arr_len, len, shrink_factor); + + src_arr = XMALLOC((len * sizeof(struct SRC_special *)), "src specials lookup array"); + + for (j = 0; j < len; j++) { + src_arr[j] = NULL; + + } +} + +static void +src_resize_array(len) + unsigned int len; +{ + unsigned int j; + + if (src_arr_too_long(len)) { + return; + } + + fprintf(stderr, "resizing array to len: %d; page_h: %d; shrink_factor: %d\n", src_arr_len, page_h, shrink_factor); + + src_arr = XREALLOC(src_arr, len * sizeof(struct SRC_special *), "src specials lookup array"); + + for (j = 0; j < len; j++) { + src_arr[j] = NULL; + + } +} + +/************************************************************************* + Called from src_eval_special (once, when the first special is found); + assigns values to the global variables: + + src_EditorCmd_filename_first + src_tick_width + src_tick_height + + by parsing the settings of src_editorCommand and src_tickSize, + and initializes the lookup array src_arr. + *************************************************************************/ +void +src_get_settings(void) +{ + + char *line_substring, *file_substring; + char *my_size; + char *test_src_editorCommand; + + if (src_editorCommand == NULL) { /* in case there's something wrong with the default settings */ + Fprintf(stderr, "\nShouldn't happen: Resource \"srcEditorCommand\" has no default value!\n"); + Fprintf(stderr, "Please report this as a bug to the maintainer, along with this error message.\n"); + src_editorCommand = "emacsclient --no-wait '+%u' '%s'"; + Fprintf(stderr, "(Assuming \"%s\" to recover.)\n", src_editorCommand); + } + + if((file_substring = strstr(src_editorCommand, "%s")) == NULL) { + Fprintf(stderr, "\nError: srcEditorCommand %s doesn't contain a \"%%s\"\n(to hold the file name)\n", + src_editorCommand); + src_editorCommand = "emacsclient --no-wait '+%u' '%s'"; + Fprintf(stderr, "Using built-in default: \"%s\"\n", src_editorCommand); + src_EditorCmd_filename_first = False; + } + else { + if((line_substring = strstr(src_editorCommand, "%u")) == NULL) { + Fprintf(stderr, "\nError: srcEditorCommand %s doesn't contain a \"%%u\"\n(to hold the line number)\n", + src_editorCommand); + src_editorCommand = "emacsclient --no-wait '+%u' '%s'"; + Fprintf(stderr, "Using built-in default: \"%s\"\n", src_editorCommand); + src_EditorCmd_filename_first = False; + } + else { + /* + * warn if src_editorCommand doesn't start with a command, i.e. + * doesn't contain at least one alphabetic character in front of + * the format string. + */ + test_src_editorCommand = src_editorCommand; + while (!isalpha(*test_src_editorCommand) && *test_src_editorCommand != '%') { + test_src_editorCommand++; + } + if (*test_src_editorCommand == '%') { + /* ring all bells */ + MessageBeep(MB_ICONEXCLAMATION); + Fprintf(stderr, "\n\n****************************************************************\n"); + Fprintf(stderr, "WARNING: srcEditorCommand string %s doesn't seem to\n", src_editorCommand); + Fprintf(stderr, "contain a command name -- this might be a security problem!\n"); + Fprintf(stderr, "Be sure to read the section on `src specials and security'\n"); + Fprintf(stderr, "in the xdvi man page before proceeding.\n"); + Fprintf(stderr, "****************************************************************\n\n"); + } + if (strlen(file_substring) > strlen(line_substring)) { /* %s before %u */ + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "SRC info: filename comes first in editor command\n"); + } + src_EditorCmd_filename_first = True; + } + else { /* %u before %s */ + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "SRC info: line number comes first in editor command\n"); + } + src_EditorCmd_filename_first = False; + } + } + } + + /* get settings for src_tick_width, src_tick_height */ + if(src_tickSize == NULL) { /* in case there's something wrong with the default settings */ + Fprintf(stderr, "\nShouldn't happen: Resource \"srcTickSize\" has no default value!\n"); + Fprintf(stderr, "Please report this as a bug to the maintainer, along with this error message.\n"); + src_tickSize = "40x70"; + Fprintf(stderr, "(Assuming \"%s\" to recover.)\n", src_tickSize); + } + if ((my_size = rindex(src_tickSize, 'x')) == NULL) { + src_tickSize = "40x70"; + src_tick_height = 70; + src_tick_width = 40; + Fprintf(stderr, "\nError: argument for \"-srcTickSize\" not in `geometry' format\n"); + Fprintf(stderr, "(e.g.: \"40x70\"); using default: %s\n", src_tickSize); + } + else { + my_size++; + fflush(stderr); + src_tick_height = atoi(my_size); + src_tick_width = atoi(src_tickSize); + } +} + + +/************************************************************************* + perform a search to find the next src special starting at x,y. + `jump' signals that we want to issue the editor command (if jump == 1) + or just highlight the special found (jump == 0). + *************************************************************************/ +void +src_find_special(jump,x,y) + int jump; /* 1 if we are to call the editor command, 0 else */ + Position x,y; /* coordinates of Xevent that triggered the search */ +{ + struct SRC_special *curr; + Position i = y; /* don't modify y, will be needed later */ + long last_line_y; + + if(src_arr_len == 0) { /* return immediately if searching is disabled */ + MessageBeep(MB_ICONINFORMATION); + fprintf(stdout, "No more specials on this page.\n"); + return; + } + + /* + * last_active_special (last item searched) will have highlight colour; redraw with + * ordinary colour if last_active_special was on current page: + */ + if (last_active_special != NULL && src_tickVisibility) { + draw_src_glyph(last_active_special->x_coord, last_active_special->y_coord, highGC); + } + + + /* start searching for special after current point */ + + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "Current point: x: %d, y: %d (%d,%d)\n", x, y, PXL_H, PXL_V); + } + + /* check if lookup array at y position is empty, and if yes, move down: */ + if (src_arr[i] == NULL) { + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "array at %d is NULL\n", y); + } + while (src_arr[i] == NULL && i < src_arr_len) { + i++; + } + + if (i == src_arr_len) { /* reached end of array without finding special */ + MessageBeep(MB_ICONINFORMATION); + fprintf(stdout, "No more specials on this page.\n"); + return; + } + else { + if (debug & DBG_SRC_SPECIALS) { + fprintf(stderr, "found at %d\n", i); + } + } + } + else { /* lookup array contains elem at y */ + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "Found array position at %d: %u, %u; %s:%d\n", y, + src_arr[i]->x_coord, src_arr[i]->y_coord, src_arr[i]->filename, src_arr[i]->lineno); + } + } + if (debug & DBG_SRC_SPECIALS) { + fprintf(stderr, "horizontal list:\n"); + for (curr = src_arr[i]; curr != NULL; curr = curr->next_special) { + fprintf(stderr, "%s:%u (%d,%d)\n", curr->filename, curr->lineno, curr->x_coord, curr->y_coord); + } + } + if((curr = src_arr[i]) != NULL) { + /* compute the y coord of the previous line: */ + last_line_y = i - (Position)(curr->pt_size / 72.27 * (double)yRESOLUTION); + + /* move to right in the horizontal list if y point is on current line: */ + if (y > last_line_y) { + while (curr != NULL && x > curr->x_coord) { + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "x: %d <= %d\n", curr->x_coord, x); + } + curr = curr->next_special; + } + if (curr == NULL) { + + i++; + while (src_arr[i] == NULL && i < src_arr_len) { + i++; + } + curr = src_arr[i]; + } + } + if (curr != NULL) { /* might be at end of page; do nothing in this case */ + + last_active_special = curr; + + /* if src specials are visible, draw this special with foreground color: */ + if (src_tickVisibility) { + draw_src_glyph(curr->x_coord, curr->y_coord, foreGC); + } + Fprintf(stderr, "SRC special: %s:%d (x:%d,y:%d)\n", curr->filename, curr->lineno, curr->x_coord, curr->y_coord); + /* + * if `jump' argument is set to one, issue the editor command. + */ + if (jump == 1) { + issue_src_editor_cmd(curr->filename, curr->lineno); + } + } + } +} + + +/************************************************************************* + free the memory used by src_arr + *************************************************************************/ +void +src_cleanup(void) { + fprintf(stderr, "freeing memory...\n"); + src_delete_all_specials(); + free(src_arr); + src_arr_len = 0; + src_arr_not_initialized = True; +} + +/************************************************************************* + delete all elements from specials list. Called from check_dvi_file + (dvi_init.c). + *************************************************************************/ +void +src_delete_all_specials(void) +{ + int j; + for (j = 0; j < src_arr_len; j++) { + src_arr[j] = delete_from_pages(src_arr[j], current_page); + } + last_active_special = NULL; +} + +/************************************************************************* + insert special into array at index y. Returns 0 for success, + 1 if y is larger than array size. +*************************************************************************/ +static int +src_insert_into_array(y,special) + unsigned y; + struct SRC_special *special; +{ + if (y >= src_arr_len) { + Fprintf(stderr, "\nShouldn't happen: y coordinate %d exceeds src_arr bounds (%d)\n", y, src_arr_len); + Fprintf(stderr, "- skipping this special.\n"); + Fprintf(stderr, "As a workaround, you may try a smaller magnification factor;\n"); + Fprintf(stderr, "however please report this bug to the maintainer(s) of xdvi(k).\n"); + return 1; + } + src_arr[y] = insert_into_src_specials(src_arr[y], special); + return 0; +} + + + +/************************************************************************* + Evaluate a src special; called during the page scan from + `applicationDoSpecial' (special.c). + Main tasks are: + - allocate space for the SRC_special struct and its elements + - call `delete_from_pages' to delete specials from non-current + pages or if magnification factor has changed + - call `insert_into_src_specials' to insert special into list of specials + - call `draw_src_glyph' to draw the `tick' indicating the specials on the + displayed page + *************************************************************************/ +void +src_eval_special(input_string, x, y) + char *input_string; + Position x, y; +{ + struct SRC_special *new_special; + unsigned int j; + + if (!src_evalMode) { + return; + } + + + if (specials_not_initialized) { + fprintf(stderr, "initializing specials...\n"); + src_get_settings(); + specials_not_initialized = False; + } + + if (src_arr_not_initialized) { + src_arr_len = page_h; + /* initialize save_shrinkfactor to sensible value: */ + save_shrinkfactor = mane.shrinkfactor; + src_initialize_array(src_arr_len); + src_arr_not_initialized = False; + } + + + if (debug & DBG_SRC_SPECIALS) { + if (currinf.fontp == NULL) { + Fprintf(stderr, "SRC special: %s (%d, %d); (NULL font)\n", input_string, x, y); + } + else { + Fprintf(stderr, "SRC special: %s (%d, %d), font:%s (%f)\n", + input_string, x, y, currinf.fontp->fontname, currinf.fontp->pt_size + ); + } + Fprintf(stderr, "shrink factors: %d,%d,%d\n", alt.shrinkfactor, mane.shrinkfactor, currwin.shrinkfactor); + } + + /* + * flush specials if shrink factor has changed. + * The test (mane.shrinkfactor != save_shrinkfactor) gave misbehaviour with the magnifier + * which also sets the shrinkfactor; hence the additional check + * MAGNIFIER_NOT_ACTIVE (kludgy, see definition above). + */ + if (mane.shrinkfactor != save_shrinkfactor && MAGNIFIER_NOT_ACTIVE) { + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "shrink factor changed, flushing specials ...\n"); + } + + /* delete all specials from src_arr */ + for (j = 0; j < src_arr_len; j++) { + src_arr[j] = delete_from_pages(src_arr[j], current_page); + } + + /* recompute length of src_arr */ + src_arr_len = page_h; + src_resize_array(src_arr_len); + /* + * set last_active_special to NULL since it might point to the wrong value + * after size has changed: + */ + last_active_special = NULL; + } + /* + * only insert new specials if displaying specials is ON (ignoring + * size changes by the magnifier glass - this would insert way too + * many specials), if src special is well-formed and if its y coordinate + * doesn't exceed the length of the src_arr. + */ + if ( + MAGNIFIER_NOT_ACTIVE && (src_arr_len > 0)) { + if ((new_special = src_parse_special_string(input_string, x, y)) != NULL) { + if ((src_insert_into_array(y, new_special) == 0) && src_tickVisibility) { + draw_src_glyph(new_special->x_coord, new_special->y_coord, highGC); + } + } + } + save_shrinkfactor = mane.shrinkfactor; +} + +/************************************************************************* + Currently unused. + In case an external function would have to draw the src ticks, it might + want to call this function. + *************************************************************************/ +void draw_src_specials() +{ + struct SRC_special *curr; + for(curr = head_special; curr != NULL; curr = curr->next_special) { + draw_src_glyph(curr->x_coord, curr->y_coord, highGC); + } +} + +#endif diff --git a/Build/source/texk/windvi/src-spec.c b/Build/source/texk/windvi/src-spec.c new file mode 100644 index 00000000000..cc45b8d4df6 --- /dev/null +++ b/Build/source/texk/windvi/src-spec.c @@ -0,0 +1,1675 @@ +/************************************************************************ +src special support for xdvi(k) previewer +written by S. Ulrich (ulrich@cis.uni-muenchen.de) 8/1999 + +version 0.1a 1999/11/02 + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +------------------------------------------------------------ + +NOTES ON IMPLEMENTATION + +The basic idea is that there's a key that takes the user into `src +special' mode: In this mode, the location of the specials on the page +may optionally be indicated by little tick marks (indeed the list of +specials is only built and maintained with this mode being active), +and a convenient mouse/keyboard action will do a system() call with +some editor command for the next special found. IMHO the advantages +of such a special mode are: The user gets some visual feedback where +the next click will take him (before he actually clicks somewhere), +which is especially important if the insertion technique for the +specials (on the TeX side) doesn't always produce predictable results; +and the performance in `normal mode' isn't affected by the source +specials (list handling, display stuff, and bugs ;). + +The method used here for evaluating the src specials is very simple: +During the scan of the .dvi page, applicationDoSpecial will call +src_eval_special which inserts the special just scanned into a +lookup array (in case src specials mode is ON; see below) containing +pointers to the horizontal lists of specials. The length of the +array is dynamically allocated to page_h. + +While this data structure isn't terribly efficient because of the +`gaps' in the y-coordinates (\lineskip), it fulfils the following +two requirements which are important in our case: + +- sequential searching has to be possible in case the user clicks + somewhere between two specials, i.e. the structure has to be + order-preserving w.r.t. the coordinates on the page; + +- insertion should be fairly fast because redrawing the page + will cause each special to be checked if it's already contained + in the structure. + +(Note that for these reasons a hash table would probably not +be better suited, because of the requirement of order-preserving +and the `gaps' in the data.) + +This structure should work reasonably with any number of specials on +the page; while it might be wasteful if only few (< 50) specials are +used, it still works well with a large number of specials per page (it +can handle even the pathological case where one special is used for +each glyph on the page). + +To call the editor for a certain special, the x/y coordinates of the +Xevent (mouse position) are handed to a function (src_find_special) +that checks if there is a special just at those coordinates, and if +not, it returns the next special on the current line or the first +special in the next line (doing a search in the horizontal list). + +************************************************************************/ + +#ifdef WIN32 +#define XDVIK +#define XBell(a, b) MessageBeep(0xFFFFFFFF) +#include <win32lib.h> +#endif + +#ifdef XDVIK +#include "xdvi-config.h" +#include <kpathsea/c-fopen.h> +#include <kpathsea/c-stat.h> +#include <kpathsea/magstep.h> +#include <kpathsea/tex-file.h> +#include "dvi.h" +#define XMALLOC(x,y) xmalloc(x) +#define XREALLOC(x,y,z) xrealloc(x,y) + +#else /* non-k version of xdvi */ + +#ifndef findrec +#include "filf_app.h" /* application-related defs, etc. */ +#include "filefind.h" +#endif /* findrec */ +#include <errno.h> +#include <stdlib.h> +#include <sys/stat.h> + +#define XMALLOC(x,y) xmalloc(x,y) /* has explanative string as 2nd argument */ +#define XREALLOC(x,y,z) xrealloc(x,y,z) /* has explanative string as 3rd argument */ +#endif /* XDVIK */ + +#if !defined(WIN32) +#include <unistd.h> /* added SU; have to test for availability !! */ +#endif + +#include <limits.h> /* added SU, for UINT_MAX, CHAR_BIT; have to test for availability !! */ +#include <ctype.h> + +#ifdef SRC_SPECIALS + +/* + * Define a reasonable maximum length of the lookup array, because + * the variable the value is usually taken from (page_h) might + * overflow on a 32-bit architecture; here are examples for the size + * of page_h at various font resolutions on my Intel Linux box: + * + * resolution page_h (at shrink factor 10) + * + * 600dpi 704 + * 1200dpi 1406 + * 2400dpi 2812 + * 2540dpi 2972 + * 3386dpi 6601 + * 5333dpi 429494415 + * + * It's obvious that the last number results from an overflow at + * that resolution, while all the other values are inside some reasonable + * range << 100 000 (the worst case would be ten times the above values + * for shrink factor 1). (This overflow also shows in the display: + * the vertical scrollbar becomes very tiny, and the glyphs below a certain + * y coordinate are not drawn.) + * + * Using (page_w * 2) instead could be a possible workaround, but that's + * no clean solution either (src specials exceeding the y maximum would + * still cause `out of bounds' errors in the `src_insert_into_array' function). + * + * So we simply define the maximum size of the lookup array to be 100 000. + */ + +#define ARR_MAX_SIZE 100000 + + +/* from special.c */ +#define xRESOLUTION (pixels_per_inch/shrink_factor) +#define yRESOLUTION (pixels_per_inch/shrink_factor) + +#define src_is_smaller(x,y) ((x->y_coord < y->y_coord) || ((x->y_coord == y->y_coord) && (x->x_coord < y->x_coord))) +#define src_is_equal(x,y) ((x->y_coord == y->y_coord) && (x->x_coord == y->x_coord)) + + +/* get the values of these from Xresources or command-line options */ + +#define src_specialFormat resource._src_specialFormat +#define src_tickSize resource._src_tickSize + +/* kludgy check if magnifier is off; is this always defined/correct?? */ +#define MAGNIFIER_NOT_ACTIVE (mane.shrinkfactor == currwin.shrinkfactor) + +#define PRELIM_VERSION + + +/* double-linked list structure for src specials + * + * Note: currently only the `next' pointer of the list is used; + * so a single-linked list would also do. Not sure if we might not + * need the `previous' pointer in the future, though. + */ + +struct SRC_special { + char *filename; /* filename contained in the special */ + unsigned int lineno; /* line number contained in the special */ + int pageno; /* number of displayed page on which special is drawn */ + float pt_size; + /* + * pixel coordinates in xdvi display + * (take the values of PXL_H, PXL_V; hence int) + */ + int x_coord; + int y_coord; + /* pointers to next/previous elem in list */ + struct SRC_special *next_special; + struct SRC_special *prev_special; +}; + +/* + * structure to save specials that caused warnings, + * used to display these warnings only once: + */ +struct SRC_warn_special { + char *src_string; + struct SRC_warn_special *next_warn_special; +}; + + +/* + * A list of vertical positions of the specials on a page (indexes of + * src_arr that point to a horizontal list). This is used to speed up + * traversing src_arr to delete all non-NULL elements (inside the + * src_delete_all_specials() routine): For deletion, only non-empty + * positions will have to be looked at, which is generally much less + * than the total number of index positions (because the former + * correspond roughly to line numbers on the page); e.g., a src_arr of + * length 879 (shrink 8 at 600dpi) will generally only have 30 to 40 + * entries. + */ + +struct SRC_vertical_list { + unsigned int index; + struct SRC_vertical_list *next_vertical; +}; + +#ifndef XDVIK + +static _Xconst char no_f_str_tex[] = "/%f"; + +static struct findrec search_tex = { + /* path1 */ NULL, +#if CFGFILE + /* envptr */ NULL, +#endif + /* path2 */ DEFAULT_HEADER_PATH, + /* type */ "TeX file", + /* fF_etc */ "fF", + /* x_var_char */ 'f', + /* n_var_opts */ 2, + /* no_f_str */ no_f_str_tex, + /* no_f_str_end */ no_f_str_tex + sizeof(no_f_str_tex) - 1, + /* abs_str */ "%f", +#ifdef PK_AND_GF + /* no_f_str_flags */ F_FILE_USED, + /* abs_str_flags */ F_FILE_USED, + /* pk_opt_char */ 'f', + /* pk_gf_addr */ NULL, +#endif + /* pct_s_str */ "%q//", + { + /* v.stephead */ NULL, + /* v.pct_s_head */ NULL, + /* v.pct_s_count */ 0, + /* v.pct_s_atom */ NULL, + /* v.rootp */ NULL, + } +}; +#endif /* not XDVIK */ + + +/* + * maximum length of long int in octal representation; compare C FAQ. + * CHAR_BIT is from limits.h (may we assume 8 if it's unavailable?) I + * *think* the +2 is for rounding up the length to include the full + * triad; the / 3 computes the length of the octal digit. The + 1 is + * for the minus sign. Note that the value is the same for int as for + * unsigned int, since there the minus sign might be taken by another + * digit (the maximum value of unsigned being twice as much as the + * maximum value for signed). How about the trailing `\n' ? + */ + +#define LONG_SIZE ((sizeof(long) * CHAR_BIT + 2) / 3 + 1) +#define UINT_SIZE ((sizeof(int) * CHAR_BIT + 2) / 3 + 1) + +/* global variables */ +struct SRC_special *head_special = NULL; +struct SRC_vertical_list *head_vertical = NULL; +struct SRC_vertical_list *first_vertical = NULL; +struct SRC_vertical_list *last_vertical = NULL; +static Boolean greatest_smallest_notset = True; +struct SRC_warn_special *head_warn_special = NULL; +struct SRC_special *last_active_special = NULL; +int save_shrinkfactor = 0; +static Boolean specials_not_initialized = True; +static Boolean src_arr_not_initialized = True; +static int corr_fact; +static struct stat statbuf; + +/* + * A global array holding pointers to src special lists. + * The array is implemented using pointers so that its + * size can be set at run-time (inside src_initialize_array). + * Throughout the program, this array will be treated as an + * ordinary array, i.e. we'll write + * src_arr[i] + * instead of + * *(src_arr+i) + */ +struct SRC_special **src_arr; +static unsigned int src_arr_len; + + + + + +/* + ======================================================================== + Private Functions + ======================================================================== +*/ + + + + +/************************************************************************* + small helper function: print out the list of specials + *************************************************************************/ +static void +print_out_list(top) + struct SRC_special *top; +{ + struct SRC_special *curr; + int j; + for (curr = top, j=0; curr != NULL; curr = curr->next_special, j++) { + Fprintf(stderr, "[%d] %s:%u (%d,%d)\n", + j, curr->filename, curr->lineno, curr->x_coord, curr->y_coord); + } + +} + +/* currently unused */ +static void +print_out_warn_list() +{ + struct SRC_warn_special *curr; + int j; + for (curr = head_warn_special, j=0; curr != NULL; curr = curr->next_warn_special, j++) { + Fprintf(stderr, "%d: %s\n", + j, curr->src_string); + } + +} + +/************************************************************************* + print out the list of specials in reverse order + currently unused + *************************************************************************/ +static void +test_print_out_reversed_list() +{ + struct SRC_special *curr; + int j; + for (curr = head_special, j=0; curr->next_special != NULL; curr = curr->next_special, j++) { ; } + for (; curr != NULL; curr = curr->prev_special, j--) { + Fprintf(stderr, "[%d] %s:%u (%d,%d)\n", + j, curr->filename, curr->lineno, curr->x_coord, curr->y_coord); + if (j > 500) {return;} + } + +} + +/************************************************************************* + A test to draw the entire background of the text in a certian height. +*************************************************************************/ +static void +test_draw_mark(x_coord, y_coord, pt_size, gc) + int x_coord, y_coord; + float pt_size; + GC gc; +{ + + XFillRectangle(DISP, mane.win, gc, x_coord, y_coord - (int)(0.5 + pt_size), + (int)(0.5 + pt_size * 2), (int)(0.5 + pt_size)); +} + +/************************************************************************* + draw glyphs representing the specials on a page + *************************************************************************/ +static void +draw_src_glyph(x_coord, y_coord, gc) + int x_coord, y_coord; + GC gc; +{ + /* + * The height/width of the shapes we're going to draw. + * Height/width have their `natural' meaning only for the rectangle. + * For the equilateral triangle, height is the base of the triangle. + * For the angles, height is the length of the lines, width is twice + * the thickness of the lines. + */ + +#ifdef WIN32 + POINT point1, point2, point3; + POINT triangle_points[3]; + extern int xCurrentScroll, yCurrentScroll; + + gc = foreGC; /* FIXME : not good !!! */ + + x_coord -= xCurrentScroll; + y_coord -= yCurrentScroll; + + switch (src_tickShape) { + case 0: { + /* rectangle */ + RECT r; + r.left = x_coord; + r.top = y_coord; + r.right = r.left + src_tick_width/mane.shrinkfactor; + r.bottom = r.top + src_tick_height/mane.shrinkfactor; + /* FIXME: this is wrong ! + The use of foreGC / highGC / ruleGC should be sorted out ! */ + FillRect(gc, &r, foreBrush); + } + break; + case 1: + /* equilateral triangle */ + /* + * Since XFillPolygon will be drawn with `CoordModePrevious', each point + * will be specified relative to its predecessor. + */ + /* top */ + point1.x = x_coord; + point1.y = y_coord; + /* lower left corner */ + point2.x = x_coord + (src_tick_height/shrink_factor)/2; + point2.y = y_coord + src_tick_height/shrink_factor; + /* lower right corner */ + point3.x = x_coord + src_tick_height/shrink_factor; + point3.y = y_coord; + + triangle_points[0] = point1; + triangle_points[1] = point2; + triangle_points[2] = point3; + Polygon(gc, triangle_points, 3); + break; + case 2: + /* + * angle: _| + */ + XFillRectangle(DISP, + mane.win, + gc, + x_coord - src_tick_height/mane.shrinkfactor + ((src_tick_width/2) / mane.shrinkfactor), + y_coord, + src_tick_height/mane.shrinkfactor, /* length */ + (src_tick_width/2)/mane.shrinkfactor /* height */ + ); + /* vertical line */ + XFillRectangle(DISP, + mane.win, + gc, + x_coord, + /* + * increase height for (height/10) to compensate for optical error + * that makes vertical lines appear shorter + */ + y_coord - (src_tick_height/mane.shrinkfactor - + (src_tick_width/mane.shrinkfactor/2)), /* */ + + (src_tick_width/2)/mane.shrinkfactor, /* height */ + /* like before */ + src_tick_height/mane.shrinkfactor - (src_tick_width/mane.shrinkfactor/2) + + ); + break; + case 3: + /* + * angle, rotated 180 degs: _ + * | + */ + XFillRectangle(DISP, + mane.win, + gc, + x_coord, + y_coord, + src_tick_height/mane.shrinkfactor, + src_tick_width/mane.shrinkfactor/2 + ); + /* vertical line */ + XFillRectangle(DISP, + mane.win, + gc, + x_coord, + y_coord + src_tick_width/mane.shrinkfactor/2, + src_tick_width/mane.shrinkfactor/2, + src_tick_height/mane.shrinkfactor - src_tick_width/mane.shrinkfactor/2 + ); + break; + case 4: + /* Ellipse */ + { + /* FIXME: this is wrong ! + The use of foreGC / highGC / ruleGC should be sorted out ! */ + Ellipse(gc, x_coord, y_coord, + x_coord + src_tick_width/mane.shrinkfactor, + y_coord + src_tick_height/mane.shrinkfactor); + } + break; + } +#else + XPoint point1, point2, point3; + XPoint triangle_points[3]; + + /* used to have this initialization which required that height and width are constant: + XPoint points[] = { + {x, y}, + {((-height/shrink_factor)/2), (height/shrink_factor)}, + {(height/shrink_factor), 0} + }; + */ + + switch (src_tickShape) { + case 0: + /* rectangle */ + XFillRectangle(DISP, mane.win, gc, x_coord, y_coord, + src_tick_width/mane.shrinkfactor, src_tick_height/mane.shrinkfactor); + break; + case 1: + /* equilateral triangle */ + /* + * Since XFillPolygon will be drawn with `CoordModePrevious', each point + * will be specified relative to its predecessor. + */ + /* top */ + point1.x = x_coord; + point1.y = y_coord; + /* lower left corner */ + point2.x = (-src_tick_height/shrink_factor)/2; + point2.y = src_tick_height/shrink_factor; + /* lower right corner */ + point3.x = src_tick_height/shrink_factor; + point3.y = 0; + + triangle_points[0] = point1; + triangle_points[1] = point2; + triangle_points[2] = point3; + + XFillPolygon(DISP, + mane.win, + gc, + triangle_points, + (sizeof(triangle_points)/sizeof(XPoint)), + Convex, + CoordModePrevious); + break; + case 2: + /* + * angle: _| + */ + /* horizontal line */ + XFillRectangle(DISP, + mane.win, + gc, + x_coord - src_tick_height/mane.shrinkfactor + ((src_tick_width/2) / mane.shrinkfactor), + y_coord, + src_tick_height/mane.shrinkfactor, /* length */ + (src_tick_width/2)/mane.shrinkfactor /* height */ + ); + /* vertical line */ + XFillRectangle(DISP, + mane.win, + gc, + x_coord, + y_coord - (src_tick_height/mane.shrinkfactor - (src_tick_width/mane.shrinkfactor/2)), + (src_tick_width/2)/mane.shrinkfactor, /* height */ + src_tick_height/mane.shrinkfactor - (src_tick_width/mane.shrinkfactor/2) /*length */ + ); + break; + case 3: + /* + * angle, rotated 180 degs: _ + * | + */ + /* horizontal line */ + XFillRectangle(DISP, + mane.win, + gc, + x_coord, + y_coord, + src_tick_height/mane.shrinkfactor, /* length */ + src_tick_width/mane.shrinkfactor/2 /* height */ + ); + /* vertical line */ + XFillRectangle(DISP, + mane.win, + gc, + x_coord, + y_coord + src_tick_width/mane.shrinkfactor/2, + src_tick_width/mane.shrinkfactor/2, /*height */ + src_tick_height/mane.shrinkfactor - src_tick_width/mane.shrinkfactor/2 /*length */ + ); + break; + } +#endif +} + + +/************************************************************************* + check if string `my_string' occurs already in the SRC_warn_special list + *************************************************************************/ + +static Boolean +occurs_in_warn_specials(my_string) + char *my_string; +{ + struct SRC_warn_special *curr; + for (curr = head_warn_special; curr != NULL; curr = curr->next_warn_special) { + if (strcmp(my_string, curr->src_string) == 0) { /* matched */ + return True; + } + } + return False; +} + +/************************************************************************* + insert SRC_special `new' into list pointed to by *list, return + pointer to head of the list. Assumes that the space for `new' and + its field `filename' have been malloc-ed by the caller. + *************************************************************************/ + +static struct SRC_special * +insert_into_src_specials(top, new) + struct SRC_special *top, *new; +{ + struct SRC_special *curr, *bak; + + if (top == NULL) { /* list empty */ + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "new is only elem in list\n"); + } + new->next_special = NULL; + new->prev_special = NULL; + return new; + } + /* arrive here only if list not empty. */ + curr = top; + bak = NULL; + + /* + * advance in list while next item is `smaller' than new item, + * eventually reaching the end of the list. bak is a save pointer + * to the previous item. + */ + while (curr != NULL && src_is_smaller(curr, new)) { + bak = curr; + curr = curr->next_special; + } + + /* don't append elems already in the list; top is unchanged: */ + if (curr != NULL && src_is_equal(curr, new)) { + free(new->filename); + free(new); + return top; + } + + /* + * now curr is NULL (end of list) or `bigger' item; bak is pointer to + * the previous element (to NULL if we're still at the head of the list). + * Use these to assign prev/next to new (doesn't matter if they are NULL): + */ + new->next_special = curr; + new->prev_special = bak; + if(bak != NULL) { + /* + * we're not not at the head of list. Make `new' the successor of previous; + * top is unchanged: + */ + bak->next_special = new; + } + else { + /* we're at the head of the list; `new' becomes new top: */ + top = new; + } + if(curr != NULL) { + /* + * we're not at the end of the list. Make `new' predecessor of next; + * top is unchanged: + */ + curr->prev_special = new; + } + /**** + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "List after insert:\n"); + print_out_list(top); + } + ****/ + return top; +} + +// unused +static struct SRC_special * +delete_from_pages(top, page) + struct SRC_special *top; + int page; +{ + struct SRC_special *curr, *tmp; + + /* loop throuhg list, deleting all elems with pageno == page */ + for (curr = top; curr != NULL; curr = tmp) { + tmp = curr->next_special; + if (curr->pageno == page) { + if (curr == top) { /* delete from top */ + top = curr->next_special; + if (top) { + top->prev_special = NULL; + } + else { + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "removing last elem in list\n"); + } + } + } + else { /* delete from middle or end */ + curr->prev_special->next_special = curr->next_special; + if (curr->next_special != NULL) { /* delete from middle */ + curr->next_special->prev_special = curr->prev_special; + } + } + Fprintf(stderr, "Deleted %s:%u (%d,%d)\n", curr->filename, curr->lineno, curr->x_coord, curr->y_coord); + free(curr->filename); + free(curr); + } + /*** + if (debug & DBG_SRC_SPECIALS) { + for (tmp = top, j=0; tmp != NULL; tmp = tmp->next_special, j++) { + Fprintf(stderr, "Delete: [%d] %s:%u (%d,%d)\n", j, tmp->filename, tmp->lineno, tmp->x_coord, tmp->y_coord); + } + } + ***/ + } + return top; +} + +// unused +static struct SRC_special * +delete_from_pages_2(top) + struct SRC_special *top; +{ + struct SRC_special *curr, *tmp; + + /* loop throuhg list, deleting all elems with pageno == page */ + for (curr = top; curr != NULL; curr = tmp) { + tmp = curr->next_special; + if (curr == top) { /* delete from top */ + top = curr->next_special; + if (top) { + top->prev_special = NULL; + } + else { + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "removing last elem in list\n"); + } + } + } + else { /* delete from middle or end */ + curr->prev_special->next_special = curr->next_special; + if (curr->next_special != NULL) { /* delete from middle */ + curr->next_special->prev_special = curr->prev_special; + } + } + Fprintf(stderr, "Deleted %s:%u (%d,%d)\n", curr->filename, curr->lineno, curr->x_coord, curr->y_coord); + free(curr->filename); + free(curr); + + /*** + if (debug & DBG_SRC_SPECIALS) { + for (tmp = top, j=0; tmp != NULL; tmp = tmp->next_special, j++) { + Fprintf(stderr, "Delete: [%d] %s:%u (%d,%d)\n", j, tmp->filename, tmp->lineno, tmp->x_coord, tmp->y_coord); + } + } + ***/ + } + return top; +} + +// delete all specials in list pointed to by top. +//static struct SRC_special * +static void +delete_special_list(top) + struct SRC_special **top; +{ + struct SRC_special *curr, *tmp; + + /* loop throuhg list, deleting all elems */ + for (curr = *top; curr != NULL; curr = tmp) { + tmp = curr->next_special; + // fprintf(stderr, "deleting %s:%d\n", curr->filename, curr->lineno); + free(curr->filename); + free(curr); + /*** + if (debug & DBG_SRC_SPECIALS) { + for (tmp = top, j=0; tmp != NULL; tmp = tmp->next_special, j++) { + Fprintf(stderr, "Delete: [%d] %s:%u (%d,%d)\n", j, tmp->filename, tmp->lineno, tmp->x_coord, tmp->y_coord); + } + } + ***/ + } +} + + +/************************************************************************* + Print warning or error message (only once) if a special string doesn't + conform to the current format selected. level = 0 is warning, level = 1 + is error. +*************************************************************************/ +static void +src_special_format_error(level, input_string, err_msg) + int level; + char *input_string, *err_msg; +{ + int string_len; + char *bad_src_string; + struct SRC_warn_special *new_warn_special; + static int have_mentioned_man_page = 0; + + if (!occurs_in_warn_specials(input_string)) { + switch(level) { + case 0: + Fprintf(stderr, "\nWarning: src special \"%s\"%s\n", input_string, err_msg); + break; + case 1: + Fprintf(stderr, "\nError: src special \"%s\"%s\n", input_string, err_msg); + break; + } + if (have_mentioned_man_page == 0) { + Fprintf(stderr, "(See the xdvi man page on \"SRC special format\" for more information)\n"); + have_mentioned_man_page++; + } + /* remember this special as warned about */ + string_len = strlen(input_string); + bad_src_string = XMALLOC(string_len + 1, "remember bad special"); + Sprintf(bad_src_string, "%.*s", string_len, input_string); + new_warn_special = XMALLOC(sizeof(struct SRC_warn_special), "warn special"); + new_warn_special->src_string = bad_src_string; + /* + * insert new_warn_special at begin of SRC_warn_special list. + * + * Note that this list is never free'd again! + * + * While this is probably what we want (ensuring the user will + * never see the same warning twice, even after resizing/... the + * page), this might eventually lead to space problems if there + * are *many* warnings. But since this is a pathological case + * anyway (and the user would probably turn specials off in this + * case), I think we might leave it like that. + */ + new_warn_special->next_warn_special = head_warn_special; + head_warn_special = new_warn_special; + } +} + +/********************************************************************** + Parse the special string pointed to by `input_string' and return + pointer to a SRC_special element containing the necessary + information, or NULL if parsing `input_string' failed. + **********************************************************************/ +static struct SRC_special * +src_parse_special_string(input_string, x, y) + char *input_string; + Position x, y; +{ + struct SRC_special *new_special; + char *my_filename, *my_lineno, *save_special; + int filename_string_len = 0, lineno_string_len = 0; + unsigned long numtest; /* for testing if line number fits into unsigned int */ + Boolean read_leading_garbage = False; /* true if we had to read over leading garbage */ + /* + * preliminary stuff to account for various formats of the src specials. + * 0 is: `<filename>:<lineno>' + * 1 is: `<lineno> <filename>' + * 2 is: `<lineno>[ ]*<filename>' + * + * where (0) has been used by myself for test purposes, (1) is used + * by YAP, (2) (where there may be any (including 0) number of spaces + * separating lineno and filename) is used by YAP and DVIWIN. + * (note that if there are zero spaces, the filename mustn't start with + * a digit). + * + * The current web2c patch uses (2), but in a safe way: it inserts a + * space as separator iff the filename starts with a digit. + * + * So (1) is a special case of (2); you might use it if you want to enforce the + * use of white-space as separator. + * + * I still have to find out which format the viewers/editors on some + * (commercial) MAC implementations use. + */ + + new_special = XMALLOC(sizeof(struct SRC_special), "new special"); + save_special = input_string; + + switch(src_specialFormat) { + case 0: + /* this case is for testing only, so it doesn't contain many sanity checks that + * have been included in the tests below. + */ + if((my_lineno = rindex(input_string, ':')) == NULL) { + src_special_format_error(1, input_string, " doesn't contain a `:' (skipped)"); + return NULL; + } + + /* first char in my_lineno is now `:' - read over it: */ + my_lineno++; + lineno_string_len = strlen(my_lineno); + filename_string_len = strlen(input_string) - lineno_string_len - 1; /* - 1 for the `:' */ + + my_filename = XMALLOC(filename_string_len + 1, "filename in special"); + (void) strncpy(my_filename, input_string, filename_string_len); + my_filename[filename_string_len] = '\0'; + break; + + default: /* treat src_specialFormat == 1 and 2 simultaneously */ + /* + * Delete everything that isn't a digit from the start of + * input_string (including, eventually, minus signs etc.) Will + * check below for read_leading_garbage and issue a warning in + * this case (after fatal errors have been processed). + */ + while(*input_string != '\0' && !isdigit(*input_string)) { + input_string++; + read_leading_garbage = True; + } + my_lineno = input_string; + lineno_string_len = 0; + + if (src_specialFormat == 1) { + /* read line number until finding a space: */ + while (*input_string != '\0' && *input_string != ' ') { + input_string++; + lineno_string_len++; + } + } + else { + while (*input_string != '\0' && isdigit(*input_string)) { + input_string++; + lineno_string_len++; + } + } + + /* did we read a line number? */ + if(lineno_string_len == 0) { + src_special_format_error(1, save_special, " doesn't contain a digit (skipped)"); + return NULL; + } + + if (src_specialFormat == 1) { + /* read over single whitespace */ + if (*input_string != '\0' && *input_string == ' ') { + input_string++; + } + else { + src_special_format_error(1, save_special, " doesn't contain a space (skipped)"); + return NULL; + } + } + else { + /* read over any amount of whitespace */ + while (*input_string != '\0' && isspace(*input_string)) { + input_string++; + } + } + + filename_string_len = strlen(input_string); + + /* is the remaining chunk of input_string empty? */ + if(filename_string_len == 0) { + src_special_format_error(1, save_special, " contains only digits and no filename (skipped)"); + return NULL; + } + + /* if everything else was OK, warn if special had contained leading garbage: */ + if (read_leading_garbage) { + src_special_format_error(0, save_special, ": leading non-digits deleted"); + } + + /* finally, allocate and copy filename */ + my_filename = XMALLOC(filename_string_len + 1, "filename in special"); + (void) strncpy(my_filename, input_string, filename_string_len); + my_filename[filename_string_len] = '\0'; + break; + } + new_special->filename = my_filename; + + /* + * similar to atol(my_lineno), but converts to unsigned long int + * and does additional error checking. First set errno to 0 so that + * it won't contain the result of calls: + */ + errno = 0; + numtest = strtoul((my_lineno), (char **)NULL, 10); + new_special->lineno = (unsigned int)numtest; + + /* + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + have to check for ERANGE availability (errno.h) !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + */ + + /* + * If number has been too long for unsigned long int (ERANGE), + * it's definitely too long for unsigned int either. + * If not, check if it is too long for unsigned int. + * Note that the test for ERANGE isn't redundant, since on + * Intel Linux UINT_MAX == ULONG_MAX. + */ + if ((errno == ERANGE) || (numtest > UINT_MAX)) { + Fprintf(stderr, "\nWarning: line number %s too long for data type \"unsigned int\";\nchopping to %u\n", + my_lineno, new_special->lineno); + } + /* + * If special is in a text line, currinf.fontp->pt_size + * should contain the pt size of the font. + */ + if (currinf.fontp != NULL) { + // new_special->pt_size = pt_size; + new_special->pt_size = currinf.fontp->pt_size; + } + else { + /* + * Assume some reasonable default value. Note that this is not + * critical, since currinf.fontp == NULL means that the current + * special doesn't occur in a text line at all + * (but before all text on the current page). + */ + new_special->pt_size = 12.0; + } + new_special->x_coord = x; + new_special->y_coord = y; + new_special->pageno = current_page; + + /*** + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "\n============ lineno: %u; filename: |%s|\n", new_special->lineno, input_string); + } + ***/ + return new_special; +} + + +/************************************************************************* + Build up the editor command for the system call and perform the system + call. + Example format for emacs: emacsclient --no-wait +lineno filename + *************************************************************************/ + +//_Xconst char *kpse_pathname = ""; /* used to hold the expanded path name of the file in the special */ +char *kpse_pathname; /* used to hold the expanded path name of the file in the special */ + +static void +issue_src_editor_cmd(filename, lineno) + char *filename; + long lineno; +{ + char *cmdstring; + + /* + * Here's the very simple algorithm for finding the files contained + * in the specials: First check if file is in current directory; if + * so, open it. Else, use kpse_find_tex (special form of + * kpse_find_file) if kpathsearch library is available, or the + * `filefind' function from non-k xdvi to expand the path name. + * This should nearly always succeed, even if the path may not be + * exactly what you wanted ... however you'll get decent results when + * calling xdvi from the same directory as LaTeX, which is (I hope ;) + * quite common. + */ + if (stat(filename, &statbuf) == 0) { + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "Found file \"%s\" in current dir\n", filename); + } + kpse_pathname = filename; + } + else { +#ifdef XDVIK + /* make a kpathsea search for filename */ + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "file \"%s\" not found in cwd, trying kpathsea expansion\n", filename); + } + kpse_pathname = kpse_find_tex(filename); + if (stat(kpse_pathname, &statbuf) != 0) { + Fprintf(stderr, "Error: file `%s' not found, couldn't jump to special `%s:%ld'\n", + filename, filename, lineno); + return; + } + else { + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "Found file: `%s'\n", kpse_pathname); + } + } +#else /* XDVIK */ + /* + * search for filename in $TEXINPUTS, using the filefind function from + * non-k xdvi's filefind.c + */ + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "file \"%s\" not found in cwd, trying TEXINPUTS\n", filename); + } + search_tex.path1 = getenv("TEXINPUTS"); +#if CFGFILE + search_tex.envptr = ffgetenv("TEXINPUTS"); + if (search_tex.envptr != NULL && search_tex.envptr->value == NULL) { + search_tex.envptr = NULL; + } +#endif /* CFGFILE */ + (void) filefind(filename, &search_tex, &kpse_pathname); + if (stat(kpse_pathname, &statbuf) != 0) { + Fprintf(stderr, "Error: file `%s' not found, couldn't jump to special `%s:%ld'\n", + filename, filename, lineno); + return; + } + else { + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "Found file: `%s'\n", kpse_pathname); + } + } +#endif /* XDVIK */ + } + src_warn_outdated(); + + /* now allocate space for the command string, and issue the editor command */ + + /* + 1 is for `\n' */ + cmdstring = XMALLOC((unsigned)strlen(src_editorCommand) + (unsigned)strlen(kpse_pathname) + LONG_SIZE + 1, + "editor command string"); + if (src_EditorCmd_filename_first) { /* set inside src_get_settings, called by main() */ + Sprintf(cmdstring, src_editorCommand, kpse_pathname, lineno); + } + else { + Sprintf(cmdstring, src_editorCommand, lineno, kpse_pathname); + } + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf (stderr, "Calling: %s\n", cmdstring); + } + (void) system(cmdstring); + free(cmdstring); +} + +static Boolean +src_arr_too_long(len) + unsigned int len; +{ + if (len > ARR_MAX_SIZE) { + Fprintf(stderr, "Error: Requested lookup array size %u exceeds sensible limit of %d\n", len, ARR_MAX_SIZE); + Fprintf(stderr, "(Reason might be an overflow in page_h)\n", ARR_MAX_SIZE); + Fprintf(stderr, "Disabling src specials at this resolution/magnification.\n\n", ARR_MAX_SIZE); + src_arr_len = 0; + return True; + } + return False; +} + +static void +src_initialize_array(len) + unsigned int len; +{ + unsigned int j; + + /* + * Note that src_arr isn't free()d at exit(0). Should we do + * something like `atexit(src_cleanup)? However I think every real + * OS takes care of that (and if it doesn't, it probably also + * doesn't have `atexit'; and in any case all this would only work + * in case of normal program termination anyway ...) + */ + + if (src_arr_too_long(len)) { + return; + } + + if (debug & DBG_SRC_SPECIALS) { + fprintf(stderr, "initializing array of len: %u; page_h: %u; shrink_factor: %d\n", src_arr_len, len, shrink_factor); + } + src_arr = XMALLOC((len * sizeof(struct SRC_special *)), "src specials lookup array"); + + /* initialize all index positions to NULL */ + for (j = 0; j < len; j++) { + src_arr[j] = NULL; + } +} + +static void +src_resize_array(len) + unsigned int len; +{ + unsigned int j; + + if (src_arr_too_long(len)) { + return; + } + + if (debug & DBG_SRC_SPECIALS) { + fprintf(stderr, "resizing array to len: %d; page_h: %d; shrink_factor: %d\n", src_arr_len, page_h, shrink_factor); + } + src_arr = XREALLOC(src_arr, len * sizeof(struct SRC_special *), "src specials lookup array"); + + /* re-initialize all index positions to NULL */ + for (j = 0; j < len; j++) { + src_arr[j] = NULL; + } +} + +/************************************************************************* + private function called by src_find_special + *************************************************************************/ + +static struct SRC_special * +src_get_special(x,y) + Position x,y; /* coordinates of Xevent that triggered the search */ +{ + struct SRC_special *curr = NULL, *bak = NULL, *remember = NULL; + Position i = y; /* don't modify y, will be needed later */ + long last_line_y; + + + if(last_vertical == NULL || first_vertical == NULL) { + /* this means that there aren't any specials on this page; we may return NULL: */ + return NULL; + } + else { + // fprintf(stderr, "== Last/first: %d/%d\n", last_vertical->index, first_vertical->index); + } + + /*** + fprintf(stderr, "pixels per inch: %d; xresolution: %d\n", resource._pixels_per_inch, xRESOLUTION); + fprintf(stderr, "find got args: %u, %u\n", x, y); + x = (int)((double)x / (double)corr_fact); + y = (int)((double)y / (double)corr_fact); + fprintf(stderr, "after conversion: %u, %u\n", x, y); + ***/ + + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "Current point: x: %d, y: %d (%d,%d)\n", x, y, PXL_H, PXL_V); + } + + /* check if lookup array at y position is empty, and if yes, start moving: */ + if (src_arr[i] == NULL) { + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "array at %d is NULL\n", y); + } + while (src_arr[i] == NULL && i < src_arr_len && i < last_vertical->index) { + // Fprintf(stderr, "moving down: %d (bound: %d)", i, last_vertical->index); + i++; + } + while (src_arr[i] == NULL && i > 0 && i > first_vertical->index) { + // Fprintf(stderr, "moving up: %d (bound: %d)", i, first_vertical->index); + i--; + } + } + if (debug & DBG_SRC_SPECIALS) { + fprintf(stderr, "Found: i: %d; horizontal list:\n", i); + for (curr = src_arr[i]; curr != NULL; curr = curr->next_special) { + fprintf(stderr, "%s:%u (%d,%d)\n", curr->filename, curr->lineno, curr->x_coord, curr->y_coord); + } + } + if((curr = src_arr[i]) != NULL) { + /* compute the y coord of the previous line: */ + last_line_y = curr->y_coord - (Position)(curr->pt_size / 72.27 * (double)yRESOLUTION); + + if (y >= curr->y_coord) { /* point is below last line; return last of last line */ + while (curr->next_special != NULL) { + curr = curr->next_special; + } + } + else if ((x < curr->x_coord || y < last_line_y) && y > first_vertical->index) { + /* point is above/left of current line; return last of previous line */ + i--; + while (src_arr[i] == NULL && i > first_vertical->index) { + i--; + // fprintf(stderr, "moving up: %d\n", i); + } + if ((curr = src_arr[i]) != NULL) { + while (curr->next_special != NULL) { + curr = curr->next_special; + } + } + } + else { /* point is on current line; find closest x */ + bak = curr; + while (curr != NULL && x > curr->x_coord) { + // fprintf(stderr, "moving right: %d\n", curr->x_coord); + bak = curr; + curr = curr->next_special; + } + curr = bak; + } + } + return curr; +} + +/************************************************************************* + insert special into array at index y. Returns 0 for success, + 1 if y is larger than array size. +*************************************************************************/ +static int +src_insert_into_array(y,special) + Position y; + struct SRC_special *special; +{ + struct SRC_vertical_list *new_vertical, *tmp; + static Position save_greatest, save_smallest; /* save minimum/maximum y coordinates for this page */ + static int initialized = 0; + if (greatest_smallest_notset) { + save_smallest = save_greatest = y; + // fprintf(stderr, "==smallest: %d\n", y); + greatest_smallest_notset = False; + } + if (y >= src_arr_len) { + Fprintf(stderr, "\nShouldn't happen: y coordinate %d exceeds src_arr bounds (%d)\n", y, src_arr_len); + Fprintf(stderr, "- skipping this special.\n"); + Fprintf(stderr, "As a workaround, you may try a smaller magnification factor;\n"); + Fprintf(stderr, "however please report this bug to the maintainer(s) of xdvi(k).\n"); + return 1; + } + if (src_arr[y] == NULL) { + /* array is empty at this index; insert this index into helper list SRC_vertical_list */ + new_vertical = XMALLOC(sizeof(struct SRC_vertical_list), "elem of vertical list"); + new_vertical->index = y; + + if (y >= save_greatest) { + save_greatest = y; + // fprintf(stderr, "==greatest: %d\n", y); + last_vertical = new_vertical; + } + if (y <= save_smallest) { + save_smallest = y; + // fprintf(stderr, "==smallest: %d\n", y); + first_vertical = new_vertical; + } + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "inserting new vertical pointer to %u\n", new_vertical->index); + } + new_vertical->next_vertical = head_vertical; + head_vertical = new_vertical; + } + src_arr[y] = insert_into_src_specials(src_arr[y], special); + return 0; +} + +/************************************************************************* + Called from src_eval_special (once, when the first special is found); + assigns values to the global variables: + + src_EditorCmd_filename_first + src_tick_width + src_tick_height + + by parsing the settings of src_editorCommand and src_tickSize, + and initializes the lookup array src_arr. + *************************************************************************/ +static void +src_get_settings(void) +{ + + char *line_substring, *file_substring; + char *my_size; + char *test_src_editorCommand; + + if (src_editorCommand == NULL) { /* in case there's something wrong with the default settings */ + Fprintf(stderr, "\nShouldn't happen: Resource \"srcEditorCommand\" has no default value!\n"); + Fprintf(stderr, "Please report this as a bug to the maintainer, along with this error message.\n"); + src_editorCommand = "emacsclient --no-wait '+%u' '%s'"; + Fprintf(stderr, "(Assuming \"%s\" to recover.)\n", src_editorCommand); + } + + if((file_substring = strstr(src_editorCommand, "%s")) == NULL) { + Fprintf(stderr, "\nError: srcEditorCommand %s doesn't contain a \"%%s\"\n(to hold the file name)\n", + src_editorCommand); + src_editorCommand = "emacsclient --no-wait '+%u' '%s'"; + Fprintf(stderr, "Using built-in default: \"%s\"\n", src_editorCommand); + src_EditorCmd_filename_first = False; + } + else { + if((line_substring = strstr(src_editorCommand, "%u")) == NULL) { + Fprintf(stderr, "\nError: srcEditorCommand %s doesn't contain a \"%%u\"\n(to hold the line number)\n", + src_editorCommand); + src_editorCommand = "emacsclient --no-wait '+%u' '%s'"; + Fprintf(stderr, "Using built-in default: \"%s\"\n", src_editorCommand); + src_EditorCmd_filename_first = False; + } + else { + /* + * warn if src_editorCommand doesn't start with a command, i.e. + * doesn't contain at least one alphabetic character in front of + * the format string. + */ + test_src_editorCommand = src_editorCommand; + while (!isalpha(*test_src_editorCommand) && *test_src_editorCommand != '%') { + test_src_editorCommand++; + } + if (*test_src_editorCommand == '%') { + /* ring all bells */ + XBell(DISP, 20); + Fprintf(stderr, "\n\n****************************************************************\n"); + Fprintf(stderr, "WARNING: srcEditorCommand string %s doesn't seem\n", src_editorCommand); + Fprintf(stderr, "to contain a command name -- this might be a security problem!\n"); + Fprintf(stderr, "Be sure to read the section on `src specials and security'\n"); + Fprintf(stderr, "in the xdvi man page before proceeding.\n"); + Fprintf(stderr, "****************************************************************\n\n"); + } + if (strlen(file_substring) > strlen(line_substring)) { /* %s before %u */ + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "SRC info: filename comes first in editor command\n"); + } + src_EditorCmd_filename_first = True; + } + else { /* %u before %s */ + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "SRC info: line number comes first in editor command\n"); + } + src_EditorCmd_filename_first = False; + } + } + } + + /* get settings for src_tick_width, src_tick_height */ + if(src_tickSize == NULL) { /* in case there's something wrong with the default settings */ + Fprintf(stderr, "\nShouldn't happen: Resource \"srcTickSize\" has no default value!\n"); + Fprintf(stderr, "Please report this as a bug to the maintainer, along with this error message.\n"); + src_tickSize = "40x70"; + Fprintf(stderr, "(Assuming \"%s\" to recover.)\n", src_tickSize); + } + if ((my_size = rindex(src_tickSize, 'x')) == NULL) { + src_tickSize = "40x70"; + src_tick_height = 70; + src_tick_width = 40; + Fprintf(stderr, "\nError: argument for \"-srcTickSize\" not in `geometry' format\n"); + Fprintf(stderr, "(e.g.: \"40x70\"); using default: %s\n", src_tickSize); + } + else { + my_size++; + fflush(stderr); + src_tick_height = atoi(my_size); + src_tick_width = atoi(src_tickSize); + } +} + + +/* + ======================================================================== + Public Functions + ======================================================================== +*/ + +void +src_warn_outdated(void) +{ + /* + * Warn if source file is newer than .dvi file (the line number + * information in the specials might be outdated in this case). + */ + char *warnmsg; + // if (kpse_pathname + if (statbuf.st_mtime > dvi_time) { + if (src_warn_verbosity >= SRC_WARNINGS_VERBOSE) { + warnmsg = XMALLOC((unsigned)strlen(kpse_pathname) + + (unsigned)strlen("Warning: File %s is newer than dvi file!") + 2, + "warning message"); + Sprintf(warnmsg, "Warning: File %s is newer than dvi file!", kpse_pathname); + // redraw(&mane); + + showmessage(warnmsg); + free(warnmsg); + XFlush(DISP); + } + else { + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "\nWarning: file \"%s\" is newer than .dvi file;\n", kpse_pathname); + Fprintf(stdout, " line number in special might be wrong!\n\n"); + } + } + } +} + + + +/************************************************************************ + find src special that's closest to x,y. + `jump' signals that we want to issue the editor command (if jump == 1) + or just highlight the special found (jump == 0). +************************************************************************/ +void +src_find_special(jump,x,y) + int jump; /* 1 if we are to call the editor command, 0 else */ + Position x,y; +{ + struct SRC_special *found; + /* + * last_active_special (last item searched) will have highlight colour; redraw with + * ordinary colour if last_active_special was on current page: + */ + if (last_active_special != NULL && src_tickVisibility) { + draw_src_glyph(last_active_special->x_coord, last_active_special->y_coord, highGC); + } + + if(src_arr_len == 0) { /* return immediately if searching is disabled */ + XBell(DISP, 15); + fprintf(stdout, "specials not enabled.\n"); + return; + } + + found = src_get_special(x,y); + if (found != NULL) { + last_active_special = found; + if (src_tickVisibility) { + draw_src_glyph(found->x_coord, found->y_coord, foreGC); + } + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stderr, "SRC special file:%s, line:%d (x:%d,y:%d;%f)\n", + found->filename, found->lineno, found->x_coord, found->y_coord, found->pt_size); + } + /* if `jump' argument == 1, issue the editor command: */ + if (jump == 1) { + issue_src_editor_cmd(found->filename, found->lineno); + } + } + else { + XBell(DISP, 15); + fprintf(stdout, "No specials on this page.\n"); + } +} + + +/************************************************************************* + free the memory used by src_arr + *************************************************************************/ +void +src_cleanup(void) { + fprintf(stderr, "freeing memory...\n"); + src_delete_all_specials(); + free(src_arr); + src_arr_len = 0; + src_arr_not_initialized = True; +} + +/************************************************************************* + delete all elements from specials list. Not static, since also called + from external functions (check_dvi_file in dvi-init.c, and ... in events.c). + *************************************************************************/ +void +src_delete_all_specials(void) +{ + int j; + struct SRC_vertical_list *curr, *tmp; + + /* + * use SRC_vertical_list to locate and delete all elements in + * src_arr, and free SRC_vertical_list at the same time. + */ + for (curr=head_vertical; curr != NULL; curr = tmp) { + tmp = curr->next_vertical; + delete_special_list(&src_arr[curr->index]); + src_arr[curr->index] = NULL; + free(curr); + } + head_vertical = NULL; + last_active_special = NULL; + greatest_smallest_notset = True; + last_vertical = NULL; + first_vertical = NULL; +} + +/************************************************************************* + Evaluate a src special; called during the page scan from + `applicationDoSpecial' (special.c). + Main tasks are: + - allocate space for the SRC_special struct and its elements + - call `src_delete_all_specials' if page or magnification factor has changed + - call `src_insert_into_array' to insert special into search array + - call `draw_src_glyph' to draw the `tick' indicating the specials on the + displayed page + *************************************************************************/ +void +src_eval_special(input_string, x, y) + char *input_string; + Position x, y; +{ + struct SRC_special *new_special; + unsigned int j; + + if (!src_evalMode) { + return; + } + + if (specials_not_initialized) { + if (debug & DBG_SRC_SPECIALS) { + fprintf(stderr, "initializing specials...\n"); + } + src_get_settings(); + specials_not_initialized = False; + } + + if (src_arr_not_initialized) { + src_arr_len = page_h; + /* initialize save_shrinkfactor to sensible value: */ + save_shrinkfactor = mane.shrinkfactor; + src_initialize_array(src_arr_len); + src_arr_not_initialized = False; + } + + if (debug & DBG_SRC_SPECIALS) { + if (currinf.fontp == NULL) { + Fprintf(stderr, "SRC special: %s (%d, %d); (NULL font)\n", input_string, x, y); + } + else { + Fprintf(stderr, "SRC special: %s (%d, %d), font:%s (%f)\n", + input_string, x, y, currinf.fontp->fontname, currinf.fontp->pt_size + ); + } + Fprintf(stderr, "shrink factors: %d,%d,%d\n", alt.shrinkfactor, mane.shrinkfactor, currwin.shrinkfactor); + } + + /* + * flush specials if shrink factor has changed. + * The test (mane.shrinkfactor != save_shrinkfactor) gave + * misbehaviour with the magnifier which also sets the shrinkfactor; + * hence the additional check MAGNIFIER_NOT_ACTIVE (kludgy, see + * definition above). The specials are also flushed when changing + * pages; this is done inside keystroke (in events.c). + + */ + if (mane.shrinkfactor != save_shrinkfactor && MAGNIFIER_NOT_ACTIVE) { + if (debug & DBG_SRC_SPECIALS) { + Fprintf(stderr, "shrink factor changed, flushing specials ...\n"); + } + + /* delete all specials from src_arr */ + src_delete_all_specials(); + + /* recompute length of src_arr */ + src_arr_len = page_h; + src_resize_array(src_arr_len); + } + + /* + * only insert new specials if displaying specials is ON (ignoring + * size changes by the magnifier glass - this would insert way too + * many specials), if src special is well-formed and if its y coordinate + * doesn't exceed the length of the src_arr. + */ + if (MAGNIFIER_NOT_ACTIVE && (src_arr_len > 0)) { + // fprintf(stderr, "scanning: %s\n", input_string); + if ((new_special = src_parse_special_string(input_string, x, y)) != NULL) { + if ((src_insert_into_array(y, new_special) == 0) && src_tickVisibility) { + draw_src_glyph(new_special->x_coord, new_special->y_coord, highGC); + } + } + } + save_shrinkfactor = mane.shrinkfactor; +} + +/************************************************************************* + Currently unused. + In case an external function would have to draw the src ticks, it might + want to call this function. + *************************************************************************/ +void draw_src_specials() +{ + struct SRC_special *curr; + for(curr = head_special; curr != NULL; curr = curr->next_special) { + draw_src_glyph(curr->x_coord, curr->y_coord, highGC); + } +} + +/************************************************************************ + function that prints out the list of specials for the current page +************************************************************************/ + +void +test_print_out_list() +{ + struct SRC_special *curr2; + struct SRC_vertical_list *curr, *tmp; + int j; + for (curr = head_vertical; curr != NULL; curr = curr->next_vertical) { + curr2 = src_arr[curr->index]; + for (curr2 = src_arr[curr->index], j = 0; curr2 != NULL; curr2 = curr2->next_special, j++) { + Fprintf(stderr, "[%3d:%3d] %s:%u (%d,%d;%f)\n", + curr->index, j, curr2->filename, curr2->lineno, curr2->x_coord, curr2->y_coord, curr2->pt_size); + } + } +} + + +#endif diff --git a/Build/source/texk/windvi/t1.c b/Build/source/texk/windvi/t1.c new file mode 100644 index 00000000000..e49a4938e22 --- /dev/null +++ b/Build/source/texk/windvi/t1.c @@ -0,0 +1,1051 @@ +/*========================================================================*\ + +Copyright (c) 1999 Nicolai Langfeldt + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL NICOLAI LANGFELDT, PAUL VOJTA, OR ANYONE ELSE BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Names: + janl: Nicolai Langfeldt (janl@math.uio.no) + rmz: Rainer Menzner (Rainer.Menzner@neuroinformatik.ruhr-uni-bochum.de) + +History: + 18/02/1999, janl: Initial version, first public alpha release of xdvi-t1. + 22/02/1999, rmz: Changes to make scaling and antialiasing work better. + 24/02/1999, janl: Read afm files to get alignments right. type1 char + widhts are to coarse. + 08/05/1999, janl: Update to t1lib-0.9, add code to read more generic + encoding maps (encoding.map, not *.enc) + 10/05/1999, janl: New font loading code and data struct for defered + font loading. Significant reduction in startup time realized. + +Bugs: + - Every kpse_find_file call presents a memory leak. The pathname + buffer is not freed. + +\*========================================================================*/ + +#define HAVE_BOOLEAN 1 + +#include "xdvi-config.h" + +#if T1 + +#define PRIVATE static +#define PUBLIC + +#if defined(HAVE_STRING_H) +#include <string.h> +#else +extern char *strtok P2H(char *, const char *); +#endif + +#include "dvi.h" +#include <kpathsea/tex-file.h> + +#include <t1lib.h> +#include <t1libw32.h> + +/* Datastructures: + + encodings[n]: Loaded from map file + [0] = 8r, <vector> + [1] = 8c, <vector> + + The vectors are demand-loaded in 'load_encoded_font' + +*/ + +typedef struct encoding { + char *enc; /* This may be NULL. From dvips maps we get + encodings loaded by filename, and no name given */ + char *file; + char **vector; +} encoding; + +PRIVATE encoding *encodings; /* Dynamic array */ +#define ENCSTART 16 /* Start size. Normaly there will not + be even this many. */ +#define ENCGROW 16 /* Grow by, when full */ +PRIVATE int maxenc=ENCSTART-1; /* Current size of array */ +PRIVATE int enclidx=-1; /* Current last index in array */ + +/* + + t1fonts[n]: Built as xdvi loads t1 fonts + idx file short t1id loaded + [0] = /path/cmr10.pfb, cmr10 0 1 + [1] = /path/prmr.pfa, prmr 1 0 + [2] = /path/pcrr8a.pfa, pcrr8a 2 0 + + This array enumerates the loaded t1 fonts by full path name. The + refered to t1id is the t1lib font id. The font will not be + extended/slanted/encoded. The loaded field indicates if + T1_LoadFont has been called for the font yet. texfonts that need a + modified version of the t1 font must use T1_CopyFont to copy the + raw font and obtain the id of a new t1 font which can then be + modified. As described in the t1 docs a font must be loaded before + it can be copied. + + Fonts that are copies of other fonts have NULL filenames. If any + font files are to be reused based on the file name the raw font + must be reused, not a copy. + + The short field contains the font as it was identified in the + fontmap. This is used to save searching; if two fonts are + identified the same way in the fontmap they the same font. + +*/ + +typedef struct t1font { + char *file; + char *shortname; + int t1id; + int loaded; +} t1font; + +PRIVATE t1font *t1fonts; /* Dynamic array */ +#define T1START 2048 /* Japanese, Chineese, Korean and others + use a lot of fonts */ +#define T1GROW 1024 +PRIVATE int maxt1=T1START-1; +PRIVATE int t1lidx=-1; + +/* + fontmaps[n]: Loaded from map file, and extended with 'implied' + fonts as needed. + idx texname enc exten. slant filena. t1libid pathn. tfmidx + [0] = pcrr8rn 0 750 0 pcrr8a 2 ... 2 + [1] = putro8r 0 0 0 putro8r 3 ... 3 + + The first 5 fields of this table are loaded from the font map + files, or filled out with default values when implied fonts are + set-up. The t1libid is -1 until the font is loaded or copied as + described under t1fonts. Once the dvi file reveals that the font + is needed it is located on disk to ensure it exists, and the + pathname field is filled out. The t1 font is not loaded, or + copied, before it's needed because set_t1_char has been called to + draw a glyph from the font. The late loading is necessiated by the + high cost of loading fonts. If the font loading is concentrated at + startup of the program the startup-time becomes ecessively high due + to the high number of fonts used by any normaly LaTeX-document. + + 0 extention and slant means no extention/slant. If the input + values are decimal (less than 10) they're multiplied by 1000 and + 10000 respectively to obtain fixed-point integer values. Integer + values have the advandage of being testable for exact match (== 0) + on all architectures (it's true! Not all architectures can do + (reliable) exact matching of floatingpoint values) + +*/ + +typedef struct fontmap { + char *texname; + int enc; /* Index in encoding array */ + int extention; /* Fixed point, *1000 */ + int slant; /* Fixed point, *10000, some font slantings have 4 + significant digits, all after the decimalpoint */ + char *filename; /* Name of the t1 font file as given in map/dvi */ + + int t1libid; /* The t1lib id of this font, or -1 if not set up */ + char *pathname; /* Full path of the font, once needed and located */ + int tfmidx; /* Index in tfminfo array, or -1 */ +} fontmap; + +PRIVATE fontmap *fontmaps; +#define FNTMAPSTART 2048 +#define FNTMAPGROW 1024 +PRIVATE int maxmap=FNTMAPSTART-1; +PRIVATE int maplidx=-1; + +/* + widthinfo[n]: TFM widht info, demand loaded as the fonts are used. + idx texname widths + [0] = cmr10 ... + [1] = ptmr8r ... + [2] = pcrr8rn ... + [3] = putro8r ... + + The widthinfo is loaded from the font tfm file since the type1 + width information isn't precise enough to avoid accumulating + rounding errors that make things visibly unaligned. This is + esp. noticeable in tables; the vline column separators become + unaligned. + + For other than "design" sizes the widths are scaled up or down. + +*/ + +typedef struct tfminfos { + char *texname; + long designsize; + long widths[256]; +} tfminfos; + +PRIVATE tfminfos *tfminfo; +#define TEXWSTART 2048 +#define TEXWGROW 1024 +PRIVATE int maxw=TEXWSTART-1; +PRIVATE int wlidx=-1; + +PRIVATE int size_devisor; + +/* For file reading */ +#define BUFFER_SIZE 512 + +/* This is the conversion factor from TeXs pt to TeXs bp (big point). + Maximum machine precision is needed to keep it accurate. */ +PRIVATE double bp_fac=72.0/72.27; + +/* Try to convert from PS charspace units to DVI units with minimal + loss of significant digits */ +#define t1_dvi_conv(x) ((((int) (x)) << 16)/1000) +/* Convert from DVI units to TeX pt */ +#define dvi_pt_conv(x) (((long) (x)) >> 16) +/* Experiment with preserving significant digits by using floating point. + No win observed. */ +#define dvi_pt_fconv(x) ((x) / 65536.0) + +/* Convert from TFM units to DVI units */ +#define tfm_dvi_conv(x) (((int) (x)) >> 1) + +/* ********************** FONT AND ENCODING LOADING ******************** */ + +PRIVATE char **load_vector P1C(char *,enc) + +{ + char *filename; + char **vector=NULL; + + filename=kpse_find_file(enc,kpse_program_text_format,0); + + if (filename!=NULL) { + vector=T1_LoadEncoding(filename); + if (vector==NULL) { + fprintf(stderr,"%s: Unable to load encoding vector %s from %s\n", + enc,filename); + perror("xdvi"); + exit(1); + } + fprintf(stderr,"Encoding %s loaded from %s at 0x%lx\n", + enc,filename,vector); + } else + fprintf(stderr,"Unable to load encoding vector %s\n",enc); + + return vector; +} + + +PRIVATE int add_tfm P1C(char *,texname) + +{ + /* Load font metrics if not already loaded. Return index into + fontmetrics array, or -1 if it failed */ + + int i; + + for (i=0;i<=wlidx;i++) + if (strcmp(tfminfo[i].texname,texname)==0) + return i; + + if (wlidx==maxw) { + maxw += TEXWGROW; + tfminfo=realloc(tfminfo,sizeof(*tfminfo)*maxw); + if (tfminfo==NULL) { + fprintf(stderr,"%s: Error: Out of memory.\n"); + exit(1); + } + } + + wlidx++; + + tfminfo[wlidx].texname=texname; + + if (!tfmload(texname,&tfminfo[wlidx].designsize,tfminfo[wlidx].widths)) { + fprintf(stderr,"%s: Could not find/load tfm file for %s. " + "%s: Expect ugly output.\n",texname); + + wlidx--; + return -1; + } + + return wlidx; +} + + +PRIVATE int add_t1font P2C(char *,fontname, char *,filename) + +{ + /* Add t1 font to list, or not if it's already there. Return the + t1lib font id. The filename argument is optional, but is assumed + to be a full path if it is given */ + + int id,i,free_it=0; + char *path; + + /* Already set up by that name? */ + for (i=0;i<=t1lidx;i++) { + if (strcmp(t1fonts[i].shortname,fontname)==0 || + strcmp(t1fonts[i].file,fontname)==0) { +#if debug + fprintf(stderr,"Type1 font %s already loaded from %s\n", + fontname, filename); +#endif + return t1fonts[i].t1id; + } + } + + /* Insert and set up new t1 font */ + + if (t1lidx==maxt1) { + /* Make room */ + maxt1 += T1GROW; + t1fonts=realloc(t1fonts,sizeof(*t1fonts)*maxt1); + if (t1fonts==NULL) { + fprintf(stderr,"%s: Error: Out of memory\n"); + exit(1); + } + fprintf(stderr,"Enlarged t1 table from %d to %d entries\n", + t1lidx, maxt1); + } + + t1lidx++; + + if (filename == NULL) { + /* We don't know the full path name yet, find it */ + fprintf(stderr,"Looking for type1: %s\n",fontname); + path = kpse_find_file(fontname,kpse_type1_format,0); + if (path == NULL) return -1; /* xdvi will use substitution font */ + free_it=1; + } else { + path=filename; + } + + t1fonts[t1lidx].file=strdup(path); + t1fonts[t1lidx].t1id=id=T1_AddFont(path); + t1fonts[t1lidx].shortname=strdup(fontname); + t1fonts[t1lidx].loaded=0; + + if (free_it) + free(path); + + fprintf(stderr,"%s set-up as t1lib font %d\n", filename, id); + +#if USE_AFM + /* Set the afm filename. Always before loading. If no afm file + found t1lib will use fallback code */ + path=kpse_find_file(fontname,kpse_afm_format,0); + if (path!=NULL) { + T1_SetAfmFileName(id,path); + free(path); + } +#endif + + return id; +} + + +PRIVATE int find_texfont P1C(char *,texname) + +{ + /* Find fontmap index of texfont */ + int i; + + for (i=0;i<maplidx;i++) { + if (strcmp(fontmaps[i].texname,texname)==0) { +#if debug + fprintf(stderr,"Type1 font already loaded: %s\n",texname); +#endif + return i; + } + } + return -1; +} + + +PRIVATE int setup_encoded_T1_font P6C(char *,texname, char *,alias, + char *,filename, + int, enc, int, ext, int, sl) + + +{ + /* xdvi T1 Font loading is done in two steps: + + 1. At xdvi startup two things happen: + + a. The fontmaps are read. + + b. the dvi file is (partialy) scanned, and fonts are set up. + In the case of t1 fonts we only set up the data structures, + they are not actually loaded until they are used. + + 2. At the time a T1 font is used it is loaded, encoded, extended + and slanted as prescribed. + + This procedure takes care of step 1a. It locates the font and + sets up the data-structures so it may be assumed, by xdvi, to be + loaded. Return the fontmaps array index. + + The 'texname' param should be the texname of the font, such as + ptmr8r or cmr10. + + The 'alias' param should be the file name of the font if it is + different from the texname. This is often the case with fonts + defined in fontmaps. + + If, for some reason, the full filename of the font has already + been looked up before we get here it is passed in the filename + param so we don't have to look it up again. + + Implied encodings are not handled here. + + REMEMBER: THIS PROC IS CALLED FOR EACH FONT IN THE FONTMAPS, WE + CANNOT DO ANY EXPENSIVE OPERATIONS HERE!!! + + */ + + int idx=-1; + + /* Already setup by that name? */ + idx=find_texfont(texname); + + if (idx!=-1) return idx; + + /* Not set up. Do it. */ + + if (maplidx==maxmap) { + maxmap += FNTMAPGROW; + /* Hope realloc isn't destructive anywhere :-) */ + fontmaps=realloc(fontmaps,sizeof(*fontmaps)*maxmap); + if (fontmaps==NULL) { + fprintf(stderr,"%s: Error: No memory for fontmap. Buy some RAM?\n"); + exit(1); + } + fprintf(stderr,"Enlarged the fontmap from %d to %d entries\n", + maplidx,maxmap); + } + + maplidx++; + + if (alias==NULL) + alias=texname; + + fontmaps[maplidx].texname=strdup(texname); + fontmaps[maplidx].enc=enc; + fontmaps[maplidx].extention=ext; + fontmaps[maplidx].slant=sl; + + fontmaps[maplidx].filename=strdup(alias); + fontmaps[maplidx].t1libid=-1; + if (filename!=NULL) { + fontmaps[maplidx].pathname=strdup(filename); + } else { + fontmaps[maplidx].pathname=NULL; + } + fontmaps[maplidx].tfmidx=-1; + + if (fontmaps[maplidx].texname==NULL || fontmaps[maplidx].filename==NULL) { + fprintf(stderr, "%s: Error: Dang, can't find any free memory!\n"); + exit(1); + } + + return maplidx; +} + + +PRIVATE void load_font_now P1C(int, idx) + +{ + /* At this point xdvi needs to draw a glyph from this font. But + first it must be loaded/copied and modified if needed. */ + + int t1idx; /* The fontmap entry number */ + int t1id; /* The id of the unmodified font */ + int cid; /* The id of the copied font */ + int enc,sl,ext; + + t1idx=add_t1font(fontmaps[idx].filename,fontmaps[idx].pathname); + + t1id=fontmaps[idx].t1libid=t1fonts[t1idx].t1id; + + if (!t1fonts[t1idx].loaded && T1_LoadFont(t1id)==-1) { + fprintf(stderr,"Could not load T1 font %s from %s alias %s\n", + fontmaps[idx].texname, fontmaps[idx].filename, + fontmaps[idx].pathname); + exit(1); + } + + fontmaps[idx].tfmidx=add_tfm(fontmaps[idx].texname); + + t1fonts[t1idx].loaded=1; + + /* If there is nothing further to do, just return */ + enc=fontmaps[idx].enc; + ext=fontmaps[idx].extention; + sl=fontmaps[idx].slant; + + if (enc==-1 && ext==0 && sl==0) + return; + + /* The fontmap entry speaks of a modified font. Copy it first. */ + cid = T1_CopyFont(t1id); + + fprintf(stderr,"t1lib font %d copied to %d to be modified: enc: %d, sl: " + "%d ext: %d\n",t1id,cid,enc,sl,ext); + + fontmaps[idx].t1libid=cid; + + if (enc!=-1) { + /* Demand load vector */ + if (encodings[enc].vector==NULL) + encodings[enc].vector=load_vector(encodings[enc].file); + + if (encodings[enc].vector==NULL) { + fprintf(stderr,"xdvik: Could not load encoding file %s for vector %s.\n" + "The font '%s' is affected by this.\n", + encodings[enc].file,encodings[enc].enc,fontmaps[idx].texname); + } else { + if (T1_ReencodeFont(cid,encodings[enc].vector)!=0) { + fprintf(stderr,"%s: WARNING: Re-encoding of %s did not work.\n", + fontmaps[idx].texname); + } + } + } + + if (ext) + T1_ExtendFont(cid,ext/1000.0); + + if (sl) + T1_SlantFont(cid,sl/10000.0); + + return; +} + + +PUBLIC int find_T1_font P1C(char *,texname) + +{ + /* Step 1b in the scenario above. xdvi knows that this font is + needed. Check if it is available. But do not load yet. + Return the fontmap index at which the font was found */ + + int idx; /* Iterator, t1 font id */ + char *filename; + int fl,el; /* Fontname length, encoding name length */ + int encoded=-1; + char *mname; /* Modified font name */ + + encoded=0; + + /* First: Check the maps */ + idx=find_texfont(texname); + + if (idx!=-1) { + if (fontmaps[idx].pathname==NULL) { + filename=kpse_find_file(fontmaps[idx].filename,kpse_type1_format,0); + /* It should have been on disk according to the map, but never + fear, xdvi will try to find it other ways. */ + if (filename==NULL) { + fprintf(stderr,"%s: Warning: Font map calls for %s, but it was " + "not found\n",fontmaps[idx].filename); + return -1; + } + fontmaps[idx].pathname=filename; + } + return idx; + } + + /* Second: the bare name */ + filename=kpse_find_file(texname,kpse_type1_format,0); + + if (filename!=NULL) + return setup_encoded_T1_font(texname, NULL, filename, -1, 0, 0); + + /* Third: Implied encoding? */ + fl=strlen(texname); + + for (idx=0; idx<=enclidx; idx++) { + + if (encodings[idx].enc==NULL) + continue; + + el=strlen(encodings[idx].enc); + + if (strcmp(texname+(fl-el),encodings[idx].enc)==0) { + /* Found a matching encoding */ + fprintf(stderr,"Encoding match: %s - %s\n",texname,encodings[idx].enc); + mname=malloc(fl+2); + strcpy(mname,texname); + mname[fl-el]='\0'; + /* If we had 'ptmr8r' the we now look for 'ptmr' */ + filename=kpse_find_file(mname, kpse_type1_format,0); + if (filename==NULL) { + /* No? Look for ptmr8a. 8a postfix is oft used on raw fonts */ + strcat(mname,"8a"); + filename=kpse_find_file(mname,kpse_type1_format,0); + } + if (filename!=NULL) + return setup_encoded_T1_font(texname, mname, filename, idx, 0, 0); + + free(mname); + /* Now we have tried everything. Time to give up. */ + return -1; + + } /* If (strcmp...) */ + } /* for */ + + return -1; +} + +/* ************************* CONFIG FILE READING ************************ */ + + +PRIVATE int new_encoding P2C(char *,enc, char *,file) + +{ + /* (Possebly) new encoding entered from .cfg file, or from dvips + map. When entered from dvips map the enc is null/anonymous */ + + int i; + + /* Shirley! You're jesting! */ + if (file==NULL) return -1; + + if (enc==NULL) { + /* Enter by file name. First check if the file has been entered + already. */ + for (i=0; i<=enclidx; i++) { + if (strcmp(encodings[i].file,file)==0) + return i; + } + } else { + /* Enter by encoding name. Check if already loaded first. */ + for (i=0; i<=enclidx; i++) { + if (encodings[i].enc!=NULL && strcmp(encodings[i].enc,enc)==0) + return i; + } + } + + /* Bonafide new encoding */ + + /* Any space left? */ + if (enclidx==maxenc) { + maxenc += ENCGROW; + encodings=realloc(encodings,sizeof(*encodings)*maxenc); + if (encodings==NULL) { + fprintf(stderr,"%s: Error: No memory for encoding map.?\n"); + exit(1); + } + fprintf(stderr,"Enlarged encoding map from %d to %d entries\n", + enclidx,maxenc); + } + + enclidx++; +#if debug + fprintf(stderr,"New encoding #%d: '%s' -> '%s'\n",enclidx,enc,file); +#endif + encodings[enclidx].enc=strdup(enc); + encodings[enclidx].file=strdup(file); + encodings[enclidx].vector=NULL; /* Demand load later */ + + if (encodings[enclidx].enc==NULL || encodings[enclidx].file==NULL) { + fprintf(stderr,"%s: Ran out memory\n"); + exit(0); + } + + return enclidx; +} + + +PUBLIC void add_T1_mapentry P4C(char *,name, char *,file, char *,vec, + char *,spec) + +{ + /* This is called from getpsinfo, once for each fontmap line. We + will dutifully enter the information into our fontmap table */ + + static char delim[]="\t "; + char *last, *current; + float number; + int extend=0; + int slant=0; + +#if 0 + fprintf(stderr,"Map entry: %s -> %s(%s) Spec: %s\n",name,file,vec,spec); +#endif + + if (spec!=NULL) { + /* Try to analyze the postscript string. We recognize two things: + "n ExtendFont" and "m SlantFont". n can be a decimal number in + which case it's an extention factor, or a integer, in which + case it's a charspace unit? In any case 850 = .85 */ + + last=strtok(spec,delim); + current=strtok(NULL,delim); + while (current!=NULL) { + if (strcmp(current,"ExtendFont")==0) { + sscanf(last,"%f",&number); + if (number<10.0) + extend = number * 1000.0; + else + extend = number; +#if 0 + fprintf(stderr,"EXTEND: %d\n",extend); +#endif + } else if (strcmp(current,"SlantFont")==0) { + sscanf(last,"%f",&number); + slant = number * 10000.0; +#if 0 + fprintf(stderr,"SLANT: %d\n",slant); +#endif + } + last=current; + current=strtok(NULL,delim); + } + } + + setup_encoded_T1_font(name,file,NULL,new_encoding(NULL,vec),extend,slant); + + if (fontmaps[maplidx].texname==NULL || fontmaps[maplidx].filename==NULL) { + fprintf(stderr, "%s: Error: Dang, can't find any free memory!\n"); + exit(1); + } +} + + +PRIVATE void read_enc_map P1C(char *,file) + + /* Read encoding map file */ + +{ + char *filename; + char *enc, *name, *f; + char *buffer; + FILE *mapfile; + int len; + int i; + static const char delim[]="\t \n\r"; + + filename=kpse_find_file(file,kpse_program_text_format,1); + if (filename==NULL) { + fprintf(stderr,"%s: Warning: Unable to find %s\n",file); + exit(1); + } + + mapfile = fopen(filename,"r"); + + if (mapfile==NULL) { + fprintf(stderr,"%s: Unable to open %s for reading: ",filename); + perror(""); + exit(1); + } + +#if debug + fprintf(stderr,"Reading encoding map file %s\n",filename); +#endif + + buffer=malloc(BUFFER_SIZE); + if (buffer==NULL) { + fprintf(stderr,"%s: Out of memory error.\n"); + exit(1); + } + + while (fgets(buffer, BUFFER_SIZE, mapfile)!=NULL) { + len=strlen(buffer); + if (buffer[len-1]!='\n') { + fprintf(stderr,"%s: Error: Line longer than %d in %s. %d\n", + BUFFER_SIZE,filename,(int)buffer[len]); + exit(1); + } + + /* char *enc, *name, *f; */ + enc=buffer; + + while (enc[0]!='\0' && (enc[0]==' ' || enc[0]=='\t')) enc++; + + /* % in first column is a correct comment */ + if (enc[0]=='%' || enc[0]=='\0' || enc[0]=='\n') + continue; + + enc=strtok(enc,delim); + name=strtok(NULL,delim); + f=strtok(NULL,delim); + i=new_encoding(enc,f); + fprintf(stderr,"Encoding[%d]: '%s' = '%s' -> '%s'\n", i,enc,name,f); + } + + fclose(mapfile); + + free(buffer); + free(filename); +} + + +PRIVATE void read_cfg_file P1C(char *,file) + + /* Read config file. */ + +{ + char *filename; + FILE *mapfile; + int len; + char *keyword; + char *f; + char *buffer; + static const char delim[]="\t \n\r"; + + if (file==NULL) + file="xdvi.cfg"; + + filename=kpse_find_file(file,kpse_program_text_format,1); + if (filename==NULL) { + fprintf(stderr,"%s: Warning: unable to find %s\n",file); + return; + } + + mapfile = fopen(filename,"r"); + + if (mapfile==NULL) { + fprintf(stderr,"%s: Error: Unable to open %s for reading: ",filename); + perror(""); + exit(1); + } + + fprintf(stderr,"Reading cfg file %s\n",filename); + + buffer=malloc(BUFFER_SIZE); + if (buffer==NULL) { + fprintf(stderr,"%s: Out of memory error.\n"); + exit(1); + } + + while (fgets(buffer, BUFFER_SIZE, mapfile)!=NULL) { + len=strlen(buffer); + if (buffer[len-1]!='\n') { + fprintf(stderr, "%s: Error: Line longer than %d in %s. %d\n", + BUFFER_SIZE,filename,(int)buffer[len]); + exit(1); + } + + keyword=buffer; + + /* Skip leading whitespace */ + while (keyword[0]!='\0' && (keyword[0]==' ' || keyword[0]=='\t')) + keyword++; + + /* % in first column is a correct comment */ + if (keyword[0]=='%' || keyword[0]=='\0' || keyword[0]=='\n') + continue; + + keyword=strtok(keyword,delim); + + if (strcmp(keyword,"dvipsmap")==0) { + f=strtok(NULL,delim); +#if debug + fprintf(stderr,"DVIPSMAP: '%s'\n",f); +#endif + if (!getpsinfo(f)) { + fprintf(stderr,"Could not load dvips map %s\n",f); + exit(1); + } + } else if (strcmp(keyword,"encmap")==0) { + f=strtok(NULL,delim); +#if debug + fprintf(stderr,"Encoding map: '%s'\n",f); +#endif + read_enc_map(f); + } else { + fprintf(stderr,"%s: Error: Unknown keyword: '%s' in %s\n", + keyword,filename); + exit(1); + } + } + + fclose(mapfile); + + free(buffer); + free(filename); + + return; +} + + +/* **************************** GLYPH DRAWING *************************** */ + + +/* Set character# ch */ + +#ifdef TEXXET +PUBLIC void set_t1_char P2C(wide_ubyte, cmd, wide_ubyte, ch) +#else +PUBLIC long set_t1_char P1C(wide_ubyte, ch) +#endif + +{ + GC gc; + int xpos = PXL_H - currwin.base_x ; + /* + 1 here, seems t1lib and xdvi rounds the baseline differently */ + int ypos = PXL_V - currwin.base_y + 1; + int t1libid; + + /* Side by side comparison of cmr10 and ecrm1000 suggests that t1lib + renders the fonts a touch too large, and a factor of 0.96 was + arrived at as a reasonable correction for this. + + Comparing the test file in gv at large sizes indicates that the + t1 cmr10 font is a hair taller than ecrm1000 also as seen by gv. + But, the size difference in xdvi was bigger. + + Another related problem is that there are some gaps in math modes + tall braces '{', (see for example the amstex users guide). When + the factor is applied these gaps are more pronounced and there + are more of them, compared to when the factor is not applied. + The gaps does not show up in the fullsize window, and when the + 0.96 factor is not applied it only seems to show up in the main + window when the shrink factor is even. + + Also, the size difference is in no way obvious unless you're + looking for it. + + All in all the factor has been droped pending further experience + with t1 fonts in xdvi. + + */ + + float size= + dvi_pt_conv(currinf.fontp->scale*(pixels_per_inch/size_devisor))/72.27; + + int id=currinf.fontp->t1id; + int dvi_h_sav; + + long gw ; + + /* size=size*0.96; */ + + if (fontmaps[id].t1libid==-1) + load_font_now(id); + + t1libid=fontmaps[id].t1libid; + +#if 0 + fprintf(stderr,"Setting '%c' of %d, at %ld(%.2fpt), shrinkage is %d\n", + ch, t1libid, currinf.fontp->scale, + dvi_pt_fconv(currinf.fontp->scale),shrink_factor); +#endif + + if (fontmaps[id].tfmidx==-1) + /* Fallback when tfm data is missing. Not precise enough for + tables with vertical lines. */ + gw = t1_dvi_conv(T1_GetCharWidth(t1libid, ch)*size)* + pixels_per_inch/72; + else + /* Use the widht from the tfm file */ + gw = tfminfo[fontmaps[id].tfmidx].widths[ch] * currinf.fontp->dimconv; + +#ifdef HTEX + gc = HTeXreflevel > 0? highGC: foreGC; +#else + gc = foreGC; +#endif + +#ifdef TEXXET + dvi_h_sav = DVI_H; + if (currinf.dir < 0) DVI_H -= gw; + + /* FIXME: There is something about scan_frame in set_char, I have no + idea what it does, and dvi-draw does not export it either. */ +#endif + +#ifdef GREY + if (use_grey && !(shrink_factor==1)) { + T1_AASetCharX(currwin.win, gc, T1_OPAQUE, xpos, ypos, + t1libid, ch, size/(double) shrink_factor, NULL); + } else +#endif + { + T1_SetCharX(currwin.win, gc, T1_OPAQUE, xpos, ypos, t1libid, + ch, size/(double) shrink_factor, NULL); + } + +#ifndef TEXXET + return gw; +#else +# ifdef Omega + if ((cmd == PUT1) || (cmd == PUT2)) +# else + if (cmd == PUT1) +# endif + DVI_H = dvi_h_sav; + else + if (currinf.dir > 0) + DVI_H += gw; +#endif +} + + +PUBLIC void read_T1_char P2C(struct font *,fontp, ubyte, ch) + +{ + /* Should never be called */ + fprintf(stderr,"BUG: asked to load %c\n",ch); +} + + +PUBLIC void init_t1 P1C(void,) + +{ + /* Initialize t1lib for drawing marks on screen */ + + if ((T1_InitLib(LOGFILE| + IGNORE_CONFIGFILE| + IGNORE_FONTDATABASE| + T1_NO_AFM)==NULL)) { + fprintf(stderr, "%s: Error: Initialization of t1lib failed\n"); + exit(1); + } + T1_SetLogLevel(T1LOG_DEBUG); + + T1_SetDeviceResolutions((float)pixels_per_inch,(float)pixels_per_inch); + + /* Thanks to my wife for figuring this out. My mind was putty after + struggeling with too many kinds of units and factors for too + long: */ + size_devisor=pixels_per_inch/75; + + T1_SetX11Params(DISP, our_visual, our_depth, our_colormap); + /* T1_AA_LOW seems better than T1_AA_HIGH */ + T1_AASetLevel(T1_AA_HIGH); + /* T1_AASetLevel(T1_AA_LOW);*/ + T1_AASetBitsPerPixel(our_depth); + + encodings=malloc(sizeof(*encodings)*ENCSTART); + fontmaps=malloc(sizeof(*fontmaps)*FNTMAPSTART); + t1fonts=malloc(sizeof(*t1fonts)*T1START); + tfminfo=malloc(sizeof(*tfminfo)*TEXWSTART); + + if (encodings==NULL || fontmaps==NULL || t1fonts==NULL) { + fprintf(stderr,"%s: Error: No memory for datastructures.\n"); + exit(1); + } + + /* Malloc mem before reading config files! */ + read_cfg_file(NULL); +} + +#endif /* t1 */ diff --git a/Build/source/texk/windvi/t1mapper b/Build/source/texk/windvi/t1mapper new file mode 100644 index 00000000000..bf2aea5f4d9 --- /dev/null +++ b/Build/source/texk/windvi/t1mapper @@ -0,0 +1,424 @@ +#!/usr/bin/env perl +# +# This program maps full PS font names to abreviated TeX style names +# and puts font files or links to font files in a file hierarchy +# suitable for texk. +# +# Mapping example: Times-Roman.{gsf,pfa,pfb} becomes ptmr.{pfa,pfb} +# + +use File::Path; + +# These are the fontname map files to read + +# This is for the fontname distribution in teTeX 0.4: +# @fonts=qw(adobe apple bitstrea dtc linotype monotype skey1250 skey1555 +# softkey urw); + +# This is for fontname 2.2, get it from ftp.tug.org:/tex/fontname-2.2 +# The linotype map in teTeX 1.0 is terebly corrupted. Removed from the list. + +@fonts=qw(adobe apple bitstrea dtc monotype softkey-1250 + softkey-1555 urw wolfram yandy); + +$logname="t1map.log"; + +# How much to read from font files to figure out the font name +$fontdatalen=1024*10; + +# HERE BE DRAGONS + +usage() if $#ARGV==0; + +# By default copy files +$method=1; + +while ($_=shift(@ARGV)) { + /^-cp$/ && do { $method=1; next; }; + /^-ln$/ && do { $method=2; next; }; + /^-lns$/ && do { $method=3; next; }; + /^-lnlns$/ && do { $method=4; next; }; + /^-lncp$/ && do { $method=5; next; }; + /^-gs$/ && do { + $gsmap = shift(@ARGV) or usage(); + $gsdir = shift(@ARGV) or usage(); + next; + }; + unshift(@ARGV,$_); + last; +} + +$texdir = shift(@ARGV) or usage(); + +if (! -d $texdir) { + print "Making directory $texdir\n"; + mkpath($texdir) or die "Could not make directory: $texdir: $!\n"; +} + +if (!open(LOG,">$logname")) { + $logname="/tmp/$logname"; + open(LOG,">$logname") || + die "Could not open file t1map.err for writing: $!\n"; +} + +# What major mode of operation? + +# Establish fonts based on ghostscript map? +if ($gsmap) { + process_gsfonts(); + print "Log in $logname\n"; + exit 0; +} + +# Ok, loop examine fonts to figure out the font name and copy/link to $texdir + +process_fontname_maps(); +process_fonts(); +print "Log in $logname\n"; + +exit 0; + +# ############################### MOVE_FONT ################################ + +sub move_font { + # Move font to destination directory, according to specified $method + my($from)=shift; + my($to)=shift; + my($relok)=shift; + + my($other); # Same font, other format + my($type); # Other type + + die "I need absolute paths please\n" + if !$relok && substr($from,0,1) ne '/'; + + logmsg("$from -> $to\n"); + + # Remove the old font to replace with this + unlink($to) if -f $to; + + # Also remove the old font in the other format: + $other=$to; + $type='.pfb' if substr($to,-4) eq '.pfa'; + $type='.pfa' if !$type && substr($to,-4) eq '.pfb'; + substr($other,-4)=$type; + + unlink($other) if -f $other; + + if ($method==1) { + # cp + system "cp $from $to 2>/dev/null" and # Shell exit value + warn "Copying $from to $to failed\n"; + } elsif ($method==2) { + # ln + link($from,$to) or + warn "Linking of $to to $from failed: $!\n"; + } elsif ($method==3) { + # lns + symlink($from,$to) or + warn "Symlinking $to to $from failed: $!\n"; + } elsif ($method==4) { + # lnlns + link($from,$to) || + symlink($from,$to) || + warn "Both linking and symlinking $to to $from failed: $!\n"; + } elsif ($method==5) { + # lncp. Let cp give the error-message + link($from,$to) || system "cp $from $to"; + } else { + die "Internal error: Unknown font copy/link method\n"; + } +} + +# ############################# PROCESS_FONTS ############################## + +sub process_fonts { + # Loop over ARGV, examine each (font?) file to see if it is a + # type1 font, binary or text format, and figure out it's name + my($type,$font); + + foreach $filename (@ARGV) { + ($type,$font)=examine_font($filename); + + next if !defined($font); + + if (!exists($file{$font})) { + logmsg("TeX name of $font ($filename) unknown\n"); + next; + } + + $file=$file{$font}; + move_font($filename,"$texdir/$file$type",0); + } +} + +# ############################## EXAMINE_FONT ############################## + +sub examine_font { + # Examine font to determine name and type + # + # The method for finding the font name is based on an awk script + # written years ago by Kjetil T. Homme and me (mostly him). + # + my($filename)=shift; + my($type); + + my($size)=-s $filename; + + if ($size==0) { + logmsg("Zero size file skipped: $filename\n"); + return (undef,undef); + } + + if (!open(FONT,"< $filename")) { + logmsg("Unable to open $filename for reading: $!\n"); + return (undef,undef); + } + + sysread FONT, $fontdata, $fontdatalen, 0; + + # Determine type based on magic number + $type='.pfa' if substr($fontdata,0,16) eq '%!PS-AdobeFont-1'; + $type='.pfa' if !$type && substr($fontdata,0,13) eq '%!FontType1-1'; + $type='.pfb' if !$type && substr($fontdata,6,16) eq '%!PS-AdobeFont-1'; + + if (!$type) { + # This is where we end up if the file does not match the magic + # numbers. The file is most probably not a type1 file. + + if ((index($fontdata,'%!PS-AdobeFont-1')==-1) && + (index($fontdata,'%!FontType1-1')==-1)) { + # If the string '%!PS-AdobeFont-1.0' or '%!FontType1-1.0' + # does not appear at all this is NOT a type1 font of any + # kind. + logmsg("$filename is not a type1 file\n"); + return (undef,undef); + } + + logmsg("Odd magic in $filename\n"); + + # Try to determine type based on filename extention + $type='.pfa' if substr($filename,-4) eq '.pfa'; + $type='.pfb' if !$type && substr($filename,-4) eq '.pfb'; + + if (!$type) { + # No extention? Fall back to perls -T (text) test operator. + $type='.pfb'; + $type='.pfa' if -T $filename; + } + } + + # The font type has now been determined. I wonder what the font's + # name is. + + # What we look for is lines like this: + # + # %!PS-AdobeFont-1.0: URWGothicL-Demi 001.005 + # + # or this: + # + # /FontName /URWGothicL-Demi def + + $fontname=''; + + if ($fontdata =~ m~/FontName /([\S]+) def~) { + # The /FontName line is the most reliable source + $fontname = $1; + } elsif ($fontdata =~ m/%\!PS-AdobeFont-1.0: ([\S]+)/) { + # The magic line is not always fully formed and can only be + # used as fallback --- in case the /FontName entry is not in + # the file. True, this would be a rather dubious font. + $fontname = $1; + } elsif ($fontdata =~ m/%\!FontType1-1.0: ([\S]+)/) { + # The magic line is not always fully (or correctly) formed and + # can only be used as fallback --- in case the /FontName entry + # is not in the file. True, this would be a rather dubious + # font (actually, a lot of type1 versions of tex fonts fall + # into this category). + $fontname = $1; + } + + return ($type,$fontname); +} + +# ######################### PROCESS_FONTNAME_MAPS ########################## + +sub process_fontname_maps { + # Read the fontname maps + + while ($foundry=shift(@fonts)) { + $map=findfile($foundry.".map"); + next unless $map; + print "Reading (fontname/$foundry) $map\n"; + open(FILE,"<$map") || die "Could not open $map: $!\n"; + while (<FILE>) { + chomp; + s/@.*//; + next if $_ eq ''; + ($file,$font,undef)=split(/\s+/,$_,3); + # Remove known encoding codes: + $file =~ s/(8a|8r|8t)$//; + # 8a = StandardEncoding 8a.enc + # 8r = TeXBase1Encoding 8r.enc + # 8t = CorkEncoding cork.enc + # Any filenames with numbers left are 'unknown encodings' + if ($file =~ /\d/) { + # print "Unknown encoding: $file - $font\n"; + next; + } + $file{$font}=$file; + } + close(FILE); + } +} + +# ########################### PROCESS_GSFONTS ############################# + +sub read_gsmap { + # Read gs map file to obtain Font-Name -> filename mappings, and + # aliases so we can use GS' Times-Roman replacement as Times-Roman + # ourselves. Not everyone has oodles of type1 fonts on disk. + + my($gsmap)=shift; + + open(FILE,"<$gsmap") or die "Could not open $gsmap: $!\n"; + + print "Reading (gsmap) $gsmap\n"; + + %gsalias=(); + %gsfile=(); + + while (<FILE>) { + chomp; + s/%.*//; + s/\s+$//; + next if $_ eq ''; + + ($font,$file,undef)=split(/\s+/,$_,3); + + $font =~ s~^/~~; + + if (!exists($file{$font})) { + logmsg("TeX name of $font unknown\n"); + next; + } + + if ($file =~ m~\((.*)\)~) { + $file = $1; + $gsfile{$font}=$file; + } else { + $file =~ s~^/~~; + # The aliases(sp?) cannot be resolved until the whole file is + # read + $gsalias{$font}=$file; + } + + } + + close(FILE); +} + + +sub process_gsfonts { + # Do the Work based on a ghostscript map file. + + process_fontname_maps(); + read_gsmap($gsmap); + + chdir($gsdir) or die "Could not chdir to $gsdir: $!\n"; + + print "Moving fonts\n"; + + foreach $font (keys %gsfile) { + $gsfile=$gsfile{$font}; + # GSF files are not propper t1 fonts I understand, so ignore them + next if $gsfile =~ /\.gsf$/; + $file=$file{$font}; + $type=''; + + if (-f $gsfile) { + + # Crude font type guessing. First based on existing extention: + $type='pfa' if substr($gsfile,-4) eq '.pfa'; + $type='pfb' if !$type && substr($gsfile,-4) eq '.pfb'; + + # If existing extention fails use perls -T (text) test + if (!$type) { + # print "Fallback typing: $gsfile\n"; + $type='pfb'; + $type='pfa' if -T $gsfile; + } + + # Use for alias resolving + $texname{$font}="$file.$type"; + + if (substr($gsfile,0,1) eq '/') { + move_font("$gsfile","$texdir/".$texname{$font},0); + } else { + move_font("$gsdir/$gsfile","$texdir/".$texname{$font},0); + } + + } else { + logmsg("$file not found\n"); + } + } + + chdir($texdir) or die "Could not chdir to $texdir\n"; + + foreach $font (keys %gsalias) { + $alias = $gsalias{$font}; + $falias = $texname{$alias}; + + $type='pfa' if substr($gsfile,-4) eq '.pfa'; + $type='pfb' if !$type && substr($gsfile,-4) eq '.pfb'; + + $file=$file{$font}; + + # Symlink the aliases + logmsg("$falias -> $file.$type\n"); + $method=3; + move_font($falias,"$file.$type",1); + } +} + + +# ############################ JUNK PROCEDURES ########################### + +sub findfile { + # Find file, use kpsewhich to access texmf database and search rules + + my($file)=shift; + $fileloc=`kpsewhich $file`; + + # Check errors + return undef if ($? != 0); + chomp($fileloc); + return undef if $fileloc eq ''; + + # It worked + return $fileloc; +} + +sub usage { + # Abuse the user + print +"Usage: t1mapper [-cp|-ln|-lns|-lnlns|-lncp] \\ + -gs /path/to/gs/Fontmap /path/to/gs/fonts \\ + /path/to/target/tex/directory + + t1mapper [-cp|-ln|-lns|-lnlns|-lncp] \\ + /path/to/target/tex/directory \\ + <font-file-list> + +See XDVIFONTS for documentation + +"; + exit 1; +} + +sub logmsg { + my($string)=shift; + + print STDERR "$string"; + print LOG "$string"; +} diff --git a/Build/source/texk/windvi/test-pk.ps b/Build/source/texk/windvi/test-pk.ps new file mode 100644 index 00000000000..6f804817b3a --- /dev/null +++ b/Build/source/texk/windvi/test-pk.ps @@ -0,0 +1,763 @@ +%!PS-Adobe-2.0 +%%Creator: dvips(k) 5.78 Copyright 1998 Radical Eye Software (www.radicaleye.com) +%%Title: test.dvi +%%Pages: 1 +%%PageOrder: Ascend +%%BoundingBox: 0 0 596 842 +%%DocumentFonts: Times-Roman +%%EndComments +%DVIPSCommandLine: dvips test.dvi -o test-pk.ps +%DVIPSParameters: dpi=600, compressed +%DVIPSSource: TeX output 1999.05.13:0052 +%%BeginProcSet: texc.pro +%! +/TeXDict 300 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N +/X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72 +mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1} +ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale +isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div +hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul +TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if} +forall round exch round exch]setmatrix}N /@landscape{/isls true N}B +/@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B +/FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{ +/nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N +string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N +end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{ +/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0] +N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup +length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{ +128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub +get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data +dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N +/rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup +/base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx +0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff +setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff +.1 sub]/id ch-image N /rw ch-width 7 add 8 idiv string N /rc 0 N /gp 0 N +/cp 0 N{rc 0 ne{rc 1 sub /rc X rw}{G}ifelse}imagemask restore}B /G{{id +gp get /gp gp 1 add N dup 18 mod S 18 idiv pl S get exec}loop}B /adv{cp +add /cp X}B /chg{rw cp id gp 4 index getinterval putinterval dup gp add +/gp X adv}B /nd{/cp 0 N rw exit}B /lsh{rw cp 2 copy get dup 0 eq{pop 1}{ +dup 255 eq{pop 254}{dup dup add 255 and S 1 and or}ifelse}ifelse put 1 +adv}B /rsh{rw cp 2 copy get dup 0 eq{pop 128}{dup 255 eq{pop 127}{dup 2 +idiv S 128 and or}ifelse}ifelse put 1 adv}B /clr{rw cp 2 index string +putinterval adv}B /set{rw cp fillstr 0 4 index getinterval putinterval +adv}B /fillstr 18 string 0 1 17{2 copy 255 put pop}for N /pl[{adv 1 chg} +{adv 1 chg nd}{1 add chg}{1 add chg nd}{adv lsh}{adv lsh nd}{adv rsh}{ +adv rsh nd}{1 add adv}{/rc X nd}{1 add set}{1 add clr}{adv 2 chg}{adv 2 +chg nd}{pop nd}]dup{bind pop}forall N /D{/cc X dup type /stringtype ne{] +}if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup +length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{ +cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin +0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul +add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore userdict +/eop-hook known{eop-hook}if showpage}N /@start{userdict /start-hook +known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X +/IE 256 array N 2 string 0 1 255{IE S dup 360 add 36 4 index cvrs cvn +put}for pop 65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N +/RMat[1 0 0 -1 0 0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley +X /rulex X V}B /V{}B /RV statusdict begin /product where{pop false[ +(Display)(NeXT)(LaserWriter 16/600)]{dup length product length le{dup +length product exch 0 exch getinterval eq{pop true exit}if}{pop}ifelse} +forall}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false +RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1 +false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform +round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg +rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail +{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M} +B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{ +4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{ +p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p +a}B /bos{/SS save N}B /eos{SS restore}B end + +%%EndProcSet +%%BeginProcSet: 8r.enc +% @@psencodingfile@{ +% author = "S. Rahtz, P. MacKay, Alan Jeffrey, B. Horn, K. Berry", +% version = "0.6", +% date = "22 June 1996", +% filename = "8r.enc", +% email = "kb@@mail.tug.org", +% address = "135 Center Hill Rd. // Plymouth, MA 02360", +% codetable = "ISO/ASCII", +% checksum = "119 662 4424", +% docstring = "Encoding for TrueType or Type 1 fonts to be used with TeX." +% @} +% +% Idea is to have all the characters normally included in Type 1 fonts +% available for typesetting. This is effectively the characters in Adobe +% Standard Encoding + ISO Latin 1 + extra characters from Lucida. +% +% Character code assignments were made as follows: +% +% (1) the Windows ANSI characters are almost all in their Windows ANSI +% positions, because some Windows users cannot easily reencode the +% fonts, and it makes no difference on other systems. The only Windows +% ANSI characters not available are those that make no sense for +% typesetting -- rubout (127 decimal), nobreakspace (160), softhyphen +% (173). quotesingle and grave are moved just because it's such an +% irritation not having them in TeX positions. +% +% (2) Remaining characters are assigned arbitrarily to the lower part +% of the range, avoiding 0, 10 and 13 in case we meet dumb software. +% +% (3) Y&Y Lucida Bright includes some extra text characters; in the +% hopes that other PostScript fonts, perhaps created for public +% consumption, will include them, they are included starting at 0x12. +% +% (4) Remaining positions left undefined are for use in (hopefully) +% upward-compatible revisions, if someday more characters are generally +% available. +% +% (5) hyphen appears twice for compatibility with both ASCII and Windows. +% +/TeXBase1Encoding [ +% 0x00 (encoded characters from Adobe Standard not in Windows 3.1) + /.notdef /dotaccent /fi /fl + /fraction /hungarumlaut /Lslash /lslash + /ogonek /ring /.notdef + /breve /minus /.notdef +% These are the only two remaining unencoded characters, so may as +% well include them. + /Zcaron /zcaron +% 0x10 + /caron /dotlessi +% (unusual TeX characters available in, e.g., Lucida Bright) + /dotlessj /ff /ffi /ffl + /.notdef /.notdef /.notdef /.notdef + /.notdef /.notdef /.notdef /.notdef + % very contentious; it's so painful not having quoteleft and quoteright + % at 96 and 145 that we move the things normally found there down to here. + /grave /quotesingle +% 0x20 (ASCII begins) + /space /exclam /quotedbl /numbersign + /dollar /percent /ampersand /quoteright + /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash +% 0x30 + /zero /one /two /three /four /five /six /seven + /eight /nine /colon /semicolon /less /equal /greater /question +% 0x40 + /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O +% 0x50 + /P /Q /R /S /T /U /V /W + /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore +% 0x60 + /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o +% 0x70 + /p /q /r /s /t /u /v /w + /x /y /z /braceleft /bar /braceright /asciitilde + /.notdef % rubout; ASCII ends +% 0x80 + /.notdef /.notdef /quotesinglbase /florin + /quotedblbase /ellipsis /dagger /daggerdbl + /circumflex /perthousand /Scaron /guilsinglleft + /OE /.notdef /.notdef /.notdef +% 0x90 + /.notdef /.notdef /.notdef /quotedblleft + /quotedblright /bullet /endash /emdash + /tilde /trademark /scaron /guilsinglright + /oe /.notdef /.notdef /Ydieresis +% 0xA0 + /.notdef % nobreakspace + /exclamdown /cent /sterling + /currency /yen /brokenbar /section + /dieresis /copyright /ordfeminine /guillemotleft + /logicalnot + /hyphen % Y&Y (also at 45); Windows' softhyphen + /registered + /macron +% 0xD0 + /degree /plusminus /twosuperior /threesuperior + /acute /mu /paragraph /periodcentered + /cedilla /onesuperior /ordmasculine /guillemotright + /onequarter /onehalf /threequarters /questiondown +% 0xC0 + /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla + /Egrave /Eacute /Ecircumflex /Edieresis + /Igrave /Iacute /Icircumflex /Idieresis +% 0xD0 + /Eth /Ntilde /Ograve /Oacute + /Ocircumflex /Otilde /Odieresis /multiply + /Oslash /Ugrave /Uacute /Ucircumflex + /Udieresis /Yacute /Thorn /germandbls +% 0xE0 + /agrave /aacute /acircumflex /atilde + /adieresis /aring /ae /ccedilla + /egrave /eacute /ecircumflex /edieresis + /igrave /iacute /icircumflex /idieresis +% 0xF0 + /eth /ntilde /ograve /oacute + /ocircumflex /otilde /odieresis /divide + /oslash /ugrave /uacute /ucircumflex + /udieresis /yacute /thorn /ydieresis +] def + +%%EndProcSet +%%BeginProcSet: texps.pro +%! +TeXDict begin /rf{findfont dup length 1 add dict begin{1 index /FID ne 2 +index /UniqueID ne and{def}{pop pop}ifelse}forall[1 index 0 6 -1 roll +exec 0 exch 5 -1 roll VResolution Resolution div mul neg 0 0]/Metrics +exch def dict begin Encoding{exch dup type /integertype ne{pop pop 1 sub +dup 0 le{pop}{[}ifelse}{FontMatrix 0 get div Metrics 0 get div def} +ifelse}forall Metrics /Metrics currentdict end def[2 index currentdict +end definefont 3 -1 roll makefont /setfont cvx]cvx def}def /ObliqueSlant +{dup sin S cos div neg}B /SlantFont{4 index mul add}def /ExtendFont{3 -1 +roll mul exch}def /ReEncodeFont{/Encoding exch def}def end + +%%EndProcSet +TeXDict begin 39158280 55380996 1000 600 600 (test.dvi) +@start +%DVIPSBitmapFont: Fa ecrm1000 128 2 +/Fa 2 110 df[<0207C5C5C5C5BB12F8A64AA1A1A1A186AB4AA1A1A1A186AC4AA1A1A1A1 +86A4A103FCD06CA101C0CF1207A191D3003F1180D2121FA148D510E0D4120FA1D6001F9E +D6123F11C011030EF8230010F8D7C60EE0A112071080A16D55A1EA007F4A0CF8D7C76C55 +A101078B0F80A16E9CD7C87E0EFCD7C86C54A1150F0EE0A16F54A115019DD7C96C54A1ED +003F0DF8A1A1A116070DE0A17054A116019CD7CAA1A1EA003F0CFCA17154A1170F0CF0A1 +A1A118030CC0A1A1A1180091BDD7CC6C53A1063F870BFCA1A1A11A0F0BF0A1A1A11A0353 +A1A1A11A000B80A1A1A18752D7CDA1A1141F52A17453A1850AF0A1A1A11C0352A1A1A188 +0A80A1A1A1767E99D7CEA1A18151A1A1A18A494FA1A1A1788509F0A1A1A11E0351A1A1A1 +8A51A1A1A18A51A1A1A18B98D7CFA1A18250A1A1A18C50A1A1A18C50A1A1A18C50A1A1A1 +8C50A1A1A18C494EA1A1A17A8450A1A1A18D97D7D0A1A183A24FA1A1A18E4FA1A1A18EA1 +A1A1A184614FA1A1A18EA24FA1A1A18E4FA1A1A18E49A1A1A1A1884FA1A1A18FA296D7D1 +A1A184A24EA1A1A1A17EA24EA1A1A1A17EA24EA1A1A1A17EA2494CA1A1A1A16C82A34EA1 +A1A1A17EA24EA1A1A1A17EA34EA1A1A1A17FA395D7D2A1A18549A1A1A1A188A1A1A1A186 +5FA34DA1A1A1A180A34DA1A1A1A180A3494BA1A1A1A16E81A44DA1A1A1A180A44DA1A1A1 +A180A349A1A1A1A1894DA1A1A1A181A494D7D3A1A186A54CA1A1A1A182A290B6A1A1A1A1 +87A34CA1A1A1A182A54CA1A1A1A182A348A1A1A1A18AA34CA1A1A1A182A64CA1A1A1A182 +A348A1A1A1A18AA44CA1A1A1A182A7484BA1A1A1A17180A893D7D4A1A187A448A1A1A1A1 +8AA44BA1A1A1A184A748A1A1A1A18AA24BA1A1A1A184A948A1A1A1A18A4BA1A1A1A184AB +484AA1A1A1A1721580ABB648A1A1A1A17215C0A6D7D7C6A1A198CAFCB3B3B3B3B3B3B3B3 +B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3A1A14989A4A1A190BF7EA2A1A1488AA2A1A1488AA2 +A1A1488AA2A1A1488AA1A1488AA1A1488BA2A1A1488BA1A1C17EA1110320F8A1598CA159 +8CA1113F7A7EA1598DA158C312F0A1100F22FEA1107FFAFFC0A10F07C512FCA156C5B512 +F0A155C5B712F0A10C07C5B912FCA152C5BD12F0A1070FC5C312FEA1C5C5C112E0B3ACA1 +0FE0D7C6FCA107F0D7D51201A102C0D7D7CE7E>690 720 90 847 +767 84 D[<A1007E111FB600F0A10E3FB612E09F260FFFFE103FB800FEA10C7FB812FC9E +B6100FBA00FEA10A1FBA12FC0D1FB757BC00F8A10803BC12F053B90F1FE1FFC0A1073FF3 +FF800A3FBA56BE00FCA10603BE12F80807BC0E0FE3FFC0A1051FF5FF80077FBD0E7F0CFC +A194C012F8050FBF0D03C16CA103071FFF93C10D1F0EF0A1033F20E0021FC29CC200FEA1 +4AC212FC48C40C03E7FFC0A10107F9FF80C50C1F10F0A1013F22E0A10C7F10FCA190C412 +F8A153C56C110323FFA10B07A100E0110FA112C0A10B1FA100F8113FA112F0A10B7FA100 +FEA0C5B412FCA152C5B56C0F03A113FFA10A07A16E0F0FA180A10A1FA102F00F3FA114E0 +A152A102FC57A114F8A199C5B66C56C5B67EA10903A16F6C0D07A115FFA1519726E00003 +77559726C0000789A1091F07C0C800070AF00D3F0780C8000F1CE0A1097F06F8CA003F75 +9CBA00F0CA6C87A198BACB000375544ECB000787A1080306F0DE007F08FF0C0706E00600 +1BFEA15095CD001F75534DCD003F86A15005F80803755305F0080787A1083F05C0080075 +0B7F0580080187A1504CCF003F749AB800FCCF6C86A197B800F00A0F08FC5205E00A1F1A +F8A1070305C076740A0705807686A14F94D0000174524CD0000386A14F04FC77755104F8 +7786A14F04F00C3F745104E0776C86A1077F04C0787498B800807886A196B8D26C594CD2 +7EA14E04FC79745004F87986A14E04F079745004E07986A14E04C079745004807986A14E +4C79745093D36C86A14E4BD46C735003FC7A86C80007A14A03F87B5803F08D92C76CA148 +4B7B7496B7487B850500A1B7487B744E4C7B8606075804807B744E93D56C86DE007F5793 +D56C574B8E070F5703FCA1734E03F8A1850701574B7C744E4B7C86736C564B7C744E4B7C +86081F564BA1565D08075603807D7395B7D786749DB7D7565D7459A16C7351A16C857455 +4BA1754C4BA18675544BA16C554BA17E755403E0A16C744C03C0A16C8675544BA1565D75 +544BA16C744C92D7C66C86A197D7C66B75544AA16D744C4AA16D86A14C4AA19EB65A759B +B648A1764B4BA188A14B4BA16D544BA17F7557A1764FA188A14B4BA16D544BA17F75534B +A1764B92D7C787A196D7C869A14B4AA16F734B4AA16E86A14BA1A15A76524AA16F534AA1 +81A14EA1784DA189A14B4AA19EB65AA192B648A1565D7655A16F744DA16F86A14AA1A15A +A14A4BA15692D7C9FCA195D7C96C744CA17086A14A4AA1575CA2A14A4AA179494AA18BA1 +4A4AA170524AA1827654A1A15AA14AA17C49A18EA14DA1A15AA14A4AA19EB65AA1A17674 +A17586A191B648A15692D7CAFCA194D7CA67A149A1A15AA14CA10EFE4BA18CA149A17451 +A186A1494AA1575CA14CA1A15AA1A1A101FFA1A17EA1494AA1575CA2A1494AA171514AA1 +83A2A1494AA19EB648A18CA14CA1A1D7CBFCA15BA193D7CC65A190B6FCA14BA1A15AA1A1 +A1A1A181A1B648A17352A184A2A14BA1A15AA3A14BA1A15AA1A1A1A1A181A14BA1A15AA2 +A14BA1A15AA3A14BA1A1D7CDFCA1A177A1A17EA192D7CD64A3A14AA1A15AA1A1A1A1A181 +A2A14AA1A15AA3A14AA1A15AA3A14AA1A15AA4A14AA1A15AA4A14AA1A15AA4A14AA1A1D7 +CEFCA5A191D7CE63A6A149A1A15AA7A149A1A15AAAA149A1A15AB3B3B3B3B3B3B3B3B3B3 +B3B3B05274A15174A198BC7EA65274A198BC6CA15087A399BDA15075A15087A35176A14F +75A15087A25176A14F76A14F875176A14F76A14F88A25176A14F76A14F885176A14F76A1 +4F885176A14F76A196BE7E5176A196BE6CA14E8950BF6CA105030BFFA106071DFE5078A1 +4D78A14D89081F0CF8A1053F0CF0A1057F1EE097C1A14CC000FEA10403C012FC070F0EF0 +A1031FE5FFE0A1033FF7FFC04EC36CA10103C3A10207C212FE4DC56C1103C5A10007C412 +FE047FC5B500FE9EC5B600FC56C5B612F8C5BF4EC5BE00FE0603C5BE12FCB3AC0980CF00 +01A196D00003A14ED0120704F0D7C7000F0FE0D7C7001F0FC0D7C7123F01E0D7CD000709 +C0D7CD000F0980D7CD121F>830 469 95 596 885 109 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fb cmr10 128 2 +/Fb 2 110 df[<0207C5C5C5C5BB12F8A64AA1A1A1A186AB4AA1A1A1A186AC4AA1A1A1A1 +86A4A103FCD06CA101C0CF1207A191D3003F1180D2121FA148D4000110F0D4120FA1D600 +1F9ED6123F11C011030EF8230010F8D7C60EE0A112071080A16D55A1EA007F4A0CF8D7C7 +6C55A101078B0F80A16E9CD7C87E0EFCD7C86C54A1150F0EE0A16F54A115019DD7C96C54 +A1ED003F0DF8A1A1A116070DE0A17054A116019CD7CAA1A1EA003F0CFCA17154A1170F0C +F0A1A1A118030CC0A1A1A1180091BDD7CC6C53A1063F870BFCA1A1A11A0F0BF0A1A1A11A +0353A1A1A11A000B80A1A1A18752D7CDA1A1141F52A17453A1850AF0A1A1A11C0352A1A1 +A1880A80A1A1A1767E99D7CEA1A18151A1A1A18A494FA1A1A1788509F0A1A1A11E0351A1 +A1A18A51A1A1A18A51A1A1A18B98D7CFA1A18250A1A1A18C50A1A1A18C50A1A1A18C50A1 +A1A18C50A1A1A18C494EA1A1A17A8450A1A1A18D97D7D0A1A183A24FA1A1A18E4FA1A1A1 +8EA1A1A1A184614FA1A1A18EA24FA1A1A18E4FA1A1A18E49A1A1A1A1884FA1A1A18FA296 +D7D1A1A184A24EA1A1A1A17EA24EA1A1A1A17EA24EA1A1A1A17EA2494CA1A1A1A16C82A3 +4EA1A1A1A17EA24EA1A1A1A17EA34EA1A1A1A17FA395D7D2A1A18549A1A1A1A188A1A1A1 +A1865FA34DA1A1A1A180A34DA1A1A1A180A3494BA1A1A1A16E81A44DA1A1A1A180A44DA1 +A1A1A180A349A1A1A1A1894DA1A1A1A181A494D7D3A1A186A54CA1A1A1A182A290B6A1A1 +A1A187A34CA1A1A1A182A54CA1A1A1A182A348A1A1A1A18AA34CA1A1A1A182A64CA1A1A1 +A182A348A1A1A1A18AA44CA1A1A1A182A7484BA1A1A1A17180A893D7D4A1A187A448A1A1 +A1A18AA44BA1A1A1A184A748A1A1A1A18AA24BA1A1A1A184A948A1A1A1A18A4BA1A1A1A1 +84AB484AA1A1A1A1721580ABB648A1A1A1A17215C0A6D7D7C6A1A198CAFCB3B3B3B3B3B3 +B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3A1A14989A4A1A190BF7EA2A1A1488AA2A1A148 +8AA2A1A1488AA2A1A1488AA1A1488AA1A1488BA2A1A1488BA1A1C17EA1110320F8A1598C +A1598CA1113F7A7EA1598DA158C312F0A1100F22FEA1107FFAFFC0A10F07C512FCA156C5 +B512F0A155C5B712F0A10C07C5B912FCA152C5BD12F0A1070FC5C312FEA1C5C5C112E0B3 +ACA10FE0D7C6FCA107F0D7D51201A102C0D7D7CE7E>690 720 90 +847 767 84 D[<A1007E111FB600F0A10E3FB612E09F260FFFFE103FB800FEA10C7FB812 +FC9EB6100FBA00FEA10A1FBA12FC0D1FB757BC00F8A10803BC12F053B90F1FE1FFC0A107 +3FF3FF800A3FBA56BE00FCA10603BE12F80807BC0E0FE3FFC0A1051FF5FF80077FBD0E7F +0CFCA194C012F8050FBF0D03C16CA103071FFF93C10D1F0EF0A1033F20E0021FC29CC200 +FEA14AC212FC48C40C037B6CA1010721FFC50C1F10F0A1013F22E0A10C7F10FCA190C412 +F8A153C56C110323FFA10B07A100E0110FA112C0A10B1FA100F8113FA112F0A10B7FA100 +FEA0C5B412FCA152C5B51003A17FA10A07A102C00F0FA16D7EA10A1FA102F00F3FA114E0 +A152A16E57A180A199C5B600FE56C5B612FCA10903A16F6C0D07A115FFA1519726E00003 +77559726C0000789A1091F07E0C800070AF00D3F07C0C8000F1CE0A15106F8CA003F7555 +06F0CA6C87A198BACB00037554B948CB000787A15006F0DE007F08FF5406E006001BFEA1 +080795CD001F750B0F4DCD003F86A15005F80803755305F0080787A1083F05C00800750B +7F0580080187A1504CCF003F749AB800FCCF6C86A197B800F80A0F745205F00A1F86A107 +0305C076740A0705807686A14F94D0000174524CD0000386A14F04FC77745204F87786A1 +4F04F078745104E07786A14F04C00C1F745104800C3F86A196B8D26C7450B748D26C86A1 +4E04FC79745004F87986A14E04F079745004E07986A14E04C079745004807986A14E4C79 +745093D36C86A14E4BD46C5803FC8CC80007A14A4B7B73504B7B8592C76CA14803F07B74 +96B700E07B850500A1B7487B744E4C7B8606075804807B744E93D56C86DE007F5793D558 +5D070F574B7C744E4B7C8607015703F87C744E03F07C86736C564BA1565D081F564B7C74 +4E4B7C8608075603807D7395B7D78674A1D7A15A749DB648A16C734D4BA16C8574554BA1 +565D75544BA16C744C4BA16C8575544BA1754C4BA18775544BA16C554BA17E751080A175 +97D7C687A14C92D7C66C554AA17F75544AA1764C4AA188A14C4AA16D9CB648A17F759BB6 +48A1764B4BA188A14FA16D58A17F75534BA1764B4BA188A14B4BA16D544BA17F7553A17A +4BA18CA14FA1A1D7C7FCA14B92D7C86C534AA180A14B4AA1774B4AA1897655A1A15AA14B +4AA16F744A4AA16F85A14B4AA19EB65AA14EA1A15A7699B6A1707449A17386A14A4BA156 +5DA14EA1A1D7C9FCA14A92D7C96C74494AA17086A14A4AA1575CA2A14A4AA179494AA18B +A14DA17055A1827651A1A15AA14A4AA179494AA18BA14DA1A15AA14AA1A1B6FCA14DA170 +744CA17086A191B648A15692D7CAFCA2A14992D7CA525CA14CA10EFE4BA18CA149A17451 +A186A14CA1A15AA149A1A15AA14CA10EFF4BA18CA1494AA1575CA2A1494AA1575CA1A176 +A1A17EA1494AA19EB648A18CA2A1494AA1A1D7CBFCA2A193D7CC65A190B6FCA14BA1A148 +A18EA1B6A174A18FA14BA1A15AA2A14BA1A15AA2A14BA1A15AA2A14BA1A148A18EA3A14B +A1A15AA2A14BA1A1D7CDFCA2A1A177A1A17EA192D7CD64A2A14AA1A15AA1A1A1A1A181A2 +A14AA1A15AA3A14AA1A15AA4A14AA1A15AA3A14AA1A15AA4A14AA1A15AA5A14AA1A1D7CE +FCA5A191D7CE63A5A149A1A15AA7A149A1A15AABA149A1A15AB3B3B3B3B3B3B3B3B3B3B3 +B3B05274A15174A198BC7EA65274A198BC6CA15087A399BDA15075A15087A35176A14F75 +A15087A25176A14F76A14F875176A14F76A14F88A25176A14F76A14F885176A14F76A14F +885176A14F76A196BE7E5176A196BE6CA14E8950BF6CA105030BFFA106071DFE5078A14D +78A14D89081F0CF8A1053F0CF0A1057F1EE097C1A14CC000FEA10403C012FC070F0EF0A1 +031FE5FFE0A1033FF7FFC04EC36CA10103C3A10207C212FE4DC56C1103C5A10007C412FE +047FC5B500FE9EC5B600FC56C5B612F8C5BF4EC5BE00FE0603C5BE12FCB3AC0980CF0001 +A196D00003A14ED0120704F0D7C7000F0FE0D7C7001F0FC0D7C7123F01E0D7CD000709C0 +D7CD000F0980D7CD121F>830 470 94 597 887 109 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fc ecrm1000 64 2 +/Fc 2 110 df[<013FC5C5B612FEA649A1A181AA0AE0CA000109C0CA12030980CC000707 +F0CDFC90BA00F0CD000107C00807854FCF6C95CF123F07F0764D1C070780764D1C0006FC +D0A1121F06F0774D1D070680A11D004DD1A1133F4DA18B05F0784D1E074DA18B0580A11F +004893D2A16E814CA18D04F8A1210F4CA18D4CA18D4CA18D4CA18D93D3A181A24BA18F4B +A18FA2484AA17D80A24BA18FA24BA18FA24BA18FA24BA18FA392D4A18248A1A183A24AA1 +A17FA34AA1A17FA44AA1A17FA248A1A183A34AA1A17FA54AA1A17FA448A1A1834AA1A17F +A74AA1A17FA448A1A183A491D5A1177FA848A1A18349A1A181AB4848A1A16F1380A6D7A1 +94C8FCB3B3B3B3B3B3B3B3B3B3B3ACA14883A2A14883A2A14883A2A14883A1BA7E598511 +0719F05985117F19FF1007BC12F00F07BE12F00D03C212E098C5BA7EAF0BE0D7C61203> +345 360 109 487 384 84 D[<E007E00703B500F80F3FB57E96B597B700F80D0FB77E05 +0FB6070FDCFFC09BB812FC4BB896B900FC0B0FEFFFC0021FB90603DEFF800A3F18F80003 +BB061F07F051BBFCBC067F07FC09071AC056BC6C081F1AF80E0709E0087F1AFE0E1F754F +BDFC0E7F09FC07071CC055BE071F1CF00D079226FE000F71067FDBE00083550380D9007F +04E095B600F8C7000716FE0D3F02F8C8000F70050303800200825502800301704D02F8C9 +001F829CB500FCCA6C6F4D02C00407820C0302F0051F6F053F91CA0001825402C0716F4D +01FC71825491CB00037093B500F0063F815401FC72704B02C072815401F072704B91CC6C +81C7003F5149736F4B497381DA007F97B50080736F4B01F8738203074F91CD505B03004F +01FC746F4B01C07382704E49746F4B497382041F4E499FB5CEFC704E49746F4A49758170 +4E018074704901F875815390CE4F5B704E48757049497581704FA15A52497A49498B5249 +754E90CF7E704D497A49488CA25249764D488852497A48498D9BD061714C48776F484976 +820A7F6B53A15A5248585BA17103FE798209E1495890D0FC536B09E3E9FF3F8F536B09E7 +49774C4889A209EF90D14D5AA1A188E1FFFEA15AA252A15AA352784D8AA252A1D282A352 +6BA3526BA3526BA499D25FA551A15AA751A15AB3B3B3B3B3B3AD94B76C55709CB77EA44C +7055705482A24C71547054834C71547054834C719BB86C54834C715371548393B900FE0B +0F06E09AB912FE030FDEFFE099BA00FE0A0FF0FFE0020FBC00E097BC00FE080FBC12E0C1 +00FE030FC100E092C112FEAF01E0D0000F4DD106E0D0120F>415 +235 111 362 444 109 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fd cmr10 64 2 +/Fd 2 110 df[<013FC5C5B612FEA649A1A181AA0AE0CA000109C0CA12030980CC000707 +F0CDFC90BA00F0CD000107C00807854FCF6C95CF123F07F0764D1C070780764D1C0006FC +D0A1121F06F0774D1D070680A11D004DD1A1133F4DA18B05F0784D1E074DA18B0580A11F +004893D2A16E814CA18D04F8A1210F4CA18D4CA18D4CA18D4CA18D93D3A181A24BA18F4B +A18FA2484AA17D80A24BA18FA24BA18FA24BA18FA24BA18FA392D4A18248A1A183A24AA1 +A17FA34AA1A17FA44AA1A17FA248A1A183A34AA1A17FA54AA1A17FA448A1A1834AA1A17F +A74AA1A17FA448A1A183A491D5A1177FA848A1A18349A1A181AB4848A1A16F1380A6D7A1 +94C8FCB3B3B3B3B3B3B3B3B3B3B3ACA14883A2A14883A2A14883A2A14883A1BA7E598511 +0719F05985117F19FF1007BC12F00F07BE12F00D03C212E098C5BA7EAF0BE0D7C61203> +345 360 109 487 384 84 D[<E007E00703B500F80F3FB57E96B597B700F80D0FB77E05 +0FB6070FDCFFC09BB812FC4BB896B900FC0B0FEFFFC0021FB90603DEFF800A3F18F80003 +BB061F07F051BBFCBC067F07FC09071AC056BC6C081F1AF80E0709E0087F1AFE0E1F09F8 +4FBD7E0E7F7507078855BE071F1CF00D079226FE000F71067FDBE00083550380D9007F04 +E095B600F8C7000716FE0D3F02F8C8000F70050303800200825502800301704D02F8C900 +1F829CB500FCCA6C6F4D02C00407820C0302F0051F6F053F91CA0001825402C0716F4D01 +FC71825491CB00037093B500F0063F815401FC72704B02C072815401F072704B91CC6C81 +C7003F5149736F4B497381DA007F97B50080736F4B01F8738203074F91CD505B03004F01 +FC746F4B01C07382704E49746F4B497382041F4E499FB5CEFC704E49746F4A497581704E +018074704901F875815390CE4F5B704E48757049497581704FA15A52497A49498B524975 +4E90CF7E704D497A49488CA25249764D488852497A48498D9BD061714C48776F48497682 +0A7F6B53A15A5248585BA17103FE798209E1495890D0FC536B09E3E9FF3F8F536B09E749 +774C4889A209EF90D14D5AA1A188E1FFFEA15AA252A15AA352784D8AA252A1D282A3526B +A3526BA3526BA499D25FA551A15AA751A15AB3B3B3B3B3B3AD94B76C55709CB77EA44C70 +55705482A24C71547054834C71547054834C719BB86C54834C715371548393B900FE0B0F +06E09AB912FE030FDEFFE099BA00FE0A0FF0FFE0020FBC00E097BC00FE080FBC12E0C100 +FE030FC100E092C112FEAF01E0D0000F4DD106E0D0120F>415 235 +111 362 444 109 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fe ecrm1000 32 2 +/Fe 2 110 df[<0007C5B412FCA648A17FA24CC800074BC812070480030003F0ED003F03 +F8CA6C4A160303C0F7007F92CB6C4A171F4A210702F88D4A8D02C0F9007F4A223F48A16C +7E91CCFC498FA17F5BA17F5BA2498FA3498F003FA11480A349A1127FA549A1123FA4007F +A114C0A390CD1D1FA900FEA1EB0FE0A6CE9AC7FCB3B3B3B3B3AF5180A298B67E50815081 +081FEDFF80071FB97E040FBFFCA70780CB121F>171 180 118 307 +192 84 D<047E922603FFFC96B5FC91260FFFFE033FD9FFE0050F14F848B64BB600FC05 +7F14FFB70307DBFF804BB712E0071F04E0030716F8077F04F8031F16FE4E4848C66E037F +D9803F7F4E01C0010F6D9227FFF00003804E48C700036D4A0180010080DE1FF86E6ED907 +FEC86C7FDE3FE06E6ED90FF86F7FD8000F4C486F6D49486F7F01004CC96C6DD93FC06F7F +023F4A48706D49486F7F6E4A4850C9FC4E706D49707F6E4A484F5A4D48706D484870806E +4A484F5A4E06FF49854DCA4B5A7786057E505A057C089FCB8005FC1ABF4D1ABE04FF7202 +FE844D62A1834D62A34D62A34D62A594CB5DB3B3B3AA4A6E4D6E95B57EA24A6E4D6E4D80 +027F02F0051F02FC050714FF0107B74CB700C0047F15F0BA00F8013FB900FE010FBA1280 +A701F8C94CC9003F0480C8120FD17579F4DE>109 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Ff cmr10 32 2 +/Ff 2 110 df[<0007C5B412FCA648A17FA24CC800074BC812070480030003F0ED003F03 +F8CA6C4A160303C0F7007F92CB6C4A171F4A210702F88D4A8D02C0F9007F4A223F48A16C +7E91CCFC498FA17F5BA17F5BA2498FA3498F003FA11480A349A1127FA549A1123FA4007F +A114C0A390CD1D1FA900FEA1EB0FE0A6CE9AC7FCB3B3B3B3B3B05180A298B67E50815081 +081FEDFF80071FB97E040FBFFCA70780CB121F>171 181 118 308 +192 84 D<047E922603FFFC96B5FC91260FFFFE033FD9FFE0050F14F848B64BB600FC05 +7F14FFB70307DBFF804BB712E0071F04E0030716F8077F04F8031F16FE4E4848C66E037F +D9803F7F4E01C0010F6D9227FFF00003804E48C700036D4A0180010080DE1FF86E6ED907 +FEC86C7FDE3FE06E6ED90FF86F7FD8000F4C486F6D49486F7F01004CC96C6DD93FC06F7F +023F4A48706D49486F7F6E4A4850C9FC4E706D49707F6E4A484F5A4D48706D484870806E +4A484F5A4E06FF49854DCA4B5A7786057E505A057C089FCB8005FC1ABF4D1ABE04FF7202 +FE844D62A1834D62A34D62A34D62A594CB5DB3B3B3AA4A6E4D6E95B57EA24A6E4D6E4D80 +027F02F0051F02FC050714FF0107B74CB700C0047F15F0BA00F8013FB900FE010FBA1280 +A701F8C94CC9003F0480C8120FD17579F4DE>109 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fg ecrm1000 17 2 +/Fg 2 110 df<001FBDFCA5489026E0000701FCC7148049C7000101F0140F01F8190301 +E01900491A7F491A3F90C8181FA2003E1B0FA348F307C0A400781B03A748F301E0A5C995 +C7FCB3B3B34C7F4C7F043FEBFF80021FB9FCA55B5F7BDE66>84 D<D901F0D90FFEED1FFC +D807FF91267FFFC091B57EB549B500F0010314E0922707F81FFC90390FF03FF892270FC0 +07FE90391F800FFC92271F0001FF90393E0003FE033CDB80788000014A6D4A7FD8007F49 +DBC1E08190263FF1E091267FC3C07F90261FF3C0DBE780814B93C8FC02F716EF92C8D83F +FE6F7E14FF4A5EA24A5EA44A5EB3B1496C4B6C4B7E90B5912601FFFE020313FCB748B6D8 +FE03B612FCA56E3F7BBE77>109 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fh cmr10 17 2 +/Fh 2 110 df<001FBDFCA5489026E0000701FCC7148049C7000101F0140F01F8190301 +E01900491A7F491A3F90C8181FA2003E1B0FA348F307C0A400781B03A748F301E0A5C995 +C7FCB3B3B34C7F4C7F043FEBFF80021FB9FCA55B5F7BDE66>84 D<D901F0D90FFEED1FFC +D807FF91267FFFC091B57EB549B500F0010314E0922707F81FFC90390FF03FF892270FC0 +07FE90391F800FFC92271F0001FF90393E0003FE033CDB80788000014A6D4A7FD8007F49 +DBC1E08190263FF1E091267FC3C07F90261FF3C0DBE780814B93C8FC02F716EF92C8D83F +FE6F7E14FF4A5EA24A5EA44A5EB3B1496C4B6C4B7E90B5912601FFFE020313FCB748B6D8 +FE03B612FCA56E3F7BBE77>109 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fi ecrm1000 14 2 +/Fi 2 110 df<003FBB1280A49026FE00019038F0000F01E06D49130049187F48C8EE1F +C0007E190F007C1907A200781903A400701901A500F01AE0481900A6C91700B3B3A94B7F +030F13FE49B812F0A44B4E7CCD54>84 D<01FFD907FCEC07FCB590263FFF8090383FFF80 +92B500E090B512E0913D03F00FF803F00FF8913D07C007FC07C007FC000349C66C6C48C6 +6C7EC6011E0101011E13016D486D6C486D7E4A5D0270157002F0DA7FF06E7E4A5DA24A5D +A34A5DB3AB496C4A6C4A7E486D496D497FB600C0B600C0B612C0A45A337CB261>109 +D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fj cmr10 14 2 +/Fj 2 110 df<003FBB1280A49026FE00019038F0000F01E06D49130049187F48C8EE1F +C0007E190F007C1907A200781903A400701901A500F01AE0481900A6C91700B3B3A94B7F +030F13FE49B812F0A44B4E7CCD54>84 D<01FFD907FCEC07FCB590263FFF8090383FFF80 +92B500E090B512E0913D03F00FF803F00FF8913D07C007FC07C007FC000349C66C6C48C6 +6C7EC6011E0101011E13016D486D6C486D7E4A5D0270157002F0DA7FF06E7E4A5DA24A5D +A34A5DB3AB496C4A6C4A7E486D496D497FB600C0B600C0B612C0A45A337CB261>109 +D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fk ecrm1000 12 2 +/Fk 2 110 df<003FB912F8A3903BF8003FF8003F01C06D48130790C71501007EEF00FC +007C187CA20078183CA20070181CA648180EA5C81600B3B3A44B7EEDFFFE0107B712C0A3 +3F437CC248>84 D<D801FCD97FC0EB07FC00FF902601FFF890381FFF8091260780FE9038 +780FE0913C1E007F01E007F000030138903A3F838003F800014990391F87000100004902 +CE804A14CC01FDDA0FFC6D7E4A5C13FF91C75BA3495DB3A8486C4A6C497EB5D8FE0FB500 +E0B512FEA34F2C7DAB54>109 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fl cmr10 12 2 +/Fl 2 110 df<003FB912F8A3903BF8003FF8003F01C06D48130790C71501007EEF00FC +007C187CA20078183CA20070181CA648180EA5C81600B3B3A44B7EEDFFFE0107B712C0A3 +3F437CC248>84 D<D801FCD97FC0EB07FC00FF902601FFF890381FFF8091260780FE9038 +780FE0913C1E007F01E007F000030138903A3F838003F800014990391F87000100004902 +CE804A14CC01FDDA0FFC6D7E4A5C13FF91C75BA3495DB3A8486C4A6C497EB5D8FE0FB500 +E0B512FEA34F2C7DAB54>109 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fm ecrm1000 7 2 +/Fm 2 110 df<007FB612F0A2397E00F803007814000070157000601530A200E0153848 +1518A5C71400B3A6497E90B512F8A225287EA72A>84 D<3A0F07E007E03AFF1FF81FF890 +39383C383C3A1F601E601ED80F401340496C487EA201001300B13BFFF0FFF0FFF0A22C1A +7E9931>109 D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fn cmr10 7 2 +/Fn 2 110 df<007FB612F0A2397E00F803007814000070157000601530A200E0153848 +1518A5C71400B3A6497E90B512F8A225287EA72A>84 D<3A0F07E007E03AFF1FF81FF890 +39383C383C3A1F601E601ED80F401340496C487EA201001300B13BFFF0FFF0FFF0A22C1A +7E9931>109 D E +%EndDVIPSBitmapFont +/Fo 7[42 17[55 37 112[23 32 28 1[42 42 42 65 3[23 2[28 +37 3[37 12[51 1[55 13[60 11[42 10[28 3[28 28 36[46 46 +2[{ TeXBase1Encoding ReEncodeFont }23 83.022 /Times-Roman +rf +%DVIPSBitmapFont: Fp ecrm1000 10 21 +/Fp 21 249 df<EC0FF8EC7FFE903901F80780903907E001C090391F8000E090383F0007 +017E497EA25BA2485A6F5AED018092C8FCA9ED03F0B7FCA33901F8000F1503B3AA486C49 +7E267FFFE0B512C0A32A3B7FBA2E>28 D<EC0FFC91387FFF70903901F803F0903807E007 +90381F800FEB3F00137EA25B150748481303ADB7FCA33901F80003B3AB486C497E267FFF +E0B512C0A32A3B7FBA2E>I<DA0FF0EB1FF0DA7FFEEBFFFC903B01F80F83F00F903C07E0 +01CFC00380903C1F8000FF0001C090273F0007FE130F017E4948497EA2495CA248485C03 +076E5A03030203C7FC95C8FCA9F007E0BAFCA33C01F80003F0001F1807B3AA486C496C49 +7E267FFFE0B500C1B51280A3413B7FBA45>I<DA0FF8EB1FF8DA7FFF9038FFFEE0903B01 +F80783F007903B07E001CFC00F903B1F8007FF001F4948485A017E5CA2495C180F48486D +4813071503ACBAFCA33C01F80003F00007B3AB486C496C497E267FFFE0B500C1B51280A3 +413B7FBA45>I<121C127FEAFF80A8EA7F00AB123EAB121CABC7FCA8121C127FEAFF80A5 +EA7F00121C093C79BB17>33 D<146014E0EB01C0EB0380EB0700130E131E5B5BA25B485A +A2485AA212075B120F90C7FCA25A121EA2123EA35AA65AB2127CA67EA3121EA2121F7EA2 +7F12077F1203A26C7EA26C7E1378A27F7F130E7FEB0380EB01C0EB00E01460135278BD20 +>40 D<12C07E12707E7E7E120F6C7E6C7EA26C7E6C7EA21378A2137C133C133E131EA213 +1F7FA21480A3EB07C0A6EB03E0B2EB07C0A6EB0F80A31400A25B131EA2133E133C137C13 +78A25BA2485A485AA2485A48C7FC120E5A5A5A5A5A13527CBD20>I<B712C016F816FE00 +0190398001FF806C90C7EA3FE0EE0FF0EE03F8707E707E177FA2EF3F8018C0171F18E017 +0F18F0A3EF07F8A418FCAC18F8A4EF0FF0A218E0A2171F18C0EF3F80A2EF7F0017FE4C5A +4C5AEE0FF0EE3FE0486DEBFF80B8C7FC16F816C036397DB83F>68 +D<B648B512FEA30001902680000313006C90C76C5AB3A491B6FCA391C71201B3A6486D49 +7EB648B512FEA337397DB83E>72 D<003FB812E0A3D9C003EB001F273E0001FE130348EE +01F00078160000701770A300601730A400E01738481718A4C71600B3B0913807FF80011F +B612E0A335397DB83C>84 D<EB03FC90381FFF8090387E03E03901F80070484813F83907 +E001FC380FC003A2EA1F80123F90380001F848EB00F01500A2127E12FEAA127E127FA26C +14067F001F140E6D130C000F141C6C6C13386C6C13706C6C13E039007C07C090381FFF00 +EB07F81F277DA525>99 D<EB07F8EB1FFF90387C0FC03901F803E03903F001F0D807E013 +F8380FC0004848137CA248C7127E153E5A153F127E12FEA3B7FCA248C8FCA5127EA2127F +A26C14037F001F14076C6C13060007140E6D131CD801F013386C6C137090387E03E09038 +1FFF80903803FC0020277EA525>101 D<EA0380EA0FE0487EA56C5AEA0380C8FCAAEA03 +F012FFA312071203B3AA487EB512C0A312387EB717>105 D<2703F00FF0EB1FE000FFD9 +3FFCEB7FF8913AF03F01E07E903BF1C01F83803F3D0FF3800FC7001F802603F70013CE01 +FE14DC49D907F8EB0FC0A2495CA3495CB3A3486C496CEB1FE0B500C1B50083B5FCA34025 +7EA445>109 D<3903F00FF000FFEB3FFCECF03F9039F1C01F803A0FF3800FC03803F700 +13FE496D7EA25BA35BB3A3486C497EB500C1B51280A329257EA42E>I<3807E01F00FFEB +7FC09038E1E3E09038E387F0380FE707EA03E613EE9038EC03E09038FC0080491300A45B +B3A2487EB512F0A31C257EA421>114 D<EBFF03000313E7380F80FF381E003F487F487F +00707F12F0A2807EA27EB490C7FCEA7FE013FF6C13E06C13F86C7F00037FC67F01071380 +EB007F141F00C0EB0FC01407A26C1303A37E15806C13077EEC0F00B4131E38F3C07C38E1 +FFF038C03F801A277DA521>I<1318A51338A31378A313F8120112031207001FB5FCB6FC +A2D801F8C7FCB215C0A93800FC011580EB7C03017E13006D5AEB0FFEEB01F81A347FB220 +>I<EB0FC0EB3FF0EB7018EBC00C48487EA56C6C5AEB7018EB3FF0EB0FC090C9FCA4EB1F +E0EBFFFC3803E03F3907000F80390F8007E0486C6C7E13E06E7EA26E7E6C5A6C5AC8FCA4 +147FEB07FFEB3FE0EBFE00EA03F8EA0FF0EA1FC0123F485A90C7FC160C12FEA31401A26C +13036CEB077C903980063E18383FC01E3A0FE0781FF03A03FFF00FE03A007F8007C02638 +7DB62A>229 D<D91FE0EB07F0D9FFFCEB3FFC2603E03FEBF81F3C07000F81F00F803C0F +8007E3E007C0281FC003F7C013E001E09039FF8003F06E1300EF01F8806C485B6C5AC8EC +00FC5DA4023FB6FC0107B7FC90263FF0FCC8FC3801FE00EA07F8EA0FE0485A485A007F14 +7E90C7FC5A48170C157F4B141C7013184A6D1338007FD903E7147090278007C3E013E03C +3FC00F81F001C03C0FE03E007C07802603FFF890381FFE0026007FC0EB03F836277DA53C +>I<ED0180ED03005D1506150E150C903803F81C90381FFF1890387C07F0EBF0013903E0 +00F85B48487F390F0001DE48149F001EEB038F003EEC0F801406007E15C0007CEB0C0714 +1C00FC011813E0143814301460A214C0A2EB018013031400D87C0714C01306D87E0C130F +003E15805BD81F38EB1F00D80F30131E01F0133E6C485B00035C6C6C485A9038FC07C0D9 +9FFFC7FC380307FC48C9FC1206120E120C121C12185A23347DAB2A>248 +D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fq cmr10 10 37 +/Fq 37 123 df<EC0FF8EC7FFE903901F80780903907E001C090391F8000E090383F0007 +017E497EA25BA2485A6F5AED018092C8FCA9ED03F0B7FCA33901F8000F1503B3AA486C49 +7E267FFFE0B512C0A32A3B7FBA2E>12 D<EC0FFC91387FFF70903901F803F0903807E007 +90381F800FEB3F00137EA25B150748481303ADB7FCA33901F80003B3AB486C497E267FFF +E0B512C0A32A3B7FBA2E>I<DA0FF0EB1FF0DA7FFEEBFFFC903B01F80F83F00F903C07E0 +01CFC00380903C1F8000FF0001C090273F0007FE130F017E4948497EA2495CA248485C03 +076E5A03030203C7FC95C8FCA9F007E0BAFCA33C01F80003F0001F1807B3AA486C496C49 +7E267FFFE0B500C1B51280A3413B7FBA45>I<DA0FF8EB1FF8DA7FFF9038FFFEE0903B01 +F80783F007903B07E001CFC00F903B1F8007FF001F4948485A017E5CA2495C180F48486D +4813071503ACBAFCA33C01F80003F00007B3AB486C496C497E267FFFE0B500C1B51280A3 +413B7FBA45>I<EA07C0EA1FF0EA3838EA600CA2EAC006A5EA600CA2EA3838EA1FF0EA07 +C00F0F69BB3E>23 D<D91FE0EB07F0D9FFFCEB3FFC2603E03FEBF81F3C07000F81F00F80 +3C0F8007E3E007C0281FC003F7C013E001E09039FF8003F06E1300EF01F8806C485B6C5A +C8EC00FC5DA4023FB6FC0107B7FC90263FF0FCC8FC3801FE00EA07F8EA0FE0485A485A00 +7F147E90C7FC5A48170C157F4B141C7013184A6D1338007FD903E7147090278007C3E013 +E03C3FC00F81F001C03C0FE03E007C07802603FFF890381FFE0026007FC0EB03F836277D +A53C>26 D<ED0180ED03005D1506150E150C903803F81C90381FFF1890387C07F0EBF001 +3903E000F85B48487F390F0001DE48149F001EEB038F003EEC0F801406007E15C0007CEB +0C07141C00FC011813E0143814301460A214C0A2EB018013031400D87C0714C01306D87E +0C130F003E15805BD81F38EB1F00D80F30131E01F0133E6C485B00035C6C6C485A9038FC +07C0D99FFFC7FC380307FC48C9FC1206120E120C121C12185A23347DAB2A>28 +D<121C127FEAFF80A8EA7F00AB123EAB121CABC7FCA8121C127FEAFF80A5EA7F00121C09 +3C79BB17>33 D<146014E0EB01C0EB0380EB0700130E131E5B5BA25B485AA2485AA21207 +5B120F90C7FCA25A121EA2123EA35AA65AB2127CA67EA3121EA2121F7EA27F12077F1203 +A26C7EA26C7E1378A27F7F130E7FEB0380EB01C0EB00E01460135278BD20>40 +D<12C07E12707E7E7E120F6C7E6C7EA26C7E6C7EA21378A2137C133C133E131EA2131F7F +A21480A3EB07C0A6EB03E0B2EB07C0A6EB0F80A31400A25B131EA2133E133C137C1378A2 +5BA2485A485AA2485A48C7FC120E5A5A5A5A5A13527CBD20>I<EB03F8EB1FFF90387E0F +C09038F803E03901E000F0484813780007147C48487FA248C77EA2481580A3007EEC0FC0 +A600FE15E0B3007E15C0A4007F141F6C1580A36C15006D5B000F143EA26C6C5B6C6C5B6C +6C485A6C6C485A90387E0FC0D91FFFC7FCEB03F8233A7DB72A>48 +D<EB01C013031307131F13FFB5FCA2131F1200B3B3A8497E007FB512F0A31C3879B72A> +I<EB0FF0EB7FFE48B57E3903E03FE0390F000FF0000E6D7E486D7E486D7E123000706D7E +126012FCB4EC7F807FA56CC7FC121CC8FCEDFF00A34A5A5D14035D4A5A5D140F4A5A4A5A +92C7FC147C5C495A495A495A495A91C8FC011EEB01805B5B49130348481400485A485A00 +0EC75A000FB6FC5A5A485CB6FCA321387CB72A>I<EB07F8EB3FFF4913C03901F80FF039 +03C007F848486C7E380E0001000F80381FE0006D7FA56C5A6C5AC85A1401A25D4A5AA24A +5A5DEC0F80027EC7FCEB1FFCECFF809038000FE06E7EEC01FC816E7EED7F80A216C0A215 +3F16E0A2121EEA7F80487EA416C049137F007F1580007EC7FC0070ECFF006C495A121E39 +0F8003F83907F00FF00001B512C06C6C90C7FCEB0FF8233A7DB72A>I<1538A2157815F8 +A2140114031407A2140F141F141B14331473146314C313011483EB030313071306130C13 +1C131813301370136013C01201EA038013005A120E120C5A123812305A12E0B712F8A3C7 +3803F800AB4A7E0103B512F8A325397EB82A>I<EC3FC0903801FFF0010713FC90380FE0 +3E90383F800790387E001F49EB3F804848137F485AA2485A000FEC3F0049131E001F91C7 +FCA2485AA3127F90C9FCEB01FC903807FF8039FF1E07E090383801F0496C7E01607F01E0 +137E497FA249148016C0151FA290C713E0A57EA56C7E16C0A2121FED3F807F000F15006C +6C5B15FE6C6C5B6C6C485A3900FE07F090383FFFC06D90C7FCEB03FC233A7DB72A>54 +D<12301238123E003FB612E0A316C05A168016000070C712060060140E5D151800E01438 +485C5D5DC712014A5A92C7FC5C140E140C141C5CA25CA214F0495AA21303A25C1307A213 +0FA3495AA3133FA5137FA96DC8FC131E233B7BB82A>I<EB03F8EB1FFF017F13C09038FC +07F03901E001F848486C7E4848137C90C77E48141E000E141F001E80A3121FA27F5D01E0 +131E6C6C133E01FC133C6D5B6C6C6C5AECC1E06CEBF3C06C01FFC7FC6C5BEB3FFF6D13C0 +81017F13F801F07F3903E07FFE3907801FFF48486C1380481303003E6D13C0003CEB007F +007C143F0078EC0FE000F814075A1503A21501A36C15C012781503007C15806CEC07006C +5C6C6C131ED807E0137C3903F803F0C6B55A013F1380D907FCC7FC233A7DB72A>I<121C +127FEAFF80A5EA7F00121CC7FCB2121C127FEAFF80A5EA7F00121C092479A317>58 +D<B712C016F816FE000190398001FF806C90C7EA3FE0EE0FF0EE03F8707E707E177FA2EF +3F8018C0171F18E0170F18F0A3EF07F8A418FCAC18F8A4EF0FF0A218E0A2171F18C0EF3F +80A2EF7F0017FE4C5A4C5AEE0FF0EE3FE0486DEBFF80B8C7FC16F816C036397DB83F>68 +D<B648B512FEA30001902680000313006C90C76C5AB3A491B6FCA391C71201B3A6486D49 +7EB648B512FEA337397DB83E>72 D<D90FF813C090383FFE0190B512813903F807E33907 +E000F74848137F4848133F48C7121F003E140F007E1407A2007C140312FC1501A36C1400 +A37E6D14006C7E7F13F86CB47E6C13F8ECFF806C14E06C14F86C14FEC680013F14800107 +14C0EB007F020713E0EC007FED3FF0151F150FED07F8A200C01403A21501A37EA216F07E +15036C15E06C14076C15C06C140F6DEB1F80D8FBF0EB3F00D8F0FE13FE39E03FFFF8010F +13E0D8C00190C7FC253D7CBA2E>83 D<003FB812E0A3D9C003EB001F273E0001FE130348 +EE01F00078160000701770A300601730A400E01738481718A4C71600B3B0913807FF8001 +1FB612E0A335397DB83C>I<EB1FE0EBFFFC3803E03F3907000F80390F8007E0486C6C7E +13E06E7EA26E7E6C5A6C5AC8FCA4147FEB07FFEB3FE0EBFE00EA03F8EA0FF0EA1FC0123F +485A90C7FC160C12FEA31401A26C13036CEB077C903980063E18383FC01E3A0FE0781FF0 +3A03FFF00FE03A007F8007C026277DA52A>97 D<EB03FC90381FFF8090387E03E03901F8 +0070484813F83907E001FC380FC003A2EA1F80123F90380001F848EB00F01500A2127E12 +FEAA127E127FA26C14067F001F140E6D130C000F141C6C6C13386C6C13706C6C13E03900 +7C07C090381FFF00EB07F81F277DA525>99 D<ED0FC0EC03FFA3EC003F150FB0EB03F8EB +1FFF90387E078F9038F801EF3903F0007F4848133F4848131FA24848130F123F90C7FC5A +A2127E12FEAA127E127FA27EA26C6C131FA26C6C133F6C6C137F6C6CEBEFF03A01F801CF +FF39007C078F90381FFE0FD907F813C0283B7DB92E>I<EB07F8EB1FFF90387C0FC03901 +F803E03903F001F0D807E013F8380FC0004848137CA248C7127E153E5A153F127E12FEA3 +B7FCA248C8FCA5127EA2127FA26C14037F001F14076C6C13060007140E6D131CD801F013 +386C6C137090387E03E090381FFF80903803FC0020277EA525>I<147E903803FF809038 +0FC1E0EB1F8790383F0FF0137EA213FCA23901F803C091C7FCADB512FCA3D801F8C7FCB3 +AB487E387FFFF8A31C3B7FBA19>I<EA0380EA0FE0487EA56C5AEA0380C8FCAAEA03F012 +FFA312071203B3AA487EB512C0A312387EB717>105 D<EA03F012FFA3120F1203B3B3AD +487EB512C0A3123A7EB917>108 D<2703F00FF0EB1FE000FFD93FFCEB7FF8913AF03F01 +E07E903BF1C01F83803F3D0FF3800FC7001F802603F70013CE01FE14DC49D907F8EB0FC0 +A2495CA3495CB3A3486C496CEB1FE0B500C1B50083B5FCA340257EA445>I<3903F00FF0 +00FFEB3FFCECF03F9039F1C01F803A0FF3800FC03803F70013FE496D7EA25BA35BB3A348 +6C497EB500C1B51280A329257EA42E>I<EB03FE90380FFF8090383E03E09038F800F848 +48137C48487F48487F4848EB0F80001F15C090C712074815E0A2007EEC03F0A400FE15F8 +A9007E15F0A2007F14076C15E0A26C6CEB0FC0000F15806D131F6C6CEB3F006C6C137EC6 +6C13F890387E03F090381FFFC0D903FEC7FC25277EA52A>I<3807E01F00FFEB7FC09038 +E1E3E09038E387F0380FE707EA03E613EE9038EC03E09038FC0080491300A45BB3A2487E +B512F0A31C257EA421>114 D<EBFF03000313E7380F80FF381E003F487F487F00707F12 +F0A2807EA27EB490C7FCEA7FE013FF6C13E06C13F86C7F00037FC67F01071380EB007F14 +1F00C0EB0FC01407A26C1303A37E15806C13077EEC0F00B4131E38F3C07C38E1FFF038C0 +3F801A277DA521>I<1318A51338A31378A313F8120112031207001FB5FCB6FCA2D801F8 +C7FCB215C0A93800FC011580EB7C03017E13006D5AEB0FFEEB01F81A347FB220>I<003F +B512FCA2EB8003D83E0013F8003CEB07F00038EB0FE012300070EB1FC0EC3F800060137F +150014FE495AA2C6485A495AA2495A495A495AA290387F000613FEA2485A485A0007140E +5B4848130C4848131CA24848133C48C7127C48EB03FC90B5FCA21F247EA325>122 +D E +%EndDVIPSBitmapFont +%DVIPSBitmapFont: Fr cmbx10 10 23 +/Fr 23 123 df<B61280A819087F9620>45 D<167016F8A2150116F0A2150316E0150716 +C0A2150F1680151F16005D153EA2157E157C15FC5DA214015D14035DA214075D140F5D14 +1F92C7FCA25C143E147E147CA214FC5C13015CA213035C13075CA2130F5C131F91C8FC5B +133EA2137E137C13FC5BA212015B12035BA212075B120F5B121F90C9FCA25A123E127E12 +7CA212FC5AA2127025537BBD30>47 D<141E143E14FE1307133FB5FCA313CFEA000FB3B3 +A6007FB61280A4213779B630>49 D<B812C017FC17FF18C028007FF000037F04007F717E +717E171F84A2717EA74D5AA260173F4D5A4D5A4C13C0040F5B91B600FCC7FCA2EFFF8002 +F0C713F0EF3FF8717E717E717E19807113C0A319E0A719C0A25F4D138019005FEF7FFE4C +485AB912F018C095C7FC17F03B397DB844>66 D<D907FF130E013FEBE01E90B5EAF83E00 +03ECFE7E3A07FC01FFFE390FF0001F4848130F48481303491301007F140090C8FC167E5A +163EA27F161E7F7F6D91C7FC13FC387FFFE014FEECFFF06C14FE6F7E6C816C15F06C816C +81C681133F010F801301D9000F1480EC007F030F13C01503818100F0157FA3163FA27E17 +807E167F6C16007E6D14FE01E0495A01F813039039FF801FF800FC90B512E0D8F83F5CD8 +F00749C7FC39E0007FF02A3B7BB935>83 D<EB3FFE0003B512E0000F14F8391FF00FFE00 +3FEB03FF6D6C7F6E7FA26F7EA26C5A6C5AEA0380C8FCA2EC3FFF010FB5FC137F3901FFF8 +7F00071380380FFE00EA3FF85B485A12FF5BA415FF6D5A127F263FF00713F83B1FFC1FBF +FFC0390FFFFE1F0003EBF80F39003FE0032A257DA42E>97 D<903801FFC0010F13FC017F +13FFD9FF8013802603FE0013C048485AEA0FF8121F13F0123F6E13804848EB7F00151C92 +C7FC12FFA9127FA27F123FED01E06C7E15036C6CEB07C06C6C14806C6C131FC69038C07E +006DB45A010F13F00101138023257DA42A>99 D<EE7F80ED7FFFA4150381AF903801FF81 +010F13F1013F13FD9038FFC07F0003EB001FD807FC1307000F8048487F5B123FA2485AA3 +12FFAA127FA27F123FA26C6C5B000F5C6C6C5B6C6C4913C02701FF80FD13FE39007FFFF9 +011F13E1010313012F3A7DB935>I<903803FF80011F13F0017F13FC3901FF83FE3A03FE +007F804848133F484814C0001FEC1FE05B003FEC0FF0A2485A16F8150712FFA290B6FCA3 +01E0C8FCA4127FA36C7E1678121F6C6C14F86D14F000071403D801FFEB0FE06C9038C07F +C06DB51200010F13FC010113E025257DA42C>I<EC1FF0903801FFFC010713FF90391FF8 +7F8090383FE0FFD9FFC113C0A2481381A24813016E1380A2ED3E0092C7FCA8B6FCA40003 +90C8FCB3ABB512FEA4223A7DB91D>I<161FD907FEEBFFC090387FFFE348B6EAEFE02607 +FE07138F260FF801131F48486C138F003F15CF4990387FC7C0EEC000007F81A6003F5DA2 +6D13FF001F5D6C6C4890C7FC3907FE07FE48B512F86D13E0261E07FEC8FC90CAFCA2123E +123F7F6C7E90B512F8EDFF8016E06C15F86C816C815A001F81393FC0000F48C813804815 +7F5A163FA36C157F6C16006D5C6C6C495AD81FF0EB07FCD807FEEB3FF00001B612C06C6C +91C7FC010713F02B377DA530>I<13FFB5FCA412077EAFED7FC0913803FFF8020F13FE91 +381F03FFDA3C01138014784A7E4A14C05CA25CA291C7FCB3A3B5D8FC3F13FFA4303A7DB9 +35>I<EA01F0EA07FC487EA2487EA56C5AA26C5AEA01F0C8FCA913FF127FA412077EB3A9 +B512F8A4153B7DBA1B>I<13FFB5FCA412077EAF92380FFFE0A4923803FC0016F0ED0FE0 +ED1F804BC7FC157E5DEC03F8EC07E04A5A141FEC7FE04A7E8181A2ECCFFEEC0FFF496C7F +806E7F6E7F82157F6F7E6F7E82150F82B5D8F83F13F8A42D3A7EB932>107 +D<13FFB5FCA412077EB3B3ACB512FCA4163A7DB91B>I<01FEEB7FC000FF903803FFF802 +0F13FE91381F03FFDA3C011380000713780003497E6D4814C05CA25CA291C7FCB3A3B5D8 +FC3F13FFA430257DA435>110 D<903801FFC0010F13F8017F13FFD9FF807F3A03FE003F +E048486D7E48486D7E48486D7EA2003F81491303007F81A300FF1680A9007F1600A3003F +5D6D1307001F5DA26C6C495A6C6C495A6C6C495A6C6C6CB45A6C6CB5C7FC011F13FC0101 +13C029257DA430>I<90383FF0383903FFFEF8000F13FF381FC00F383F0003007E130100 +7C130012FC15787E7E6D130013FCEBFFE06C13FCECFF806C14C06C14F06C14F81203C614 +FC131F9038007FFE140700F0130114007E157E7E157C6C14FC6C14F8EB80019038F007F0 +90B512C000F8140038E01FF81F257DA426>115 D<130FA55BA45BA25B5BA25A1207001F +EBFFE0B6FCA3000390C7FCB21578A815F86CEB80F014816CEBC3E090383FFFC06D138090 +3803FE001D357EB425>I<B539F001FFF8A4000390C7EA3F00161E6E133E6C153C6E137C +6C15786E13F8017F5CECF001013F5C14F8011F495AA2ECFC07010F5CECFE0F010791C7FC +6E5A6D131E15BE6D13BC15FC6D5BA36E5AA26E5AA26E5AA26E5AA22D257EA432>118 +D<B500F1B538803FFFA43D07FE000FF80003E06C6C010715C082028015076C6E6C148015 +076C01C0ED0F00826E485C017FED801E5D90273FF01E7F5B17C0DAF83E147C011F90393C +3FE078037C14F8903B0FFC781FF0F0A29139FEF00FF10107EDF9E002FF14FB6D496CB45A +A24B7E6D5EA26D496C90C7FCA292C7FC6E5CA2023E147C023C143C40257EA445>I<B539 +F01FFFF0A4000390398003F8006C01C013E06C1407D97FE05B6D6C485A6E48C7FC90381F +FC3E010F5B903807FEFC6D6C5A5D6D5B6D5B6E7E6E7E814A7EA24A7E903801F3FFD903E3 +7FD907C17FEB0FC049486C7E4A6C7E013E80496D7E49130F00016E7EB590383FFFF8A42D +257EA432>I<003FB612C0A3D9F0031380EB800749481300003E5C003C495A007C133F5D +0078495A14FF5D495B5BC6485B92C7FC495A131F5C495A017FEB03C0EBFFF014E04813C0 +5AEC80074813005A49EB0F80485A003F141F4848133F9038F001FFB7FCA322257DA42A> +122 D E +%EndDVIPSBitmapFont +end +%%EndProlog +%%BeginSetup +%%Feature: *Resolution 600dpi +TeXDict begin +%%PaperSize: A4 + +%%EndSetup +%%Page: 1 1 +1 0 bop 166 83 a Fr(xdvik-t1)32 b(tests)166 266 y(Basic)g(test)f(of)h +(size/width)f(and)h(enco)s(ding)166 407 y Fq(Hei!)p Fp(Hei!)166 +506 y(Hei!)166 606 y Fq(Dette)d(er)e(en)g(test)h(\032\034)-10 +b(\027)-52 b(a)27 b(\014)h(\016)f(\015)h(\017)g(\(cmr\))166 +706 y Fp(Dette)g(er)g(en)f(test)h(\346\370\345)f(\034)g(\036)h(\035)g +(\037)g(\(ecrm\))166 805 y Fo(Dette)21 b(er)f(en)g(test)h(\346\370\345) +g(\002)g(f)n(\002)f(\003)h(f)n(\003)f(\(T)m(imes-Roman)f(ptmr8r\))166 +988 y Fr(Scaling)32 b(tests)166 1129 y Fq(Size)c(is)f(7)g(\(scaled)h +(from)f(10\):)166 1229 y Fn(mT)p Fm(T)166 1281 y(m)166 +1381 y Fq(Size)h(is)f(10)g(\(scaled)g(from)g(10\):)166 +1480 y(mT)p Fp(T)166 1533 y(m)166 1632 y Fq(Size)h(is)f(12)g(\(scaled)g +(from)g(10\):)166 1732 y Fl(mT)p Fk(T)166 1784 y(m)166 +1884 y Fq(Size)h(is)f(14)g(\(scaled)g(from)g(10\):)166 +1993 y Fj(mT)p Fi(T)166 2045 y(m)166 2145 y Fq(Size)h(is)f(17)g +(\(scaled)g(from)g(10\):)166 2271 y Fh(mT)p Fg(T)166 +2324 y(m)166 2423 y Fq(Size)h(is)f(32)g(\(scaled)g(from)g(10\):)166 +2635 y Ff(mT)p Fe(T)166 2711 y(m)166 2810 y Fq(Size)h(is)f(64)g +(\(scaled)g(from)g(10\):)166 3205 y Fd(mT)p Fc(T)166 +3395 y(m)166 3495 y Fq(Size)h(is)f(128)f(\(scaled)i(from)f(10\):)166 +4256 y Fb(mT)p Fa(T)166 4674 y(m)1929 5539 y Fq(1)p eop +%%Trailer +end +userdict /end-hook known{end-hook}if +%%EOF diff --git a/Build/source/texk/windvi/test-t1.ps b/Build/source/texk/windvi/test-t1.ps new file mode 100644 index 00000000000..77b12183469 --- /dev/null +++ b/Build/source/texk/windvi/test-t1.ps @@ -0,0 +1,997 @@ +%!PS-Adobe-2.0 +%%Creator: dvips(k) 5.78 Copyright 1998 Radical Eye Software (www.radicaleye.com) +%%Title: test.dvi +%%Pages: 1 +%%PageOrder: Ascend +%%BoundingBox: 0 0 596 842 +%%DocumentFonts: CMBX10 CMR10 Times-Roman +%%EndComments +%DVIPSCommandLine: dvips -Pcmz test.dvi -o +%DVIPSParameters: dpi=600, compressed +%DVIPSSource: TeX output 1999.05.13:0006 +%%BeginProcSet: texc.pro +%! +/TeXDict 300 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N +/X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72 +mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1} +ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale +isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div +hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul +TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if} +forall round exch round exch]setmatrix}N /@landscape{/isls true N}B +/@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B +/FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{ +/nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N +string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N +end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{ +/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0] +N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup +length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{ +128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub +get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data +dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N +/rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup +/base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx +0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff +setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff +.1 sub]/id ch-image N /rw ch-width 7 add 8 idiv string N /rc 0 N /gp 0 N +/cp 0 N{rc 0 ne{rc 1 sub /rc X rw}{G}ifelse}imagemask restore}B /G{{id +gp get /gp gp 1 add N dup 18 mod S 18 idiv pl S get exec}loop}B /adv{cp +add /cp X}B /chg{rw cp id gp 4 index getinterval putinterval dup gp add +/gp X adv}B /nd{/cp 0 N rw exit}B /lsh{rw cp 2 copy get dup 0 eq{pop 1}{ +dup 255 eq{pop 254}{dup dup add 255 and S 1 and or}ifelse}ifelse put 1 +adv}B /rsh{rw cp 2 copy get dup 0 eq{pop 128}{dup 255 eq{pop 127}{dup 2 +idiv S 128 and or}ifelse}ifelse put 1 adv}B /clr{rw cp 2 index string +putinterval adv}B /set{rw cp fillstr 0 4 index getinterval putinterval +adv}B /fillstr 18 string 0 1 17{2 copy 255 put pop}for N /pl[{adv 1 chg} +{adv 1 chg nd}{1 add chg}{1 add chg nd}{adv lsh}{adv lsh nd}{adv rsh}{ +adv rsh nd}{1 add adv}{/rc X nd}{1 add set}{1 add clr}{adv 2 chg}{adv 2 +chg nd}{pop nd}]dup{bind pop}forall N /D{/cc X dup type /stringtype ne{] +}if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup +length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{ +cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin +0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul +add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore userdict +/eop-hook known{eop-hook}if showpage}N /@start{userdict /start-hook +known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X +/IE 256 array N 2 string 0 1 255{IE S dup 360 add 36 4 index cvrs cvn +put}for pop 65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N +/RMat[1 0 0 -1 0 0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley +X /rulex X V}B /V{}B /RV statusdict begin /product where{pop false[ +(Display)(NeXT)(LaserWriter 16/600)]{dup length product length le{dup +length product exch 0 exch getinterval eq{pop true exit}if}{pop}ifelse} +forall}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false +RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1 +false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform +round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg +rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail +{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M} +B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{ +4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{ +p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p +a}B /bos{/SS save N}B /eos{SS restore}B end + +%%EndProcSet +%%BeginProcSet: 8r.enc +% @@psencodingfile@{ +% author = "S. Rahtz, P. MacKay, Alan Jeffrey, B. Horn, K. Berry", +% version = "0.6", +% date = "22 June 1996", +% filename = "8r.enc", +% email = "kb@@mail.tug.org", +% address = "135 Center Hill Rd. // Plymouth, MA 02360", +% codetable = "ISO/ASCII", +% checksum = "119 662 4424", +% docstring = "Encoding for TrueType or Type 1 fonts to be used with TeX." +% @} +% +% Idea is to have all the characters normally included in Type 1 fonts +% available for typesetting. This is effectively the characters in Adobe +% Standard Encoding + ISO Latin 1 + extra characters from Lucida. +% +% Character code assignments were made as follows: +% +% (1) the Windows ANSI characters are almost all in their Windows ANSI +% positions, because some Windows users cannot easily reencode the +% fonts, and it makes no difference on other systems. The only Windows +% ANSI characters not available are those that make no sense for +% typesetting -- rubout (127 decimal), nobreakspace (160), softhyphen +% (173). quotesingle and grave are moved just because it's such an +% irritation not having them in TeX positions. +% +% (2) Remaining characters are assigned arbitrarily to the lower part +% of the range, avoiding 0, 10 and 13 in case we meet dumb software. +% +% (3) Y&Y Lucida Bright includes some extra text characters; in the +% hopes that other PostScript fonts, perhaps created for public +% consumption, will include them, they are included starting at 0x12. +% +% (4) Remaining positions left undefined are for use in (hopefully) +% upward-compatible revisions, if someday more characters are generally +% available. +% +% (5) hyphen appears twice for compatibility with both ASCII and Windows. +% +/TeXBase1Encoding [ +% 0x00 (encoded characters from Adobe Standard not in Windows 3.1) + /.notdef /dotaccent /fi /fl + /fraction /hungarumlaut /Lslash /lslash + /ogonek /ring /.notdef + /breve /minus /.notdef +% These are the only two remaining unencoded characters, so may as +% well include them. + /Zcaron /zcaron +% 0x10 + /caron /dotlessi +% (unusual TeX characters available in, e.g., Lucida Bright) + /dotlessj /ff /ffi /ffl + /.notdef /.notdef /.notdef /.notdef + /.notdef /.notdef /.notdef /.notdef + % very contentious; it's so painful not having quoteleft and quoteright + % at 96 and 145 that we move the things normally found there down to here. + /grave /quotesingle +% 0x20 (ASCII begins) + /space /exclam /quotedbl /numbersign + /dollar /percent /ampersand /quoteright + /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash +% 0x30 + /zero /one /two /three /four /five /six /seven + /eight /nine /colon /semicolon /less /equal /greater /question +% 0x40 + /at /A /B /C /D /E /F /G /H /I /J /K /L /M /N /O +% 0x50 + /P /Q /R /S /T /U /V /W + /X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore +% 0x60 + /quoteleft /a /b /c /d /e /f /g /h /i /j /k /l /m /n /o +% 0x70 + /p /q /r /s /t /u /v /w + /x /y /z /braceleft /bar /braceright /asciitilde + /.notdef % rubout; ASCII ends +% 0x80 + /.notdef /.notdef /quotesinglbase /florin + /quotedblbase /ellipsis /dagger /daggerdbl + /circumflex /perthousand /Scaron /guilsinglleft + /OE /.notdef /.notdef /.notdef +% 0x90 + /.notdef /.notdef /.notdef /quotedblleft + /quotedblright /bullet /endash /emdash + /tilde /trademark /scaron /guilsinglright + /oe /.notdef /.notdef /Ydieresis +% 0xA0 + /.notdef % nobreakspace + /exclamdown /cent /sterling + /currency /yen /brokenbar /section + /dieresis /copyright /ordfeminine /guillemotleft + /logicalnot + /hyphen % Y&Y (also at 45); Windows' softhyphen + /registered + /macron +% 0xD0 + /degree /plusminus /twosuperior /threesuperior + /acute /mu /paragraph /periodcentered + /cedilla /onesuperior /ordmasculine /guillemotright + /onequarter /onehalf /threequarters /questiondown +% 0xC0 + /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla + /Egrave /Eacute /Ecircumflex /Edieresis + /Igrave /Iacute /Icircumflex /Idieresis +% 0xD0 + /Eth /Ntilde /Ograve /Oacute + /Ocircumflex /Otilde /Odieresis /multiply + /Oslash /Ugrave /Uacute /Ucircumflex + /Udieresis /Yacute /Thorn /germandbls +% 0xE0 + /agrave /aacute /acircumflex /atilde + /adieresis /aring /ae /ccedilla + /egrave /eacute /ecircumflex /edieresis + /igrave /iacute /icircumflex /idieresis +% 0xF0 + /eth /ntilde /ograve /oacute + /ocircumflex /otilde /odieresis /divide + /oslash /ugrave /uacute /ucircumflex + /udieresis /yacute /thorn /ydieresis +] def + +%%EndProcSet +%%BeginProcSet: texps.pro +%! +TeXDict begin /rf{findfont dup length 1 add dict begin{1 index /FID ne 2 +index /UniqueID ne and{def}{pop pop}ifelse}forall[1 index 0 6 -1 roll +exec 0 exch 5 -1 roll VResolution Resolution div mul neg 0 0]/Metrics +exch def dict begin Encoding{exch dup type /integertype ne{pop pop 1 sub +dup 0 le{pop}{[}ifelse}{FontMatrix 0 get div Metrics 0 get div def} +ifelse}forall Metrics /Metrics currentdict end def[2 index currentdict +end definefont 3 -1 roll makefont /setfont cvx]cvx def}def /ObliqueSlant +{dup sin S cos div neg}B /SlantFont{4 index mul add}def /ExtendFont{3 -1 +roll mul exch}def /ReEncodeFont{/Encoding exch def}def end + +%%EndProcSet +%%BeginFont: CMR10 +%!PS-AdobeFont-1.1: CMR10 1.00B +%%CreationDate: 1992 Feb 19 19:54:52 + +% Copyright (C) 1997 American Mathematical Society. All Rights Reserved. + +11 dict begin +/FontInfo 7 dict dup begin +/version (1.00B) readonly def +/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def +/FullName (CMR10) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle 0 def +/isFixedPitch false def +end readonly def +/FontName /CMR10 def +/PaintType 0 def +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0] readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 12 /fi put +dup 13 /fl put +dup 14 /ffi put +dup 15 /ffl put +dup 23 /ring put +dup 26 /ae put +dup 28 /oslash put +dup 33 /exclam put +dup 40 /parenleft put +dup 41 /parenright put +dup 48 /zero put +dup 49 /one put +dup 50 /two put +dup 51 /three put +dup 52 /four put +dup 54 /six put +dup 55 /seven put +dup 56 /eight put +dup 58 /colon put +dup 68 /D put +dup 72 /H put +dup 83 /S put +dup 84 /T put +dup 97 /a put +dup 99 /c put +dup 100 /d put +dup 101 /e put +dup 102 /f put +dup 105 /i put +dup 108 /l put +dup 109 /m put +dup 110 /n put +dup 111 /o put +dup 114 /r put +dup 115 /s put +dup 116 /t put +dup 122 /z put +readonly def +/FontBBox{-251 -250 1009 969}readonly def +/UniqueID 5000793 def +currentdict end +currentfile eexec +8053514d28ec28da1630165fab262882d3fca78881823c5537fe6c3dda8ee5b8 +97e17cb027f5c73fdbb56b0a7c25fc3512b55fe8f3acfbffcc7f4a382d8299cc +8fd37d3cea49dabdca92847af0560b404ef71134b0f3d99934fc9d0b4e602011 +b9cfb856c23f958f3c5a2fbe0ef8587d1f5774879c324e51fcb22888b74f2415 +50d7401eb990d4f3a7af635198422283cac1b6cd446ddbcbd915db9bff88844e +784c6bf7389803d9450b0c21756a017306457c7e62c1d269f306bd3402e266de +fc3b5e7d8a8d2f5bf0fe6ddd40d07391df4fad4a6018dce29a2b8f692b29f202 +3a7c0e66de8ed85c14f1f8492167357f51a7e84cc5d92e0fee4d81cf7fbc8de5 +2d2e7bb57142033993f9c08c315abade8dbc4a732e84e142d3bee51557910e12 +cd8aa37c459a5e6b7f5269f59078aba3be4641a11ac48d0b625c8325b38ec08e +4c9e5e7fed976a5650d99d82114f449b9ca14c4ec957702295a39a93ef93f618 +99b8ea06b092c3c1e503e6e436e0a9fa22576c8930ab3dc8c20f5d82b69cddf8 +ff4dacfa9c54bed5a3aa3ea5b129fe96be632843b9b6bc91b615581a985db56b +1e01ca60ee69ca92cf5c0882ece62edad3e106d835348822400f0b66af658f2a +e56ed08f8b0010571807009b73ab12a8cf14ca6c71f03c2a48c500f9d62266af +154a6375ff600d9bac3f05ce34142d6867a79581c533176bb2f3117336671e2e +44638a97167e2ea9644e31ea16c2ad2990ea33c54001e0c8156e6de8ab6a4d40 +a7137ba275f39589fea2e2db8256adc103d6f9cc038037a47e8fd469c5f98a5e +3c15bd4ace40d340018b1cff7d1ed8abb0ac57b5b5a2c20a51957b96c453edb7 +dae5affd91a46d938fe0a13363001d844ded4323f1ee6d30012aea19b024a552 +315505535c85dc26bad31e09c50e6512802976d298c4e90d0044c362e6bf3ab3 +62a454ee93de25ce54411090c29e9d75c80ce26a84404bd9de3aee0e3f921ac5 +87f907572b8354a5c3165eea7e8b2ba4e332f2f36960670119d90725b633a217 +0563ef5833e8e342bed71874ada5f163cd855d16f0e7051954fc99cbf5ac6b19 +c3f2d60f8125a5be282702fa621095768066fafac56dcbe07723b6da0ea367a4 +5ef7f513218833e3aa5b8afc39994b3932ba09476c504ec958089e6ebb941b1f +f1b7856738054a03d392512634bdebdace868919fd603aea2a0c7d706e22228a +26b0315af28ce7ad235ad1c24e27cde921ba469cb31028a173be065a8b240be8 +10b541480646409f63647e74a243858dfe8257081f0ec32a29dfb8e510bedef8 +bb96d2f17f9d520650d272cbd9264c82ef659a7011a9638b42621a3a54f50a37 +a8c3596232ad7ceb5ba5bcfe0f088b83797a2acea191dc1210d7feddd4df45e2 +3817168828b3aae003c656827b31093f300fe7413092b2f1a284d199e78b9d5d +f8d181122a40bf398f426c4dd32ec802115e5abc2964a78a09e798d51657eb5c +0bc2a1a6cef27c26508a83b4fefac78c38e6a4cc86ffdf42be56b9b50cc7cd34 +3c7ca9a56707d878fc92c45b9dd2beb4af1c235d13826c680e1a83f8966c3403 +c34f49b466d03152f3e7424c1589bb3732e514a38e72deb00c42d174cbbe0c52 +3757698b616a4c35ea2d6042c211825186ec4d795443934a6f45b7869fc5c7e6 +111bf52370d54b0a8dd35b4d453cd689ee5b4369c048137e7b23a108d407eb0c +83c55c94e4d987975438d149fdae75dc7d56a1017c1e0629b37c762fbd17a9ee +8e9a981221e32d389770acb6574f2b2ae9feb0b218fc8479c3fed486921ddd61 +17b079767ea37c9cc7a8375cbcfd4c333fdbd83c539b3d4f8c683d98fa863396 +0c32e4f2053ea66539972953dd62b1c428db3d9de837a5925c590250e19882b5 +a306d72b4c9466fc5ebf656453a5654eccab82c10593d372a4bc85ef1633cdc8 +2d2b7a1cfd0fe4561a01dc8ad0b949d631d13aee140b35251c4d19921e931a9e +a482993ca6a910155971e914d9dadf80e39651c4a27b18e5243da8b435d59b6e +d1b8dd195c6bbebaf4113e7d88afa243a2131b77f5441cdb08425682633408ff +a9429cfa76fe6b025916107481fab4c0c0b2e7bbfe45abbeccbd655d5de7a7ab +c19d71a8b56ef04e71621b28ac195635c8526475dbc905034c274c9703ba8431 +1b1a3ed43d75220ffd0ae666c860d73696a7195f300afe72c363896a6c7ce2c2 +ebf41c21a86337635f353c6571f07a4c788992b0c38ec72e3c1dc6bc70f31f20 +0693b74f4f2da991fef20aeeeacb456324847cbbc13ad510e6e6dbaf7df5f784 +110d695548caad4665a6038d53bdffd9e21764f38268d2e94047acf1f56e13c8 +56e108f93527f3ffc1f1a645548b00b82299619f5b1da8d7b4d1a4aee32c7002 +b9aaf57f21f266bc74e44f8835a3824081f32fb58aa5a6b11fc76871d868330a +bca9f55253281d745b2a47dc9ede0c5ca3bb7720523f617803928ee6e4dbbe2a +fe5a1004484a90324db2be08312ce2139a0b9e78bd0d3f8f7f20118dee74a67d +bab7224b25283d843e90b8f9032f412e121ce5cac49d3581a7bda0a59f64e956 +7775e0c49ee9c73b59d9f5b0c3932824087a605fdca44c1b9263b9d8440e6f08 +670a9e50ff988d26b635bc800a3602a6dfbc369e5891de654f6161ca279fb034 +16b2d4d62e46e4bdb2d8a7144cc52fac2cb412445573561afdc00c5f6efa72c8 +7f4be15d19a9121e0e47dd0015fb4c100c35a8aacf37687af898760b218f4fbb +1ecf3998286d17f5d1470320f0a8b0da859e0e034ff634d53787a8801a7e3fc2 +773f8848e8e129442d9fad767dfd81516918dd6253a665e11e38f859fdc0852f +6bb653a8a46774e1a2efb6f56a1cc91ae617d62a4080e6e209fe735b0354e9f4 +6c095102dc587d72cc700c1d189e2a878b5afc71d1f8eee7c7bfd52590f6c580 +50fbdef33baa2f9045ab192a4d3c54deaa3616712f80032c236f6942bf6d14f7 +93ec9de6f27b268a5fb14076f197e7834f03874fb37d6ad6735efcdec0df1175 +d5a8b05fee0bd7c2f56c82b9e9c200712bd864b3db1b448fce8f6c8113c40e8a +0f6ca8aa11486e7ad72883bb804eb89cedeeb0b27c5a1c568a852b1ed8136073 +08b2bbc8ef21ecde75c60b3e1074e0fe1f911d2fbe7073c256521e175b66c526 +5c693e0fffa0a671ab3caf86ff5e40cdfe62b7c5d3b1cf904bf988998017c302 +462eb8c3f0d4c586238cee9a9c120ed1d18e8211c346a44615454f12ad2374a3 +8a73766a68765ec456a9df3ac1f457c63fdf85574610932a1a08db3c083e8f23 +150029d775f177a4bb25ae5f67e9dbcd51004587c9c0fb594a5e548495d67688 +927823c4effa5e66b64c97c29c08d2a1f275fc3d3986dfc1029a179c6c7d08a6 +3740c85c1b28fb86b062937a46fe692eb34d077de9d896a8d7b046fc973c25d0 +4ed4d06e4e694aae418d680da4a32514b89c9840613868aaabd606d4d57b9822 +8d4bf632b74ec831d4036b3bf364f9ae81fd3cf4f185d93c8dedbc97d07a8f59 +4e52133416a913c90541d9d0ad1641f40e521eacec86b6c8a7cbb6ec34ff3ddb +99ea7ea45f11af351a02865f1b417d20eedac8e1b8ca306541ab4aea3a18d711 +f83fa361417cdb3aa62fa161a56c5d376f3e4906a47c511bad5a2ccfe165a281 +e22c63a9be715117254d973fa86b4dc2b4001727abc1aa1d143c94ab3c2613cd +296ad30f33285a20c8233c424abf748972e0d1266cb06f3235849b26505e7a7c +bc72a74ef2e08a0be1b804f42db4f1ffa70f8b48c676324570d8aeeac104ea38 +e7b84bf2ebc2b4e6c70bc23f8e510fbcf982e95ee2da46e5802872da6237e60b +3b6bd325740fd50aa756a6fcfcf89ba20b6adbe5440c9ffe48cf3befd6d01bf5 +99ec2114291ec3807adc4611a78a4bffeab0b79bc0c59bd8b4f0d598e5341c29 +67be99ed9b696d0a064762abfa0c3d2becf525e28b87c72ed92699b969f25979 +6705e0040a1b428e7c402a76c93070a548268aec5a3a8b8e626ceefdf928d5f7 +79b4a9cdc0c8b96bd2f16fe132880a503d84e1e2ee483a048572a73ec3197fba +cc0c9dbaaf315f09528c7a933f50356fb92655db15bffd84af174c163c6c12fb +bdc99e52218fdc5413f97766f2b2fa3d415b1c7ea3cb1b31a932d4f2bd91f98e +2e10b18c90b8ebae00564b3c1c25d04bbcace072992c1967f783f02e1e80586b +8103e9a0c542625c4341818b841f57ec2367307aa44125d45f5b5dc46a88e0e3 +95ef2c1a82ea477387f2c041817c0202dce805038e737aa3da14e37bcede6ae1 +ba37e2c1793d49e07536486422383666ae72f8667f6299140776cc0ad021ab66 +63ef5a4a4ffcd848e4a7860eab2796c54d08ec48dd4418fc26e17e83f3a5585a +43ee25f481e01685eff516e209d29eaf016ca6d31518a150f50a1dcfdb19e552 +a7d4bd6d8235443668fd4cbc27517183834eb15a112913f7891dab81141c8ffb +005974c5b4ec7727dc86983fbaecb38c7da95e449a189436db1ac7b5f3dd74c4 +145099236dc59a6a403d5f040037bb1ddcec14ff381a41f72a8a943f52d4c245 +e1c705801a3cde26bd436b403cbadc203f5ca661cce83f3daf25c5903f8fc401 +8836d1b8929390a904f64cf7a320649f74f2bad03e1a2469c0bac5c6c3462874 +4c36010f24f5eda81c4ec19ffc366530831d65b78ce2686a86151e63fb6c6de1 +0b0ca2db989814910e1c6c2a6488681d5172548fe12be2fd2e55a7154a483da7 +52a1a361250e420eedf8f4144aa890d0c4782866ec1f2ac0575b0288421b6b94 +1ef62cfd62cb6d9dcf7f4eb8129ed30ec831dbb9fa79971e670c54eaa81c9a40 +e5227c7a5318fcd4a0d0c13d44017b05814eb0c5de6606461568b4a0f28d1701 +a0f82337d40be48e9ded65b3fe460005af00cd0122e3a1b1a3e5b0de2873e459 +36290d42f0ae63c9fba14309ee3e7fe2697a84e88b1bc04ffc08e67fe7dac8b7 +ad93289aab8e8a0abbea04faadfc58c5da7ed70650bb39c0042d628457034974 +0d0de21b4d5ea38540459bf07781defc675cb45cf5f6d5829a52377067028859 +503aa40b16370a0dffcac6622b5fa0e977677ecde54ce9c2432c1a64783add7e +1be70f70c315bf225944bd6d586b755f22b743c49ea8e9ab687b9a50e34d7b54 +435e473d040d749936047b1d307dcc531187115bfba41e5127d2cd0c441f316d +c73deb49fedf4a795af108b2d266244787aca611dfe531104ea3161a2605d047 +6da31dc7069d84de3c6cf2092304ced8ed217137a0da1c21d87eb2793a2d8f50 +23675d464ef29ace91d93580154b2582d8cd4206cfb4874a9bf1073720a19123 +36f6fdcee63428042db08a2cfa15836e4e8f353980882f81114f3c0d7347d25b +4cc8789dbc7d8b34dee56bdf8c968a9acc9bc29795bf611b4d037dc88726e237 +c619ad8c35ccb4615afe54a85a9febdf0cc1bf905c5b7cc5d631c2df8bebcded +62ce30e63fe8a28715069d80e88b66adb1e12397c1ac319cd38a81cafe615261 +c308468df747b2700b0561460de200c8512e3ee0bf6e4f3b45b87ada3863b103 +bcbbbfa006e6392af9277eb6a2c767d7324996e4b5be7857adca859a7c5ba442 +4a9e7ef1f55895eeab7f7d5d8ab66cc453136f3b1b7ebc8f9bbf82231129ad43 +c07ee08f8b932b2f0233c4ed804c1937ab87afaa4dab30117c9aca6f90150303 +93d900d866f61cc1a0cfa485b4c934ab70b649dcc45715ea946feb48da0ccf40 +9d4eabdfb7ac50d0ae00e8fae99699a165c45bc89a056b7b7399b57fc8b1992a +35bf24524c52fa519ac4ca0e84f571a94b46e7899b8c4aa5391806ad6f061c62 +9f534c6c59f7fa4e7ceee571260cbd2223ff13e039e7abc0f7519d8d1af5e995 +ee0726ac101c6ecbc1b3b9f7f169553aa57755572dd9b5b23d07687b313c9b78 +2304fe03afbfa0c75b843c4d9d667498c3c6ace04059e86f7a904c36fac5a0b8 +177d2a2b9194ab22d349708313af1f801a0813cefcd54cd70a3f3e5b41b6aab3 +321485334baaf91f88a5d64b5faa37f56d15bb86eb4539500e5215a974577cf8 +47c7b16cc5ad1328d32d86e19b768e5573db3f866daa4f1f5f770850ee461650 +2698db76c1983623a63067db8a62499d76a2c20b1a4d2fa41425aea26ba3ec76 +ed299d69034837124e885eb658e526d282d63f24a2fbae60023434ff1bbb109c +df9a5ab7798169190378cb37e47e86bfaf954a86bcc212df74638375ed3f227a +7b8175663394d065494fd9d849fd781b55cd4c9af93f739de213a92b5a107484 +5b88df5e020b424465e8360a9ae40ee2d70099d099dd2194ce0f42c0235d949a +e6ee6475c15a7634b34703049e020a7c33373f2a2d30726377b5a96dfc234f53 +c5a4cbc28087e5bdebc54115f76a7734b71ad44d29a25702bb88b8e7b8fd89f9 +67e689b4c88d7394c4193bc4fd952284c765e0cc47737a8d28d85b7ba2f1067d +855fd865bf273fe853dcf4cde42749cc768be0ba043ce3a4095bfaad64b28738 +49d99f2e7b1a4e0d0412dd7d10691591a5a4747f4005005c67ecce9c6e962007 +9033d6f3bc6e7f68bbff80d220655c75592b158bfdb72e1dae7c0e529ace16cd +0af5a8e6d4d0126f2e6cf720e92b3fed7f8903038d55793522de849f52cdd27e +f03445ce854c500ef95cc57c8cec31cb87c8a570c481de1c0b2e0c873aa68683 +e39feb98ff488a60e41a3c28c31ce7dc8f2abc634d7f46f75ef507a56f83a062 +91831fb66ac0e3eec04d9615f5afa650d66d8e9e16552469bf272eb283db5b74 +9caa4a06a86a160d40a7dd6953f972c77935c7ecce719fbda4a430ebc3cfac83 +fa8828963a53a280e78b771ef66b74dd82eaeb73b9ce8b86e4ca289726a7a7a4 +75ee4895dd2541bc555bc229b5daa517be052296f906bb28c8985f320ce0c222 +7accd226e5cbb3cff42c7a60346530e06c26b1d9ab8c3cbe86faebdc0beef389 +159ce04af770d9c55e7953b2fd3d79e9032ea6db06d9c792a58453915bd1f1d5 +0a229a0a409ec6f49ce683a8b944fd11159ee34778f9ccc5d5cf1f3109a9c5e8 +546e3c14bbc4a90a238d3001078a00ebed664bf6841c2e644448f497aba26ebe +9099cdb9a382227d1b7126246f0d6cd24f9e4628543fb75b3cd12aeeeec03506 +a4f8afcaede87c6e15a73ea4acb1f0dce25b80c54ca6c308cfef43c07f6df145 +30040589e9cf4bc5f81da5f1aad326719fef652350e0bb45bce1aaf804a5935e +b28b14a3ed1b5e7104662ad240a8faf3c195088df299c66c603cafe394937f53 +b18c2376bb10af8a43175ccd7a165385bce28d86fe029ffc85d2f9edea062649 +01ef933b51c476701129a998ee75717d9919b68e3b229cb2f90666644eca9ea5 +b158bbc59512042b97c382c8d988f42564895e57763ffe09943fd353feb20609 +1a3650de97c8d97463c0ffe13a220d4feb812942b474fd8b3760347643560d54 +fb2dafc7b68416896d2f2416896a380179d94225152a686b6a10c3b84f8ac11a +31211eb6c8011ffaa535211c92bbcb23604dd221a82059b65981b6cec86bf533 +4a339ac221ce36fd14561f195652301f5791ba123c6b6497bd74fd6080b66d86 +50777b4253b1bdc31511ffcc17f96694f2dedf32a0c68f2485d1e74e0bd57c1b +e960a9f56d57c914e41059b7e854c1f000c98552091bd8c46427134b547c162f +4274de454f262b9cc451e917a95f3007b6e7da9f0dce964dd008cee1aee3add1 +e2ab5fc4f201edfa99c1c06a5b367ad04177af0bee800021af8a8f11957398d8 +99882f5a9af1982e88fa89e7d2c29877939417ed2c1d2c5c971e3ffd1bc91efc +d55cee0c4a7c86dea0919a5cefe1f1fb7c1dc8d3344aa133a7f67dfbb364cfbc +f891b99f6fb89b2dbe0dfaea6809680259f4e6b9e0013e11faece8dc77082024 +87b50f507bff3cea551703d362f790d7cf84ad18e1b712a75ca2dc40814b9d93 +577ce68a753cd33b7c60dbfb20ea4e729e1a07ff77ed71f5055b41522aab093a +df83e0cd1a44007c40ef6d7ff69b9d564d1b8d27f1209e9d2f3bbd769f73facb +d1b3c8df09e68f4ef54d5b9032d89ce4cd0ec999de71931f8e27b2b57183c27a +dae555a6878eaa9fc589a9573ca65d1a356cb23bcac92e4592e6dfc409046e7b +b967a8546273b3b83c1d3a3fb7d9e97b7e4bb937aea527395a8608caae7698f1 +ecc74965ef7f4a5504957166756b5d7994f791cc3bee55db6311ce40f9cb55c4 +4cafcf7b61206b5971f2b856c2eae3772d83d59419cfa2ebee35cb4937934652 +3e706e18f0a6d0dfaf2688844e0327841513b440c6968c148cc77cc4c6b5c2f6 +12ed402a0f66429b6f836a408e8471580fdb44763903a11bc456a49458e7c5d7 +508ccf345105ec4d7cdaecc30403c3d517eb166f238aa1b5e311190996c5e3d9 +799d3537de594d202a508860a2e12b8388933a8f06de65454873c6f326fa99d8 +80ea5cb52a5ce900ca2f45a67d7e9b33657b58bc8c553ef4931e868e2d0d89a6 +eb23f9a0cc4019dcb18ae96e241c266c3d37ce0ad1c6b8ba0b279fac1fb7803d +b2dda9becdeff1fe16ca1e9dd175740777abd205a00d3d448ce3e762ab41314a +94af1a5342a50f7657346c8028e4b7f36a705fa5b978760a1b47d64b342877c1 +1971879e5f253531fbc99bf316e1f2174b7b548cf22bcf85ebc2f5bb74f60bc0 +fb908c60d53317b338ab94164167565b0a1f1acb758d65c47a85c050a4028156 +bfdf74a66876769f533e2ca868986c3861e0cd7f623f81daa9c36d2f58753094 +21b92f44549155411fc9da0958b86e3fbb7bedacff6a5c8c99b090cd3d84cade +eec548ab1ed81aa69e9f2415698ff9a3c602f043f1cd0de585061da3d3efb705 +39c8a64300b3ff3e0184c6e7aca5c164a6444fd1999103410f07735d5c14033b +8b64b784e1b6153b567c20ff7eb1397f63280a71a1777af864635cd61f5047b0 +aa05de90d143394ea587576079765c6030acd3cbfed8ae95c84c39bc2d4fc91e +83023cdf954e52929d1395cf79caaee4d2d3a2bf0dfb0dfc0a6a324749b3232e +38de33685143d94964877e9649c6e11007a0460e6c57f4b2155e321ab57ad9a7 +b594931375010812bef8abba148212a40148a261e4a69b67c9e6b98cf1fb52c9 +a5532f0531a80c1fd9b48709b8ea03a21d0267a3016b0f258b619ace8840da8f +d990c3ed32a2e16a29e42280e45eae6abdd96dc4bd7bccc55651284f60227d28 +09bd3e4922ad82833bf762d8cc7cdbe3d64ed10d2d0a27ba299c122b6c4d1f79 +843aa41fbb8b729a0c1e3499b3531ed739ced8b3d1d88c01db5700fc5586454e +be2850e7207e8b743d6245b586d9910d07655c3463da7ccde3856ffdd4417e20 +2d10cfb9edf6dba58b560a1a9cf4ab2680c373e5e99177fb971b54f8667e1e07 +d44a965e63efaca250aebf06005d1b0e16ee238a6af52630102b0bda3cade5d8 +95524a788883087946390edb7bf98704ecb221eace7b477516155bfb8f467f66 +13e0e26fd89c18d098a34295f9713f640870ed7e19e0def5ffce3d3e8762609b +21612fa8fcfaffe5f28ace4c141236492518ec954d644b723ee698c41cc3903e +2db67b4b04b03d255b5e9ba70c7c72c9f3fb9cca443b9c65b554a27f44b993c9 +3b9875416f2e86be363f4096d049f20fdb1b6745a00a28b494eb5140b8d87568 +e36d06050c24c145381300df54b56e328fc3bac32f4725a47f863986a3c3c627 +2905c5d571c169a93ca950f1c525b668feb8b524fea7a6f818343921accf12b7 +3943ff80f632893f055bb2b362f311a2e5cef0cb396f4a0eb0625f91a3868f07 +b2fa86af54acbef3d1b7b6e05866967f2fa29db2ea760e0e0f242eb9a1808f66 +880a137161bb512e4b3f91f5946d9498b6f41fe372278d6ad719989d00463d2c +c8f97c5d291c866ae671e01d0b0f61220cda1c56dc0600b8440bf98b17dbbb9d +6516c1f813392e65d4e36b20f1fefc784c2700092c31259fcfac198d9b19688b +21e0023f0896ff7cfaf24ad6aea400ef87de2443d1338dbb0bc4423753c67afc +2777a38dd288cd9147e42702001b75aff7e5338f6e2867d15b7d0e0d9a62c069 +5cdf21c309e78778baa8e696e4b47fc4067d6854eb7fd95f0466d6cfeb54bb80 +f6aad2f8e510c9b3fff443afd92ee29dc27770e3ece4c7ebacc51cdb296e90ef +c484526e16220e7b0620115ce2b7be4133c51345e539c53651e75a08a0610658 +15dc073f8ee88c0028dd2d01f9adba0274d1be04023cf0ef1c266942817317e7 +f115c4854effb7c30ee22820ee43553350f16e5cac761b812a1e4b82c3d9324d +708864d00f9f2ea7142dfc7d091633c64e1f090ca20d7a30230029b33626bacc +db42b400c1708f4f573c3b92ee4f641a4832853f9232fe7ff60c25f844253cda +a0aa0b5776c34cfd2e0e3e87702f57a80ac8b50c3ce8b474f19c4e82f8748958 +a3332dd84315d5d69b6c150daccaa49c5d2d590ce1037ee05f77e146c6d7529f +a1df4e03b11b2eadbe0d09978576ea6240446a640f610f5dcb5c36f42ef69242 +7e0fe61501fd42776f9066d9c5021ec68c9a067bec7aeb8f3a6b0e9a9e020e0c +8a6c6ff9edd5885c6a483437e7efaa869293adf67a32600e33636761348cc0c8 +5e2edc003e3648ba4e5817305ea7c9e628dfddb824cd21cb442e86351b344a51 +be8aff5616c430b70b511b41180ae900f54ffd602432d5cd6819dc175d9152a7 +000c58bb9f92742132c18d843df57e88261ed3b70a29552d9ebbd8eb253a090b +5b549095af3534cb71cc4fe9e72b0209a720003e8ebc80b840317cc2ab128dc9 +7d7f472ba00a4ff9255261d7e6a8aa092e101af4fb4b905338ecd7e35fc4d983 +ddf6d23c706f19280511279b151b3306a352265c196b571ab373d6660d67ca7d +d191b1ca60168dde72a4199fdddd0b5e18f125803b6dcf87edabb3b1369ec5fc +fa99daf5fab1b3abdee669938ff18ce9fe61e817af9a009be7f164b1b1e445aa +e17f7a377c14a91ca5dd548a3871fcf4c491d490da1d539cffaf57 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark + +%%EndFont +%%BeginFont: CMBX10 +%!PS-AdobeFont-1.1: CMBX10 1.00B +%%CreationDate: 1992 Feb 19 19:54:06 + +% Copyright (C) 1997 American Mathematical Society. All Rights Reserved. + +11 dict begin +/FontInfo 7 dict dup begin +/version (1.00B) readonly def +/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def +/FullName (CMBX10) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Bold) readonly def +/ItalicAngle 0 def +/isFixedPitch false def +end readonly def +/FontName /CMBX10 def +/PaintType 0 def +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0] readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 45 /hyphen put +dup 47 /slash put +dup 49 /one put +dup 66 /B put +dup 83 /S put +dup 97 /a put +dup 99 /c put +dup 100 /d put +dup 101 /e put +dup 102 /f put +dup 103 /g put +dup 104 /h put +dup 105 /i put +dup 107 /k put +dup 108 /l put +dup 110 /n put +dup 111 /o put +dup 115 /s put +dup 116 /t put +dup 118 /v put +dup 119 /w put +dup 120 /x put +dup 122 /z put +readonly def +/FontBBox{-301 -250 1164 946}readonly def +/UniqueID 5000768 def +currentdict end +currentfile eexec +8053514d28ec28da1630165fab262882d3fca78881823c5537fe6c3dda8ee5b8 +97e17cb027f5c73fdbb56b0a7c25fc3512b55fe8f3acfbffcc7f4a382d8299cc +8fd37d3cea49dabdca92847af0560b404ef71134b0f3d99934fc9d0b4e602011 +b9cfb856c23f958f3c5a2fbe0ef8587d1f5774879c324e51fcb22888b74f2415 +50d7401eb990d4f3a7af635198422283cac1b6cd446ddbcbd915db9bff88844e +784c6bf7389803d9450b0c21756a017306462c563d51ece66fcc9c831843ecae +1fefc1a232e2724f7baee428ae03aadb95c3035345c15e9922fe49e1f2cfc980 +237316572dbc57064edac9b0db8913a5e2d45e97e19a91435ccf8adfc835b585 +48e74b291446d689c7f2f8c4325e8356e974ae30c3e2977477baeaa33d141fb7 +80f59351e84bfc88c87b3a4a1d25e168b9d134554f6a581378c7d2d6eca8ac09 +045cc3a5e0ed86f147133f094029e3483bebc81cfde69942cf645ea20d0a2b64 +5140ccc2f9cb4a3d969f4b0a79cd3329b440dfcff5285494406f3dd08d804c86 +df191e57232f6f1f83df6430f214e03fa5412b1e13d83c60c52a698bc9a38159 +19a64162af7b83a9468fae9507c6cb55ea80df8c696dfbc3296c663902d77e89 +a181502627281181ac8624f65be9de5fb32f056cc7dd7cbc7366a91717b5892a +34ef6b441871c6993da3a81afc9bf70ff3842a21a29c0e49da1ccba37dd6b920 +2702db510b8b1109acf4c27ee8d676bdbd16abe189f34a9b61532eb777457698 +cee0561838eaab2d3939c5093afbb215bac433d1918c739b62566906bb2187f3 +378521fb52e70c18886e1aa15f53a1f8a169528cf2ddd54c203613ff88e619f2 +6c9c50c2c3b8b8c868a88afab1dc8472e7b6f3f992a161723a3c0904865a7c42 +3281601eee91f35222c4a71f343739f102eb43145a47e4fac3bd666e4c114a90 +5950618ecb1bdc29f90f6ebed1d8325fe6b52e14a8870e9b4bb088e585c71b91 +493c12845a101937e3473ac5e9ae24f7c358f06c8b42dee8ef2a1a7a9f536037 +57517f2fb6da0ea305d9d20cc74d922ec4b95b8b299459b71825f6f67abee3a6 +f5267c6283c7c62aa8d36663071f18e1a3f0b35dcd88d739caf8dbc344630a28 +7f583f037768d861f37d7929f248146b5f31ed9f61ef0a9659b50f47ec328516 +9fd999b19687e50303557945476fe9845e5c4780045d84d7df253fe61bf69607 +fd277a2651ef9afc6e55fc68728750f2583b2f48a7b31f594b26bee171463e44 +42e320b124d2b74b0eb0852c0bfcee123aff60111ff606819a119349376e6e66 +5de51bce1092c90a369b91b6fb28d1833fba26d6ef2d9249a6fa8371d3c49f02 +7e7d33a3be0072aeb234d55b28a9c05a8de0e01f4638860ce8be1f31b11b2b14 +e77e172b33a576c6b01ae095d4e83c8d5ab4fbaa7a40b3cb35902a56f6ad6448 +3320b049eceba4d74466964d7d85b1211e3a4afdbd687360a2a95ef084458dcb +3d33ecc40620ea7d41f3a56989e192f79eebcd9c390aec4d3c74c2f6c05bc064 +63282b4bcd14a3e2d3aaf78710f30b0139d93663946fe518d31d2b91cbc7c86c +edb983bba3fad5c45ac7d449fa6eeb7fa1402bbf69e3c8e43cf84b1c551ab7cb +3be6bef4e5f45640eed784af774a81ba105438a81c4bd07ee272380980290420 +e3e9be2543aa77b789cb844e25353f4c58d6ad766efd3aacd8a97f82510fd6ef +20db4495b951f6904a15da01157114c99a6fe7c469ce4d13f0e312e327fe9637 +dd68b8d6bc3f98b7e27ccce022d596dd959e227c49427d086a339f990da3a112 +24fd37cf7405f74f4c75195e2e1f7242a5645635e0bc3ef9cd9e8cac3c988c22 +7f24809d38d268aaaf3dd8175c7101e2a522a9a37693a78f571a68cc0eb7ee6f +c18a887a49066d76ace23f0799d5bb25016d71b5b6284866e6e0ef62f7f78c92 +a73c5404d6035719afc176a8b432234ea5cc4216352d263d395186a68459cf83 +3e66ce988cffb82efc57350d9c40f0fe72148ed6e0bffaca34bc4f0948e15ecb +be2019426ecd695cb39272ea8c1f6778541a1cec61172fc65fdc27382416653c +a8d1a9a7a3f917bebd21aeca26349539afa288d863ac75200f95167e22626072 +318a0e26e936a9b31ec7a7a171ab415406c36585ad83a61d55c58933bc876e7b +f1dae96728b459e53e6879d12b5d8b351da069393630db4246d2ce5d5c6d8ec1 +17931a9ee1fc05c5bdb6372fd1990d2db7c14cc44be9c2aba37dd76ecf8df81f +1f805160ba6dbab66b2d05175ba2170ed35af45f9e799a667443ddbe7ea0b7cd +971ec44a387b6881cd42d8bbd2a455c55fd255b3d87604e8ea3e04bf215bd2b2 +1d7acbfeecbee7c4346e6be0ca063a413475cd243b91904a535f680ad91123c4 +067bb86bb445be9fb2baf014f3cc2aeccced46cea575fd369b6c539c94aa6ef6 +c340303a6e4806798a60f1a71c994198f922e0725929d27b5a4c0079d6a99761 +3eac7e9cb2bc486da9b3fd87c2a528be33fcf845e1849454bd75594c0cb1f65e +73b3a80ec6ecad93010b589f6836cac29f32fafdff5cda75c4500dede1e0c797 +7d7a56a957766c3e920664d502b2cc0406abc971efc805fcb14c1c0f310f7c76 +4990c91767cb6cf2ffbe5b55baa1b7c655db893398a2b26894e3c1b04ef681eb +72ff9e41d4135de6d0a7c3bb5a60393511fc498eb9fd0001ebe0c01a5272d7c6 +719915bacc34ff8dd64a738464d907eb5dbc1fd75c30fe6c08f8fd916aef6462 +adc30c74e104d73a74f560aad605b731676ffd964af8efc6e00db25c79488864 +8b5e78993f8394686982dcebec1b1ba35ea8025dfaf8b07bdcc3579b5f4631ff +4581186d0f1a66109c1b6e48d61fc91e8da7407bb5452badf50e1a1883766d2c +8fc2a7cf34505384c596c683d191f11b06e5b49a5aaaebc8dd014470fd760c69 +d5ed49c475975904bf2bb88aec5336f0dab86fa556cdf4fe708e07e53a272923 +5e04ae4998ea986eac6aebcd5a62de19762dc93a9d4b345ebf3e81d57d470551 +0c9cab1d691c86ac360e5e4a810228ac336ee1d7216f5eebf6ba2d336389e3d9 +322569ab4925510912d8f0e2d78639aac236b64d889b7d2b06529476a5f303f1 +38b26f4808d0ed14f4f7d2de99be4f018fa19f899ae2be36cb8368f94a88a8d6 +1a8fb730d154cc191689c463a9ddfb93cd2700554cbf8c1f9480e5121a165599 +816b518e30473b544f4cd49b3ad96e5ed3d90d6fd049588c58d10f2f449a7622 +26a7fa8e8d9df48d24974b48dd6011e7b3b800bf6cb26a6864fa6bd4fe397e71 +11c9b8904484470e09a61a98c2e454e6b3d6545f978c0a6501bbafde6e0c5442 +6a8078092c44205beb8d355f167a04f449c75943b756211ce9d40e8a15a10c2e +3822dd56aedfc8cbd24c6bd3798f4f47240b5acd6514159e0f2d9d33ca7b6b5a +1dfab37afa1e143b0f4bc86d2e422bd3939bc44148e6fe3ceff6393bad23604b +50dee5f60ff260e9304e9f287533fe30a042401ea588b64bfc77427bdb1aaafa +cfe1d3d9380c5fdaf10ec7727defd57f8accb728c60086011359687b1d9c6729 +964abdc258ac5ae4f44cd0987466c697d8e7315de949a611875f8a34665e52a3 +b416f5d8a6ae3990d9d0ea4e3baf363701795bc46f966e7e9879c10ac9919df6 +9a0caee4c16538232d42bb4d54c7b8a2684b2679748af4bfcac9f573b0c072bd +d0129e7febe4d8b1da354c48288b8e1bfa3e7fa89291272ccfcbfb11735f9fbc +8bc3f8f33c48d9e28f55145d3435a474baf77ec4a3a203cccf5e000ee475f216 +df5987c20fca95d5ace2a479ac00e9633fb1cba88fab4192a14590249cbeeb62 +65e4ca298436c9b9789dfbdc383f2bf51c28fa2404e1ee9de27c7fd5a8cdfc6e +59388c05b02b7d6a3c453ed90fa1d4583c8aa5f090d342f7fef6af693d76e601 +3b2e21fc44884344a1acc7bc0f9617183e5bf1a6efc546de0ef5931217cddccf +c0664d43972048dffc2a931d67cced4ccf8f612128e214f499fe55c5cc08ce37 +4b1f263f35fe7647a9d3ec8684236ee9f6b0b7b1b2b42fbef3b7c47b0f8072e2 +6950e08238dade77db4cc9f733eb7fa43e09e87e8e91f34fe9d39b9e7cc80b9e +91367b07f4887528e1d2efef75b5bd7092aa10ffcde02029bd58c5b67910431a +457abb4219ad0a8f3e76011d4044da14c9c1fd8b995fcbb718649d44ae7fc942 +db3f170258eadc7d6a6ebbce2f96cf382fd6a9e22c359b7ee5cd11c96dcc9752 +0be61049f4ad6320cbddc0ad4a4d44d9f3ac09c66fc8a19e94580758177f3ae0 +8dba341d0310094687a22468e155dda536384a0db805b27e1c035e4937a51345 +e2694592872b9827e2bbb089d4a1918931afb98e86bca03b1a04239c48c71511 +4b7ed9c4ace029caa47f34132c864f2f17e7fbeab7301390b614acce0a0b7305 +0cf0df70c279ff220db024eb4b10c2b0d22324ccf5145da36c8a0ecf7a406fc0 +7c6a59f188f1ed2289cee1fde22ffe94fc1fdb1f99b029913c14a2b8e8c1b9d0 +5d72460f23da144b4f588248b9f8ee3ddb9cecae0ec8034b6d7f2001b78a06e7 +d4599cdc2e8193e0e312480f5cc233b74aef8adaf314c8c297dadb9564849cfe +b47647e300200b4f1387d228ec6cdb49b2394b8bd91a5a9a86257f4540a4e577 +6dd113a1e61532e00d50892dc4b3fc08edd44a919dff62e6d42c9ef10a658bce +1b6ed698a31052532194765996bcadebd47827a3d63ecaccb6a399ad39d2ff81 +73cf820d36c6a716ad06f7a778567bfc4059bfa980e5bb358a0bb6ded3a36250 +fbf6d9c01e678f24b5c7cc3e6ae20b0a836bd73c51c93bc1f46887f4e514f7f6 +43b9ecc5038e8913d1100880433c41df11032d595aca4c64638962934dbd39b9 +d56e8368ce74b3d4212e29806fc201b4254f7781dcdcf2127d11823e4ede3f41 +6bf14f8db371921cd0859a8ad8295dea2d27d23d6583d08aeb0b0710989880da +e06ce66e039f7e278d4d473a8e7a94ece65820541d919b2e1302bd055b049e22 +db574e943eb3e71fbc7307293ee959f101c7c72d43a64fff0226fd7189ec2592 +47948b27ab4f762cdcbdb44153e1ee1aab92fa4a709c069830c5a94c9d5de26d +c240ca902d9e742b654cca2fdc0919f8421fa0a03cc178fb38baca19a5f6f4fe +b8da3e389ad8577ebccd4526c559439ed5ec0e598397c88f5c75747970eb437a +303b4dbbaf1b6924564d68e936702e1e7c6b47a623eee9a1123e774a216d026c +998046d137cb8a42b093088e365517971c28aa17936208084a65ea9fe31b2676 +b2e88efc7d5b2da8b808c80153c53ee4b0956ffa2cff2b9771c80908c5f7a64e +06cc082badf6318592a53f7ec5dc313ac5e783dc85dba1f0f3195700b049aec8 +6a68012f7cf2f202e7d6536915a3f3459dcca21e264e74a9edf872ea329eaa07 +3d91200d6e03e23ec08642866491413d3671009a763aabc3cbf66bbb35fe6ff5 +80adad738500b6bdc6bb949aec46aec6a4bf651dcb44b530dc9155481e545bbd +989c9070d897ce20e518bb03483e391bce2e48ca74ddf455cc3d431aeda5fae3 +08b819511448968a5029db61a09e23290b2dcd24e718aebcdc0de933715a1683 +60298f0c521d5f149f768c37af70b40861987aba545f2f210aaf2fa7f8eeb5c6 +942fc2bcfdd6e9590fdca71a4bc47d9c013de9839c2397a5844d8b81d92f1351 +78e124f4994391749082471802ae447d2f0bebb22af19e9f514e90066e42880d +a2d069a9ebe686735bdaaf56f4be51b5811f01a3d54ccb1aa25f68e3ceb8144a +c1d677ad36d1d93484b16011292084b56ac25597c3380e222bb6df95d13b7d8f +1951ec6684857ae7a911d71cde4e776db40ea3a45dd216df982ff6a49a3c4ee1 +b98f95c3ac8a491c48a6ce0b46f4ee5923501235c30256e7447c2b207926b519 +4dd15e8f28abba2640647a66062a549d726a62e227bd5421122f87bd2633fa1c +99dcc878397b700a1b4b50824c1657a4ecd8dba9321c80a79366279d3601fbc3 +d39e120150c4dcc4b24d8692a98a3df4d13bae1cc32f5fdc2cac2d8a83053833 +6db1e457c6873351ec78ec802a3d27fab0b91c601dfe64912fde593280e8b62c +2c37fe2afbde62dc11b8073ff9f248322d13e89a48768d5c9dbc56664fa5268c +ff163b8350a286ad4aadb919fa1c21d68909be7043e8daf8b8caa26224c8d89e +957080b11fd88237ad44819284c5d9c7685895ceb396189899a5ada41b62bb51 +57da984c2c5c1faf5098b7af0b77510a32ff59bdd947fa9db9a43d5fc3f18ed7 +b3db209c30401b8a80a177b43605c0a47bfbf5f241f5024d51a23e7d54ae6e99 +d86fb09767f55d194849db73726642818232723efc2c68ba40ec5591d99a4e99 +774042269ddd34807eb52ad8e0b557cb3688a4510b956c5e5889cb9ed0c4261b +ad79433850250b7b21f1586869826fd859b083fa4478e18b9ee3afc9ab3f20b3 +e3a457e668b1b6f6aaa2737d83051013c9961031f402c2cc645fd8231fc202cc +fdddf2cc6d9edb5602c74b777190688bc00a07cdf13f54b18b4253522bf3e10f +65e9ba7b4b0e23d36cba02994a2aea4e7797bb06093976d7931c75f8fe3079b7 +7811d2f6e54793bb2e539bb59abda5a86d19e4088296f96da93c7047aedb1cfc +ab51439ecb9455a39ff0872576bc187e112484065f4c0e3fbfadc792d9801b39 +14e880277f760485a048178cb50f4dc1b98a0b6d4b54f450114a4d4ed022bcdd +1425ec71ca577efaec743063cfb590ccb85b91b05f4ab10296a3e7edac254e28 +dd22d852f2cf5e0de1d99a1d4e09101a90fa5778c309e8a89eb0b4e53f6535af +e7a7a188e19cf4a96f876f28a89d6b38c40c1d175abc95422d7743505045682c +8b441960dcde20726f75e8aaa321a86c77f359b3b41550793f04b69cd49849af +8b2071ff0a5190f1105dbee3d78c766335 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark + +%%EndFont +TeXDict begin 39158280 55380996 1000 600 600 (test.dvi) +@start +%DVIPSBitmapFont: Fa ecrm1000 128 2 +/Fa 2 110 df[<0207C5C5C5C5BB12F8A64AA1A1A1A186AB4AA1A1A1A186AC4AA1A1A1A1 +86A4A103FCD06CA101C0CF1207A191D3003F1180D2121FA148D510E0D4120FA1D6001F9E +D6123F11C011030EF8230010F8D7C60EE0A112071080A16D55A1EA007F4A0CF8D7C76C55 +A101078B0F80A16E9CD7C87E0EFCD7C86C54A1150F0EE0A16F54A115019DD7C96C54A1ED +003F0DF8A1A1A116070DE0A17054A116019CD7CAA1A1EA003F0CFCA17154A1170F0CF0A1 +A1A118030CC0A1A1A1180091BDD7CC6C53A1063F870BFCA1A1A11A0F0BF0A1A1A11A0353 +A1A1A11A000B80A1A1A18752D7CDA1A1141F52A17453A1850AF0A1A1A11C0352A1A1A188 +0A80A1A1A1767E99D7CEA1A18151A1A1A18A494FA1A1A1788509F0A1A1A11E0351A1A1A1 +8A51A1A1A18A51A1A1A18B98D7CFA1A18250A1A1A18C50A1A1A18C50A1A1A18C50A1A1A1 +8C50A1A1A18C494EA1A1A17A8450A1A1A18D97D7D0A1A183A24FA1A1A18E4FA1A1A18EA1 +A1A1A184614FA1A1A18EA24FA1A1A18E4FA1A1A18E49A1A1A1A1884FA1A1A18FA296D7D1 +A1A184A24EA1A1A1A17EA24EA1A1A1A17EA24EA1A1A1A17EA2494CA1A1A1A16C82A34EA1 +A1A1A17EA24EA1A1A1A17EA34EA1A1A1A17FA395D7D2A1A18549A1A1A1A188A1A1A1A186 +5FA34DA1A1A1A180A34DA1A1A1A180A3494BA1A1A1A16E81A44DA1A1A1A180A44DA1A1A1 +A180A349A1A1A1A1894DA1A1A1A181A494D7D3A1A186A54CA1A1A1A182A290B6A1A1A1A1 +87A34CA1A1A1A182A54CA1A1A1A182A348A1A1A1A18AA34CA1A1A1A182A64CA1A1A1A182 +A348A1A1A1A18AA44CA1A1A1A182A7484BA1A1A1A17180A893D7D4A1A187A448A1A1A1A1 +8AA44BA1A1A1A184A748A1A1A1A18AA24BA1A1A1A184A948A1A1A1A18A4BA1A1A1A184AB +484AA1A1A1A1721580ABB648A1A1A1A17215C0A6D7D7C6A1A198CAFCB3B3B3B3B3B3B3B3 +B3B3B3B3B3B3B3B3B3B3B3B3B3B3B3A1A14989A4A1A190BF7EA2A1A1488AA2A1A1488AA2 +A1A1488AA2A1A1488AA1A1488AA1A1488BA2A1A1488BA1A1C17EA1110320F8A1598CA159 +8CA1113F7A7EA1598DA158C312F0A1100F22FEA1107FFAFFC0A10F07C512FCA156C5B512 +F0A155C5B712F0A10C07C5B912FCA152C5BD12F0A1070FC5C312FEA1C5C5C112E0B3ACA1 +0FE0D7C6FCA107F0D7D51201A102C0D7D7CE7E>690 720 90 847 +767 84 D[<A1007E111FB600F0A10E3FB612E09F260FFFFE103FB800FEA10C7FB812FC9E +B6100FBA00FEA10A1FBA12FC0D1FB757BC00F8A10803BC12F053B90F1FE1FFC0A1073FF3 +FF800A3FBA56BE00FCA10603BE12F80807BC0E0FE3FFC0A1051FF5FF80077FBD0E7F0CFC +A194C012F8050FBF0D03C16CA103071FFF93C10D1F0EF0A1033F20E0021FC29CC200FEA1 +4AC212FC48C40C03E7FFC0A10107F9FF80C50C1F10F0A1013F22E0A10C7F10FCA190C412 +F8A153C56C110323FFA10B07A100E0110FA112C0A10B1FA100F8113FA112F0A10B7FA100 +FEA0C5B412FCA152C5B56C0F03A113FFA10A07A16E0F0FA180A10A1FA102F00F3FA114E0 +A152A102FC57A114F8A199C5B66C56C5B67EA10903A16F6C0D07A115FFA1519726E00003 +77559726C0000789A1091F07C0C800070AF00D3F0780C8000F1CE0A1097F06F8CA003F75 +9CBA00F0CA6C87A198BACB000375544ECB000787A1080306F0DE007F08FF0C0706E00600 +1BFEA15095CD001F75534DCD003F86A15005F80803755305F0080787A1083F05C0080075 +0B7F0580080187A1504CCF003F749AB800FCCF6C86A197B800F00A0F08FC5205E00A1F1A +F8A1070305C076740A0705807686A14F94D0000174524CD0000386A14F04FC77755104F8 +7786A14F04F00C3F745104E0776C86A1077F04C0787498B800807886A196B8D26C594CD2 +7EA14E04FC79745004F87986A14E04F079745004E07986A14E04C079745004807986A14E +4C79745093D36C86A14E4BD46C735003FC7A86C80007A14A03F87B5803F08D92C76CA148 +4B7B7496B7487B850500A1B7487B744E4C7B8606075804807B744E93D56C86DE007F5793 +D56C574B8E070F5703FCA1734E03F8A1850701574B7C744E4B7C86736C564B7C744E4B7C +86081F564BA1565D08075603807D7395B7D786749DB7D7565D7459A16C7351A16C857455 +4BA1754C4BA18675544BA16C554BA17E755403E0A16C744C03C0A16C8675544BA1565D75 +544BA16C744C92D7C66C86A197D7C66B75544AA16D744C4AA16D86A14C4AA19EB65A759B +B648A1764B4BA188A14B4BA16D544BA17F7557A1764FA188A14B4BA16D544BA17F75534B +A1764B92D7C787A196D7C869A14B4AA16F734B4AA16E86A14BA1A15A76524AA16F534AA1 +81A14EA1784DA189A14B4AA19EB65AA192B648A1565D7655A16F744DA16F86A14AA1A15A +A14A4BA15692D7C9FCA195D7C96C744CA17086A14A4AA1575CA2A14A4AA179494AA18BA1 +4A4AA170524AA1827654A1A15AA14AA17C49A18EA14DA1A15AA14A4AA19EB65AA1A17674 +A17586A191B648A15692D7CAFCA194D7CA67A149A1A15AA14CA10EFE4BA18CA149A17451 +A186A1494AA1575CA14CA1A15AA1A1A101FFA1A17EA1494AA1575CA2A1494AA171514AA1 +83A2A1494AA19EB648A18CA14CA1A1D7CBFCA15BA193D7CC65A190B6FCA14BA1A15AA1A1 +A1A1A181A1B648A17352A184A2A14BA1A15AA3A14BA1A15AA1A1A1A1A181A14BA1A15AA2 +A14BA1A15AA3A14BA1A1D7CDFCA1A177A1A17EA192D7CD64A3A14AA1A15AA1A1A1A1A181 +A2A14AA1A15AA3A14AA1A15AA3A14AA1A15AA4A14AA1A15AA4A14AA1A15AA4A14AA1A1D7 +CEFCA5A191D7CE63A6A149A1A15AA7A149A1A15AAAA149A1A15AB3B3B3B3B3B3B3B3B3B3 +B3B3B05274A15174A198BC7EA65274A198BC6CA15087A399BDA15075A15087A35176A14F +75A15087A25176A14F76A14F875176A14F76A14F88A25176A14F76A14F885176A14F76A1 +4F885176A14F76A196BE7E5176A196BE6CA14E8950BF6CA105030BFFA106071DFE5078A1 +4D78A14D89081F0CF8A1053F0CF0A1057F1EE097C1A14CC000FEA10403C012FC070F0EF0 +A1031FE5FFE0A1033FF7FFC04EC36CA10103C3A10207C212FE4DC56C1103C5A10007C412 +FE047FC5B500FE9EC5B600FC56C5B612F8C5BF4EC5BE00FE0603C5BE12FCB3AC0980CF00 +01A196D00003A14ED0120704F0D7C7000F0FE0D7C7001F0FC0D7C7123F01E0D7CD000709 +C0D7CD000F0980D7CD121F>830 469 95 596 885 109 D E +%EndDVIPSBitmapFont +/Fb 146[886 24[767 84[{}2 1062.68 /CMR10 rf +%DVIPSBitmapFont: Fc ecrm1000 64 2 +/Fc 2 110 df[<013FC5C5B612FEA649A1A181AA0AE0CA000109C0CA12030980CC000707 +F0CDFC90BA00F0CD000107C00807854FCF6C95CF123F07F0764D1C070780764D1C0006FC +D0A1121F06F0774D1D070680A11D004DD1A1133F4DA18B05F0784D1E074DA18B0580A11F +004893D2A16E814CA18D04F8A1210F4CA18D4CA18D4CA18D4CA18D93D3A181A24BA18F4B +A18FA2484AA17D80A24BA18FA24BA18FA24BA18FA24BA18FA392D4A18248A1A183A24AA1 +A17FA34AA1A17FA44AA1A17FA248A1A183A34AA1A17FA54AA1A17FA448A1A1834AA1A17F +A74AA1A17FA448A1A183A491D5A1177FA848A1A18349A1A181AB4848A1A16F1380A6D7A1 +94C8FCB3B3B3B3B3B3B3B3B3B3B3ACA14883A2A14883A2A14883A2A14883A1BA7E598511 +0719F05985117F19FF1007BC12F00F07BE12F00D03C212E098C5BA7EAF0BE0D7C61203> +345 360 109 487 384 84 D[<E007E00703B500F80F3FB57E96B597B700F80D0FB77E05 +0FB6070FDCFFC09BB812FC4BB896B900FC0B0FEFFFC0021FB90603DEFF800A3F18F80003 +BB061F07F051BBFCBC067F07FC09071AC056BC6C081F1AF80E0709E0087F1AFE0E1F754F +BDFC0E7F09FC07071CC055BE071F1CF00D079226FE000F71067FDBE00083550380D9007F +04E095B600F8C7000716FE0D3F02F8C8000F70050303800200825502800301704D02F8C9 +001F829CB500FCCA6C6F4D02C00407820C0302F0051F6F053F91CA0001825402C0716F4D +01FC71825491CB00037093B500F0063F815401FC72704B02C072815401F072704B91CC6C +81C7003F5149736F4B497381DA007F97B50080736F4B01F8738203074F91CD505B03004F +01FC746F4B01C07382704E49746F4B497382041F4E499FB5CEFC704E49746F4A49758170 +4E018074704901F875815390CE4F5B704E48757049497581704FA15A52497A49498B5249 +754E90CF7E704D497A49488CA25249764D488852497A48498D9BD061714C48776F484976 +820A7F6B53A15A5248585BA17103FE798209E1495890D0FC536B09E3E9FF3F8F536B09E7 +49774C4889A209EF90D14D5AA1A188E1FFFEA15AA252A15AA352784D8AA252A1D282A352 +6BA3526BA3526BA499D25FA551A15AA751A15AB3B3B3B3B3B3AD94B76C55709CB77EA44C +7055705482A24C71547054834C71547054834C719BB86C54834C715371548393B900FE0B +0F06E09AB912FE030FDEFFE099BA00FE0A0FF0FFE0020FBC00E097BC00FE080FBC12E0C1 +00FE030FC100E092C112FEAF01E0D0000F4DD106E0D0120F>415 +235 111 362 444 109 D E +%EndDVIPSBitmapFont +/Fd 146[443 24[384 84[{}2 531.341 /CMR10 rf +%DVIPSBitmapFont: Fe ecrm1000 32 2 +/Fe 2 110 df[<0007C5B412FCA648A17FA24CC800074BC812070480030003F0ED003F03 +F8CA6C4A160303C0F7007F92CB6C4A171F4A210702F88D4A8D02C0F9007F4A223F48A16C +7E91CCFC498FA17F5BA17F5BA2498FA3498F003FA11480A349A1127FA549A1123FA4007F +A114C0A390CD1D1FA900FEA1EB0FE0A6CE9AC7FCB3B3B3B3B3AF5180A298B67E50815081 +081FEDFF80071FB97E040FBFFCA70780CB121F>171 180 118 307 +192 84 D<047E922603FFFC96B5FC91260FFFFE033FD9FFE0050F14F848B64BB600FC05 +7F14FFB70307DBFF804BB712E0071F04E0030716F8077F04F8031F16FE4E4848C66E037F +D9803F7F4E01C0010F6D9227FFF00003804E48C700036D4A0180010080DE1FF86E6ED907 +FEC86C7FDE3FE06E6ED90FF86F7FD8000F4C486F6D49486F7F01004CC96C6DD93FC06F7F +023F4A48706D49486F7F6E4A4850C9FC4E706D49707F6E4A484F5A4D48706D484870806E +4A484F5A4E06FF49854DCA4B5A7786057E505A057C089FCB8005FC1ABF4D1ABE04FF7202 +FE844D62A1834D62A34D62A34D62A594CB5DB3B3B3AA4A6E4D6E95B57EA24A6E4D6E4D80 +027F02F0051F02FC050714FF0107B74CB700C0047F15F0BA00F8013FB900FE010FBA1280 +A701F8C94CC9003F0480C8120FD17579F4DE>109 D E +%EndDVIPSBitmapFont +/Ff 146[221 24[192 84[{}2 265.67 /CMR10 rf +%DVIPSBitmapFont: Fg ecrm1000 17 2 +/Fg 2 110 df<001FBDFCA5489026E0000701FCC7148049C7000101F0140F01F8190301 +E01900491A7F491A3F90C8181FA2003E1B0FA348F307C0A400781B03A748F301E0A5C995 +C7FCB3B3B34C7F4C7F043FEBFF80021FB9FCA55B5F7BDE66>84 D<D901F0D90FFEED1FFC +D807FF91267FFFC091B57EB549B500F0010314E0922707F81FFC90390FF03FF892270FC0 +07FE90391F800FFC92271F0001FF90393E0003FE033CDB80788000014A6D4A7FD8007F49 +DBC1E08190263FF1E091267FC3C07F90261FF3C0DBE780814B93C8FC02F716EF92C8D83F +FE6F7E14FF4A5EA24A5EA44A5EB3B1496C4B6C4B7E90B5912601FFFE020313FCB748B6D8 +FE03B612FCA56E3F7BBE77>109 D E +%EndDVIPSBitmapFont +/Fh 146[118 24[102 84[{}2 141.137 /CMR10 rf +%DVIPSBitmapFont: Fi ecrm1000 14 2 +/Fi 2 110 df<003FBB1280A49026FE00019038F0000F01E06D49130049187F48C8EE1F +C0007E190F007C1907A200781903A400701901A500F01AE0481900A6C91700B3B3A94B7F +030F13FE49B812F0A44B4E7CCD54>84 D<01FFD907FCEC07FCB590263FFF8090383FFF80 +92B500E090B512E0913D03F00FF803F00FF8913D07C007FC07C007FC000349C66C6C48C6 +6C7EC6011E0101011E13016D486D6C486D7E4A5D0270157002F0DA7FF06E7E4A5DA24A5D +A34A5DB3AB496C4A6C4A7E486D496D497FB600C0B600C0B612C0A45A337CB261>109 +D E +%EndDVIPSBitmapFont +/Fj 146[97 24[84 84[{}2 116.231 /CMR10 rf +%DVIPSBitmapFont: Fk ecrm1000 12 2 +/Fk 2 110 df<003FB912F8A3903BF8003FF8003F01C06D48130790C71501007EEF00FC +007C187CA20078183CA20070181CA648180EA5C81600B3B3A44B7EEDFFFE0107B712C0A3 +3F437CC248>84 D<D801FCD97FC0EB07FC00FF902601FFF890381FFF8091260780FE9038 +780FE0913C1E007F01E007F000030138903A3F838003F800014990391F87000100004902 +CE804A14CC01FDDA0FFC6D7E4A5C13FF91C75BA3495DB3A8486C4A6C497EB5D8FE0FB500 +E0B512FEA34F2C7DAB54>109 D E +%EndDVIPSBitmapFont +/Fl 146[83 24[72 84[{}2 99.6264 /CMR10 rf +%DVIPSBitmapFont: Fm ecrm1000 7 2 +/Fm 2 110 df<007FB612F0A2397E00F803007814000070157000601530A200E0153848 +1518A5C71400B3A6497E90B512F8A225287EA72A>84 D<3A0F07E007E03AFF1FF81FF890 +39383C383C3A1F601E601ED80F401340496C487EA201001300B13BFFF0FFF0FFF0A22C1A +7E9931>109 D E +%EndDVIPSBitmapFont +/Fn 146[48 24[42 84[{}2 58.1154 /CMR10 rf /Fo 7[42 17[55 +37 112[23 32 28 1[42 42 42 65 3[23 2[28 37 3[37 12[51 +1[55 13[60 11[42 10[28 3[28 28 36[46 46 2[{ + TeXBase1Encoding ReEncodeFont }23 83.022 /Times-Roman +rf +%DVIPSBitmapFont: Fp ecrm1000 10 21 +/Fp 21 249 df<EC0FF8EC7FFE903901F80780903907E001C090391F8000E090383F0007 +017E497EA25BA2485A6F5AED018092C8FCA9ED03F0B7FCA33901F8000F1503B3AA486C49 +7E267FFFE0B512C0A32A3B7FBA2E>28 D<EC0FFC91387FFF70903901F803F0903807E007 +90381F800FEB3F00137EA25B150748481303ADB7FCA33901F80003B3AB486C497E267FFF +E0B512C0A32A3B7FBA2E>I<DA0FF0EB1FF0DA7FFEEBFFFC903B01F80F83F00F903C07E0 +01CFC00380903C1F8000FF0001C090273F0007FE130F017E4948497EA2495CA248485C03 +076E5A03030203C7FC95C8FCA9F007E0BAFCA33C01F80003F0001F1807B3AA486C496C49 +7E267FFFE0B500C1B51280A3413B7FBA45>I<DA0FF8EB1FF8DA7FFF9038FFFEE0903B01 +F80783F007903B07E001CFC00F903B1F8007FF001F4948485A017E5CA2495C180F48486D +4813071503ACBAFCA33C01F80003F00007B3AB486C496C497E267FFFE0B500C1B51280A3 +413B7FBA45>I<121C127FEAFF80A8EA7F00AB123EAB121CABC7FCA8121C127FEAFF80A5 +EA7F00121C093C79BB17>33 D<146014E0EB01C0EB0380EB0700130E131E5B5BA25B485A +A2485AA212075B120F90C7FCA25A121EA2123EA35AA65AB2127CA67EA3121EA2121F7EA2 +7F12077F1203A26C7EA26C7E1378A27F7F130E7FEB0380EB01C0EB00E01460135278BD20 +>40 D<12C07E12707E7E7E120F6C7E6C7EA26C7E6C7EA21378A2137C133C133E131EA213 +1F7FA21480A3EB07C0A6EB03E0B2EB07C0A6EB0F80A31400A25B131EA2133E133C137C13 +78A25BA2485A485AA2485A48C7FC120E5A5A5A5A5A13527CBD20>I<B712C016F816FE00 +0190398001FF806C90C7EA3FE0EE0FF0EE03F8707E707E177FA2EF3F8018C0171F18E017 +0F18F0A3EF07F8A418FCAC18F8A4EF0FF0A218E0A2171F18C0EF3F80A2EF7F0017FE4C5A +4C5AEE0FF0EE3FE0486DEBFF80B8C7FC16F816C036397DB83F>68 +D<B648B512FEA30001902680000313006C90C76C5AB3A491B6FCA391C71201B3A6486D49 +7EB648B512FEA337397DB83E>72 D<003FB812E0A3D9C003EB001F273E0001FE130348EE +01F00078160000701770A300601730A400E01738481718A4C71600B3B0913807FF80011F +B612E0A335397DB83C>84 D<EB03FC90381FFF8090387E03E03901F80070484813F83907 +E001FC380FC003A2EA1F80123F90380001F848EB00F01500A2127E12FEAA127E127FA26C +14067F001F140E6D130C000F141C6C6C13386C6C13706C6C13E039007C07C090381FFF00 +EB07F81F277DA525>99 D<EB07F8EB1FFF90387C0FC03901F803E03903F001F0D807E013 +F8380FC0004848137CA248C7127E153E5A153F127E12FEA3B7FCA248C8FCA5127EA2127F +A26C14037F001F14076C6C13060007140E6D131CD801F013386C6C137090387E03E09038 +1FFF80903803FC0020277EA525>101 D<EA0380EA0FE0487EA56C5AEA0380C8FCAAEA03 +F012FFA312071203B3AA487EB512C0A312387EB717>105 D<2703F00FF0EB1FE000FFD9 +3FFCEB7FF8913AF03F01E07E903BF1C01F83803F3D0FF3800FC7001F802603F70013CE01 +FE14DC49D907F8EB0FC0A2495CA3495CB3A3486C496CEB1FE0B500C1B50083B5FCA34025 +7EA445>109 D<3903F00FF000FFEB3FFCECF03F9039F1C01F803A0FF3800FC03803F700 +13FE496D7EA25BA35BB3A3486C497EB500C1B51280A329257EA42E>I<3807E01F00FFEB +7FC09038E1E3E09038E387F0380FE707EA03E613EE9038EC03E09038FC0080491300A45B +B3A2487EB512F0A31C257EA421>114 D<EBFF03000313E7380F80FF381E003F487F487F +00707F12F0A2807EA27EB490C7FCEA7FE013FF6C13E06C13F86C7F00037FC67F01071380 +EB007F141F00C0EB0FC01407A26C1303A37E15806C13077EEC0F00B4131E38F3C07C38E1 +FFF038C03F801A277DA521>I<1318A51338A31378A313F8120112031207001FB5FCB6FC +A2D801F8C7FCB215C0A93800FC011580EB7C03017E13006D5AEB0FFEEB01F81A347FB220 +>I<EB0FC0EB3FF0EB7018EBC00C48487EA56C6C5AEB7018EB3FF0EB0FC090C9FCA4EB1F +E0EBFFFC3803E03F3907000F80390F8007E0486C6C7E13E06E7EA26E7E6C5A6C5AC8FCA4 +147FEB07FFEB3FE0EBFE00EA03F8EA0FF0EA1FC0123F485A90C7FC160C12FEA31401A26C +13036CEB077C903980063E18383FC01E3A0FE0781FF03A03FFF00FE03A007F8007C02638 +7DB62A>229 D<D91FE0EB07F0D9FFFCEB3FFC2603E03FEBF81F3C07000F81F00F803C0F +8007E3E007C0281FC003F7C013E001E09039FF8003F06E1300EF01F8806C485B6C5AC8EC +00FC5DA4023FB6FC0107B7FC90263FF0FCC8FC3801FE00EA07F8EA0FE0485A485A007F14 +7E90C7FC5A48170C157F4B141C7013184A6D1338007FD903E7147090278007C3E013E03C +3FC00F81F001C03C0FE03E007C07802603FFF890381FFE0026007FC0EB03F836277DA53C +>I<ED0180ED03005D1506150E150C903803F81C90381FFF1890387C07F0EBF0013903E0 +00F85B48487F390F0001DE48149F001EEB038F003EEC0F801406007E15C0007CEB0C0714 +1C00FC011813E0143814301460A214C0A2EB018013031400D87C0714C01306D87E0C130F +003E15805BD81F38EB1F00D80F30131E01F0133E6C485B00035C6C6C485A9038FC07C0D9 +9FFFC7FC380307FC48C9FC1206120E120C121C12185A23347DAB2A>248 +D E +%EndDVIPSBitmapFont +/Fq 133[37 5[32 33 33 2[42 46 69 23 2[23 2[25 37 46 37 +1[42 12[60 46 10[62 3[63 9[23 1[42 42 42 1[42 42 42 42 +42 6[32 32 6[23 4[42 1[60 2[62 7[69 69 46 46 12[{}37 +83.022 /CMR10 rf /Fr 133[42 1[50 69 50 1[37 38 3[48 53 +1[27 50 1[27 53 48 29 44 53 42 1[46 13[53 16[68 16[48 +1[48 1[32 45[{}23 83.022 /CMBX10 rf end +%%EndProlog +%%BeginSetup +%%Feature: *Resolution 600dpi +TeXDict begin +%%PaperSize: A4 + +%%EndSetup +%%Page: 1 1 +1 0 bop 166 83 a Fr(xdvik-t1)32 b(tests)166 266 y(Basic)g(test)f(of)h +(size/width)f(and)h(enco)s(ding)166 407 y Fq(Hei!)p Fp(Hei!)166 +506 y(Hei!)166 606 y Fq(Dette)d(er)e(en)g(test)h(\032\034)-10 +b(\027)-52 b(a)27 b(\014)h(\016)f(\015)h(\017)g(\(cmr\))166 +706 y Fp(Dette)g(er)g(en)f(test)h(\346\370\345)f(\034)g(\036)h(\035)g +(\037)g(\(ecrm\))166 805 y Fo(Dette)21 b(er)f(en)g(test)h(\346\370\345) +g(\002)g(f)n(\002)f(\003)h(f)n(\003)f(\(T)m(imes-Roman)f(ptmr8r\))166 +988 y Fr(Scaling)32 b(tests)166 1129 y Fq(Size)c(is)f(7)g(\(scaled)h +(from)f(10\):)166 1229 y Fn(mT)p Fm(T)166 1281 y(m)166 +1381 y Fq(Size)h(is)f(10)g(\(scaled)g(from)g(10\):)166 +1480 y(mT)p Fp(T)166 1533 y(m)166 1632 y Fq(Size)h(is)f(12)g(\(scaled)g +(from)g(10\):)166 1732 y Fl(mT)p Fk(T)166 1784 y(m)166 +1884 y Fq(Size)h(is)f(14)g(\(scaled)g(from)g(10\):)166 +1993 y Fj(mT)p Fi(T)166 2045 y(m)166 2145 y Fq(Size)h(is)f(17)g +(\(scaled)g(from)g(10\):)166 2271 y Fh(mT)p Fg(T)166 +2324 y(m)166 2423 y Fq(Size)h(is)f(32)g(\(scaled)g(from)g(10\):)166 +2635 y Ff(mT)p Fe(T)166 2711 y(m)166 2810 y Fq(Size)h(is)f(64)g +(\(scaled)g(from)g(10\):)166 3205 y Fd(mT)p Fc(T)166 +3395 y(m)166 3495 y Fq(Size)h(is)f(128)f(\(scaled)i(from)f(10\):)166 +4256 y Fb(mT)p Fa(T)166 4674 y(m)1929 5539 y Fq(1)p eop +%%Trailer +end +userdict /end-hook known{end-hook}if +%%EOF diff --git a/Build/source/texk/windvi/test.tex b/Build/source/texk/windvi/test.tex new file mode 100644 index 00000000000..3f105c31fbf --- /dev/null +++ b/Build/source/texk/windvi/test.tex @@ -0,0 +1,56 @@ +{\bf xdvik-t1 tests} +\vskip10pt + +\font\ec=ecrm1000 at 10pt +\font\tr=ptmr8r at 10pt + +{\bf Basic test of size/width and encoding} +\vskip5pt + +Hei!\ec Hei! + +Hei! + +\rm Dette er en test \ae\o\aa\ fi ffi fl ffl (cmr) + +\ec Dette er en test æøå fi ffi fl ffl (ecrm) + +\tr Dette er en test æøå fi ffi fl ffl (Times-Roman ptmr8r) + +\rm +\vskip 10pt + +{\bf Scaling tests} + +% These tests first show two cmr glyphs, and then two ecrm gyphs for +% comparison of size. + +\vskip 5pt + +\def\testat#1 {{ +\font\ecf=ecrm1000 at #1 pt +\font\rmf=cmr10 at #1 pt +\rm Size is #1 (scaled from 10): + +\rmf mT\ecf T +\vskip-2mm +m + +}} + +% \testat 7 +\testat 10 +\testat 12 + +\testat 14 +\testat 17 + +\testat 32 + +\testat 64 + +\testat 128 + +\rm + +\bye diff --git a/Build/source/texk/windvi/testfont.ps b/Build/source/texk/windvi/testfont.ps new file mode 100644 index 00000000000..0437491f41b --- /dev/null +++ b/Build/source/texk/windvi/testfont.ps @@ -0,0 +1,1163 @@ +%!PS-Adobe-2.0 +%%Creator: dvips(k) 5.78 Copyright 1998 Radical Eye Software (www.radicaleye.com) +%%Title: testfont.dvi +%%Pages: 1 +%%PageOrder: Ascend +%%BoundingBox: 0 0 596 842 +%%DocumentFonts: CMR7 CMR10 CMTI10 Times-Roman CMTT10 +%%EndComments +%DVIPSCommandLine: /local/TEX/bin.linux/dvips -Pbsr testfont.dvi -o +%DVIPSParameters: dpi=300 +%DVIPSSource: TeX output 1999.02.23:1254 +%%BeginProcSet: tex.pro +%! +/TeXDict 300 dict def TeXDict begin /N{def}def /B{bind def}N /S{exch}N +/X{S N}B /TR{translate}N /isls false N /vsize 11 72 mul N /hsize 8.5 72 +mul N /landplus90{false}def /@rigin{isls{[0 landplus90{1 -1}{-1 1} +ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale +isls{landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div +hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul +TR[matrix currentmatrix{dup dup round sub abs 0.00001 lt{round}if} +forall round exch round exch]setmatrix}N /@landscape{/isls true N}B +/@manualfeed{statusdict /manualfeed true put}B /@copies{/#copies X}B +/FMat[1 0 0 -1 0 0]N /FBB[0 0 0 0]N /nn 0 N /IE 0 N /ctr 0 N /df-tail{ +/nn 8 dict N nn begin /FontType 3 N /FontMatrix fntrx N /FontBBox FBB N +string /base X array /BitMaps X /BuildChar{CharBuilder}N /Encoding IE N +end dup{/foo setfont}2 array copy cvx N load 0 nn put /ctr 0 N[}B /df{ +/sf 1 N /fntrx FMat N df-tail}B /dfs{div /sf X /fntrx[sf 0 0 sf neg 0 0] +N df-tail}B /E{pop nn dup definefont setfont}B /ch-width{ch-data dup +length 5 sub get}B /ch-height{ch-data dup length 4 sub get}B /ch-xoff{ +128 ch-data dup length 3 sub get sub}B /ch-yoff{ch-data dup length 2 sub +get 127 sub}B /ch-dx{ch-data dup length 1 sub get}B /ch-image{ch-data +dup type /stringtype ne{ctr get /ctr ctr 1 add N}if}B /id 0 N /rw 0 N +/rc 0 N /gp 0 N /cp 0 N /G 0 N /sf 0 N /CharBuilder{save 3 1 roll S dup +/base get 2 index get S /BitMaps get S get /ch-data X pop /ctr 0 N ch-dx +0 ch-xoff ch-yoff ch-height sub ch-xoff ch-width add ch-yoff +setcachedevice ch-width ch-height true[1 0 0 -1 -.1 ch-xoff sub ch-yoff +.1 sub]{ch-image}imagemask restore}B /D{/cc X dup type /stringtype ne{]} +if nn /base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{dup dup +length 1 sub dup 2 index S get sf div put}if put /ctr ctr 1 add N}B /I{ +cc 1 add D}B /bop{userdict /bop-hook known{bop-hook}if /SI save N @rigin +0 0 moveto /V matrix currentmatrix dup 1 get dup mul exch 0 get dup mul +add .99 lt{/QV}{/RV}ifelse load def pop pop}N /eop{SI restore userdict +/eop-hook known{eop-hook}if showpage}N /@start{userdict /start-hook +known{start-hook}if pop /VResolution X /Resolution X 1000 div /DVImag X +/IE 256 array N 2 string 0 1 255{IE S dup 360 add 36 4 index cvrs cvn +put}for pop 65781.76 div /vsize X 65781.76 div /hsize X}N /p{show}N +/RMat[1 0 0 -1 0 0]N /BDot 260 string N /rulex 0 N /ruley 0 N /v{/ruley +X /rulex X V}B /V{}B /RV statusdict begin /product where{pop false[ +(Display)(NeXT)(LaserWriter 16/600)]{dup length product length le{dup +length product exch 0 exch getinterval eq{pop true exit}if}{pop}ifelse} +forall}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale rulex ruley false +RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR rulex ruley scale 1 1 +false RMat{BDot}imagemask grestore}}ifelse B /QV{gsave newpath transform +round exch round exch itransform moveto rulex 0 rlineto 0 ruley neg +rlineto rulex neg 0 rlineto fill grestore}B /a{moveto}B /delta 0 N /tail +{dup /delta X 0 rmoveto}B /M{S p delta add tail}B /b{S p tail}B /c{-4 M} +B /d{-3 M}B /e{-2 M}B /f{-1 M}B /g{0 M}B /h{1 M}B /i{2 M}B /j{3 M}B /k{ +4 M}B /w{0 rmoveto}B /l{p -4 w}B /m{p -3 w}B /n{p -2 w}B /o{p -1 w}B /q{ +p 1 w}B /r{p 2 w}B /s{p 3 w}B /t{p 4 w}B /x{0 S rmoveto}B /y{3 2 roll p +a}B /bos{/SS save N}B /eos{SS restore}B end + +%%EndProcSet +%%BeginProcSet: 8r.enc +% @@psencodingfile@{ +% author = "S. Rahtz, P. MacKay, Alan Jeffrey, B. Horn, K. Berry", +% version = "0.6", +% date = "22 June 1996", +% filename = "8r.enc", +% email = "kb@@mail.tug.org", +% address = "135 Center Hill Rd. // Plymouth, MA 02360", +% codetable = "ISO/ASCII", +% checksum = "119 662 4424", +% docstring = "Encoding for TrueType or Type 1 fonts to be used with TeX." +% @} +% +% Idea is to have all the characters normally included in Type 1 fonts +% available for typesetting. This is effectively the characters in Adobe +% Standard Encoding + ISO Latin 1 + extra characters from Lucida. +% +% Character code assignments were made as follows: +% +% (1) the Windows ANSI characters are almost all in their Windows ANSI +% positions, because some Windows users cannot easily reencode the +% fonts, and it makes no difference on other systems. The only Windows +% ANSI characters not available are those that make no sense for +% typesetting -- rubout (127 decimal), nobreakspace (160), softhyphen +% (173). quotesingle and grave are moved just because it's such an +% irritation not having them in TeX positions. +% +% (2) Remaining characters are assigned arbitrarily to the lower part +% of the range, avoiding 0, 10 and 13 in case we meet dumb software. +% +% (3) Y&Y Lucida Bright includes some extra text characters; in the +% hopes that other PostScript fonts, perhaps created for public +% consumption, will include them, they are included starting at 0x12. +% +% (4) Remaining positions left undefined are for use in (hopefully) +% upward-compatible revisions, if someday more characters are generally +% available. +% +% (5) hyphen appears twice for compatibility with both ASCII and Windows. +% +Encoding=TeXBase1Encoding +.notdef % 0x00 +dotaccent +fi +fl +fraction +hungarumlaut +Lslash +lslash +ogonek +ring +.notdef +breve +minus +.notdef +Zcaron % These are the only two remaining unencoded characters, so +zcaron % may as well include them. +/caron % 0x10 +/dotlessi +dotlessj % (unusual TeX characters available in, e.g., Lucida Bright) +ff +ffi +ffl +.notdef +.notdef +.notdef +.notdef +.notdef +.notdef +.notdef +.notdef +grave % very contentious; it's painful not having quoteleft and quoteright +quotesingle % at 96 and 145 that we move the things normally found there down to here. +space % 0x20 (ASCII begins) +exclam +quotedbl +numbersign +dollar +percent +ampersand +quoteright +parenleft +parenright +asterisk +plus +comma +hyphen +period +slash +zero % 0x30 = 0 +one +two +three +four +five +six +seven +eight +nine +colon +semicolon +less +equal +greater +question +at % 0x40 +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +P % 0x50 +Q +R +S +T +U +V +W +X +Y +Z +bracketleft +backslash +bracketright +asciicircum +underscore +quoteleft % 0x60 +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +p % 0x70 +q +r +s +t +u +v +w +x +y +z +braceleft +bar +braceright +asciitilde +.notdef % rubout; ASCII ends +.notdef % 0x80 +.notdef +quotesinglbase +florin +quotedblbase +ellipsis +dagger +daggerdbl +circumflex +perthousand +Scaron +guilsinglleft +OE +.notdef +.notdef +.notdef +.notdef % 0x90 +.notdef +.notdef +quotedblleft +quotedblright +bullet +endash +emdash +tilde +trademark +scaron +guilsinglright +oe +.notdef +.notdef +Ydieresis +.notdef % 0xA0 - nobreakspace +exclamdown +cent +sterling +currency +yen +brokenbar +section +dieresis +copyright +ordfeminine +guillemotleft +logicalnot +hyphen % Y&Y (also at 45); Windows' softhyphen +registered +macron +degree % 0xD0 +plusminus +twosuperior +threesuperior +acute +mu +paragraph +periodcentered +cedilla +onesuperior +ordmasculine +guillemotright +onequarter +onehalf +threequarters +questiondown +Agrave % 0xC0 +Aacute +Acircumflex +Atilde +Adieresis +Aring +AE +Ccedilla +Egrave +Eacute +Ecircumflex +Edieresis +Igrave +Iacute +Icircumflex +Idieresis +Eth % 0xD0 +Ntilde +Ograve +Oacute +Ocircumflex +Otilde +Odieresis +multiply +Oslash +Ugrave +Uacute +Ucircumflex +Udieresis +Yacute +Thorn +germandbls +agrave % 0xE0 +aacute +acircumflex +atilde +adieresis +aring +ae +ccedilla +egrave +eacute +ecircumflex +edieresis +igrave +iacute +icircumflex +idieresis +eth % 0xF0 +ntilde +ograve +oacute +ocircumflex +otilde +odieresis +divide +oslash +ugrave +uacute +ucircumflex +udieresis +yacute +thorn +ydieresis + + +%%EndProcSet +%%BeginProcSet: texps.pro +%! +TeXDict begin /rf{findfont dup length 1 add dict begin{1 index /FID ne 2 +index /UniqueID ne and{def}{pop pop}ifelse}forall[1 index 0 6 -1 roll +exec 0 exch 5 -1 roll VResolution Resolution div mul neg 0 0]/Metrics +exch def dict begin Encoding{exch dup type /integertype ne{pop pop 1 sub +dup 0 le{pop}{[}ifelse}{FontMatrix 0 get div Metrics 0 get div def} +ifelse}forall Metrics /Metrics currentdict end def[2 index currentdict +end definefont 3 -1 roll makefont /setfont cvx]cvx def}def /ObliqueSlant +{dup sin S cos div neg}B /SlantFont{4 index mul add}def /ExtendFont{3 -1 +roll mul exch}def /ReEncodeFont{/Encoding exch def}def end + +%%EndProcSet +%%BeginFont: CMTT10 +%!PS-AdobeFont-1.1: CMTT10 1.00B +%%CreationDate: 1992 Apr 26 10:42:42 + +% Copyright (C) 1997 American Mathematical Society. All Rights Reserved. + +11 dict begin +/FontInfo 7 dict dup begin +/version (1.00B) readonly def +/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def +/FullName (CMTT10) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle 0 def +/isFixedPitch true def +end readonly def +/FontName /CMTT10 def +/PaintType 0 def +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0] readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 48 /zero put +dup 49 /one put +dup 50 /two put +dup 51 /three put +dup 52 /four put +dup 53 /five put +dup 54 /six put +dup 55 /seven put +dup 56 /eight put +dup 57 /nine put +dup 65 /A put +dup 66 /B put +dup 67 /C put +dup 68 /D put +dup 69 /E put +dup 70 /F put +dup 120 /x put +readonly def +/FontBBox{-4 -235 731 800}readonly def +/UniqueID 5000832 def +currentdict end +currentfile eexec +8053514d28ec28da1630165fab262882d3fca78881823c5537fe6c3dda8ee5b8 +97e17cb027f5c73fdbb56b0a7c25fc3512b55fe8f3acfbffcc7f4a382d8299cc +8fd37d3cea49dabdca92847af0560b404ef71134b0f3d99934fc9d0b4e602011 +b9cfb856c23f958f3c5a2fbe0ef8587d1f5774879c324e51fcb22888b74f2415 +50d7401eb990d4f3a7af635198422283cac1b6cd446ddbcbd915db9bff88844e +784c6bf7389803d9450b0c21756a017306462c563d51ecefaacd079732f12c29 +315e4b9623a5752c6f1d8145869e120d910b2644887cea7e30b15676a92537c2 +9d3aa80dc30082aba94b40990b82fb1a877e805e0c8c48f61e9f2edac05b944e +e4d8084ec1d5cc517aaeec5b3ea379dd011eeb454cecab3ad2443c887c582789 +72355673e503affe0394fc7db31de364e4f56c24033c7df2265c56445ec63a1d +5695a6041ea1b94407e1cdb7c5635603a4fd047e6edcaeb2d0da6c9e0e9396d5 +1a4a58e8fdc1578730f992435560a6e2d3e3687703ee2f78f5896389ac8470bc +806169eb01762e89b6dc9adf857ead656620e2589aae722c37a2ed7a2941c360 +b067ee34d8d5ca3bf68db725614d936bcb207781f4d4ec2ac67b13a5ad161f3f +059add7b5e3d904831e31c20c04546fae83ca93a35989e65c201756888f727b9 +7e5313c9870ec96e4cec3901ea03a5c744754485e7d169bbc98bf872d0796e18 +9d43b712950c3786257d8be06ab6080b9d9392313298327549a8a41c00a2cea3 +690b4a333e45aa815a64facae1c2b44640860b8b8687afbefdbd5b4a541a7251 +4ee7d3e0752af3e96a88c95d31fa16d34ba2f02fdb0088b165844f02611c734a +dbcc2037bf741fdea7e8bcdc130c70c33772f777d8bcddf4611db99001ccff14 +d7af2bb05defc3480bdab312a0eff2f375afb4e0df2f803c594b7c93f71ca4af +861ae1711932fef19bfe2f9b7adb69d68e5a70ea4d1a3d5bd85231b16993f65e +fb37a2027d1d9e35806536824b07416071bfb1d133185d44bbd07ad73f224355 +a9dbde77c4448edad90700807ecc4dad98e2f7dd7dcfef27ccc42a9e61d29bcd +629c16837262fa3d6c487761a17d2763c15e3abdfeb85e7ac9a5a1169e5046f1 +566f5b24aeace067107be342341d1306e185ccb91fb008f58d444265813a4439 +9ab2722696525c2c0a7540e1e39d1e5bb29402328a80f8d1b1f6342dc65b5ae4 +479c5dd90b38f563290ccbbdb69e6a52321f7c9813dcf5454e2578a3a6e210fa +2b992038527fd6fbd20b09a19c182b999ea5f299fac11b94455dd7bdfd7d86f9 +dedd098fa3d5d3b80ad3518af35ea31f2cfc8c2fd50245aa9b3f56e9d72c9a2a +ce2559bae76aa3497137f29d0457ff6b04493ba09a3ac8b7dd3aa0978f8b340f +86b3ebb0f26628203d256d9c07b624305689df8c7471db49707b3d8b5a81cf6c +bf96ca4b9d261b7f18efc00d01c68fe85e60d094223acfb2bc5cf9d4d8e41702 +64a2af5938a5f341439ee2388d305db72dc335c8ea3670bbe18a059d924d7b35 +54fe58c74ba977cbf9d490f96ee46fe7b2274dbbb37bf83e2ba3763646f62861 +1007b650087366959d673f4734bc94915d6eed6aed703471a85a340f2a57418f +5fc4c9c242cd2c2624e407b038d6adb30057172f3c332b2fb40fc237da457659 +de341cfc76d6d5f8dac339fc7fd5195ff4b545b1c8df0bce4cf36b353c52d91c +c68cd64f5a2775395a2f8bb24fa36ff29d8b95b2021e87f5b03d3780abde0517 +916aadf3273a34fbd9748a5f6a16c5a47819ea9d010382a1fc1f7d64a594d5f9 +2cdcf562d1091719b626846fbd24390021f818c2a729639eac2f302bdabe4525 +814d9899364a35a77ba30be1fbf1080b083c17ddfdeb57f392cff9c29d344fbb +2ca80f883d7a7ebe2670483d228560474c0963cb0e70d90b1a870609edd34f8e +ff765019b6296cc51627973867562e50ad3228838f5211a08b9fd937c728da7c +baed376e8eccf67b79290baa07fa7f6148bcf775aa2e8cbff6cee55c7eb5887c +00a8cd1d6ec51d8ac8464b80d41517c23dfc9f44a368537086d24340c3d2ede3 +f6ec6bb1c3a8cf6b30583b772de2c7c77c7249178caadbbbb90b491dd8a13be2 +437253d218284d95869ed6c10bdd82512ef87fa8fc4f7fb5a3c17132a65e7144 +dc850d519c30d6caaa47712dd203d531025d5a7b25ace0254e6a4d3b18f2156b +b57259e317e2242daa5c3ad8efb52018f188333733caa7afda212a6d2ea0eb58 +ec0456f52bd57c2eea3b46747d715ee8f5cf4f6468264565cde2ca4145ba3ced +6023823674b0760d6fa13f0b015a313d2c9fffe2ffb131725f980c8a498e5577 +4bf55ac1d6bfb064916b0a612bfb67de21f87ba27f32c4885ff3073d31535c8f +ba0a7b97e14755e05b6fd988e0a0711a41b5508e0b3e39581f7ae74f09eea25c +135726e8cafe5042f74d7b12e657581d434f1b495401fab844b2ef53503577a9 +10ae5626cbf09e873c94055425d1fdd897ba724851e073cdfc47b268111ba884 +93bc13ff3ff9b6dbf51821d603928e61667cbc2dff21fe3d6f0c993b6d024367 +c45e24f9c8067312c442a04c6a0fcc8a3951f169d4f1a470ec2cdf4938871962 +3fe6a5171b89910fb4c55bd80e91993291486030dc287dcfefc7d36466ae0cab +281a7d2f97d462447342ae7c58707d816b36c28b168b282270ca2e5ec8462181 +afafa1795c63f1d94a3dc19d8fc77a1224bf9f1b17f540975043f4fb4ea53c70 +fd6a06d22e1f897b6874e789b36637f29e17be66786607554082833e0ddfd9ef +b81666ba274c1bb48e6d8cbbb14d7d470bd0678da2cec23c0aae40de2df12864 +532e28fa20a9fb9b9617be7112104ac45b2f52441a0626ecc29dc7c839a925fb +85617b499893da7fef0436c62f013740805e163a417a29f2f0f6fd6ba54b0b74 +9fb8cb1d4cf154f46a82bf8a0629ef54ce71e87d7bda6a3a5b5494bada9f64e2 +fb1a9ee15c88566a324b314cde22e7aeb5ef8790c35bcd9b965656a9dc9a0f85 +fda19bba57a1f3274ed0bd186d39123096dca81b62253fcbf623cf5b64e12c63 +7bac7b37e6ba58f7a29badd3b12ac3318a7120850d87b32c7531956d9673c159 +97825a157e9e796e59316e16c316c64f988bfba8248270816314cb038f2aca6a +74918e23d7fb45c20333e83dbed2859e25dce40e32c3d25b9b6e1fdfc4ec5f76 +cb196344ed1087eabe54ae390f7638cc9ed60684b0ffa0a0c85220016b5164cf +5552a3df239624aeb319ad9df91010c4e7993b7157dd1c73a9e654625b722a39 +ae8c78bc7c4388d16fc12cbfdf98e686b6c0909ee912f69f260e1ab017140817 +d7acc0aead359b8cee0bafc979bbedfbada7f74d7199d82f6dd8d7c023c0369e +4826f4ce3b1f1d31ea6e633df086fe4e69d9e6f0ac0dd70fa55b0a3b12cba571 +d0400cfcd448dd4656e785f0dfc0f3bf8240b1ac81b8651542a11e3fca8aa457 +51c8321f12a4d7f0006f44b02278ae27006d9c603ff35791f7296f0dc437b462 +e7f7ad957022f83364d4db38b359c261027ddb65a605536d17feda34f103abf7 +8c8caba79a5a0b59440d54188a5672e221a3e81712c95dc3c36e8c1150dc4613 +50a22af4df24ce4c6663aead8199aa72711226fc35779f6db844476096ae5e9e +99db9d1757c255b1de109fb973aa02d587ce9a1edee4ea198c333eb0b23fab38 +cc246b71143a1adbfab628de5856530074eccf9ad2a8cc0d90a0459a0382f0a3 +e683adc6f1aecdb78deb2ba9d8c6378235214f5712a38ef8bbba32c89ef4d118 +0c45c2cbbd7d761de2f7082e4d82855b35c62edb6c2d589ad7fe8ad1ef26db42 +7d04ad77ad0aa7b16424ac52ebd5d4443eb15668660767fec2f9e4c4076e4013 +48c2d0247c58124b60b08039637c2f455fae6c4acd5602d37cfa7b9ab053937e +924a71d4fbe628fe5690ca70e524b6ccf598aa1b4454ea535933153700329b22 +f2dd616150fe122b76e44eda7371cbb2566585ea4cdfae3b24b5eb838708020d +8a4986068c75bfe3f4f7d213349307021e93e88fad1999ed55b85c4c788681ce +ac4c2c5c0cc51d2d1d3871424168ebbd0c30d6a91a294cefa9bb6c1ef5d876a1 +feae93d9d64e0ca1e132be886fdce9184611e7ee2fbc1e3839f672cfe4e3c986 +e457ebd86c42c8d4474c04a9907d7e15fb5763ea4e736aaa59c5a3facc1e003d +ec5d7433bacece6f0bfa26766d9498ed7226aa5aea5c879795cc6681af310f81 +6c05d685030ddc0c42bb7c78e51e924c2531585f089e732e1ffbd02365d41282 +a49ff9424f810a52057ce22136e485de6c129056c3360dbb2e1f51c4b7d7628d +c158ca43a1295b991a876b72d1ef6d400ad91800ff24ab15956ce843fc102c9b +8ee8a581707f29380eec323ada86ffde49e4cdf322fa4a44fe893bb09b2f34b5 +d9f1fca9c4e3d56cd1727b0c6a2a9a2b896ad91ea382ef45a779c8169ec3e1f9 +a3f33fc26f699fd7717b9a78822bf4964be16711dc143985b43b6b8bcadf8c48 +7adc39d1f9b8b86ab9b9018161359fce988cffb82ecac9298c601a4a2d5ab81b +89c2daeb1050617748ce26da711083308a50b4b1eeac3926efedaaf46c08d2b4 +8816b40477fb16d329cfe3ee8d383e1749fb1570e71aac1eaa17767edaeb6f3b +3631e8486dc1eef011cc9ccf0029464c42bec801db0c78ec7bc5649950ec5e41 +b475fd9354114cc70bb7d253882d5693b94f6fb11ebb14bebe641d0a31c38d03 +7aa93414f991800c18149b282c37d3edba7019347be33aedb44daa6c1226a275 +259cdf5802a227ea17acce18365c449216b233aad1ca9c410659668d920a0b9d +9475f2498125be4fc088f41b416d590b5520a46277266b1eba405ac282247ee1 +5c70f65ef93be5cbfc6c8fb3749cb1966902289b1e4999a39e6c293736139c42 +542c83dbbeb104fed1c96777e0e950a812036292aeca82ffa6e7353c7844d7e2 +7c035017725ddffc7712f6fceb87134e507224389b09faa20666ffc3a7d76a3f +162015c45884a8d89d1ba620c36de7be6b4ebfae158e8f7500ce841ba3d1a2de +a8e879b41cf19cf5b95d22f51594306c6131b9f41aac7de121b1cb3bb22837cf +1a960b59152149aec11dbc6afaf02c7e724fe3c167dd7894f8b848ef0822e430 +40fdd88dc24b1a030fa8ff3875a5d41fea50776901f12456204c720d2c5493bf +18e06fc17ba1935265c39642db527747ba1164c73340b126226bacbf6d7e0c8c +871f77912ea894ae4d40027e837599153065b7fcd246ab1819f52223738de627 +49bfe3755140a6e5ee52362fd9578aeaf79d6e08440f2c74e832f016a8dc14a2 +05681bc48161f552b31a869b3f745ee0862f912c1e0156e9856b9c235de0bc63 +aef40dd77c73bd829e5eafe9eadf27296e4a19fa99c2393e188b +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark + +%%EndFont +%%BeginFont: CMTI10 +%!PS-AdobeFont-1.1: CMTI10 1.00B +%%CreationDate: 1992 Feb 19 19:56:16 + +% Copyright (C) 1997 American Mathematical Society. All Rights Reserved. + +11 dict begin +/FontInfo 7 dict dup begin +/version (1.00B) readonly def +/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def +/FullName (CMTI10) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle -14.04 def +/isFixedPitch false def +end readonly def +/FontName /CMTI10 def +/PaintType 0 def +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0] readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 48 /zero put +dup 49 /one put +dup 50 /two put +dup 51 /three put +dup 52 /four put +dup 53 /five put +dup 54 /six put +dup 55 /seven put +dup 120 /x put +readonly def +/FontBBox{-163 -250 1146 969}readonly def +/UniqueID 5000828 def +currentdict end +currentfile eexec +8053514d28ec28da1630165fab262882d3ffd20326947b1065649b533eb5e9e3 +a88a87fe987918a687950b26f647d6e08bf14d983ed1d4a8ca1e2da8d985f944 +2eb916f5b6ed0697ac7c33e1e36a3bf460d34ce45f1631871097cb04f18e3889 +4cf4ac1538eb19481311d24fe3be7beaa4a3730e8b4831fe59d6d9ce2e46116b +629c7ba2f9ce3ecba2f43bc162a5a077ca1b2882a42afdcec3f4b75b5d63e0bc +8e5dc95257766d8ea467ad9cbaf47be60f797580cced6884b3a68f70c91f4fdf +80fd00ed9139e7f480dc3a76af72ad9b434187730bdfaefe4cbfe5c7edcaaf24 +9204fd703011932e5a3c27be468b7dab69daa18dbbb6335ab8ddfdc607961c7c +02582763fa069d43563ba17704029945cf42fcb19cf78c51df0ec4d851086d43 +c1ab38e865ef36865fff3a08b01cbcb070ba4893f7482dc7819ad03d337e520e +7d8cd83bb8ac7aff4df36751f4f12aaaea2b6d7260c09a26e987c904003e0723 +7dbcc4a8e4e85cd3259f40d3caf55c742cbb40ad0db1044c20a4f122a63f7b81 +1d945bfa69662189ce4d089464d2ead9f6ed60b581b04114d5d45e97be27a576 +35154e9b8464f2a0df18da855eb51b8f64d3054b0b2e84621f025a0776d16fed +b988a43d2d64c32768dd106b9f541ae8e68ac0bb7399e16f4d4ba074b2152d0a +4e9b5bfc21bfa0d531e28165e518ffc054dd4ed0d74eca079d20e79670419f92 +e03bcbfeecf3554d661596f6f29e12170804d15a250d917ffe7a8b6e8fa53047 +1ed97ba56481589a65ca13619129f1e26affe6c22f0c38540f8ce37efb6e9e9b +60b51a5a9cb4454fd7c7f92f2f9437159687ab590f35b946a54491a7739c9269 +e0f1fb48b129811c82edb3171cbd5105fe65906974db8a7da92f4f43dc7f6b36 +6981146d86d23613a0b38d9d6191db9fea0172e982cb1cc50e382f69da1b377c +1be9407f88a2a761b56f398467a057f35d18c01cc377e0061d3d42ce273b1118 +f0bf5d37b697e36eb768262623d6e413c1999cd2bcf7179ed3a8b2f1d9679ca6 +ddba2b6c5c5400f5aed8193f43df06064fb2bf5b366cdb4ddfdad7922e56cd84 +c6e56e61050bb8de08e5eadd8c384dd2856b3c21f9264921a825f30b42d24f08 +0a4d01d45d3f84eb63f8dbe04ef3a35e45719ecdc5b9579a9fa303bc1bf40678 +e646e4ba5dde02c1b75f0174cc51a689827fa3d56ae5215704e13b10a51aa593 +8a0220eb33f66616838830082ab372db64c6026c07503462f9507fcf5f75c905 +851c22064fc2da6b1c54a94c7795ea0bd88fdb5e91d176c416faefe36e1524b5 +9b8c99d8e3459884396f547fbef037f93ca8e6a9ab6d926bea8e1449fd54fa2c +547313b95a138be0da13770392af4f04135a0d64c8f5216b3e0087d84fb9cc8b +d6ffb895f90becb7863f025aefc8bba0e044064d77bf40a77f65d3749646d581 +75d54eb46d0ec455c7f5aec8e2cdcd5b643e09431ef1424f31aee7d082d3398c +1772c3ccde9221736b7d094abc032d520b71c4feaaa63dfa13c6599f2899acf8 +43c8670e5d9cae8933d3b9b713418646093d88cc5c090eacc26f6b9bb171129c +f1bce75206001dd677592b6d1dc5fd954ffa95904e1f6bfe565677eb4abad647 +ac7ea72109ec7bf632530795c3d642e73e9aaed4fece16a0d4b249ceb583e88e +6750b31516f6b0ec2e907059d836bbcba203f0b5725fab971296ec0a83526972 +657b1a3cf500a08f307a862cb6ede873f79f3f06abeabf40bdd8354a14eb6075 +f968620fd64aa5324e7ab40d53e29b87ae37387be52a64bdc69f56bcaebb7119 +cb87ce08d54aa98d7f65ed14a23e23939fdf3a7a31da836e7f751002ea4f29c7 +f7058c5690b996d2beb258248596abc823899f61cdfddb99be5c48363aa7b4f8 +31b18244d60003d74b9b45fa9e53bb5fb1a08674998aba119b4e6cc0384ddf49 +65eacdc651b76e18eccd02a4a8a8c1f5ad2be56c3d5d4f1a1999d3018d3f519d +545613272cd6d71b57fc77d4fdfa4c0d84634abe27f6f86d9e0329ac84b1b535 +c05807317cb0f1050cec239c00d62a53adc386783edcd0ea551d2837f8799c6b +0849c848ba15a9f6cd3e8853bfca64aa16ea45ac60be44ac27b6e3ba3fee2bd4 +55946203474e35d3fb86cf266d29b51f3453a32f302df06b416fe3fc3a6bd96e +b93e96d6bd57d822bfa34228d045318500a40eda4e18440d9a6a73dc7d59f353 +0d7795b60aadb22da15646e58c80da0831ec53c27926321e72662afbf7259200 +91c677dfb3e1967fe34ca55263586cbed46d1a5ccfac2f1be1e98f3c1a9eedc5 +d5e8ad62e3f5368ba809d9b6645ec86d1d903049634c9fb3164badb10dcbbe54 +efacb5661ff5ff175bcedb409b1a51496d95f3077e82c2fc572679a09779cae8 +8d0fb645e59c6d3e2086e6a43056d63151b0b9aae3d3b64b46a4cd9e39a82177 +d9beea14a58c4b65c3c660de33040f581a2da84be322607c87ae17195477e524 +65d27fee986a0786e9c67cf6cf3bee66da097a83bfc7de54bed019199aa2b27b +241cb8d2fd3cf03818d697278ee07eeb755b000fc3a7a8dadbcbd0db86c710a9 +f883775ca49994ce2a7e42706487d44f6d25620ba1a324f9b059b8f0449bd229 +ed98b9ad6fe67189919fa2abc4be46e47d90da1030830dfe9dadf18d1667ae06 +60043854f1e3053170d63886749142f94be451afee45b1f806f548951f006e13 +b3d81531474bb7a2e2f38f5dccc81914a89bbfb3ae7be07b10ae9f0dbdcc13ee +67af6b104ff71671069210477a9c6fa1d2dc28eb63f6fc0f6ad77f8191ecae58 +15dc15abca932a0b2dc119c80b2e2f8acfd2c12c45edf708df33bc0b947ebbf6 +2297e108d69abc8aecf5b518848f0197e6e638c9c31b17fca14160ab2a13709f +e92ac52ced277ed777f3fc95f6eefc6a833995f3aada8623b9e1113c1bc7915c +51033381e4f6ad8e3304b5ba8bad51be85380b2048779b27269633a8ca4f9822 +a7f5a654c141622dab04f7652819240918d9d977697c7f522ae63e4f673d5c9f +27ee1187b1ac2999f9b296a1733eb07bcffe59ef9ff83ca3e967b55f8baccf5b +fa09a6a05c1ac6fc0b0488cdaed8bf2ae72191ce8dda5442a7c9afe7f268b0fd +5056345729114940ab04be7b1832ac7cba56cd0fcef6fd0a51e565b407f939fd +e5df2ab90dbb401446ef0630ac7cf166c57bfff371366d1c2c2fdc528d90525c +ea87f126b58ba4272d440a6cd6f74961551a99a3f6ed74f045ba61c8bf940bd6 +6313cde736655ef44afb3b082008ff7fbfaa714f141960b46831527fd22e60dd +4f41036ec6eb7b89ea67a63aea0297bea19eea48ca6235cbf1cd9a592e40b072 +bfae1cc392ebbcab1fa09893092bd02e89f9f42edadac796a4ce1299795c6f5c +bd8923162f0493c417696ec4c6b0e48e6043ff242e9c101a851cdea3539c60c6 +677d62bcd1b7e96162a345b3f0b105e906fcf3d3836252a11f4574b262b155b3 +61a8e5157108196f99beaf31a765e4dec5b463d347bd2af1f156a3488024813b +dcf16db4a6e5eb801be3320d2605b38dfb447a1426b46480dbe634caf26a3550 +e9bacff68fb0e9373df558c94cf8879a45213648280c47ef2015b9480e477b71 +d7b302fab85edc169da1aa8fe2059085f51239dd249d3b172d18b48f7ecaa4aa +76268c5cc4a26614b6217a14c86899af03f57df68cceff2a6cdcf7ddb6eb8d6b +7fe41daaf18b5a0b11c2da4a09b571c0fcc6680f47a5aa6104d87c633ae5edf6 +3520a90059aa8d82b5d5e261adcfdc03cb9ed3465c4a1d0f8376a08978736b9b +c3d4bd28062170cb452d7b508e542fd453802c71f67661805351e3624e41c90e +51e9190e675a31ec3b96bf05d3e6c424da8a7f919b14dad89004516fa7adac81 +f9450216a6b665038da2fcc11f80fc9c8d9d70acd83fd581708d045b3106737a +1e6e6c740b341af31e0da4bfc57b3f40752f0776dea82f524526e6c2bd5e05cf +b04b8f13690b99aaf8fb4d8249b9e318b67af6d0c6a6de4717e9718cbeb3476d +301831e9798e7ca630477dfb970a5a59b24f80917bea0af5ebeaa5f35b1c54e4 +39d747154d59230507de938e167062379c4ae35f2741da10bca4a0fe6f8008a8 +1c7fa864355fb7 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark + +%%EndFont +%%BeginFont: CMR10 +%!PS-AdobeFont-1.1: CMR10 1.00B +%%CreationDate: 1992 Feb 19 19:54:52 + +% Copyright (C) 1997 American Mathematical Society. All Rights Reserved. + +11 dict begin +/FontInfo 7 dict dup begin +/version (1.00B) readonly def +/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def +/FullName (CMR10) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle 0 def +/isFixedPitch false def +end readonly def +/FontName /CMR10 def +/PaintType 0 def +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0] readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 19 /acute put +dup 125 /hungarumlaut put +readonly def +/FontBBox{-251 -250 1009 969}readonly def +/UniqueID 5000793 def +currentdict end +currentfile eexec +8053514d28ec28da1630165fab262882d3fca78881823c5537fe6c3dda8ee5b8 +97e17cb027f5c73fdbb56b0a7c25fc3512b55fe8f3acfbffcc7f4a382d8299cc +8fd37d3cea49dabdca92847af0560b404ef71134b0f3d99934fc9d0b4e602011 +b9cfb856c23f958f3c5a2fbe0ef8587d1f5774879c324e51fcb22888b74f2415 +50d7401eb990d4f3a7af635198422283cac1b6cd446ddbcbd915db9bff88844e +784c6bf7389803d9450b0c21756a017306457c7e62c1d269f306bd3402e266de +fc3b5e7d8a8d2f5bf0fe6ddd40d07391df4fad4a6018dce29a2b8f692b29f202 +3a7c0e66de8ed85c14f1f8492167357f51a7e84cc5d92e0fee4d81cf7fbc8de5 +2d2e7bb57142033993f9c08c315abade8dbc4a732e84e142d3bee51557910e12 +cd8aa37c459a5e6b7f5269f59078aba3be4641a11ac48d0b625c8325b38ec08e +4c9e5e7fed976a5650d99d82114f449b9ca14c4ec957702295a39a93ef93f618 +99b8ea06b092c3c1e503e6e436e0a9fa22576c8930ab3dc8c20f5d82b69cddf8 +ff4dacfa9c54bed5a3aa3ea5b129fe96be632843b9b6bc91b615581a985db56b +1e01ca60ee69ca92cf5c0882ece62edad3e106d835348822400f0b66af658f2a +e56ed08f8b0010571807009b73ab12a8cf14ca6c71f03c2a48c500f9d62266af +154a6375ff600d9bac3f05ce34142d6867a79581c533176bb2f3117336671e2e +44638a97167e2ea9644e31ea16c2ad2990ea33c54001e0c8156e6de8ab6a4d40 +a7137ba275f39589fea2e2db8256adc103d6f9cc038037a47e8fd469c5f98a5e +3c15bd4ace40d340018b1cff7d1ed8abb0ac57b5b5a2c20a51957b96c453edb7 +dae5affd91a46d938fe0a13363001d844ded4323f1ee6d30012aea19b024a552 +315505535c85dc26bad31e09c50e6512802976d298c4e90d0044c362e6bf3ab3 +62a454ee93de25ce54411090c29e9d75c80ce26a84404bd9de3aee0e3f921ac5 +87f907572b8354a5c3165eea7e8b2ba4e4f834663063e9a307d8ff6f8b61acd8 +799bc105cddcf8f95f2160494fc01f7ec3effb95de571b8d7f27a2f9ad203c09 +cd4cffd98a119a507460e7fef5c910405e877aa1f8da68d1272e59e3adccef8d +82e692b3229926fbe621080b7831a2ee248948dd3ae55082a939f02875a7a0eb +7ae7d50270a576fbdfde7109c670f51be75b80b6fe3045ea50e2121025dfefb3 +ab99e4f56a608203a590a3fa689226e987e56268df7a72388036d8f84ac8f6fe +decd51a24e81d2502e8c500affbb4c06e7d06be60944376582eb7ca189d5e83a +6e9a9456ecd31763da6cdbd5769bbc2fe5bff251db7eedd627b924f1e68d3447 +e66304458fae468a8aeaf63f0497effdfe82a510a3c7ff16c172b8093a9f00c7 +51f2cfcb80c05a2e71ab8156d952cd889dea996d52be3d07f90e52d416312909 +daf6da59dd6e089abafe36c89e7b31bb61e6f24aed891a71688ed728bec12125 +a8a800d605492b0abfd616b3761fec4690e9a4f49915e2ced8a3511edbda042a +cc6cad9d0e1cea3956b19d5452f5689dc6c71e7c97b87b27f0d0735f04bb558c +d66431bf76688f172badc32ecfa25a23f404a3cc4ffd6c228d05e8b7798b080e +0a4ae46472b8035d490b572d527a56b8b83ae89a1f18ed31f3b20c64d7bc701f +e1d163248ef477de01345639390afbeb07be7757a912198c604a8c29fb9c +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark + +%%EndFont +%%BeginFont: CMR7 +%!PS-AdobeFont-1.1: CMR7 1.0 +%%CreationDate: 1991 Aug 20 16:39:21 + +% Copyright (C) 1997 American Mathematical Society. All Rights Reserved. + +11 dict begin +/FontInfo 7 dict dup begin +/version (1.0) readonly def +/Notice (Copyright (C) 1997 American Mathematical Society. All Rights Reserved) readonly def +/FullName (CMR7) readonly def +/FamilyName (Computer Modern) readonly def +/Weight (Medium) readonly def +/ItalicAngle 0 def +/isFixedPitch false def +end readonly def +/FontName /CMR7 def +/PaintType 0 def +/FontType 1 def +/FontMatrix [0.001 0 0 0.001 0 0] readonly def +/Encoding 256 array +0 1 255 {1 index exch /.notdef put} for +dup 44 /comma put +dup 49 /one put +dup 50 /two put +dup 51 /three put +dup 52 /four put +dup 53 /five put +dup 56 /eight put +dup 57 /nine put +dup 70 /F put +dup 84 /T put +dup 97 /a put +dup 98 /b put +dup 101 /e put +dup 102 /f put +dup 109 /m put +dup 110 /n put +dup 111 /o put +dup 112 /p put +dup 114 /r put +dup 115 /s put +dup 116 /t put +dup 117 /u put +dup 121 /y put +readonly def +/FontBBox{-27 -250 1122 750}readonly def +/UniqueID 5000790 def +currentdict end +currentfile eexec +9b9c1569015f2c1d2bf560f4c0d52257bacdd6500abda5ed9835f6a016cfc8f0 +0b6c052ed76a87856b50f4d80dfaeb508c97f8281f3f88b17e4d3b90c0f65ec3 +79791aacdc162a66cbbc5be2f53aad8de72dd113b55a022fbfee658cb95f5bb3 +2ba0357b5e050fddf264a07470bef1c52119b6fbd5c77ebed964ac5a2bbec9d8 +b3e48ae5bb003a63d545774b922b9d5ff6b0066ece43645a131879b032137d6d +823385fe55f3402d557fd3b448685940729e6e22f4be0e08c6505cba868f7950 +93f556b64b808dd710eb936d3ac83e5783b5f7e56d363a59a026a5619a357d21 +c4e77bea121eb24b09027d1aad93158edf912940e91cd2f17922b35885894644 +7773730bb19af9e70453e1b78d5edc123b273a979891d6d5e624f4a388f3897e +13b045e34b4ee2f5e4fc5e996d3549640010c671de14d18b0b3cd300e57dac03 +22e59bfbf7b29422230870f5897fcfaad4b50c7c1c58edcd119218163d6f6e56 +25ccb882db7b6d09a1586508e8cb642a11c29a46915e4a96e282079cb21922c1 +c2e360b487a45302fd22ec8c5fab63e54b5e844d4b17ca2fff37c69c366dd72a +d02922c14c0932f65ed03e4219c117962edbad2dcdeaa9c10ce8af38a4ae52e2 +b377245b0be19a77d6c936e7530cc4d0b78d0cc4a92698fa2870fa54f2d8503e +2d17b3d52fb2febb09f2b2af0c2a1892039ebe19a690098799a858e3d39631bd +6925a154d161df3918074ada6bd52baddd0adc3f07e2d9f15e27cbf7fe8b98c4 +07205c811121fa91e059f2f99322fed63f359ac9da97aec383f067f23e5de331 +51e80f0a88ab50fe8fdae4a5de93c1ae2fdca06150b37246140c0e87cb2325a6 +0d2349162ae3ac93144eee1e665a1289105318fdfe86b6e76251cb25adc967d3 +d0b97fe5e279e1161736ab22b4ca510b964342383a840defd38f96a7280e6ac1 +34e48d740607ff2e7804164a16d47735864db847c97335e6d4215cb99911a1ec +015a3edaac1f28fedd56d2467130d07bae9416c15f0827d27c6c79f59054282a +418c12c157c91223a829947f47592f7cafd93ca182b25a73a9419127e3b12a9e +5167ac3963f2b019b338ac46d63880f94dda4b538835884d2a5538c85528d6bd +977f844d32b43b0e48caed5a4bdabcefe71695d69ca784dc701fb68aa189fc5a +f35d9809ec0f7657c000376637b1b0e173af0cf475f585d664c3ad2760fe6aba +62d0e20674f6da16ca874aeccfe76b6b5202fc8e19a7c261683d822225ad4af7 +d3e5001f718db22c1e03ed052f98fb741896b65b66edc6e476ae08d5c34ac4ac +6017495382ff6961747d4c2572fa874cdd4ed944719306d3979d5a1269cc2b0f +440dc738c1742cef5b28b7cdcbbcb1f5e24299d6a13975370b8cd1488a2d2965 +dc7672c8ed9023473e208682586d9ff743e61bd5e1449b36d4188a963995d392 +2a8c15b188dc3102b4fe67d955c2b920f4d7b29c499b66fffce4c316417c6573 +3295b7d25a3d755e9966a7497d2274b032feed6eb87561cd0ac1bcfd31b17607 +2469f905c37d6b5fd90af4080f097124e10f9d45312e89f6acd5d75d2808111b +67d078d97fd73b493584b27a89a8299292515660a597b98c0363f77e9f894fc3 +34c5f6ec2499224e0424cacf82dd6aea1cda7119d3e03acaf80d421f316390fe +e9234a050652cd579c6e087df0e22d7d86ab4b1d83657809fb8b2530ea7ffcf9 +2fe7c1d661101421ea144880468ecc331b9fb345ede26f616bebdb97c2e4794b +166871d920c53c48daef8c9517eceee6385ef5de2dda61609ac5d1d5c22fd446 +2a32b59284dfbe3f77b0e2e30341b3e67a058aeb3760c5cf3b38192f5b623a77 +5d1b2ebe4827879036b33a2cb8114bd04f0445d7ce5a0dc59475ead0c60021bf +14cc6b07685b84506508834957fd8a9f82a2ccb91a1123c0371237ee8ed78c93 +7a2614c1d0890e1df040192dcb5dbd0c8b22ab83076b9574109017bbedb0b7d8 +c0bfc54b1a48059c51f4c0d77abb7cd9f655c041d08272b146d52143a2e275d5 +cafcc26273312f4a74b8c1fdb30658c9fd0d71ad846c69ed8f93628cbc3358f4 +040c13995ddbb6e7b496da836b70dcea9756bb90a1a953acec3b0d5e3b56f102 +9adb35311e98b1bedbbfd18396fee4cf82def36f0c307cf2ce001e4c50b3fd81 +e9deed73c0d0e8eccc114a867d1ce270d533bb08a1c89bd40ffe4d5241c455fe +f9f90a57f318171083d4f561189cdd044aef041373df4f0f492a826e5d4ec0be +20fd512c0abd51118ed2856d39dd0b089a8e71a1d11c909d5a9954c74cd71a16 +4f831d85d4f4b7f2ac4b4a9c48337a05e9d8339f02ed1d5bf3ddaa0ab30b74bd +7398bc090227ff5730ff4808f3de839d0360207ebd0bf05ea5a127a91d82c5fc +7551a3b7f1e77ce5d2617146bb9756b85d5b39450bf5f436559effb50a4ccec6 +c27e1b40d7cb870672c10f5d69a6b1c609ca9f95c6238ce709205be99778caf7 +087ee06aaa2c494d64b572ebca7a0bc4f318272e0de3add77aecc800e1aa3340 +9a04e2a9c5874827e1bbe5615a86f7575ee5cd3084654f27ff44b7fae494e7c7 +29f36f0fff15aba9fc2163564e8156c3c7678a7980884e4d0adb30bad6f3cf2d +56e9a1657c81833280e3485b906c70f871469b8d609a89224fe9fab9c69e240f +66cf3c6598e4f8b7efeeb167949e12707f1108f9595c777c186617163a219ea5 +9d889ebbf110c191de95a1d5358e9cc244d16d315c1a4df0b8ec7e24508c7561 +f9a299b0abc2e54d7f634e2b51d2f40b14dcc027ce0c486333b88f8879c66fcb +2823914c58686fda727c62a0a09ac126feef0d3a0f083b6f49659b59932fb9da +9b8429cdd80b12be7e77b435b6e3063bf7f99be9c2c9b67a93ae0f67e311a8c5 +c5c1a783e56951f29ae4fec46fa7311618f678c19dc7d6cd4b6bb44ce737cd6d +8c43f3327bb02d2ae929e3e5130a232a524da48ab2d929381cbad8d8bf9007d9 +9bf4358fd44a87245f063c600d5b415fc06b7c8e5594e36d8dd54d5754c49fbd +66ab4b60259ecaa7988e191ac5fd3e9c16a66f55d48920e870d22816f7499383 +e954265d4e04a550be2c2ca7c77189d52b0172826b1adb5fc83002a352f44b0d +f5b2b09130c14f5e568293b2e2e7d0124ddc03ed055e3e1828608e4a4bd0b98f +543a57e5ea64983c1088d031847b003f51d52c0a3fa644f19929acbd55f4b5c5 +4b8774961f6b5d284e0a7caf0a2f094fdd4e1efac461657c823e32ffb0d56896 +34d189f783d9f2bd2921e3c42e400a52b8f273255b33acb8683b4f69897287e0 +9023964e30a724208c747e59ab970baaeec72cc21740b89f3ba2ce964a494d63 +354281634c8f5b71d205680408e3c167c04067ae4e7bcc74547c67b0a09cea52 +914fcf9d61169cf9328829271c0af02b8fabb4d3d3a57751c840d1698aa75143 +294876b47c8783c346b26f703d71f50d22ffced2176965c87806915d0a80e054 +a5813d8d3ad02d8002cd5219ae54a24a7576f68e86ef8ee02ab84820da3d84c0 +58f804ea989b7ce3a239d4255804920a494d17e1b45b47d7d1294711ac337cd7 +6999e3d0b81cd8ae1a2aea5483dc5d2aa2ac4c86a766e176ee03c364db4203da +5109283cc793e50f3b570e09b6dd9592f8e7bf2a3ca927267450d7457932983f +8328ef244f0f9ea13b2f80434dc018c93c513e6eb988706b27704514b626b9c9 +d6136f2068dba6a389e1618914129065985be75a75950c9f569752c0e6659315 +2b85e47c36f2a48b92cc9443fa54a0d860aa91432819f7035580567fce462400 +98a71bf308be588fa088c2155ba232020baf3d3b5bba37ef78222be4e1dd895e +cfccab59ff8ab3ea0f277ebb11509a3c1ab72f2a4253c58ec8c0f0f3119aed62 +f2666394d342f14dc973bfdf0b5725d1ac4347c412b56517003511aeb75812db +a8e513447ecbe4e2092753f615d31527d6d61d65ae38e4b88d5b5d58863c4967 +55af8d8b89ffdb082f6b1967db59aed857cc24f1be088cd1fad6c5447e3c4e98 +77c78a6ecceaa44fbe76dec69494dd08bfa1e2c70221176e13b694a1885e09e5 +f0993234ec8814404031b7dd991b3221c1fff0cca7bf6b013e93211ef1e7ef73 +d4968779b210dfd6958e5110ebd8e1512d280ebdc71fca5f9ef4b6e7a8f29981 +7b2d8228dd54442a113410cad988b003d9dfba0d8fccb934404fbdc848a3f726 +4aed60d47507701b360f2e9bfedec87091ffeb51b87bc895e16aaf36adaabe2e +d16a5f1987ae02375dcb6b131ab5cf9f27e2eb5e7df5ad336aa4471805056b28 +d61dd8e3fbe028b3d0dd8e98f726d1ca1e1a63b5239d5a1773f9b43d30ba7d5f +ba43a7daecb87251541ce94b609f664b9acadc30e8984d66bb62b810fc272c0b +70a5df96ba5d7cf256c3b09c407f63ed99f630c846b5813c649aa940808ac910 +391b3e09ca704bc8d9f34287d6359e68b3cc72f1b8daf706a1fcdf8eacdff57f +86b95c290728a183d8470019ac9aacf9bb4b88e9e14ffa574366ee43f3294d5d +95493977e21993816a47190475bc023f8a846c13199e87e941aefe07cd14e51f +93cac419007ea1ce930d7a92d520e02eccf7f46fd50f607e1ff9388214c51341 +c8b8b5e6e19c2acf81962ce89d26ee4015a7b09b0e4d7c8c678b7d91dd650c52 +e074c6bbf4af671c38535e011b37ccca4e8868ffa9bb6d8c31079ed371715362 +04a33d068961a3b9d708f2e3c31cb05c4a8583d112229f6f527c4c1c6e8958c6 +6ee00b2e3b8e4b2638a5170138be51191e90fd5b4024260786f31348a9a73192 +e97f5f37c19a656a29e08387d9c758df2e31e585970f9e551704dec08f619995 +cf329419a0be0b8afecfb694622638492a96b83fdeee7bae12d74e49c2a5d75f +7fbd86e14d4c20dea4bbcc848b3b54ff4df29a19cd802be2097b757f87b36d58 +c327aac12eecaa5e7dd1f9f5139d487731e543094b68ed29c5b13a71817596b0 +5a12eca439fdaf7d65ffd6a089f017a9d9837b124286cabb4467aa89a206785c +b1c8673c58055cafa1bb81f7c5f375e8484d97fe803bf2a9e7d82b1e83fb7754 +f8f8127861264c4e48ea7ec1377ff7dd28c5818d9984031f8ef27bd98c2d5ff3 +332626ebc1f89d08f09a0fc5b20128943dd49fa81191c98e773f6e1cd8674803 +72913b2c425babdd4e23c745f11962bd86ee67836ba91bf3ca8aab423a5fd066 +9adf60c42098fa6d13cae19236d2929fcda558157036d8b7a8c47a22346cfb3f +be7e4a583df45dfc57e0233ea5e5b8114cee3576b3847761ed6ef166d28b3272 +3c35e23d822d476f9d701c25703b8c9025d63d56eb94bb594a057d6b5a8367ff +7500104070a4e3615f4413f1d10f2a5e94cd0867a6f4fbc1f01e4c361759ce0a +f285489a9c4131bc844573aa2aa200682a72fd72624db759748ec830cb4a719d +e7f7004b02776918d8753c014353c5441cb479313f22049cfd01183d299f3cd7 +b9cfa83bc226d9d03511fb2816f5630db0a43f92f33e7b3260995463c09c6bc4 +b85bd9cf0147c714f5495f4acd9183337d567c0fb36976eac93f8ba9203dc89b +da719ca71af689153f95d29fdcd05c967520ba1c20a45d84e0ca60e076efe6a5 +e1de300f0ba2cf8be8778eddb5282eccfa48c283f8b75430a7139db24b204332 +1c68e3fd28fe281831f4fd9b95bfadfd496915cc6b540c6f0f0fb1ce4da1da18 +ca08fa63c774e5242c2378ec9217f454fc1f28112ccd96cd875d1dc30ec9f892 +6fd432e198eb45f5b71fbb2ccb86e54b1fe20e1826f1ea2528570ab290665297 +778e0ea09d31e0ec7a5877994122cc4e645b97bf31506f9c29da0461c72c3fac +6bdf8254fe1b0a53b7fdd229ee4a151a55b77e71131a778e53a8947911158526 +7411fb09fa63c4c9a663ea38bf4d5be3842f60aa73217697dc064aa300e746fb +e09f48b66bbed881d684df35d4621d0c40bb78933d89ef0922ac5ea59b1ede2a +abfc0a204fe9bff4fc8f3e75edc75efb72b17e510d9be758aa18061cf4e638fb +833d00141196b0c9c012a7ffdf7f0af10e8159751977fd164f3f0d74605ed78d +6e028a0273f4fd3ad4032ead6669a1297143691902c792fab012ceb2826edc49 +c79df05dd5f65c16fc69888c7a11f3742e767de9785eb1339e7097af266bcd91 +b118338c6da68319a7475ba9b9eeca3d49351d35fc596be89f1abd04eaf81592 +0405fb3fba80aa25c5fd56bc0f07c8884c04edaee6efa76acc4a15ca781cd4b8 +b824de14da28264b296eb8fd0b347ff6cb1d5f18e8bfa08adb019c890d9d0168 +ba2f859dfd0864080fac9556a831733c776a87c033fdb45358a0724e8ba39306 +dcaa32099dfeaf098a55e4d38dbcf04fbbb1ecb2403838348d2f41a371f157e3 +2595b2f62e2fa5a69237fcff3356db5a6b3f2bb4a2696651f6a8089fb97b984a +0bf97a8eeef0944f8c191da61288c1bf728cc60579c4140f3e4fa58f0d1232b8 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000 +cleartomark + +%%EndFont +TeXDict begin 39158280 55380996 1000 300 300 (testfont.dvi) +@start /Fa 135[22 49[22 22 22 22 22 22 7[22 22 22 22 +22 22 22 22 22 22 48[{}17 41.511 /CMTT10 rf /Fb 21 21 +21 21 21 21 21 21 23 21 21 21 21 21 21 21 12 12 12 12 +18 18 18 18 18 28 18 18 18 18 18 18 21 23 30 30 30 30 +30 30 23 30 30 30 30 30 30 30 14 14 14 14 25 25 25 25 +28 37 30 30 30 30 30 30 18 31 31 31 21 13 12 14 10 19 +21 14 12 12 23 17 14 32 14 23 21 11 32 14 21 8 21 21 +21 21 14 1[30 2[30 14 16 41 14 42 21 15 18 18 6[37 14 +23 42 14 21 21 42 18 21 14 3[22 20 8 20 18 21 21 30 21 +21 12 16 14 21 21 21 21 32 12 21 12 12 21 21 14 18 21 +18 21 18 14 21 19 14 12 14 25 30 30 39 30 30 25 23 28 +30 23 30 30 37 25 30 16 14 30 30 23 25 30 28 28 30 38 +18 23 23 23 12 12 21 21 21 21 21 21 21 21 21 21 12 10 +14 10 23 21 14 14 14 32 35 21 21 17 14 10 7 14 12[12 +14 18 25 1[23 14 1[14 14 12 25 14 7 23 23 14 1[{ +TeXBase1Encoding ReEncodeFont}229 41.511 /Times-Roman +rf /Fc 135[19 64[21 21 21 21 21 21 21 21 48[{}9 41.511 +/CMTI10 rf /Fd 130[21 105[21 19[{}2 41.511 /CMR10 rf +/Fe 134[17 3[18 13 13 13 1[18 17 18 27 6[10 15 2[18 17 +12[24 13[21 12[17 17 2[17 17 17 17 17 4[9 44[{}23 29.0577 +/CMR7 rf end +%%EndProlog +%%BeginSetup +%%Feature: *Resolution 300dpi +TeXDict begin +%%PaperSize: a4 + +%%EndSetup +%%Page: 1 1 +1 0 bop 0 42 a Fe(T)m(est)11 b(of)g(ptmr8r)g(on)g(F)m(ebruary)i(23,)d +(1999)g(at)g(1254)p 236 285 2 67 v 310 258 a Fd(\023)-8 +b Fc(0)p 424 285 V 154 w Fd(\023)g Fc(1)p 612 285 V 154 +w Fd(\023)g Fc(2)p 800 285 V 154 w Fd(\023)g Fc(3)p 988 +285 V 154 w Fd(\023)g Fc(4)p 1176 285 V 154 w Fd(\023)g +Fc(5)p 1364 285 V 154 w Fd(\023)g Fc(6)p 1552 285 V 154 +w Fd(\023)g Fc(7)p 1740 285 V 0 287 1950 2 v 82 326 a +Fd(\023)g Fc(00x)p 236 345 2 59 v 424 345 V 356 w Fb(\001)p +612 345 V 169 w(\002)p 800 345 V 165 w(\003)p 988 345 +V 173 w(\004)p 1176 345 V 178 w(\005)p 1364 345 V 168 +w(\006)p 1552 345 V 170 w(\007)p 1740 345 V 0 346 1742 +2 v 1814 356 a Fd(})p Fa(0x)82 392 y Fd(\023)g Fc(01x)p +236 411 2 65 v 167 w Fb(\010)p 424 411 V 175 w(\011)p +612 411 V 800 411 V 362 w(\013)p 988 411 V 169 w(\014)p +1176 411 V 1364 411 V 352 w(\016)p 1552 411 V 167 w(\017)p +1740 411 V 0 412 1950 2 v 82 452 a Fd(\023)g Fc(02x)p +236 470 2 59 v 167 w Fb(\020)p 424 470 V 176 w(\021)p +612 470 V 800 470 V 988 470 V 1176 470 V 1364 470 V 1552 +470 V 1740 470 V 0 472 1742 2 v 1814 481 a Fd(})p Fa(1x)82 +511 y Fd(\023)g Fc(03x)p 236 530 2 59 v 424 530 V 612 +530 V 800 530 V 988 530 V 1176 530 V 1364 530 V 1296 +w Fb(\036)p 1552 530 V 177 w(\037)p 1740 530 V 0 532 +1950 2 v 82 571 a Fd(\023)g Fc(04x)p 236 590 2 59 v 169 +w Fb( )p 424 590 V 177 w(!)p 612 590 V 172 w(")p 800 +590 V 169 w(#)p 988 590 V 167 w($)p 1176 590 V 160 w(\045)p +1364 590 V 155 w(&)p 1552 590 V 165 w(')p 1740 590 V +0 591 1742 2 v 1814 601 a Fd(})p Fa(2x)82 631 y Fd(\023)g +Fc(05x)p 236 650 2 59 v 167 w Fb(\()p 424 650 V 175 w(\))p +612 650 V 170 w(*)p 800 650 V 166 w(+)p 988 650 V 171 +w(,)p 1176 650 V 177 w(-)p 1364 650 V 176 w(.)p 1552 +650 V 177 w(/)p 1740 650 V 0 651 1950 2 v 82 691 a Fd(\023)g +Fc(06x)p 236 709 2 59 v 164 w Fb(0)p 424 709 V 167 w(1)p +612 709 V 167 w(2)p 800 709 V 167 w(3)p 988 709 V 167 +w(4)p 1176 709 V 167 w(5)p 1364 709 V 167 w(6)p 1552 +709 V 168 w(7)p 1740 709 V 0 711 1742 2 v 1814 721 a +Fd(})p Fa(3x)82 750 y Fd(\023)g Fc(07x)p 236 769 2 59 +v 164 w Fb(8)p 424 769 V 167 w(9)p 612 769 V 172 w(:)p +800 769 V 176 w(;)p 988 769 V 170 w(<)p 1176 769 V 165 +w(=)p 1364 769 V 165 w(>)p 1552 769 V 168 w(?)p 1740 +769 V 0 771 1950 2 v 82 810 a Fd(\023)g Fc(10x)p 236 +829 2 59 v 155 w Fb(@)p 424 829 V 154 w(A)p 612 829 V +160 w(B)p 800 829 V 160 w(C)p 988 829 V 159 w(D)p 1176 +829 V 160 w(E)p 1364 829 V 164 w(F)p 1552 829 V 162 w(G)p +1740 829 V 0 831 1742 2 v 1814 840 a Fd(})p Fa(4x)82 +870 y Fd(\023)g Fc(11x)p 236 889 2 59 v 159 w Fb(H)p +424 889 V 167 w(I)p 612 889 V 172 w(J)p 800 889 V 166 +w(K)p 988 889 V 160 w(L)p 1176 889 V 157 w(M)p 1364 889 +V 155 w(N)p 1552 889 V 158 w(O)p 1740 889 V 0 890 1950 +2 v 82 930 a Fd(\023)g Fc(12x)p 236 948 2 59 v 163 w +Fb(P)p 424 948 V 161 w(Q)p 612 948 V 160 w(R)p 800 948 +V 162 w(S)p 988 948 V 164 w(T)p 1176 948 V 161 w(U)p +1364 948 V 158 w(V)p 1552 948 V 153 w(W)p 1740 948 V +0 950 1742 2 v 1814 960 a Fd(})p Fa(5x)82 990 y Fd(\023)g +Fc(13x)p 236 1008 2 59 v 159 w Fb(X)p 424 1008 V 158 +w(Y)p 612 1008 V 161 w(Z)p 800 1008 V 169 w([)p 988 1008 +V 175 w(\\)p 1176 1008 V 175 w(])p 1364 1008 V 171 w(^)p +1552 1008 V 169 w(_)p 1740 1008 V 0 1010 1950 2 v 82 +1049 a Fd(\023)g Fc(14x)p 236 1068 2 59 v 167 w Fb(`)p +424 1068 V 172 w(a)p 612 1068 V 169 w(b)p 800 1068 V +168 w(c)p 988 1068 V 169 w(d)p 1176 1068 V 169 w(e)p +1364 1068 V 172 w(f)p 1552 1068 V 171 w(g)p 1740 1068 +V 0 1070 1742 2 v 1814 1079 a Fd(})p Fa(6x)82 1109 y +Fd(\023)g Fc(15x)p 236 1128 2 59 v 164 w Fb(h)p 424 1128 +V 172 w(i)p 612 1128 V 176 w(j)p 800 1128 V 171 w(k)p +988 1128 V 172 w(l)p 1176 1128 V 166 w(m)p 1364 1128 +V 161 w(n)p 1552 1128 V 168 w(o)p 1740 1128 V 0 1129 +1950 2 v 82 1169 a Fd(\023)g Fc(16x)p 236 1188 2 59 v +164 w Fb(p)p 424 1188 V 167 w(q)p 612 1188 V 171 w(r)p +800 1188 V 173 w(s)p 988 1188 V 174 w(t)p 1176 1188 V +171 w(u)p 1364 1188 V 167 w(v)p 1552 1188 V 163 w(w)p +1740 1188 V 0 1189 1742 2 v 1814 1199 a Fd(})p Fa(7x)82 +1229 y Fd(\023)g Fc(17x)p 236 1247 2 59 v 164 w Fb(x)p +424 1247 V 167 w(y)p 612 1247 V 168 w(z)p 800 1247 V +170 w({)p 988 1247 V 174 w(|)p 1176 1247 V 174 w(})p +1364 1247 V 167 w(~)p 1552 1247 V 1740 1247 V 0 1249 +1950 2 v 82 1288 a Fd(\023)g Fc(20x)p 236 1307 2 59 v +424 1307 V 612 1307 V 544 w Fb(\202)p 800 1307 V 170 +w(\203)p 988 1307 V 168 w(\204)p 1176 1307 V 159 w(\205)p +1364 1307 V 156 w(\206)p 1552 1307 V 168 w(\207)p 1740 +1307 V 0 1309 1742 2 v 1814 1318 a Fd(})p Fa(8x)82 1354 +y Fd(\023)g Fc(21x)p 236 1373 2 65 v 167 w Fb(\210)p +424 1373 V 161 w(\211)p 612 1373 V 155 w(\212)p 800 1373 +V 170 w(\213)p 988 1373 V 162 w(\214)p 1176 1373 V 1364 +1373 V 1552 1373 V 1740 1373 V 0 1374 1950 2 v 82 1414 +a Fd(\023)g Fc(22x)p 236 1433 2 59 v 424 1433 V 612 1433 +V 800 1433 V 729 w Fb(\223)p 988 1433 V 170 w(\224)p +1176 1433 V 173 w(\225)p 1364 1433 V 169 w(\226)p 1552 +1433 V 157 w(\227)p 1740 1433 V 0 1434 1742 2 v 1814 +1444 a Fd(})p Fa(9x)82 1478 y Fd(\023)g Fc(23x)p 236 +1496 2 62 v 167 w Fb(\230)p 424 1496 V 161 w(\231)p 612 +1496 V 159 w(\232)p 800 1496 V 174 w(\233)p 988 1496 +V 166 w(\234)p 1176 1496 V 1364 1496 V 1552 1496 V 534 +w(\237)p 1740 1496 V 0 1498 1950 2 v 82 1537 a Fd(\023)g +Fc(24x)p 236 1556 2 59 v 424 1556 V 356 w Fb(\241)p 612 +1556 V 170 w(\242)p 800 1556 V 167 w(\243)p 988 1556 +V 167 w(\244)p 1176 1556 V 167 w(\245)p 1364 1556 V 174 +w(\246)p 1552 1556 V 174 w(\247)p 1740 1556 V 0 1558 +1742 2 v 1814 1567 a Fd(})p Fa(Ax)82 1597 y Fd(\023)g +Fc(25x)p 236 1616 2 59 v 167 w Fb(\250)p 424 1616 V 166 +w(\251)p 612 1616 V 166 w(\252)p 800 1616 V 172 w(\253)p +988 1616 V 166 w(\254)p 1176 1616 V 170 w(\255)p 1364 +1616 V 165 w(\256)p 1552 1616 V 165 w(\257)p 1740 1616 +V 0 1617 1950 2 v 82 1657 a Fd(\023)g Fc(26x)p 236 1676 +2 59 v 166 w Fb(\260)p 424 1676 V 168 w(\261)p 612 1676 +V 170 w(\262)p 800 1676 V 176 w(\263)p 988 1676 V 176 +w(\264)p 1176 1676 V 170 w(\265)p 1364 1676 V 168 w(\266)p +1552 1676 V 174 w(\267)p 1740 1676 V 0 1677 1742 2 v +1814 1687 a Fd(})p Fa(Bx)82 1717 y Fd(\023)g Fc(27x)p +236 1735 2 59 v 167 w Fb(\270)p 424 1735 V 175 w(\271)p +612 1735 V 176 w(\272)p 800 1735 V 171 w(\273)p 988 1735 +V 162 w(\274)p 1176 1735 V 157 w(\275)p 1364 1735 V 157 +w(\276)p 1552 1735 V 164 w(\277)p 1740 1735 V 0 1737 +1950 2 v 82 1782 a Fd(\023)g Fc(30x)p 236 1801 2 65 v +159 w Fb(\300)p 424 1801 V 158 w(\301)p 612 1801 V 159 +w(\302)p 800 1801 V 158 w(\303)p 988 1801 V 158 w(\304)p +1176 1801 V 158 w(\305)p 1364 1801 V 154 w(\306)p 1552 +1801 V 156 w(\307)p 1740 1801 V 0 1803 1742 2 v 1814 +1812 a Fd(})p Fa(Cx)82 1848 y Fd(\023)g Fc(31x)p 236 +1867 2 65 v 162 w Fb(\310)p 424 1867 V 163 w(\311)p 612 +1867 V 163 w(\312)p 800 1867 V 163 w(\313)p 988 1867 +V 169 w(\314)p 1176 1867 V 174 w(\315)p 1364 1867 V 174 +w(\316)p 1552 1867 V 174 w(\317)p 1740 1867 V 0 1868 +1950 2 v 82 1914 a Fd(\023)g Fc(32x)p 236 1932 2 65 v +159 w Fb(\320)p 424 1932 V 158 w(\321)p 612 1932 V 159 +w(\322)p 800 1932 V 158 w(\323)p 988 1932 V 158 w(\324)p +1176 1932 V 158 w(\325)p 1364 1932 V 158 w(\326)p 1552 +1932 V 161 w(\327)p 1740 1932 V 0 1934 1742 2 v 1814 +1944 a Fd(})p Fa(Dx)82 1979 y Fd(\023)g Fc(33x)p 236 +1998 2 65 v 159 w Fb(\330)p 424 1998 V 158 w(\331)p 612 +1998 V 159 w(\332)p 800 1998 V 158 w(\333)p 988 1998 +V 158 w(\334)p 1176 1998 V 158 w(\335)p 1364 1998 V 161 +w(\336)p 1552 1998 V 167 w(\337)p 1740 1998 V 0 2000 +1950 2 v 82 2039 a Fd(\023)g Fc(34x)p 236 2058 2 59 v +165 w Fb(\340)p 424 2058 V 170 w(\341)p 612 2058 V 170 +w(\342)p 800 2058 V 170 w(\343)p 988 2058 V 170 w(\344)p +1176 2058 V 171 w(\345)p 1364 2058 V 165 w(\346)p 1552 +2058 V 165 w(\347)p 1740 2058 V 0 2059 1742 2 v 1814 +2069 a Fd(})p Fa(Ex)82 2099 y Fd(\023)g Fc(35x)p 236 +2118 2 59 v 165 w Fb(\350)p 424 2118 V 170 w(\351)p 612 +2118 V 170 w(\352)p 800 2118 V 170 w(\353)p 988 2118 +V 174 w(\354)p 1176 2118 V 176 w(\355)p 1364 2118 V 176 +w(\356)p 1552 2118 V 176 w(\357)p 1740 2118 V 0 2119 +1950 2 v 82 2159 a Fd(\023)g Fc(36x)p 236 2177 2 59 v +164 w Fb(\360)p 424 2177 V 167 w(\361)p 612 2177 V 167 +w(\362)p 800 2177 V 167 w(\363)p 988 2177 V 167 w(\364)p +1176 2177 V 167 w(\365)p 1364 2177 V 167 w(\366)p 1552 +2177 V 166 w(\367)p 1740 2177 V 0 2179 1742 2 v 1814 +2189 a Fd(})p Fa(Fx)82 2218 y Fd(\023)g Fc(37x)p 236 +2237 2 59 v 164 w Fb(\370)p 424 2237 V 167 w(\371)p 612 +2237 V 167 w(\372)p 800 2237 V 167 w(\373)p 988 2237 +V 167 w(\374)p 1176 2237 V 167 w(\375)p 1364 2237 V 167 +w(\376)p 1552 2237 V 168 w(\377)p 1740 2237 V 0 2239 +1950 2 v 236 2305 2 67 v 309 2286 a Fd(})p Fa(8)p 424 +2305 V 145 w Fd(})p Fa(9)p 612 2305 V 145 w Fd(})p Fa(A)p +800 2305 V 145 w Fd(})p Fa(B)p 988 2305 V 145 w Fd(})p +Fa(C)p 1176 2305 V 145 w Fd(})p Fa(D)p 1364 2305 V 146 +w Fd(})p Fa(E)p 1552 2305 V 145 w Fd(})p Fa(F)p 1740 +2305 V eop +%%Trailer +end +userdict /end-hook known{end-hook}if +%%EOF diff --git a/Build/source/texk/windvi/texmf/8r.enc b/Build/source/texk/windvi/texmf/8r.enc new file mode 100644 index 00000000000..d03e3afe7b8 --- /dev/null +++ b/Build/source/texk/windvi/texmf/8r.enc @@ -0,0 +1,296 @@ +% @@psencodingfile@{ +% author = "S. Rahtz, P. MacKay, Alan Jeffrey, B. Horn, K. Berry", +% version = "0.6", +% date = "22 June 1996", +% filename = "8r.enc", +% email = "kb@@mail.tug.org", +% address = "135 Center Hill Rd. // Plymouth, MA 02360", +% codetable = "ISO/ASCII", +% checksum = "119 662 4424", +% docstring = "Encoding for TrueType or Type 1 fonts to be used with TeX." +% @} +% +% Idea is to have all the characters normally included in Type 1 fonts +% available for typesetting. This is effectively the characters in Adobe +% Standard Encoding + ISO Latin 1 + extra characters from Lucida. +% +% Character code assignments were made as follows: +% +% (1) the Windows ANSI characters are almost all in their Windows ANSI +% positions, because some Windows users cannot easily reencode the +% fonts, and it makes no difference on other systems. The only Windows +% ANSI characters not available are those that make no sense for +% typesetting -- rubout (127 decimal), nobreakspace (160), softhyphen +% (173). quotesingle and grave are moved just because it's such an +% irritation not having them in TeX positions. +% +% (2) Remaining characters are assigned arbitrarily to the lower part +% of the range, avoiding 0, 10 and 13 in case we meet dumb software. +% +% (3) Y&Y Lucida Bright includes some extra text characters; in the +% hopes that other PostScript fonts, perhaps created for public +% consumption, will include them, they are included starting at 0x12. +% +% (4) Remaining positions left undefined are for use in (hopefully) +% upward-compatible revisions, if someday more characters are generally +% available. +% +% (5) hyphen appears twice for compatibility with both ASCII and Windows. +% +Encoding=TeXBase1Encoding +.notdef % 0x00 +dotaccent +fi +fl +fraction +hungarumlaut +Lslash +lslash +ogonek +ring +.notdef +breve +minus +.notdef +Zcaron % These are the only two remaining unencoded characters, so +zcaron % may as well include them. +/caron % 0x10 +/dotlessi +dotlessj % (unusual TeX characters available in, e.g., Lucida Bright) +ff +ffi +ffl +.notdef +.notdef +.notdef +.notdef +.notdef +.notdef +.notdef +.notdef +grave % very contentious; it's painful not having quoteleft and quoteright +quotesingle % at 96 and 145 that we move the things normally found there down to here. +space % 0x20 (ASCII begins) +exclam +quotedbl +numbersign +dollar +percent +ampersand +quoteright +parenleft +parenright +asterisk +plus +comma +hyphen +period +slash +zero % 0x30 = 0 +one +two +three +four +five +six +seven +eight +nine +colon +semicolon +less +equal +greater +question +at % 0x40 +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +P % 0x50 +Q +R +S +T +U +V +W +X +Y +Z +bracketleft +backslash +bracketright +asciicircum +underscore +quoteleft % 0x60 +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +p % 0x70 +q +r +s +t +u +v +w +x +y +z +braceleft +bar +braceright +asciitilde +.notdef % rubout; ASCII ends +.notdef % 0x80 +.notdef +quotesinglbase +florin +quotedblbase +ellipsis +dagger +daggerdbl +circumflex +perthousand +Scaron +guilsinglleft +OE +.notdef +.notdef +.notdef +.notdef % 0x90 +.notdef +.notdef +quotedblleft +quotedblright +bullet +endash +emdash +tilde +trademark +scaron +guilsinglright +oe +.notdef +.notdef +Ydieresis +.notdef % 0xA0 - nobreakspace +exclamdown +cent +sterling +currency +yen +brokenbar +section +dieresis +copyright +ordfeminine +guillemotleft +logicalnot +hyphen % Y&Y (also at 45); Windows' softhyphen +registered +macron +degree % 0xD0 +plusminus +twosuperior +threesuperior +acute +mu +paragraph +periodcentered +cedilla +onesuperior +ordmasculine +guillemotright +onequarter +onehalf +threequarters +questiondown +Agrave % 0xC0 +Aacute +Acircumflex +Atilde +Adieresis +Aring +AE +Ccedilla +Egrave +Eacute +Ecircumflex +Edieresis +Igrave +Iacute +Icircumflex +Idieresis +Eth % 0xD0 +Ntilde +Ograve +Oacute +Ocircumflex +Otilde +Odieresis +multiply +Oslash +Ugrave +Uacute +Ucircumflex +Udieresis +Yacute +Thorn +germandbls +agrave % 0xE0 +aacute +acircumflex +atilde +adieresis +aring +ae +ccedilla +egrave +eacute +ecircumflex +edieresis +igrave +iacute +icircumflex +idieresis +eth % 0xF0 +ntilde +ograve +oacute +ocircumflex +otilde +odieresis +divide +oslash +ugrave +uacute +ucircumflex +udieresis +yacute +thorn +ydieresis diff --git a/Build/source/texk/windvi/texmf/XDvi b/Build/source/texk/windvi/texmf/XDvi new file mode 100644 index 00000000000..085be66ab84 --- /dev/null +++ b/Build/source/texk/windvi/texmf/XDvi @@ -0,0 +1,10 @@ +*mfMode: ljfour +! +! This is the default anyway: +! *pixelsPerInch: 600 +! *shrinkFactor: 8 +! +! GO! EUROPE! :-) +*paper: a4 +! +*wwwBrowser: netscape diff --git a/Build/source/texk/windvi/texmf/charter2.map b/Build/source/texk/windvi/texmf/charter2.map new file mode 100644 index 00000000000..40cf1e6707f --- /dev/null +++ b/Build/source/texk/windvi/texmf/charter2.map @@ -0,0 +1,5 @@ +% Thomas Esser, 1998, public domain. +% Updated for xdvi by Nicolai Langfeldt 1998, public domain. + +bchbo8r CharterBT-Bold ".167 SlantFont TeXBase1Encoding ReEncodeFont" <8r.enc <bchb +bchro8r CharterBT-Roman ".167 SlantFont TeXBase1Encoding ReEncodeFont" <8r.enc <bchr diff --git a/Build/source/texk/windvi/texmf/cork.enc b/Build/source/texk/windvi/texmf/cork.enc new file mode 100644 index 00000000000..08dc4a90711 --- /dev/null +++ b/Build/source/texk/windvi/texmf/cork.enc @@ -0,0 +1,286 @@ +% This is the Cork encoding, aka EC, Cork, aka TeX Latin 1, as +% described in TTN 1(4), December 1992, and TUGboat 11(4), November +% 1990, page 514. EC is the name of the Computer Modern-based fonts in +% this encoding. NFSS and Fontinst know it by `T1'. +% +% These are the ligs and kerns in addition to those found in the +% AFM file. (The only ligs in the Times-Roman.afm file are the +% fi and fl ligatures.) +% +% LIGKERN space l =: lslash ; space L =: Lslash ; +% LIGKERN question quoteleft =: questiondown ; exclam quoteleft =: exclamdown ; +% LIGKERN hyphen hyphen =: endash ; endash hyphen =: emdash ; +% LIGKERN quoteleft quoteleft =: quotedblleft ; +% LIGKERN quoteright quoteright =: quotedblright ; +% +% We blow away kerns to and from spaces (TeX doesn't have a +% space) and also remove any kerns from the numbers (although +% the only kern pair that mentions a number in Times-Roman.afm +% is one one.) +% +% LIGKERN space {} * ; * {} space ; zero {} * ; * {} zero ; +% LIGKERN one {} * ; * {} one ; two {} * ; * {} two ; +% LIGKERN three {} * ; * {} three ; four {} * ; * {} four ; +% LIGKERN five {} * ; * {} five ; six {} * ; * {} six ; +% LIGKERN seven {} * ; * {} seven ; eight {} * ; * {} eight ; +% LIGKERN nine {} * ; * {} nine ; +% LIGKERN comma comma =: quotedblbase ; less less =: guillemotleft ; +% LIGKERN greater greater =: guillemotright ; +% +Encoding=CorkEncoding +grave % 0x00 +acute +circumflex +tilde +dieresis +hungarumlaut +ring +caron +breve +macron +dotaccent +cedilla +ogonek +quotesinglbase +guilsinglleft +guilsinglright +quotedblleft % 0x10 +quotedblright +quotedblbase +guillemotleft +guillemotright +endash +emdash +compworkmark +perthousandzero +dotlessi +dotlessj +ff +fi +fl +ffi +ffl +visualspace % 0x20 +exclam +quotedbl +numbersign +dollar +percent +ampersand +quoteright +parenleft +parenright +asterisk +plus +comma +hyphen +period +slash +zero % 0x30 +one +two +three +four +five +six +seven +eight +nine +colon +semicolon +less +equal +greater +question +at % 0x40 +A +B +C +D +E +F +G +H +I +J +K +L +M +N +O +P % 0x50 +Q +R +S +T +U +V +W +X +Y +Z +bracketleft +backslash +bracketright +asciicircum +underscore +quoteleft % 0x60 +a +b +c +d +e +f +g +h +i +j +k +l +m +n +o +p % 0x70 +q +r +s +t +u +v +w +x +y +z +braceleft +bar +braceright +asciitilde +hyphen +Abreve % 0x80 +Aogonek +Cacute +Ccaron +Dcaron +Ecaron +Eogonek +Gbreve +Lacute +Lcaron +Lslash +Nacute +Ncaron +Ng +Ohungarumlaut +Racute +Rcaron % 0x90 +Sacute +Scaron +Scedilla +Tcaron +Tcedilla +Uhungarumlaut +Uring +Ydieresis +Zacute +Zcaron +Zdotaccent +IJ +Idotaccent +dbar +section +abreve % 0xA0 +aogonek +cacute +ccaron +dcaron +ecaron +eogonek +gbreve +lacute +lcaron +lslash +nacute +ncaron +ng +ohungarumlaut +racute +rcaron % 0xB0 +sacute +scaron +scedilla +tquoteright +tcedilla +uhungarumlaut +uring +ydieresis +zacute +zcaron +zdotaccent +ij +exclamdown +questiondown +sterling +Agrave % 0xC0 +Aacute +Acircumflex +Atilde +Adieresis +Aring +AE +Ccedilla +Egrave +Eacute +Ecircumflex +Edieresis +Igrave +Iacute +Icircumflex +Idieresis +Eth % 0xD0 +Ntilde +Ograve +Oacute +Ocircumflex +Otilde +Odieresis +OE +Oslash +Ugrave +Uacute +Ucircumflex +Udieresis +Yacute +Thorn +Germandbls +agrave % 0xE0 +aacute +acircumflex +atilde +adieresis +aring +ae +ccedilla +egrave +eacute +ecircumflex +edieresis +igrave +iacute +icircumflex +idieresis +eth % 0xF0 +ntilde +ograve +oacute +ocircumflex +otilde +odieresis +oe +oslash +ugrave +uacute +ucircumflex +udieresis +yacute +thorn +germandbls diff --git a/Build/source/texk/windvi/texmf/encoding.map b/Build/source/texk/windvi/texmf/encoding.map new file mode 100644 index 00000000000..3d49a0986c3 --- /dev/null +++ b/Build/source/texk/windvi/texmf/encoding.map @@ -0,0 +1,16 @@ +% Here we enumerate all the encodings we want xdvi to recognize as +% an "implied" encoding. Which means that ptmr8r will be recognized as +% ptmr 8r encoded and ptmr8y is ptmr encoded with 8y. If the font file +% we want to 8r encode is named ptmr8a then we need a map file entry. + +% NOTE: the enc files used by xdvi are special. They are NOT identical +% to the enc files used by dvips. + +% This file could easily be used by any other tex program that wants +% to handle implied encodings. + +% Encoding name Defined by this file + +8r TeXBase1Encoding 8r.enc +8c CorkEncoding cork.enc +8y TeXnANSIEncoding texnansi.enc diff --git a/Build/source/texk/windvi/texmf/lucida.map b/Build/source/texk/windvi/texmf/lucida.map new file mode 100644 index 00000000000..0a6a9f4ba38 --- /dev/null +++ b/Build/source/texk/windvi/texmf/lucida.map @@ -0,0 +1,110 @@ +% lucida.map +% Mappings of lucida fonts for xdvi. +% +% I have not looked at this file in disgust - janl 21/2/1999 +% +% If t1mapper has been used on the lucida fonts then most of these are +% quite redundant. + +hlcbot8r LucidaTypewriterBoldOblique "TeXBase1Encoding ReEncodeFont" <8r.enc <lbtbo.pfb +hlcbt8r LucidaTypewriterBold "TeXBase1Encoding ReEncodeFont" <8r.enc <lbtb.pfb + +hlcda LucidaNewMath-Arrows-Demi <lbmad.pfb +hlcdim LucidaNewMath-DemiItalic <lbmdi.pfb +hlcdima LucidaNewMath-AltDemiItalic <lbmdo.pfb +hlcdm LucidaNewMath-Demibold <lbmd.pfb +hlcdy LucidaNewMath-Symbol-Demi <lbmsd.pfb +hlcra LucidaNewMath-Arrows <lbma.pfb +hlcrf8r LucidaBlackletter "TeXBase1Encoding ReEncodeFont" <8r.enc <lbl.pfb +hlcrie8r LucidaCalligraphy-Italic "TeXBase1Encoding ReEncodeFont" <8r.enc <lbc.pfb + +hlcbot8rn LucidaTypewriterBoldOblique "850 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc <lbtbo.pfb +hlcbt8rn LucidaTypewriterBold "850 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc <lbtb.pfb + +hlcrim LucidaNewMath-Italic <lbmi.pfb +hlcrima LucidaNewMath-AltItalic <lbmo.pfb +hlcrin8r LucidaCasual-Italic "TeXBase1Encoding ReEncodeFont" <8r.enc <lbki.pfb +hlcriw8r LucidaHandwriting-Italic "TeXBase1Encoding ReEncodeFont" <8r.enc <lbh.pfb +hlcrm LucidaNewMath-Roman <lbmr.pfb +hlcrn8r LucidaCasual "TeXBase1Encoding ReEncodeFont" <8r.enc <lbkr.pfb +hlcrof8r LucidaBlackletter ".167 SlantFont TeXBase1Encoding ReEncodeFont" <8r.enc <lbl.pfb +hlcron8r LucidaCasual ".167 SlantFont TeXBase1Encoding ReEncodeFont" <8r.enc <lbkr.pfb +hlcrot8r LucidaTypewriterOblique "TeXBase1Encoding ReEncodeFont" <8r.enc <lbto.pfb +hlcrot8rn LucidaTypewriterOblique "850 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc <lbto.pfb +hlcrt8r LucidaTypewriter "TeXBase1Encoding ReEncodeFont" <8r.enc <lbtr.pfb +hlcrt8rn LucidaTypewriter "850 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc <lbtr.pfb +hlcrv LucidaNewMath-Extension <lbme.pfb +hlcry LucidaNewMath-Symbol <lbms.pfb +hlhb8r LucidaBright-Demi "TeXBase1Encoding ReEncodeFont" <8r.enc <lbd.pfb +hlhbc8r LucidaBrightSmallcaps-Demi "TeXBase1Encoding ReEncodeFont" <8r.enc <lbdsc.pfb +hlhbi8r LucidaBright-DemiItalic "TeXBase1Encoding ReEncodeFont" <8r.enc <lbdi.pfb +hlhbo8r LucidaBright-Demi ".167 SlantFont TeXBase1Encoding ReEncodeFont" <8r.enc <lbd.pfb +hlhr8r LucidaBright "TeXBase1Encoding ReEncodeFont" <8r.enc <lbr.pfb +hlhrc8r LucidaBrightSmallcaps "TeXBase1Encoding ReEncodeFont" <8r.enc <lbrsc.pfb +hlhri8r LucidaBright-Italic "TeXBase1Encoding ReEncodeFont" <8r.enc <lbi.pfb +hlhro8r LucidaBright-Oblique "TeXBase1Encoding ReEncodeFont" <8r.enc <lbsl.pfb +hlsb8r LucidaSans-Demi "TeXBase1Encoding ReEncodeFont" <8r.enc <lsd.pfb +hlsbi8r LucidaSans-DemiItalic "TeXBase1Encoding ReEncodeFont" <8r.enc <lsdi.pfb +hlsbot8r LucidaSans-TypewriterBoldOblique "TeXBase1Encoding ReEncodeFont" <8r.enc <lstbo.pfb +hlsbot8rn LucidaSans-TypewriterBoldOblique "850 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc <lstbo.pfb +hlsbt8r LucidaSans-TypewriterBold "TeXBase1Encoding ReEncodeFont" <8r.enc <lstb.pfb +hlsbt8rn LucidaSans-TypewriterBold "850 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc <lstb.pfb +hlsr8r LucidaSans "TeXBase1Encoding ReEncodeFont" <8r.enc <lsr.pfb +hlsri8r LucidaSans-Italic "TeXBase1Encoding ReEncodeFont" <8r.enc <lsi.pfb +hlsro8r LucidaSans ".167 SlantFont TeXBase1Encoding ReEncodeFont" <8r.enc <lsr.pfb +hlsrot8r LucidaSans-TypewriterOblique "TeXBase1Encoding ReEncodeFont" <8r.enc <lsto.pfb +hlsrot8rn LucidaSans-TypewriterOblique "850 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc <lsto.pfb +hlsrt8r LucidaSans-Typewriter "TeXBase1Encoding ReEncodeFont" <8r.enc <lstr.pfb +hlsrt8rn LucidaSans-Typewriter "850 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc <lstr.pfb +hlsu8r LucidaSans-Bold "TeXBase1Encoding ReEncodeFont" <8r.enc <lsb.pfb +hlsui8r LucidaSans-BoldItalic "TeXBase1Encoding ReEncodeFont" <8r.enc <lsbi.pfb +hlsuo8r LucidaSans-Bold ".167 SlantFont TeXBase1Encoding ReEncodeFont" <8r.enc <lsb.pfb +hlxb8r LucidaFax-Demi "TeXBase1Encoding ReEncodeFont" <8r.enc <lfd.pfb +hlxbi8r LucidaFax-DemiItalic "TeXBase1Encoding ReEncodeFont" <8r.enc <lfdi.pfb +hlxbo8r LucidaFax-Demi ".167 SlantFont TeXBase1Encoding ReEncodeFont" <8r.enc <lfd.pfb +hlxr8r LucidaFax "TeXBase1Encoding ReEncodeFont" <8r.enc <lfr.pfb +hlxri8r LucidaFax-Italic "TeXBase1Encoding ReEncodeFont" <8r.enc <lfi.pfb +hlxro8r LucidaFax ".167 SlantFont TeXBase1Encoding ReEncodeFont" <8r.enc <lfr.pfb + +lbkr LucidaCasual "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lbkr.pfb +lbl LucidaBlackletter "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lbl.pfb +lbma LucidaNewMath-Arrows <lbma.pfb +lbmad LucidaNewMath-Arrows-Demi <lbmad.pfb +lbmd LucidaNewMath-Demibold <lbmd.pfb +lbmdi LucidaNewMath-DemiItalic <lbmdi.pfb +lbmdo LucidaNewMath-AltDemiItalic <lbmdo.pfb +lbme LucidaNewMath-Extension <lbme.pfb +lbmi LucidaNewMath-Italic <lbmi.pfb +lbmo LucidaNewMath-AltItalic <lbmo.pfb +lbmr LucidaNewMath-Roman <lbmr.pfb +lbms LucidaNewMath-Symbol <lbms.pfb +lbmsd LucidaNewMath-Symbol-Demi <lbmsd.pfb +lbr LucidaBright "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lbr.pfb +lbrsc LucidaBrightSmallcaps "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lbrsc.pfb +lbsl LucidaBright-Oblique "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lbsl.pfb +lbtb LucidaTypewriterBold "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lbtb.pfb +lbtbo LucidaTypewriterBoldOblique "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lbtbo.pfb +lbto LucidaTypewriterOblique "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lbto.pfb +lbtr LucidaTypewriter "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lbtr.pfb +lfd LucidaFax-Demi "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lfd.pfb +lfdi LucidaFax-DemiItalic "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lfdi.pfb +lfi LucidaFax-Italic "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lfi.pfb +lfr LucidaFax "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lfr.pfb +lsb LucidaSans-Bold "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lsb.pfb +lsbi LucidaSans-BoldItalic "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lsbi.pfb +lsd LucidaSans-Demi "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lsd.pfb +lsdi LucidaSans-DemiItalic "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lsdi.pfb +lsi LucidaSans-Italic "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lsi.pfb +lsr LucidaSans "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lsr.pfb +lstb LucidaSans-TypewriterBold "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lstb.pfb +lstbo LucidaSans-TypewriterBoldOblique "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lstbo.pfb +lsto LucidaSans-TypewriterOblique "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lsto.pfb +lstr LucidaSans-Typewriter "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lstr.pfb + +lbc LucidaCalligraphy-Italic "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lbc.pfb +lbd LucidaBright-Demi "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lbd.pfb +lbdi LucidaBright-DemiItalic "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lbdi.pfb +lbdsc LucidaBrightSmallcaps-Demi "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lbdsc.pfb +lbh LucidaHandwriting-Italic "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lbh.pfb +lbi LucidaBright-Italic "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lbi.pfb +lbki LucidaCasual-Italic "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lbki.pfb diff --git a/Build/source/texk/windvi/texmf/marvosym.map b/Build/source/texk/windvi/texmf/marvosym.map new file mode 100644 index 00000000000..d63aaca8407 --- /dev/null +++ b/Build/source/texk/windvi/texmf/marvosym.map @@ -0,0 +1,2 @@ +fmvr8x Martin_Vogels_Symbole <marvosym.pfb +fmvri8x Martin_Vogels_Symbole " .167 SlantFont" <marvosym.pfb diff --git a/Build/source/texk/windvi/texmf/testfont.log b/Build/source/texk/windvi/texmf/testfont.log new file mode 100644 index 00000000000..2068ccad8fd --- /dev/null +++ b/Build/source/texk/windvi/texmf/testfont.log @@ -0,0 +1,21 @@ +This is TeX, Version 3.14159 (Web2C 7.2) (format=tex 1998.3.21) 1 MAR 1999 01:42 +**testfont +(/local/teTeX/share/texmf/tex/plain/base/testfont.tex +\m=\count26 +\n=\count27 +\p=\count28 +\dim=\dimen16 +\skewtrial=\count29 + + +Name of the font to test = +! Emergency stop. +<read *> + +\init ...he font to test = } \read -1 to\fontname + \startfont \message {Now t... +l.208 \ifx\noinit!\else\init + \fi +End of file on the terminal! + +No pages of output. diff --git a/Build/source/texk/windvi/texmf/texnansi.enc b/Build/source/texk/windvi/texmf/texnansi.enc new file mode 100644 index 00000000000..f04715707e6 --- /dev/null +++ b/Build/source/texk/windvi/texmf/texnansi.enc @@ -0,0 +1,314 @@ +% @psencodingfile{ +% author = "Y&Y, Inc.", +% version = "1.1", +% date = "1 December 1996", +% filename = "texnansi.enc", +% email = "help@YandY.com", +% address = "45 Walden Street // Concord, MA 01742, USA", +% codetable = "ISO/ASCII", +% checksum = "xx", +% docstring = "Encoding for fonts in Adobe Type 1 format for use with TeX." +% } +% +% The idea is to have all 228 characters normally included in Type 1 text +% fonts (plus a few more) available for typesetting. This is effectively +% the character set in Adobe Standard Encoding, ISO Latin 1, plus a few more. +% +% Character code assignments were made as follows: +% +% (1) The character layout largely matches `ASCII' in the 32 -- 126 range, +% except for `circumflex' in 94 and `tilde' in 126, to match `TeX text' +% (`asciicircumflex' and `asciitilde' appear in 158 and 142 instead). +% +% (2) The character layout matches `Windows ANSI' in almost all places, +% except for `quoteright' in 39 and `quoteleft' in 96 to match ASCII +% (`quotesingle' and `grave' appear in 129 and 18 instead). +% +% (3) The character layout matches `TeX typewriter' used by CM text fonts +% in most places (except for discordant positions such as hungarumlaut +% (instead of braceright), dotaccent (instead of underscore) etc. +% +% (4) Remaining characters are assigned arbitrarily to the `control character' +% range (0 -- 31), avoiding 0, 9, 10 and 13 in case we meet dumb software +% - similarly one should really avoid 127 and 128 if possible. +% In addition, the 8 open slots in Windows ANSI between 128 and 159 are used. +% +% (5) Y&Y Lucida Bright includes some extra ligatures and such; ff, ffi, ffl, +% and `dotlessj,' these are included 11 -- 15, and 17. +% +% (6) Hyphen appears both at 45 and 173 for compatibility with both ASCII +% and Windows ANSI. +% +% (7) It doesn't really matter where ligatures appear (both real, such as ffi, +% and pseudo such as ---) since these should not be accessed directly, only +% via ligature information in the TFM file. +% +% SAMPLE USAGE (in `psfonts.map' file for DVIPS): +% +% lbr LucidaBright "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <lbr.pfb +% +% This tells DVIPS that the font called `lbr' in TeX has PostScript +% FontName `LucidaBright.' It also asks DVIPS to expand the file `lbr.pfb' +% into PFA form, to include the attached `texnansi.enc' encoding vector, +% and to then actually reencode the font based on that encoding vector. +% +% Revised 1996 June 1 by adding second position for `fl' to avoid Acrobat bug. +% Revised 1996 June 1 by adding second position for `fraction' for same reason. +% +Encoding=TeXnANSIEncoding +.notdef % 0 +uni20AC % 1 +.notdef % 2 +.notdef % 3 +fraction % 4 +dotaccent % 5 +hungarumlaut % 6 +ogonek % 7 +fl % 8 +.notdef % /fraction % 9 not used (see 4), backward compatability only +cwm % 10 not used, except boundary char internally maybe +ff % 11 +fi % 12 +.notdef % fl % 13 not used (see 8), backward compatability only +ffi % 14 +ffl % 15 +dotlessi % 16 +dotlessj % 17 +grave % 18 +acute % 19 +caron % 20 +breve % 21 +macron % 22 +ring % 23 +cedilla % 24 +germandbls % 25 +ae % 26 +oe % 27 +oslash % 28 +AE % 29 +OE % 30 +Oslash % 31 +space % 32 % /suppress in TeX text +exclam % 33 +quotedbl % 34 % /quotedblright in TeX text +numbersign % 35 +dollar % 36 +percent % 37 +ampersand % 38 +quoteright % 39 % /quotesingle in ANSI +parenleft % 40 +parenright % 41 +asterisk % 42 +plus % 43 +comma % 44 +hyphen % 45 +period % 46 +slash % 47 +zero % 48 +one % 49 +two % 50 +three % 51 +four % 52 +five % 53 +six % 54 +seven % 55 +eight % 56 +nine % 57 +colon % 58 +semicolon % 59 +less % 60 % /exclamdown in TeX text +equal % 61 +greater % 62 % /questiondown in TeX text +question % 63 +at % 64 +A % 65 +B % 66 +C % 67 +D % 68 +E % 69 +F % 70 +G % 71 +H % 72 +I % 73 +J % 74 +K % 75 +L % 76 +M % 77 +N % 78 +O % 79 +P % 80 +Q % 81 +R % 82 +S % 83 +T % 84 +U % 85 +V % 86 +W % 87 +X % 88 +Y % 89 +Z % 90 +bracketleft % 91 +backslash % 92 % /quotedblleft in TeX text +bracketright % 93 +circumflex % 94 % /asciicircum in ASCII +underscore % 95 % /dotaccent in TeX text +quoteleft % 96 % /grave accent in ANSI +a % 97 +b % 98 +c % 99 +d % 100 +e % 101 +f % 102 +g % 103 +h % 104 +i % 105 +j % 106 +k % 107 +l % 108 +m % 109 +n % 110 +o % 111 +p % 112 +q % 113 +r % 114 +s % 115 +t % 116 +u % 117 +v % 118 +w % 119 +x % 120 +y % 121 +z % 122 +braceleft % 123 % /endash in TeX text +bar % 124 % /emdash in TeX test +braceright % 125 % /hungarumlaut in TeX text +tilde % 126 % /asciitilde in ASCII +dieresis % 127 not used (see 168), use higher up instead +/Lslash % 128 this position is unfortunate, but now too late to fix +quotesingle % 129 +/quotesinglbase % 130 +florin % 131 +quotedblbase % 132 +ellipsis % 133 +dagger % 134 +daggerdbl % 135 +circumflex % 136 +perthousand % 137 +Scaron % 138 +guilsinglleft % 139 +OE % 140 +Zcaron % 141 +asciicircum % 142 +minus % 143 +lslash % 144 +quoteleft % 145 +quoteright % 146 +quotedblleft % 147 +quotedblright % 148 +bullet % 149 +endash % 150 +emdash % 151 +tilde % 152 +trademark % 153 +scaron % 154 +guilsinglright % 155 +oe % 156 +zcaron % 157 +asciitilde % 158 +Ydieresis % 159 +nbspace % 160 % /space (no break space) +exclamdown % 161 +cent % 162 +sterling % 163 +currency % 164 +yen % 165 +brokenbar % 166 +section % 167 +dieresis % 168 +copyright % 169 +ordfeminine % 170 +guillemotleft % 171 +logicalnot % 172 +sfthyphen % 173 % /hyphen (hanging hyphen) +registered % 174 +macron % 175 +degree % 176 +plusminus % 177 +twosuperior % 178 +threesuperior % 179 +acute % 180 +mu % 181 +paragraph % 182 +periodcentered %183 +cedilla % 184 +onesuperior % 185 +ordmasculine % 186 +guillemotright %187 +onequarter % 188 +onehalf % 189 +threequarters % 190 +questiondown % 191 +Agrave % 192 +Aacute % 193 +Acircumflex % 194 +Atilde % 195 +Adieresis % 196 +Aring % 197 +AE % 198 +Ccedilla % 199 +Egrave % 200 +Eacute % 201 +Ecircumflex % 202 +Edieresis % 203 +Igrave % 204 +Iacute % 205 +Icircumflex % 206 +Idieresis % 207 +Eth % 208 +Ntilde % 209 +Ograve % 210 +Oacute % 211 +Ocircumflex % 212 +Otilde % 213 +Odieresis % 214 +multiply % 215 % OE in T1 +Oslash % 216 +Ugrave % 217 +Uacute % 218 +Ucircumflex % 219 +Udieresis % 220 +Yacute % 221 +Thorn % 222 +germandbls % 223 % SS in T1 +agrave % 224 +aacute % 225 +acircumflex % 226 +atilde % 227 +adieresis % 228 +aring % 229 +ae % 230 +ccedilla % 231 +egrave % 232 +eacute % 233 +ecircumflex % 234 +edieresis % 235 +igrave % 236 +iacute % 237 +icircumflex % 238 +idieresis % 239 +eth % 240 +ntilde % 241 +ograve % 242 +oacute % 243 +ocircumflex % 244 +otilde % 245 +odieresis % 246 +divide % 247 % oe in T1 +oslash % 248 +ugrave % 249 +uacute % 250 +ucircumflex % 251 +udieresis % 252 +yacute % 253 +thorn % 254 +ydieresis % 255 % germandbls in T1 diff --git a/Build/source/texk/windvi/texmf/xdvi.cfg b/Build/source/texk/windvi/texmf/xdvi.cfg new file mode 100644 index 00000000000..c2b9a02ca42 --- /dev/null +++ b/Build/source/texk/windvi/texmf/xdvi.cfg @@ -0,0 +1,50 @@ +% Comment +% Comments may only start in the first column in xdvi cfg files. +% +% Nicolai Langfeldt 21/2/1999 + +% This file describes the encodings xdvi is to recognize as implied. +encmap encoding.map + +% psfonts.map for dvips is _not_ useable with xdvi. +% dvipsmap psfonts.map +% +% xdvifont.map is a edited digest of psfonts.map for use with xdvi +dvipsmap xdvifont.map + +% We can use these un-modified: +dvipsmap marvosym.map +dvipsmap xypic.map + +% If you applied t1mapper to the Charter fonts (they are in gs) +% you want this: +dvipsmap charter2.map +% otherwise you want this: +% dvipsmap charter.map + +% These are trivial, and thus not needed. +% dvipsmap cs.map +% dvipsmap omega.map +% dvipsmap bsr.map + +% Unsuitable. t1mapper -gs took care of this +% dvipsmap acrobat.map +% dvipsmap lw35extra.map + +% Lucida fonts. Possebly unsuitabe. Much of these are wrong if +% t1mapper was applied to the fonts. Some of the lines describing +% fonts with modified slant or width will need editing if t1mapper was +% applied. If t1mapper was not applied they are both needed: +% dvipsmap lucidabr.map +% dvipsmap utopia.map + +% Partly trivial, partly unsuitable, the rest in xdvifont.map: +% dvipsmap mathtime.map + +% "real" bakoma instead of interpolated bsr +% dvipsmap bakomaextra.map +% this one *or* the previous one. Not both! +% dvipsmap bsr-missing-interpolated.map + +% What is this? +% dvipsmap hoekwater.map diff --git a/Build/source/texk/windvi/texmf/xdvifont.map b/Build/source/texk/windvi/texmf/xdvifont.map new file mode 100644 index 00000000000..6c58606aa55 --- /dev/null +++ b/Build/source/texk/windvi/texmf/xdvifont.map @@ -0,0 +1,56 @@ +% xdvifont.map. +% +% Derived from psfonts.map in teTeX 0.9 in this way: +% +% - Remove mappings which are also available in files we can use unmodified +% - Remove all trivial mappings +% - Lucida is a mess - put in separate file: lucida.map +% - Add input file names for the standard fonts left +% +% NOTE: xdvi does not care about the font-file extention, but dvips does. +% +% Nicolai Langfeldt 21/2/1999. + +ppi020 MathematicalPi-Two <mh2.pfb +ppi025 MathematicalPi-Six <mh6.pfb + +% So, non KB names for standard fonts: + +cob Courier-Bold "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <pcrb +cobo Courier-BoldOblique "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <pcrbo +com Courier "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <pcrr +coo Courier-Oblique "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <pcrro + +pcrr8rn Courier ".85 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc <pcrr + +hv Helvetica "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <phvr +hvb Helvetica-Bold "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <phvb +hvbo Helvetica-BoldOblique "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <phvbo +hvo Helvetica-Oblique "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <phvro + +% This _should've_ been HelveticaNarrow, if you own Helvetica narrow +% you want to comment these out: + +phvb8rn Helvetica-Bold ".82 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc <phvb +phvbo8rn Helvetica-BoldOblique ".82 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc <phvbo +phvr8rn Helvetica ".82 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc <phvr +phvro8rn Helvetica-Oblique ".82 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc <phvro + +pplr8rn Palatino-Roman ".82 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc <pplr +pplrr8re Palatino-Roman "1.2 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc <pplr +pplru8r Palatino-Italic "-.1763 SlantFont TeXBase1Encoding ReEncodeFont" <8r.enc <pplri + +psyro Symbol ".167 SlantFont" <psyr + +ptmr8rn Times-Roman ".82 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc <ptmr +ptmrr8re Times-Roman "1.2 ExtendFont TeXBase1Encoding ReEncodeFont" <8r.enc <ptmr + +tib Times-Bold "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <ptmb +tibi Times-BoldItalic "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <ptmbi +tibo Times-Bold ".167 SlantFont TeXnANSIEncoding ReEncodeFont" <texnansi.enc <ptmb +tii Times-Italic "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <ptmri +tio Times-Roman ".167 SlantFont TeXnANSIEncoding ReEncodeFont" <texnansi.enc <ptmr +tir Times-Roman "TeXnANSIEncoding ReEncodeFont" <texnansi.enc <ptmr + +zd ZapfDingbats <pzdr + diff --git a/Build/source/texk/windvi/texmf/xypic.map b/Build/source/texk/windvi/texmf/xypic.map new file mode 100644 index 00000000000..bd47b3ccaa1 --- /dev/null +++ b/Build/source/texk/windvi/texmf/xypic.map @@ -0,0 +1,18 @@ +% Thomas Esser, 1998, public domain. +xyatip10 XYATIP10 <xyatip10.pfb +xybsql10 XYBSQL10 <xybsql10.pfb +xybtip10 XYBTIP10 <xybtip10.pfb +xycirc10 XYCIRC10 <xycirc10.pfb +xycmat10 XYCMAT10 <xycmat10.pfb +xycmat11 XYCMAT10 "1.1 ExtendFont" <xycmat10.pfb +xycmat12 XYCMAT10 "1.2 ExtendFont" <xycmat10.pfb +xycmbt10 XYCMBT10 <xycmbt10.pfb +xycmbt11 XYCMBT10 "1.1 ExtendFont" <xycmbt10.pfb +xycmbt12 XYCMBT10 "1.2 ExtendFont" <xycmbt10.pfb +xydash10 XYDASH10 <xydash10.pfb +xyeuat10 XYEUAT10 <xyeuat10.pfb +xyeuat11 XYEUAT10 "1.1 ExtendFont" <xyeuat10.pfb +xyeuat12 XYEUAT10 "1.2 ExtendFont" <xyeuat10.pfb +xyeubt10 XYEUBT10 <xyeubt10.pfb +xyeubt11 XYEUBT10 "1.1 ExtendFont" <xyeubt10.pfb +xyeubt12 XYEUBT10 "1.2 ExtendFont" <xyeubt10.pfb diff --git a/Build/source/texk/windvi/tfmdump b/Build/source/texk/windvi/tfmdump new file mode 100644 index 00000000000..29882e52925 --- /dev/null +++ b/Build/source/texk/windvi/tfmdump @@ -0,0 +1,980 @@ +(FAMILY CMR) +(FACE O 352) +(CODINGSCHEME TEX TEXT) +(DESIGNSIZE R 10.0) +(COMMENT DESIGNSIZE IS IN POINTS) +(COMMENT OTHER SIZES ARE MULTIPLES OF DESIGNSIZE) +(CHECKSUM O 11374260171) +(FONTDIMEN + (SLANT R 0.0) + (SPACE R 0.333334) + (STRETCH R 0.166667) + (SHRINK R 0.111112) + (XHEIGHT R 0.430555) + (QUAD R 1.000003) + (EXTRASPACE R 0.111112) + ) +(LIGTABLE + (LABEL O 40) + (KRN C l R -0.277779) + (KRN C L R -0.319446) + (STOP) + (LABEL C f) + (LIG C i O 14) + (LIG C f O 13) + (LIG C l O 15) + (KRN O 47 R 0.077779) + (KRN O 77 R 0.077779) + (KRN O 41 R 0.077779) + (KRN O 51 R 0.077779) + (KRN O 135 R 0.077779) + (STOP) + (LABEL O 13) + (LIG C i O 16) + (LIG C l O 17) + (KRN O 47 R 0.077779) + (KRN O 77 R 0.077779) + (KRN O 41 R 0.077779) + (KRN O 51 R 0.077779) + (KRN O 135 R 0.077779) + (STOP) + (LABEL O 140) + (LIG O 140 O 134) + (STOP) + (LABEL O 47) + (LIG O 47 O 42) + (KRN O 77 R 0.111112) + (KRN O 41 R 0.111112) + (STOP) + (LABEL O 55) + (LIG O 55 O 173) + (STOP) + (LABEL O 173) + (LIG O 55 O 174) + (STOP) + (LABEL O 41) + (LIG O 140 O 74) + (STOP) + (LABEL O 77) + (LIG O 140 O 76) + (STOP) + (LABEL C k) + (LABEL C v) + (KRN C a R -0.055555) + (LABEL C w) + (KRN C e R -0.027779) + (KRN C a R -0.027779) + (KRN C o R -0.027779) + (KRN C c R -0.027779) + (STOP) + (LABEL C P) + (KRN C A R -0.083334) + (LABEL C y) + (KRN C o R -0.027779) + (KRN C e R -0.027779) + (KRN C a R -0.027779) + (KRN O 56 R -0.083334) + (KRN O 54 R -0.083334) + (STOP) + (LABEL C F) + (LABEL C V) + (LABEL C W) + (KRN C o R -0.083334) + (KRN C e R -0.083334) + (KRN C u R -0.083334) + (KRN C r R -0.083334) + (KRN C a R -0.083334) + (KRN C A R -0.111112) + (LABEL C K) + (LABEL C X) + (KRN C O R -0.027779) + (KRN C C R -0.027779) + (KRN C G R -0.027779) + (KRN C Q R -0.027779) + (STOP) + (LABEL C T) + (KRN C y R -0.027779) + (LABEL C Y) + (KRN C e R -0.083334) + (KRN C o R -0.083334) + (KRN C r R -0.083334) + (KRN C a R -0.083334) + (KRN C A R -0.083334) + (KRN C u R -0.083334) + (STOP) + (LABEL C D) + (LABEL C O) + (KRN C X R -0.027779) + (KRN C W R -0.027779) + (KRN C A R -0.027779) + (KRN C V R -0.027779) + (KRN C Y R -0.027779) + (STOP) + (LABEL C h) + (LABEL C m) + (LABEL C n) + (KRN C t R -0.027779) + (KRN C u R -0.027779) + (KRN C b R -0.027779) + (KRN C y R -0.027779) + (KRN C v R -0.027779) + (KRN C w R -0.027779) + (STOP) + (LABEL C c) + (KRN C h R -0.027779) + (KRN C k R -0.027779) + (STOP) + (LABEL C b) + (LABEL C o) + (LABEL C p) + (KRN C e R 0.027779) + (KRN C o R 0.027779) + (KRN C x R -0.027779) + (KRN C d R 0.027779) + (KRN C c R 0.027779) + (KRN C q R 0.027779) + (LABEL C a) + (KRN C v R -0.027779) + (KRN C j R 0.055555) + (LABEL C t) + (KRN C y R -0.027779) + (LABEL C u) + (KRN C w R -0.027779) + (STOP) + (LABEL C A) + (LABEL C R) + (KRN C t R -0.027779) + (KRN C C R -0.027779) + (KRN C O R -0.027779) + (KRN C G R -0.027779) + (KRN C U R -0.027779) + (KRN C Q R -0.027779) + (LABEL C L) + (KRN C T R -0.083334) + (KRN C Y R -0.083334) + (KRN C V R -0.111112) + (KRN C W R -0.111112) + (STOP) + (LABEL C g) + (KRN C j R 0.027779) + (STOP) + (LABEL C I) + (KRN C I R 0.027779) + (STOP) + ) +(CHARACTER O 0 + (CHARWD R 0.625002) + (CHARHT R 0.683332) + ) +(CHARACTER O 1 + (CHARWD R 0.833336) + (CHARHT R 0.683332) + ) +(CHARACTER O 2 + (CHARWD R 0.777781) + (CHARHT R 0.683332) + ) +(CHARACTER O 3 + (CHARWD R 0.694446) + (CHARHT R 0.683332) + ) +(CHARACTER O 4 + (CHARWD R 0.666669) + (CHARHT R 0.683332) + ) +(CHARACTER O 5 + (CHARWD R 0.750002) + (CHARHT R 0.683332) + ) +(CHARACTER O 6 + (CHARWD R 0.722224) + (CHARHT R 0.683332) + ) +(CHARACTER O 7 + (CHARWD R 0.777781) + (CHARHT R 0.683332) + ) +(CHARACTER O 10 + (CHARWD R 0.722224) + (CHARHT R 0.683332) + ) +(CHARACTER O 11 + (CHARWD R 0.777781) + (CHARHT R 0.683332) + ) +(CHARACTER O 12 + (CHARWD R 0.722224) + (CHARHT R 0.683332) + ) +(CHARACTER O 13 + (CHARWD R 0.583336) + (CHARHT R 0.694445) + (CHARIC R 0.077779) + (COMMENT + (LIG C i O 16) + (LIG C l O 17) + (KRN O 47 R 0.077779) + (KRN O 77 R 0.077779) + (KRN O 41 R 0.077779) + (KRN O 51 R 0.077779) + (KRN O 135 R 0.077779) + ) + ) +(CHARACTER O 14 + (CHARWD R 0.555557) + (CHARHT R 0.694445) + ) +(CHARACTER O 15 + (CHARWD R 0.555557) + (CHARHT R 0.694445) + ) +(CHARACTER O 16 + (CHARWD R 0.833336) + (CHARHT R 0.694445) + ) +(CHARACTER O 17 + (CHARWD R 0.833336) + (CHARHT R 0.694445) + ) +(CHARACTER O 20 + (CHARWD R 0.277779) + (CHARHT R 0.430555) + ) +(CHARACTER O 21 + (CHARWD R 0.305557) + (CHARHT R 0.430555) + (CHARDP R 0.194445) + ) +(CHARACTER O 22 + (CHARWD R 0.500002) + (CHARHT R 0.694445) + ) +(CHARACTER O 23 + (CHARWD R 0.500002) + (CHARHT R 0.694445) + ) +(CHARACTER O 24 + (CHARWD R 0.500002) + (CHARHT R 0.628473) + ) +(CHARACTER O 25 + (CHARWD R 0.500002) + (CHARHT R 0.694445) + ) +(CHARACTER O 26 + (CHARWD R 0.500002) + (CHARHT R 0.567777) + ) +(CHARACTER O 27 + (CHARWD R 0.750002) + (CHARHT R 0.694445) + ) +(CHARACTER O 30 + (CHARWD R 0.444446) + (CHARDP R 0.170138) + ) +(CHARACTER O 31 + (CHARWD R 0.500003) + (CHARHT R 0.694445) + ) +(CHARACTER O 32 + (CHARWD R 0.722224) + (CHARHT R 0.430555) + ) +(CHARACTER O 33 + (CHARWD R 0.777781) + (CHARHT R 0.430555) + ) +(CHARACTER O 34 + (CHARWD R 0.500002) + (CHARHT R 0.527779) + (CHARDP R 0.097223) + ) +(CHARACTER O 35 + (CHARWD R 0.902781) + (CHARHT R 0.683332) + ) +(CHARACTER O 36 + (CHARWD R 1.013891) + (CHARHT R 0.683332) + ) +(CHARACTER O 37 + (CHARWD R 0.777781) + (CHARHT R 0.731944) + (CHARDP R 0.048612) + ) +(CHARACTER O 40 + (CHARWD R 0.277779) + (CHARHT R 0.430555) + (COMMENT + (KRN C l R -0.277779) + (KRN C L R -0.319446) + ) + ) +(CHARACTER O 41 + (CHARWD R 0.277779) + (CHARHT R 0.694445) + (COMMENT + (LIG O 140 O 74) + ) + ) +(CHARACTER O 42 + (CHARWD R 0.500002) + (CHARHT R 0.694445) + ) +(CHARACTER O 43 + (CHARWD R 0.833336) + (CHARHT R 0.694445) + (CHARDP R 0.194443) + ) +(CHARACTER O 44 + (CHARWD R 0.500002) + (CHARHT R 0.75) + (CHARDP R 0.055555) + ) +(CHARACTER O 45 + (CHARWD R 0.833336) + (CHARHT R 0.75) + (CHARDP R 0.055555) + ) +(CHARACTER O 46 + (CHARWD R 0.777781) + (CHARHT R 0.694445) + ) +(CHARACTER O 47 + (CHARWD R 0.277779) + (CHARHT R 0.694445) + (COMMENT + (LIG O 47 O 42) + (KRN O 77 R 0.111112) + (KRN O 41 R 0.111112) + ) + ) +(CHARACTER O 50 + (CHARWD R 0.38889) + (CHARHT R 0.75) + (CHARDP R 0.25) + ) +(CHARACTER O 51 + (CHARWD R 0.38889) + (CHARHT R 0.75) + (CHARDP R 0.25) + ) +(CHARACTER O 52 + (CHARWD R 0.500002) + (CHARHT R 0.75) + ) +(CHARACTER O 53 + (CHARWD R 0.777781) + (CHARHT R 0.583334) + (CHARDP R 0.083334) + ) +(CHARACTER O 54 + (CHARWD R 0.277779) + (CHARHT R 0.105556) + (CHARDP R 0.194445) + ) +(CHARACTER O 55 + (CHARWD R 0.333334) + (CHARHT R 0.430555) + (COMMENT + (LIG O 55 O 173) + ) + ) +(CHARACTER O 56 + (CHARWD R 0.277779) + (CHARHT R 0.105556) + ) +(CHARACTER O 57 + (CHARWD R 0.500002) + (CHARHT R 0.75) + (CHARDP R 0.25) + ) +(CHARACTER C 0 + (CHARWD R 0.500002) + (CHARHT R 0.644444) + ) +(CHARACTER C 1 + (CHARWD R 0.500002) + (CHARHT R 0.644444) + ) +(CHARACTER C 2 + (CHARWD R 0.500002) + (CHARHT R 0.644444) + ) +(CHARACTER C 3 + (CHARWD R 0.500002) + (CHARHT R 0.644444) + ) +(CHARACTER C 4 + (CHARWD R 0.500002) + (CHARHT R 0.644444) + ) +(CHARACTER C 5 + (CHARWD R 0.500002) + (CHARHT R 0.644444) + ) +(CHARACTER C 6 + (CHARWD R 0.500002) + (CHARHT R 0.644444) + ) +(CHARACTER C 7 + (CHARWD R 0.500002) + (CHARHT R 0.644444) + ) +(CHARACTER C 8 + (CHARWD R 0.500002) + (CHARHT R 0.644444) + ) +(CHARACTER C 9 + (CHARWD R 0.500002) + (CHARHT R 0.644444) + ) +(CHARACTER O 72 + (CHARWD R 0.277779) + (CHARHT R 0.430555) + ) +(CHARACTER O 73 + (CHARWD R 0.277779) + (CHARHT R 0.430555) + (CHARDP R 0.194445) + ) +(CHARACTER O 74 + (CHARWD R 0.277779) + (CHARHT R 0.5) + (CHARDP R 0.194445) + ) +(CHARACTER O 75 + (CHARWD R 0.777781) + (CHARHT R 0.366875) + (CHARDP R -0.133125) + ) +(CHARACTER O 76 + (CHARWD R 0.472224) + (CHARHT R 0.5) + (CHARDP R 0.194445) + ) +(CHARACTER O 77 + (CHARWD R 0.472224) + (CHARHT R 0.694445) + (COMMENT + (LIG O 140 O 76) + ) + ) +(CHARACTER O 100 + (CHARWD R 0.777781) + (CHARHT R 0.694445) + ) +(CHARACTER C A + (CHARWD R 0.750002) + (CHARHT R 0.683332) + (COMMENT + (KRN C t R -0.027779) + (KRN C C R -0.027779) + (KRN C O R -0.027779) + (KRN C G R -0.027779) + (KRN C U R -0.027779) + (KRN C Q R -0.027779) + (KRN C T R -0.083334) + (KRN C Y R -0.083334) + (KRN C V R -0.111112) + (KRN C W R -0.111112) + ) + ) +(CHARACTER C B + (CHARWD R 0.708336) + (CHARHT R 0.683332) + ) +(CHARACTER C C + (CHARWD R 0.722224) + (CHARHT R 0.683332) + ) +(CHARACTER C D + (CHARWD R 0.763891) + (CHARHT R 0.683332) + (COMMENT + (KRN C X R -0.027779) + (KRN C W R -0.027779) + (KRN C A R -0.027779) + (KRN C V R -0.027779) + (KRN C Y R -0.027779) + ) + ) +(CHARACTER C E + (CHARWD R 0.680557) + (CHARHT R 0.683332) + ) +(CHARACTER C F + (CHARWD R 0.652781) + (CHARHT R 0.683332) + (COMMENT + (KRN C o R -0.083334) + (KRN C e R -0.083334) + (KRN C u R -0.083334) + (KRN C r R -0.083334) + (KRN C a R -0.083334) + (KRN C A R -0.111112) + (KRN C O R -0.027779) + (KRN C C R -0.027779) + (KRN C G R -0.027779) + (KRN C Q R -0.027779) + ) + ) +(CHARACTER C G + (CHARWD R 0.784724) + (CHARHT R 0.683332) + ) +(CHARACTER C H + (CHARWD R 0.750002) + (CHARHT R 0.683332) + ) +(CHARACTER C I + (CHARWD R 0.361112) + (CHARHT R 0.683332) + (COMMENT + (KRN C I R 0.027779) + ) + ) +(CHARACTER C J + (CHARWD R 0.51389) + (CHARHT R 0.683332) + ) +(CHARACTER C K + (CHARWD R 0.777781) + (CHARHT R 0.683332) + (COMMENT + (KRN C O R -0.027779) + (KRN C C R -0.027779) + (KRN C G R -0.027779) + (KRN C Q R -0.027779) + ) + ) +(CHARACTER C L + (CHARWD R 0.625002) + (CHARHT R 0.683332) + (COMMENT + (KRN C T R -0.083334) + (KRN C Y R -0.083334) + (KRN C V R -0.111112) + (KRN C W R -0.111112) + ) + ) +(CHARACTER C M + (CHARWD R 0.916669) + (CHARHT R 0.683332) + ) +(CHARACTER C N + (CHARWD R 0.750002) + (CHARHT R 0.683332) + ) +(CHARACTER C O + (CHARWD R 0.777781) + (CHARHT R 0.683332) + (COMMENT + (KRN C X R -0.027779) + (KRN C W R -0.027779) + (KRN C A R -0.027779) + (KRN C V R -0.027779) + (KRN C Y R -0.027779) + ) + ) +(CHARACTER C P + (CHARWD R 0.680557) + (CHARHT R 0.683332) + (COMMENT + (KRN C A R -0.083334) + (KRN C o R -0.027779) + (KRN C e R -0.027779) + (KRN C a R -0.027779) + (KRN O 56 R -0.083334) + (KRN O 54 R -0.083334) + ) + ) +(CHARACTER C Q + (CHARWD R 0.777781) + (CHARHT R 0.683332) + (CHARDP R 0.194445) + ) +(CHARACTER C R + (CHARWD R 0.736113) + (CHARHT R 0.683332) + (COMMENT + (KRN C t R -0.027779) + (KRN C C R -0.027779) + (KRN C O R -0.027779) + (KRN C G R -0.027779) + (KRN C U R -0.027779) + (KRN C Q R -0.027779) + (KRN C T R -0.083334) + (KRN C Y R -0.083334) + (KRN C V R -0.111112) + (KRN C W R -0.111112) + ) + ) +(CHARACTER C S + (CHARWD R 0.555557) + (CHARHT R 0.683332) + ) +(CHARACTER C T + (CHARWD R 0.722224) + (CHARHT R 0.683332) + (COMMENT + (KRN C y R -0.027779) + (KRN C e R -0.083334) + (KRN C o R -0.083334) + (KRN C r R -0.083334) + (KRN C a R -0.083334) + (KRN C A R -0.083334) + (KRN C u R -0.083334) + ) + ) +(CHARACTER C U + (CHARWD R 0.750002) + (CHARHT R 0.683332) + ) +(CHARACTER C V + (CHARWD R 0.750002) + (CHARHT R 0.683332) + (CHARIC R 0.013888) + (COMMENT + (KRN C o R -0.083334) + (KRN C e R -0.083334) + (KRN C u R -0.083334) + (KRN C r R -0.083334) + (KRN C a R -0.083334) + (KRN C A R -0.111112) + (KRN C O R -0.027779) + (KRN C C R -0.027779) + (KRN C G R -0.027779) + (KRN C Q R -0.027779) + ) + ) +(CHARACTER C W + (CHARWD R 1.027781) + (CHARHT R 0.683332) + (CHARIC R 0.013888) + (COMMENT + (KRN C o R -0.083334) + (KRN C e R -0.083334) + (KRN C u R -0.083334) + (KRN C r R -0.083334) + (KRN C a R -0.083334) + (KRN C A R -0.111112) + (KRN C O R -0.027779) + (KRN C C R -0.027779) + (KRN C G R -0.027779) + (KRN C Q R -0.027779) + ) + ) +(CHARACTER C X + (CHARWD R 0.750002) + (CHARHT R 0.683332) + (COMMENT + (KRN C O R -0.027779) + (KRN C C R -0.027779) + (KRN C G R -0.027779) + (KRN C Q R -0.027779) + ) + ) +(CHARACTER C Y + (CHARWD R 0.750002) + (CHARHT R 0.683332) + (CHARIC R 0.025) + (COMMENT + (KRN C e R -0.083334) + (KRN C o R -0.083334) + (KRN C r R -0.083334) + (KRN C a R -0.083334) + (KRN C A R -0.083334) + (KRN C u R -0.083334) + ) + ) +(CHARACTER C Z + (CHARWD R 0.611113) + (CHARHT R 0.683332) + ) +(CHARACTER O 133 + (CHARWD R 0.277779) + (CHARHT R 0.75) + (CHARDP R 0.25) + ) +(CHARACTER O 134 + (CHARWD R 0.500002) + (CHARHT R 0.694445) + ) +(CHARACTER O 135 + (CHARWD R 0.277779) + (CHARHT R 0.75) + (CHARDP R 0.25) + ) +(CHARACTER O 136 + (CHARWD R 0.500002) + (CHARHT R 0.694445) + ) +(CHARACTER O 137 + (CHARWD R 0.277779) + (CHARHT R 0.667859) + ) +(CHARACTER O 140 + (CHARWD R 0.277779) + (CHARHT R 0.694445) + (COMMENT + (LIG O 140 O 134) + ) + ) +(CHARACTER C a + (CHARWD R 0.500002) + (CHARHT R 0.430555) + (COMMENT + (KRN C v R -0.027779) + (KRN C j R 0.055555) + (KRN C y R -0.027779) + (KRN C w R -0.027779) + ) + ) +(CHARACTER C b + (CHARWD R 0.555557) + (CHARHT R 0.694445) + (COMMENT + (KRN C e R 0.027779) + (KRN C o R 0.027779) + (KRN C x R -0.027779) + (KRN C d R 0.027779) + (KRN C c R 0.027779) + (KRN C q R 0.027779) + (KRN C v R -0.027779) + (KRN C j R 0.055555) + (KRN C y R -0.027779) + (KRN C w R -0.027779) + ) + ) +(CHARACTER C c + (CHARWD R 0.444446) + (CHARHT R 0.430555) + (COMMENT + (KRN C h R -0.027779) + (KRN C k R -0.027779) + ) + ) +(CHARACTER C d + (CHARWD R 0.555557) + (CHARHT R 0.694445) + ) +(CHARACTER C e + (CHARWD R 0.444446) + (CHARHT R 0.430555) + ) +(CHARACTER C f + (CHARWD R 0.305557) + (CHARHT R 0.694445) + (CHARIC R 0.077779) + (COMMENT + (LIG C i O 14) + (LIG C f O 13) + (LIG C l O 15) + (KRN O 47 R 0.077779) + (KRN O 77 R 0.077779) + (KRN O 41 R 0.077779) + (KRN O 51 R 0.077779) + (KRN O 135 R 0.077779) + ) + ) +(CHARACTER C g + (CHARWD R 0.500002) + (CHARHT R 0.430555) + (CHARDP R 0.194445) + (CHARIC R 0.013888) + (COMMENT + (KRN C j R 0.027779) + ) + ) +(CHARACTER C h + (CHARWD R 0.555557) + (CHARHT R 0.694445) + (COMMENT + (KRN C t R -0.027779) + (KRN C u R -0.027779) + (KRN C b R -0.027779) + (KRN C y R -0.027779) + (KRN C v R -0.027779) + (KRN C w R -0.027779) + ) + ) +(CHARACTER C i + (CHARWD R 0.277779) + (CHARHT R 0.667859) + ) +(CHARACTER C j + (CHARWD R 0.305557) + (CHARHT R 0.667859) + (CHARDP R 0.194445) + ) +(CHARACTER C k + (CHARWD R 0.527781) + (CHARHT R 0.694445) + (COMMENT + (KRN C a R -0.055555) + (KRN C e R -0.027779) + (KRN C a R -0.027779) + (KRN C o R -0.027779) + (KRN C c R -0.027779) + ) + ) +(CHARACTER C l + (CHARWD R 0.277779) + (CHARHT R 0.694445) + ) +(CHARACTER C m + (CHARWD R 0.833336) + (CHARHT R 0.430555) + (COMMENT + (KRN C t R -0.027779) + (KRN C u R -0.027779) + (KRN C b R -0.027779) + (KRN C y R -0.027779) + (KRN C v R -0.027779) + (KRN C w R -0.027779) + ) + ) +(CHARACTER C n + (CHARWD R 0.555557) + (CHARHT R 0.430555) + (COMMENT + (KRN C t R -0.027779) + (KRN C u R -0.027779) + (KRN C b R -0.027779) + (KRN C y R -0.027779) + (KRN C v R -0.027779) + (KRN C w R -0.027779) + ) + ) +(CHARACTER C o + (CHARWD R 0.500002) + (CHARHT R 0.430555) + (COMMENT + (KRN C e R 0.027779) + (KRN C o R 0.027779) + (KRN C x R -0.027779) + (KRN C d R 0.027779) + (KRN C c R 0.027779) + (KRN C q R 0.027779) + (KRN C v R -0.027779) + (KRN C j R 0.055555) + (KRN C y R -0.027779) + (KRN C w R -0.027779) + ) + ) +(CHARACTER C p + (CHARWD R 0.555557) + (CHARHT R 0.430555) + (CHARDP R 0.194445) + (COMMENT + (KRN C e R 0.027779) + (KRN C o R 0.027779) + (KRN C x R -0.027779) + (KRN C d R 0.027779) + (KRN C c R 0.027779) + (KRN C q R 0.027779) + (KRN C v R -0.027779) + (KRN C j R 0.055555) + (KRN C y R -0.027779) + (KRN C w R -0.027779) + ) + ) +(CHARACTER C q + (CHARWD R 0.527779) + (CHARHT R 0.430555) + (CHARDP R 0.194445) + ) +(CHARACTER C r + (CHARWD R 0.391668) + (CHARHT R 0.430555) + ) +(CHARACTER C s + (CHARWD R 0.394445) + (CHARHT R 0.430555) + ) +(CHARACTER C t + (CHARWD R 0.38889) + (CHARHT R 0.61508) + (COMMENT + (KRN C y R -0.027779) + (KRN C w R -0.027779) + ) + ) +(CHARACTER C u + (CHARWD R 0.555557) + (CHARHT R 0.430555) + (COMMENT + (KRN C w R -0.027779) + ) + ) +(CHARACTER C v + (CHARWD R 0.527781) + (CHARHT R 0.430555) + (CHARIC R 0.013888) + (COMMENT + (KRN C a R -0.055555) + (KRN C e R -0.027779) + (KRN C a R -0.027779) + (KRN C o R -0.027779) + (KRN C c R -0.027779) + ) + ) +(CHARACTER C w + (CHARWD R 0.722224) + (CHARHT R 0.430555) + (CHARIC R 0.013888) + (COMMENT + (KRN C e R -0.027779) + (KRN C a R -0.027779) + (KRN C o R -0.027779) + (KRN C c R -0.027779) + ) + ) +(CHARACTER C x + (CHARWD R 0.527781) + (CHARHT R 0.430555) + ) +(CHARACTER C y + (CHARWD R 0.527781) + (CHARHT R 0.430555) + (CHARDP R 0.194445) + (CHARIC R 0.013888) + (COMMENT + (KRN C o R -0.027779) + (KRN C e R -0.027779) + (KRN C a R -0.027779) + (KRN O 56 R -0.083334) + (KRN O 54 R -0.083334) + ) + ) +(CHARACTER C z + (CHARWD R 0.444446) + (CHARHT R 0.430555) + ) +(CHARACTER O 173 + (CHARWD R 0.500002) + (CHARHT R 0.430555) + (CHARIC R 0.027779) + (COMMENT + (LIG O 55 O 174) + ) + ) +(CHARACTER O 174 + (CHARWD R 1.000003) + (CHARHT R 0.430555) + (CHARIC R 0.027779) + ) +(CHARACTER O 175 + (CHARWD R 0.500002) + (CHARHT R 0.694445) + ) +(CHARACTER O 176 + (CHARWD R 0.500002) + (CHARHT R 0.667859) + ) +(CHARACTER O 177 + (CHARWD R 0.500002) + (CHARHT R 0.667859) + ) diff --git a/Build/source/texk/windvi/tfmload.c b/Build/source/texk/windvi/tfmload.c new file mode 100644 index 00000000000..6b4d967b3c9 --- /dev/null +++ b/Build/source/texk/windvi/tfmload.c @@ -0,0 +1,95 @@ +/* This code was stolen from dvips for xdvi use. The file itself did + * not carry any licensing info. According to other filed the code + * either public domain, or, in the worst case, GPL. + * + * Loads a tfm file. It marks the characters as undefined. + * + * Modified for use by xdvi-t1 by Nicolai Langfeldt */ + +#define HAVE_BOOLEAN 1 + +#include "xdvi-config.h" + +#if T1 + +#include <kpathsea/tex-file.h> + +int tfmload P3C(char *,name, long *,design, long *,widths) + +{ + int i ; + int li ; + int nw, hd ; + int bc, ec ; + long wtab[256]; + unsigned char chardat[256]; + char *filename; + FILE *curfnt; + + filename=kpse_find_file(name, kpse_tfm_format, 0); + if (filename==NULL) + return 0; + + curfnt=fopen(filename,"r"); + + if (curfnt==NULL) + return 0; + +#if 0 + fprintf(stderr,"Loading metrics from %s\n",filename); +#endif + + /* Next, we read the font data from the tfm file, and store it in + * our own array. */ + + /* Lengths section, 16 bit unsigned quanities */ + li = two(curfnt); /* lf = length of file, in words(4 bytes) */ + hd = two(curfnt); /* lh = length of header data, in words */ + bc = two(curfnt); /* bc = lowest charcode */ + ec = two(curfnt); /* ec = largest charcode */ + nw = two(curfnt); /* nw = number of width words */ + two(curfnt); /* nh = number of height words */ + two(curfnt); /* nd = number of depth words */ + two(curfnt); /* ni = number of italic words */ + two(curfnt); /* nl = number of words in lig/kern table */ + two(curfnt); /* nk = number of words in the kern table */ + two(curfnt); /* ne = number of words in the extensible char tab */ + two(curfnt); /* np = number of font parameter words */ + + /* Header, 32 bit signed quantities */ + four(curfnt); /* header[0]: checksum */ + *design=four(curfnt);/* header[1]: design size */ + + /* Skip the rest: header[2..(hd-1)] */ + for (i=2; i<hd; i++) + li = four(curfnt); + + /* Initialize to undef value */ + for (i=0; i<256; i++) { + chardat[i] = 0xFF ; + widths[i] = 0; + } + + /* The charinfo array: */ + for (i=bc; i<=ec; i++) { + chardat[i]=one(curfnt); /* 8 bits of widht index */ + one(curfnt); /* skip */ + two(curfnt); /* skip, jump */ + } + + /* The (compressed!) width table */ + for (i=0; i<nw; i++) + wtab[i] = four(curfnt); + + (void)fclose(curfnt) ; + + /* Now whe have the table and the indecies. Expand into a directly + mapped width array */ + for (i=bc; i<=ec; i++) + if (chardat[i]!=256) + widths[i]=wtab[chardat[i]]; + + return 1; +} + +#endif diff --git a/Build/source/texk/windvi/toolbar.bmp b/Build/source/texk/windvi/toolbar.bmp Binary files differnew file mode 100644 index 00000000000..423bdc3d764 --- /dev/null +++ b/Build/source/texk/windvi/toolbar.bmp diff --git a/Build/source/texk/windvi/toolbar1.bmp b/Build/source/texk/windvi/toolbar1.bmp Binary files differnew file mode 100644 index 00000000000..243a7ff18a8 --- /dev/null +++ b/Build/source/texk/windvi/toolbar1.bmp diff --git a/Build/source/texk/windvi/ttf.c b/Build/source/texk/windvi/ttf.c new file mode 100644 index 00000000000..f00e90dae08 --- /dev/null +++ b/Build/source/texk/windvi/ttf.c @@ -0,0 +1,72 @@ +/*========================================================================*\ + +Copyright (c) 1999 Fabrice Popineau + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL FABRICE POPINEAU, PAUL VOJTA, OR ANYONE ELSE BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Names: + fp: Fabrice Popineau (Fabrice.Popineau@supelec.fr) + +History: + 24/06/99: initial version + +Bugs: + - Every kpse_find_file call presents a memory leak. The pathname + buffer is not freed. + +\*========================================================================*/ + +#define HAVE_BOOLEAN 1 + +#include "xdvi-config.h" + +#ifdef TTF + +#define PRIVATE static +#define PUBLIC + +#if defined(HAVE_STRING_H) +#include <string.h> +#else +extern char *strtok P2H(char *, const char *); +#endif + +#include "dvi.h" +#include <kpathsea/tex-file.h> + + +/* **************************** GLYPH DRAWING *************************** */ + + +/* Set character# ch */ + +#ifdef TEXXET +PUBLIC void set_ttf_char P2C(wide_ubyte, cmd, wide_ubyte, ch) +#else +PUBLIC long set_ttf_char P1C(wide_ubyte, ch) +#endif + +{ + int xpos = PXL_H - currwin.base_x ; + int ypos = PXL_V - currwin.base_y ; + +} + +#endif /* TTF */ diff --git a/Build/source/texk/windvi/util.c b/Build/source/texk/windvi/util.c new file mode 100644 index 00000000000..142353f5bbf --- /dev/null +++ b/Build/source/texk/windvi/util.c @@ -0,0 +1,614 @@ +/*========================================================================*\ + +Copyright (c) 1990-1999 Paul Vojta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +PAUL VOJTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +NOTE: + xdvi is based on prior work, as noted in the modification history + in xdvi.c. + +\*========================================================================*/ +#define HAVE_BOOLEAN +#include "xdvi-config.h" +#include <kpathsea/c-ctype.h> +#include <kpathsea/c-fopen.h> +#include <kpathsea/c-vararg.h> + +#if defined(HTEX) && !defined(WIN32) +#include "HTEscape.h" +#endif + +#ifndef WIN32 +#include <pwd.h> +#endif +#include <sys/types.h> + +#ifdef VMS +#include <rmsdef.h> +#endif /* VMS */ + +/* + * General utility routines. + */ + +/* + * Print error message and quit. + */ + +int lastwwwopen; + +#ifdef HAVE_PROTOTYPES +NORETURN void +oops(_Xconst char *message, ...) +#else +/* VARARGS */ +NORETURN void +oops(va_alist) + va_dcl +#endif +{ + int msgLen; +#ifndef HAVE_PROTOTYPES + _Xconst char *message; +#endif + va_list args; + +#ifndef WIN32 + Fprintf(stderr, "%s: ", prog); +#ifdef HAVE_PROTOTYPES + va_start(args, message); +#else + va_start(args); + message = va_arg(args, _Xconst char *); +#endif + msgLen = vfprintf(stderr, message, args); + va_end(args); + Putc('\n', stderr); +#else /* WIN32 */ + if (msgLen > 0) { + char *msgBuf = malloc(msgLen * sizeof(char) + 10); + if (msgBuf) { + va_start(args, message); + vsprintf(msgBuf, message, args); + va_end(args); + if (MessageBox(NULL, msgBuf, + "Fatal Error", + MB_OK|MB_ICONERROR|MB_TOPMOST) == 0) + Win32Error("util.c/oops()"); + free(msgBuf); + } + } +#endif +#if PS + psp.destroy(); +#endif + Exit(1); +} + + +#ifndef KPATHSEA + +/* + * Either (re)allocate storage or fail with explanation. + */ + +void * +xmalloc(size) + unsigned size; +{ + /* Avoid malloc(0), though it's not clear if it ever actually + happens any more. */ + void *mem = malloc(size ? size : 1); + + if (mem == NULL) + oops("! Out of memory (allocating %u bytes).\n", size); + return mem; +} + +void * +xrealloc(where, size) + char *where; + unsigned size; +{ + void *mem = realloc(where, size); + + if (mem == NULL) + oops("! Out of memory (reallocating %u bytes).\n", size); + return mem; +} + +/* + * Allocate a new string. The second argument is the length, or -1. + */ + +char * +xmemdup(str, len) + _Xconst char *str; + int len; +{ + char *new; + + new = xmalloc(len); + bcopy(str, new, len); + return new; +} + +#endif /* not KPATHSEA */ + +/* + * Expand the matrix *ffline to at least the given size. + */ + +void +expandline(n) + int n; +{ + int newlen = n + 128; + + ffline = (ffline == NULL) ? xmalloc(newlen) : xrealloc(ffline, newlen); + ffline_len = newlen; +} + + +/* + * Allocate bitmap for given font and character + */ + +void +alloc_bitmap(bitmap) + struct bitmap *bitmap; +{ + unsigned int size; + + /* width must be multiple of 16 bits for raster_op */ + bitmap->bytes_wide = ROUNDUP((int) bitmap->w, BMBITS) * BMBYTES; + size = bitmap->bytes_wide * bitmap->h; + bitmap->bits = xmalloc(size != 0 ? size : 1); +} + + +#ifndef KPATHSEA + +/* + * Put a variable in the environment or abort on error. + */ + +extern char **environ; + +void +xputenv(var, value) + _Xconst char *var; + _Xconst char *value; +{ + +#if HAVE_PUTENV + + char *buf; + int len1, len2; + + len1 = strlen(var); + len2 = strlen(value) + 1; + buf = xmalloc((unsigned int) len1 + len2 + 1); + bcopy(var, buf, len1); + buf[len1++] = '='; + bcopy(value, buf + len1, len2); + if (putenv(buf) != 0) + oops("! Failure in setting environment variable."); + return; + +#elif HAVE_SETENV + + if (setenv(var, value, True) != 0) + oops("! Failure in setting environment variable."); + return; + +#else /* not HAVE_{PUTENV,SETENV} */ + + int len1; + int len2; + char *buf; + char **linep; + static Boolean did_malloc = False; + + len1 = strlen(var); + len2 = strlen(value) + 1; + buf = xmalloc((unsigned int) len1 + len2 + 1); + bcopy(var, buf, len1); + buf[len1++] = '='; + bcopy(value, buf + len1, len2); + for (linep = environ; *linep != NULL; ++linep) + if (memcmp(*linep, buf, len1) == 0) { + *linep = buf; + return; + } + len1 = linep - environ; + if (did_malloc) + environ = xrealloc(environ, + (unsigned int) (len1 + 2) * sizeof(char *)); + else { + linep = xmalloc((unsigned int)(len1 + 2) * sizeof(char *)); + bcopy((char *) environ, (char *) linep, len1 * sizeof(char *)); + environ = linep; + did_malloc = True; + } + environ[len1++] = buf; + environ[len1] = NULL; + +#endif /* not HAVE_{PUTENV,SETENV} */ + +} + +#endif /* not KPATHSEA */ + +#ifndef WIN32 + +/* + * Hopefully a self-explanatory name. This code assumes the second + * argument is lower case. + */ + +int +memicmp(s1, s2, n) + _Xconst char *s1; + _Xconst char *s2; + size_t n; +{ + while (n > 0) { + int i = TOLOWER(*s1) - *s2; + if (i != 0) return i; + ++s1; + ++s2; + --n; + } + return 0; +} + +#endif /* !WIN32 */ + +/* + * Close the pixel file for the least recently used font. + */ + +static void +close_a_file() +{ + struct font *fontp; + unsigned short oldest = ~0; + struct font *f = NULL; + + if (debug & DBG_OPEN) + Puts("Calling close_a_file()"); + + for (fontp = font_head; fontp != NULL; fontp = fontp->next) + if (fontp->file != NULL && fontp->timestamp <= oldest) { + f = fontp; + oldest = fontp->timestamp; + } + if (f == NULL) + oops("Can't find an open pixel file to close"); + Fclose(f->file); + f->file = NULL; + ++n_files_left; +} + +/* + * This is necessary on some systems to work around a bug. + */ + +#if SUNOS4 +static void +close_small_file() +{ + struct font *fontp; + unsigned short oldest = ~0; + struct font *f = NULL; + + if (debug & DBG_OPEN) + Puts("Calling close_small_file()"); + + for (fontp = font_head; fontp != NULL; fontp = fontp->next) + if (fontp->file != NULL && fontp->timestamp <= oldest + && (unsigned char) fileno(fontp->file) < 128) { + f = fontp; + oldest = fontp->timestamp; + } + if (f == NULL) + oops("Can't find an open pixel file to close"); + Fclose(f->file); + f->file = NULL; + ++n_files_left; +} +#else +#define close_small_file close_a_file +#endif + +#ifdef HTEX + +/* + * Localize a local URL. This is done in place, but the pointer + * returned probably points to somewhere _WITHIN_ the filename. + * So the caller needs to use the returned pointer and the returned + * pointer is unsuitable for free operations - janl 31/1/1999 + */ + +char *urlocalize P1C(char *,filename) + +{ + if (strncmp(filename,"file:",5)==0) { + + if (debug & DBG_HYPER) + fprintf(stderr,"Shortcircuting local file url: %s\n",filename); + + /* If it's a file: URL just remove the file: part, then + we'll open it localy as a normal local file */ + filename+=5; + /* If what we're left with starts in // then we need to remove + a hostname part too */ + if (strncmp(filename,"//",2)==0) + filename=index(filename+2,'/'); + +#ifndef WIN32 + HTUnEscape(filename); +#endif + if (debug & DBG_HYPER) + fprintf(stderr,"Local filename is: %s\n",filename); + + } + + return filename; +} + +#endif /* HTEX */ + +/* + * Open a file in the given mode. URL AWARE. + */ + +FILE * +#ifndef VMS +xfopen P2C(char *,filename, _Xconst char *,type) +#define TYPE type +#else +xfopen P3C(char *,filename, _Xconst char *,type, _Xconst char *,type2) +#define TYPE type, type2 +#endif /* VMS */ +{ + FILE *f; + + /* Try not to let the file table fill up completely. */ + if (n_files_left <= 10) + close_a_file(); +#ifdef HTEX + + filename=urlocalize(filename); + + if (URL_aware && + (((URLbase != NULL) && htex_is_url(urlocalize(URLbase))) || + (htex_is_url(filename)))) { + int i; + i = fetch_relative_url(URLbase, filename, temporary_dir); + if (i < 0) return NULL; + /* Don't bother waiting right now... */ + wait_for_urls(); + /* This needs to be set somehow... */ + f = fopen(filelist[i].file, TYPE); + if (debug & DBG_HYPER) + fprintf(stderr,"Opening %s for %s\n", + filelist[i].file,filelist[i].url); + lastwwwopen=i; + } else +#endif /* HTEX */ + f = fopen(filename, TYPE); + /* Interactive Unix 2.2.1 doesn't set errno to EMFILE + or ENFILE even when it should, but if we do this + unconditionally, then giving a nonexistent file on the + command line gets the bizarre error `Can't find an open pixel + file to close' instead of `No such file or directory'. */ +#ifndef VMS + if (f == NULL && (errno == EMFILE || errno == ENFILE)) +#else /* VMS */ + if (f == NULL && errno == EVMSERR && vaxc$errno == RMS$_ACC) +#endif /* VMS */ + { + n_files_left = 0; + close_a_file(); + f = fopen(filename, TYPE); + } +#ifdef F_SETFD + if (f != NULL) (void) fcntl(fileno(f), F_SETFD, 1); +#endif + return f; +} +#undef TYPE + +/* + * Open a file, but temporary disable URL awareness. + */ + +#ifdef HTEX +FILE* xfopen_local P2C(char *,filename, _Xconst char *,type) +{ + FILE *f; + int url_aware_save; + url_aware_save = URL_aware; + URL_aware = FALSE; + f = xfopen(filename, type); + URL_aware = url_aware_save; + return f; +} +#endif /* HTEX */ + +#if !defined(WIN32) + +/* + * Create a pipe, closing a file if necessary. + */ + +int +xpipe(fd) + int *fd; +{ + int retval; + + for (;;) { + retval = pipe(fd); + if (retval == 0 || (errno != EMFILE && errno != ENFILE)) break; + n_files_left = 0; + close_a_file(); + } + return retval; +} + + +/* + * Open a directory for reading, opening a file if necessary. + */ + +DIR * +xdvi_xopendir(name) + _Xconst char *name; +{ + DIR *retval; + for (;;) { + retval = opendir(name); + if (retval == NULL || (errno != EMFILE && errno != ENFILE)) break; + n_files_left = 0; + close_a_file(); + } + return retval; +} + + +/* + * Perform tilde expansion, updating the character pointer unless the + * user was not found. + */ + +_Xconst struct passwd * +ff_getpw(pp, p_end) + _Xconst char **pp; + _Xconst char *p_end; +{ + _Xconst char *p = *pp; + _Xconst char *p1; + int len; + _Xconst struct passwd *pw; + int count; + + ++p; /* skip the tilde */ + p1 = p; + while (p1 < p_end && *p1 != '/') ++p1; + len = p1 - p; + + if (len != 0) { + if (len >= ffline_len) + expandline(len); + bcopy(p, ffline, len); + ffline[len] = '\0'; + } + + for (count = 0;; ++count) { + if (len == 0) /* if no user name */ + pw = getpwuid(getuid()); + else + pw = getpwnam(ffline); + + if (pw != NULL) { + *pp = p1; + return pw; + } + + /* On some systems, getpw{uid,nam} return without setting errno, + * even if the call failed because of too many open files. + * Therefore, we play it safe here. + */ + if (count >= 2 && len != 0 && getpwuid(getuid()) != NULL) + return NULL; + + close_small_file(); + } +} + +#endif /* ! WIN32 */ + +/* + * + * Read size bytes from the FILE fp, constructing them into a + * signed/unsigned integer. + * + */ + +unsigned long +num(fp, size) + FILE *fp; + int size; +{ + long x = 0; + + while (size--) x = (x << 8) | one(fp); + return x; +} + +long +snum(fp, size) + FILE *fp; + int size; +{ + long x; + +#if __STDC__ + x = (signed char) getc(fp); +#else + x = (unsigned char) getc(fp); + if (x & 0x80) x -= 0x100; +#endif + while (--size) x = (x << 8) | one(fp); + return x; +} + +#if !HAVE_TEMPNAM /* lacking in NeXT (and maybe others) */ + +char * +#if HAVE_PROTOTYPES +tempnam(dir, prefix) + char *dir; + char *prefix; +#else +tempnam(char *dir, char *prefix) +#endif +{ + char *result; + char *ourdir = getenv("TMPDIR"); + static int seqno = 0; + + if (ourdir == NULL || access(ourdir, W_OK) < 0) + ourdir = dir; + if (ourdir == NULL || access(ourdir, W_OK) < 0) + ourdir = "/tmp"; + if (prefix == NULL) + prefix = ""; + result = xmalloc(strlen(ourdir) + 1 + strlen(prefix) + (2 + 5 + 1)) + Sprintf(result, "%s/%s%c%c%05d", ourdir, prefix, + (seqno%26) + 'A', (seqno/26)%26 + 'A', getpid()); + ++seqno; + return result; +} + +#endif /* not HAVE_TEMPNAM */ + diff --git a/Build/source/texk/windvi/version.h b/Build/source/texk/windvi/version.h new file mode 100644 index 00000000000..2ffd05195d5 --- /dev/null +++ b/Build/source/texk/windvi/version.h @@ -0,0 +1,6 @@ +#define XDVERSION "Windvi 0.67.3 based on xdvi 22.15-k-t1" +#ifdef Omega +#define TVERSION XDVERSION" for Omega" +#else +#define TVERSION XDVERSION +#endif diff --git a/Build/source/texk/windvi/vf.c b/Build/source/texk/windvi/vf.c new file mode 100644 index 00000000000..5d55cfa7772 --- /dev/null +++ b/Build/source/texk/windvi/vf.c @@ -0,0 +1,184 @@ +/*========================================================================*\ + +Copyright (c) 1992-1999 Paul Vojta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +PAUL VOJTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +\*========================================================================*/ + +/* + * VF font reading routines. + * Public routine is read_index---because virtual characters are presumed + * to be short, we read the whole virtual font in at once, instead of + * faulting in characters as needed. + */ +#define HAVE_BOOLEAN +#include "xdvi-config.h" +#include "dvi.h" + +#define LONG_CHAR 242 + +/* + * These are parameters which determine whether macros are combined for + * storage allocation purposes. Small macros ( <= VF_PARM_1 bytes) are + * combined into chunks of size VF_PARM_2. + */ + +#ifndef VF_PARM_1 +#define VF_PARM_1 20 +#endif +#ifndef VF_PARM_2 +#define VF_PARM_2 256 +#endif + +/* + * The main routine + */ + +#ifdef Omega +unsigned long +#else +void +#endif +read_VF_index(fontp, hushcs) + struct font *fontp; + wide_bool hushcs; +{ + FILE *VF_file = fontp->file; + ubyte cmnd; + ubyte *avail, *availend; /* available space for macros */ + long checksum; +#ifdef Omega + struct macro *newmacro; + unsigned long maxcc=0; + int i; +#endif + + fontp->read_char = NULL; + fontp->flags |= FONT_VIRTUAL; + fontp->set_char_p = set_vf_char; + if (debug & DBG_PK) + Printf("Reading VF pixel file %s\n", fontp->filename); +/* + * Read preamble. + */ + Fseek(VF_file, (long) one(VF_file), 1); /* skip comment */ + checksum = four(VF_file); + if (checksum != fontp->checksum && checksum != 0 && fontp->checksum != 0 + && !hushcs) + Fprintf(stderr, + "Checksum mismatch (dvi = %lu, vf = %lu) in font file %s\n", + fontp->checksum, checksum, fontp->filename); + (void) four(VF_file); /* skip design size */ +/* + * Read the fonts. + */ + fontp->vf_table = xmalloc(VFTABLELEN * sizeof(struct font *)); + bzero((char *) fontp->vf_table, VFTABLELEN * sizeof(struct font *)); + fontp->vf_chain = NULL; + fontp->first_font = NULL; + while ((cmnd = one(VF_file)) >= FNTDEF1 && cmnd <= FNTDEF4) { + struct font *newfontp = define_font(VF_file, cmnd, fontp, + fontp->vf_table, VFTABLELEN, &fontp->vf_chain); + if (fontp->first_font == NULL) fontp->first_font = newfontp; + } +/* + * Prepare macro array. + */ +#ifdef Omega + fontp->maxchar = 65535; + fontp->macro = xmalloc(65536 * sizeof(struct macro)); + bzero((char *) fontp->macro, 65536 * sizeof(struct macro)); +#else + fontp->macro = xmalloc(256 * sizeof(struct macro)); + bzero((char *) fontp->macro, 256 * sizeof(struct macro)); +#endif +/* + * Read macros. + */ + avail = availend = NULL; + for (; cmnd <= LONG_CHAR; cmnd = one(VF_file)) { + struct macro *m; + int len; + unsigned long cc; + long width; + + if (cmnd == LONG_CHAR) { /* long form packet */ + len = four(VF_file); + cc = four(VF_file); + width = four(VF_file); +#ifdef Omega + if (cc >= 65536) { +#else + if (cc >= 256) { +#endif + Fprintf(stderr, + "Virtual character %lu in font %s ignored.\n", + cc, fontp->fontname); + Fseek(VF_file, (long) len, 1); + continue; + } + } + else { /* short form packet */ + len = cmnd; + cc = one(VF_file); + width = num(VF_file, 3); + } +#ifdef Omega + maxcc = (cc>maxcc) ? cc : maxcc; +#endif + m = &fontp->macro[cc]; + m->dvi_adv = width * fontp->dimconv; + if (len > 0) { + if (len <= availend - avail) { + m->pos = avail; + avail += len; + } + else { + m->free_me = True; + if (len <= VF_PARM_1) { + m->pos = avail = xmalloc(VF_PARM_2); + availend = avail + VF_PARM_2; + avail += len; + } + else m->pos = xmalloc((unsigned) len); + } + Fread((char *) m->pos, 1, len, VF_file); + m->end = m->pos + len; + } + if (debug & DBG_PK) + Printf("Read VF macro for character %lu; dy = %ld, length = %d\n", + cc, m->dvi_adv, len); + } + if (cmnd != POST) + oops("Wrong command byte found in VF macro list: %d", cmnd); + + Fclose (VF_file); + fontp->file = NULL; + n_files_left++; +#ifdef Omega + newmacro = xmalloc((maxcc+1) * sizeof(struct macro)); + for (i=0; i<=maxcc; i++) { + newmacro[i] = fontp->macro[i]; + } + free(fontp->macro); + fontp->macro = newmacro; + fontp->maxchar = maxcc; + return maxcc; +#endif +} diff --git a/Build/source/texk/windvi/warnings b/Build/source/texk/windvi/warnings new file mode 100644 index 00000000000..09587829547 --- /dev/null +++ b/Build/source/texk/windvi/warnings @@ -0,0 +1,153 @@ + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/windvi.obj .\windvi.c +windvi.c +.\windvi.c(942) : warning C4018: '>' : signed/unsigned mismatch +.\windvi.c(954) : warning C4018: '>' : signed/unsigned mismatch +.\windvi.c(1837) : warning C4018: '<' : signed/unsigned mismatch +.\windvi.c(1838) : warning C4018: '<' : signed/unsigned mismatch +.\windvi.c(2092) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data +.\windvi.c(2096) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/windraw.obj .\windraw.c +windraw.c +.\windraw.c(601) : warning C4018: '<' : signed/unsigned mismatch +.\windraw.c(602) : warning C4018: '<' : signed/unsigned mismatch +.\windraw.c(776) : warning C4018: '<' : signed/unsigned mismatch +.\windraw.c(777) : warning C4018: '<' : signed/unsigned mismatch +.\windraw.c(1124) : warning C4276: 'initcolor' : no prototype provided; assumed no parameters + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/winabout.obj .\winabout.c +winabout.c + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/wingoto.obj .\wingoto.c +wingoto.c + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic\wincolor.obj .\wincolor.c +wincolor.c +.\wincolor.c(271) : warning C4027: function declared without formal parameter list +.\wincolor.c(503) : warning C4087: 'init_pix' : declared with 'void' parameter list +.\wincolor.c(99) : warning C4715: 'CRefPop' : not all control paths return a value + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/winprint.obj .\winprint.c +winprint.c +.\winprint.c(59) : warning C4101: 'pgsdlg' : unreferenced local variable +.\winprint.c(141) : warning C4033: 'CmdFilePrint' must return a value +.\winprint.c(873) : warning C4276: 'ReopenDviFile' : no prototype provided; assumed no parameters +.\winprint.c(873) : warning C4276: 'IsOpenedDviFile' : no prototype provided; assumed no parameters +.\winprint.c(308) : warning C4715: 'CmdFilePrint' : not all control paths return a value +.\winprint.c(281) : warning C4700: local variable 'oldprintDIB' used without having been initialized +.\winprint.c(282) : warning C4700: local variable 'printDIB' used without having been initialized + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/winver.obj .\winver.c +winver.c + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/wincfg.obj .\wincfg.c +wincfg.c +.\wincfg.c(374) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/winlog.obj .\winlog.c +winlog.c + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/winopt.obj .\winopt.c +winopt.c +.\winopt.c(531) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data +.\winopt.c(579) : warning C4090: '=' : different 'const' qualifiers +.\winopt.c(580) : warning C4090: '=' : different 'const' qualifiers +.\winopt.c(608) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/winxutl.obj .\winxutl.c +winxutl.c +.\winxutl.c(353) : warning C4090: 'initializing' : different 'const' qualifiers +.\winxutl.c(441) : warning C4101: 'rop' : unreferenced local variable +.\winxutl.c(813) : warning C4133: '=' : incompatible types - from 'unsigned char *' to 'struct HBITMAP__ *' +.\winxutl.c(855) : warning C4047: '==' : 'int ' differs in levels of indirection from 'void *' + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/winevt.obj .\winevt.c +winevt.c + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/dvi_draw.obj .\dvi_draw.c +dvi_draw.c +.\dvi_draw.c(282) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data +.\dvi_draw.c(283) : warning C4018: '<' : signed/unsigned mismatch +.\dvi_draw.c(284) : warning C4018: '<' : signed/unsigned mismatch +.\dvi_draw.c(289) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data +.\dvi_draw.c(290) : warning C4018: '<' : signed/unsigned mismatch +.\dvi_draw.c(291) : warning C4018: '<' : signed/unsigned mismatch +.\dvi_draw.c(297) : warning C4018: '<' : signed/unsigned mismatch +.\dvi_draw.c(298) : warning C4018: '<' : signed/unsigned mismatch +.\dvi_draw.c(373) : warning C4096: '__cdecl' must be used with '...' +.\dvi_draw.c(726) : warning C4018: '<' : signed/unsigned mismatch +.\dvi_draw.c(730) : warning C4018: '==' : signed/unsigned mismatch + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/dvi_init.obj .\dvi_init.c +dvi_init.c +.\dvi_init.c(161) : warning C4244: 'initializing' : conversion from 'double ' to 'int ', possible loss of data +.\dvi_init.c(188) : warning C4244: '=' : conversion from 'int ' to 'float ', possible loss of data +.\dvi_init.c(311) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data +.\dvi_init.c(323) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data +.\dvi_init.c(327) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data +.\dvi_init.c(364) : warning C4018: '<' : signed/unsigned mismatch +.\dvi_init.c(461) : warning C4018: '!=' : signed/unsigned mismatch +.\dvi_init.c(462) : warning C4018: '!=' : signed/unsigned mismatch +.\dvi_init.c(462) : warning C4018: '!=' : signed/unsigned mismatch + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/font-open.obj .\font-open.c +font-open.c +.\font-open.c(44) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/gf.obj .\gf.c +gf.c +.\gf.c(327) : warning C4244: '=' : conversion from 'double ' to 'long ', possible loss of data + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/pk.obj .\pk.c +pk.c +.\pk.c(186) : warning C4244: '=' : conversion from 'unsigned long ' to 'unsigned short ', possible loss of data +.\pk.c(187) : warning C4244: '=' : conversion from 'unsigned long ' to 'unsigned short ', possible loss of data +.\pk.c(189) : warning C4244: '=' : conversion from 'long ' to 'short ', possible loss of data +.\pk.c(190) : warning C4244: '=' : conversion from 'long ' to 'short ', possible loss of data +.\pk.c(192) : warning C4244: '=' : conversion from 'double ' to 'long ', possible loss of data + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/psgsw32.obj .\psgsw32.c +psgsw32.c +.\psgsw32.c(296) : warning C4090: 'function' : different 'const' qualifiers +.\psgsw32.c(296) : warning C4024: 'send' : different types for formal and actual parameter 1 +.\psgsw32.c(369) : warning C4113: 'void (__fastcall *)()' differs in parameter lists from 'void (__fastcall *)(void )' +.\psgsw32.c(413) : warning C4090: 'function' : different 'const' qualifiers +.\psgsw32.c(413) : warning C4024: 'send' : different types for formal and actual parameter 1 +.\psgsw32.c(573) : warning C4101: 'buf' : unreferenced local variable +.\psgsw32.c(631) : warning C4276: 'beginheader_none' : no prototype provided; assumed no parameters + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic\squeeze.obj .\squeeze.c +squeeze.c +.\squeeze.c(112) : warning C4007: 'main' : must be '__cdecl' + link /OUT:dynamic\squeeze.exe /MACHINE:IX86 /NODEFAULTLIB /INCREMENTAL:NO /PDB:NONE /NOLOGO /RELEASE /OPT:REF /VERSION:7.2 -subsystem:console -entry:mainCRTStartup dynamic\squeeze.obj msvcrt.lib oldnames.lib kernel32.lib advapi32.lib user32.lib + .\dynamic\squeeze ./psheader.txt psheader.c-tmp + sed -f psheader.sed < psheader.c-tmp > psheader.c + F:\Users\Fabrice\Work\tex\devel\source\gnu\bin\rm -f psheader.c-tmp + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic\psheader.obj .\psheader.c +psheader.c + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/special.obj .\special.c +special.c +.\../../web2c-7.2/web2c/pdftexdir/zlib/zlib.h(712) : warning C4096: '__cdecl' must be used with '...' +.\special.c(254) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data +.\special.c(258) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data +.\special.c(259) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data +.\special.c(265) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data +.\special.c(273) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data +.\special.c(274) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data +.\special.c(275) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data +.\special.c(276) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data +.\special.c(280) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data +.\special.c(281) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data +.\special.c(316) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data +.\special.c(317) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data +.\special.c(335) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data +.\special.c(345) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data +.\special.c(346) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data +.\special.c(384) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data +.\special.c(385) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data +.\special.c(386) : warning C4244: '=' : conversion from 'double ' to 'int ', possible loss of data +.\special.c(390) : warning C4244: '=' : conversion from 'double ' to 'float ', possible loss of data +.\special.c(395) : warning C4305: '+=' : truncation from 'const double ' to 'float ' +.\special.c(612) : warning C4113: 'void (__fastcall *)()' differs in parameter lists from 'void (__fastcall *)(void )' +.\special.c(1220) : warning C4244: '=' : conversion from 'double ' to 'unsigned int ', possible loss of data +.\special.c(1223) : warning C4244: '=' : conversion from 'double ' to 'unsigned int ', possible loss of data +.\special.c(1143) : warning C4101: 'name' : unreferenced local variable +.\special.c(1301) : warning C4101: 'c' : unreferenced local variable + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/util.obj .\util.c +util.c +.\util.c(57) : warning C4096: '__cdecl' must be used with '...' + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/vf.obj .\vf.c +vf.c +.\vf.c(153) : warning C4244: '=' : conversion from 'double ' to 'long ', possible loss of data + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/hypertex.obj .\hypertex.c +hypertex.c + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/mime.obj .\mime.c +mime.c + cl -D_X86_=1 -DWINVER=0x0400 -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN -D_MT -D_DLL -D_IMPORT -DKPATHSEA -DMSBITFIRST -If:\Local/include -IF:\Users\Fabrice\Work\tex\devel\source -I. -I. -I.. -IF:\Users\Fabrice\Work\tex\devel\source\web2c-7.2 -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo -O2x -G5rs -Gy -c /Fodynamic/wwwfetch.obj .\wwwfetch.c +wwwfetch.c + rc -DWIN32 -D_WIN32 -DWINVER=0x0400 -DWINDVI_MAJVER=\""0"\" -DWINDVI_MINVER=\""54"\" /r /IF:\Users\Fabrice\Work\tex\devel\source /fodynamic\windvi.res windvi.rc + link /OUT:dynamic\windvi.exe /STACK:256000 /MACHINE:IX86 /NODEFAULTLIB /INCREMENTAL:NO /PDB:NONE /NOLOGO /RELEASE /OPT:REF /VERSION:7.2 -subsystem:windows -entry:WinMainCRTStartup dynamic\windvi.obj dynamic\windraw.obj dynamic\winabout.obj dynamic\wingoto.obj dynamic\wincolor.obj dynamic\winprint.obj dynamic\winver.obj dynamic\wincfg.obj dynamic\winlog.obj dynamic\winopt.obj dynamic\winxutl.obj dynamic\winevt.obj dynamic\dvi_draw.obj dynamic\dvi_init.obj dynamic\font-open.obj dynamic\gf.obj dynamic\pk.obj dynamic\psgsw32.obj dynamic\psheader.obj dynamic\special.obj dynamic\util.obj dynamic\vf.obj dynamic\hypertex.obj dynamic\mime.obj dynamic\wwwfetch.obj dynamic\windvi.res advapi32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib version.lib comctl32.lib shell32.lib F:\Users\Fabrice\Work\tex\devel\source\web2c-7.2\web2c\pdftexdir\zlib\dynamic\zlib.lib F:\Users\Fabrice\Work\tex\devel\source\web2c-7.2\web2c\pdftexdir\zlib\dynamic\zlib.lib F:\Users\Fabrice\Work\tex\devel\source\web2c-7.2\kpathsea/dynamic/kpathsea.lib msvcrt.lib oldnames.lib kernel32.lib advapi32.lib user32.lib +windvi.obj : error LNK2001: unresolved external symbol @init_pix@0 +dynamic\windvi.exe : fatal error LNK1120: 1 unresolved externals diff --git a/Build/source/texk/windvi/win32.mak b/Build/source/texk/windvi/win32.mak new file mode 100644 index 00000000000..0a42074500c --- /dev/null +++ b/Build/source/texk/windvi/win32.mak @@ -0,0 +1,144 @@ +################################################################################ +# +# Makefile : Windvi +# Author : Fabrice Popineau <Fabrice.Popineau@supelec.fr> +# Platform : Win32, Microsoft VC++ 6.0, depends upon fpTeX 0.5 sources +# Time-stamp: <04/03/07 16:04:45 popineau> +# +################################################################################ +root_srcdir = ..\.. +!ifdef DEVELOPMENT +INCLUDE=$(INCLUDE);$(root_srcdir)\texk.development +!else +INCLUDE=$(INCLUDE);$(root_srcdir)\texk +!endif + +USE_GNUW32 = 1 +USE_GSW32 = 1 +USE_KPATHSEA = 1 +USE_ZLIB = 1 +USE_BZIP2 = 1 +USE_T1 = 1 +USE_NETWORK2=1 + +# This is a gui application +GUI = 1 +# MEMDBG=1 +XDVIK_MAKE = 1 + +windvimajver = 0 +windviminver = 66 +xrcvars = -DWINDVI_MAJVER=\""$(windvimajver)"\" -DWINDVI_MINVER=\""$(windviminver)"\" + +subdirs = doc + +!include <msvc/common.mak> + +# Compilation options. +DEFS = $(DEFS) -DKPATHSEA -DUSE_POPEN \ + -DPS_GS \ + -DA4 \ + -DHTEX \ + -DBOOK_MODE \ + -DTRANSFORM=1 \ + -DGREY \ + -DBUTTONS \ + -DDO_BANDING=1 \ + -DSRC_SPECIALS \ + -DNeedFunctionPrototypes \ +# -I$(WWWLIBDIR) \ + -I$(ZLIBDIR) \ + -I$(REGEXLIBDIR) \ + -I$(T1LIBDIR) \ + -I$(BZ2LIBDIR) \ + -I$(root_srcdir) \ + $(ZLIB_FLAGS) $(WWWLIB_FLAGS) + +!ifdef WIN32 +XDVI_H = winutil.h +!else +XDVI_H = xdvi.h +!endif + +# Define these appropriately if configure guesses incorrectly. +x_link = + +# Extra xdvi-specific compiler options. +ps_def = +prog_cflags = $(ps_def) $(x_cppflags) + +# We don't use alloca ourselves, but the X library might, and this way +# we avoid buggy versions in -lPW or -lucb. +ALLOCA = # $(objdir)\alloca.obj + +objects = $(objdir)\windvi.obj $(objdir)\windraw.obj \ + $(objdir)\winabout.obj $(objdir)\wingoto.obj \ + $(objdir)\wincolor.obj \ + $(objdir)\wintransf.obj \ + $(objdir)\winhtex.obj \ + $(objdir)\winimg.obj \ + $(objdir)\winprint.obj $(objdir)\winver.obj $(objdir)\wincfg.obj \ + $(objdir)\winlog.obj $(objdir)\winopt.obj $(objdir)\winxutl.obj \ + $(objdir)\winevt.obj $(objdir)\dvi-draw.obj \ + $(objdir)\dvi-init.obj $(objdir)\font-open.obj $(objdir)\gf.obj \ + $(objdir)\pk.obj $(objdir)\psgsw32.obj \ +# $(objdir)\psheader.obj \ + $(objdir)\special.obj $(objdir)\util.obj $(objdir)\vf.obj \ + $(objdir)\hypertex.obj \ +# $(objdir)\mime.obj \ + $(objdir)\wwwfetch.obj \ + $(objdir)\src-spec.obj \ + $(ALLOCA) \ + $(objdir)\t1.obj $(objdir)\dvips.obj $(objdir)\tfmload.obj + +program = $(objdir)\windvi.exe +programs = $(program) + +manfiles = xdvi.1 + +default all:: $(objdir) $(programs) + +$(program): $(objects) $(objdir)\windvi.res $(kpathsealib) $(zliblib) $(bzip2lib) $(gsw32lib) + $(link_gui) $(**) $(guilibs) shell32.lib + +$(objdir)\windvi.res: ..\windvi\windvi.rc + $(RC) $(rcvars) $(rcflags) /fo$@ windvi.rc + +xdvi.1: xdvi.man sedscript + sed -f sedscript <$(srcdir)/xdvi.man >$@ + +sedscript: mksedscript.perl + $(perl) $(srcdir)/mksedscript.perl kpathsea ps grid ghost pkpath sizes vfpath figpath \ + headerpath selfile $(DEFS) >$@ + +!include <msvc/subdirs.mak> + +!include <msvc/config.mak> + +installdirs = $(docdir)\windvi\examples + +!include <msvc/install.mak> + +# install: install-exec install-data +install:: install-exec install-data install-man + +install-data:: + @echo $(verbose) & ( \ + for /f %i in (samples.lst) do \ + $(copy) .\Examples\%i $(docdir)\windvi\examples $(redir_stdout) \ + ) +!include <msvc/clean.mak> + +distclean:: + -@$(del) psheader.c sedscript xdvi.1 # gsftopk.1 + +mfmodes.h: $(win32perldir)/modes-to-cfg.pl + $(perl) $(win32perldir)/modes-to-cfg.pl + +!include <msvc/rdepend.mak> +!include "./depend.mak" + +# +# Local Variables: +# mode: makefile +# End: diff --git a/Build/source/texk/windvi/winabout.c b/Build/source/texk/windvi/winabout.c new file mode 100644 index 00000000000..6bda4acbb66 --- /dev/null +++ b/Build/source/texk/windvi/winabout.c @@ -0,0 +1,175 @@ +#include "wingui.h" + +/***************************************************************************** + About Box + ****************************************************************************/ +LRESULT CALLBACK About(HWND, UINT, WPARAM, LPARAM); +LRESULT MsgAboutInit(HWND, UINT, WPARAM, LPARAM); +LRESULT MsgAboutCommand(HWND, UINT, WPARAM, LPARAM); +LRESULT CmdAboutDone(HWND, WORD, WORD, HWND); + +/* About dialog message table definition. */ +MSD rgmsdAbout[] = +{ + {WM_COMMAND, MsgAboutCommand}, + {WM_INITDIALOG, MsgAboutInit} +}; + +MSDI msdiAbout = +{ + sizeof(rgmsdAbout) / sizeof(MSD), + rgmsdAbout, + edwpNone +}; + +/* About dialog command table definition. */ +CMD rgcmdAbout[] = +{ + {IDOK, CmdAboutDone}, + {IDCANCEL, CmdAboutDone} +}; + +CMDI cmdiAbout = +{ + sizeof(rgcmdAbout) / sizeof(CMD), + rgcmdAbout, + edwpNone +}; + +/* Module specific "globals" Used when a variable needs to be + accessed in more than on handler function. */ + +HFONT hFontCopyright; + +/* + About Box + */ + +/* + Process the IDM_ABOUT message, opens a dialog box. + */ + +LRESULT CmdAbout(HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + DialogBox(hInst, "AboutBox", hwnd, (DLGPROC)About); + return 0; +} + +/* + Process messages for the about box. + */ + +LRESULT CALLBACK About(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + return DispMessage(&msdiAbout, hdlg, uMessage, wparam, lparam); +} + +/* + Initializes the about box with version info from resources. + */ + +LRESULT MsgAboutInit(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + #define POINTSIZE 8 + + char szFullPath[256]; + DWORD dwVerHnd; + DWORD dwVerInfoSize; + HDC hDC; + int iLogPixelsY, iPointSize; + + /* Center the dialog over the application window */ + CenterWindow(hdlg, GetWindow(hdlg, GW_OWNER)); + + /* Set the copyright font to something smaller than default */ + hDC = GetDC(hdlg); + iLogPixelsY = GetDeviceCaps(hDC, LOGPIXELSY); + ReleaseDC(hdlg, hDC); + iPointSize = MulDiv(iLogPixelsY, POINTSIZE, 72); + iPointSize *= -1; + + hFontCopyright = CreateFont(iPointSize, + 0, 0, 0, + FW_BOLD, + 0, 0, 0, 0, + 0, 0, 0, 0, + "Arial"); + + SendDlgItemMessage(hdlg, + IDD_VERLAST, + WM_SETFONT, + (WPARAM)hFontCopyright, + 0L); + SendDlgItemMessage(hdlg, + IDD_VERCOPY, + WM_SETFONT, + (WPARAM)hFontCopyright, + 0L); + + /* Get version information from the application */ + GetModuleFileName(hInst, szFullPath, sizeof(szFullPath)); + dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd); + if (dwVerInfoSize) + { + /* If we were able to get the information, process it: */ + HANDLE hMem; + LPVOID lpvMem; + char szGetName[256]; + int cchRoot; + int i; + + hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize); + lpvMem = GlobalLock(hMem); + GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpvMem); + lstrcpy(szGetName, "\\StringFileInfo\\040904E4\\"); + cchRoot = lstrlen(szGetName); + + /* Walk through the dialog items that we want to replace: */ + for (i = IDD_VERFIRST; i <= IDD_VERLAST; i++) + { + BOOL fRet; + UINT cchVer = 0; + LPSTR lszVer = NULL; + char szResult[256]; + + GetDlgItemText(hdlg, i, szResult, sizeof(szResult)); + lstrcpy(&szGetName[cchRoot], szResult); + fRet = VerQueryValue(lpvMem, szGetName, &lszVer, &cchVer); + + if (fRet && cchVer && lszVer) + { + /* Replace dialog item text with version info */ + lstrcpy(szResult, lszVer); + SetDlgItemText(hdlg, i, szResult); + } + } + GlobalUnlock(hMem); + GlobalFree(hMem); + } + return TRUE; +} + +/* + Processes WM_COMMAND sent to the about box. + */ + +LRESULT MsgAboutCommand(HWND hwnd, + UINT uMessage, + WPARAM wparam, + LPARAM lparam) +{ + return DispCommand(&cmdiAbout, hwnd, wparam, lparam); +} + +/* + OK has been clicked on, free the box and related resources. + */ + +LRESULT CmdAboutDone(HWND hdlg, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + if (hFontCopyright) + DeleteObject(hFontCopyright); + + EndDialog(hdlg, TRUE); /* Exit the dialog */ + return TRUE; +} diff --git a/Build/source/texk/windvi/wincfg.c b/Build/source/texk/windvi/wincfg.c new file mode 100644 index 00000000000..dbafc75845a --- /dev/null +++ b/Build/source/texk/windvi/wincfg.c @@ -0,0 +1,667 @@ +/* + Desc: This has to manage the property sheet for WinDvi configuration. + */ + +#include "wingui.h" +#include <prsht.h> +#include "xdvi-config.h" +#include "mfmodes.h" + +HWND hwndPSheet; + +/* + DVI File Configuration Dialog. + */ +LRESULT CALLBACK DviConfigDlgProc(HWND, UINT, WPARAM, LPARAM); +LRESULT MsgDviConfigInit(HWND, UINT, WPARAM, LPARAM); +LRESULT MsgDviConfigCommand(HWND, UINT, WPARAM, LPARAM); +LRESULT MsgDviConfigNotify(HWND, UINT, WPARAM, LPARAM); +LRESULT CmdDviConfigOK(HWND, WORD, WORD, HWND); +LRESULT CmdDviConfigCancel(HWND, WORD, WORD, HWND); + +/* DviConfig dialog message table definition. */ +MSD rgmsdDviConfig[] = +{ + {WM_COMMAND, MsgDviConfigCommand}, + {WM_INITDIALOG, MsgDviConfigInit}, + {WM_NOTIFY, MsgDviConfigNotify} +}; + +MSDI msdiDviConfig = +{ + sizeof(rgmsdDviConfig) / sizeof(MSD), + rgmsdDviConfig, + edwpNone +}; + +/* DviConfig dialog command table definition. */ +CMD rgcmdDviConfig[] = +{ + {IDOK, CmdDviConfigOK}, + {IDCANCEL, CmdDviConfigCancel} +}; + +CMDI cmdiDviConfig = +{ + sizeof(rgcmdDviConfig) / sizeof(CMD), + rgcmdDviConfig, + edwpNone +}; + +/* + Page View Configuration Dialog. + */ +LRESULT CALLBACK ViewConfigDlgProc(HWND, UINT, WPARAM, LPARAM); +LRESULT MsgViewConfigInit(HWND, UINT, WPARAM, LPARAM); +LRESULT MsgViewConfigCommand(HWND, UINT, WPARAM, LPARAM); +LRESULT MsgViewConfigNotify(HWND, UINT, WPARAM, LPARAM); +LRESULT CmdViewConfigOK(HWND, WORD, WORD, HWND); +LRESULT CmdViewConfigCancel(HWND, WORD, WORD, HWND); + +/* ViewConfig dialog message table definition. */ +MSD rgmsdViewConfig[] = +{ + {WM_COMMAND, MsgViewConfigCommand}, + {WM_INITDIALOG, MsgViewConfigInit}, + {WM_NOTIFY, MsgViewConfigNotify} +}; + +MSDI msdiViewConfig = +{ + sizeof(rgmsdViewConfig) / sizeof(MSD), + rgmsdViewConfig, + edwpNone +}; + +/* ViewConfig dialog command table definition. */ +CMD rgcmdViewConfig[] = +{ + {IDOK, CmdViewConfigOK}, + {IDCANCEL, CmdViewConfigCancel} +}; + +CMDI cmdiViewConfig = +{ + sizeof(rgcmdViewConfig) / sizeof(CMD), + rgcmdViewConfig, + edwpNone +}; + +/* + Dvi File Configuration dialog box. + */ + +/* + List of controls in this dialog : + Pixels-per-inches : IDC_EDITBDPI : edit + Alternate font : IDC_EDITALTFONT : edit + MF mode : IDC_COMBOMFMODE : combo box + Paper type : IDC_COMBOPAPER : combo box + Make pk : IDC_CHECKMAKEPK : check box + List fonts : IDC_CHECKLISTFONTS : check box + Auto scan : IDC_CHECKSCAN : check box + Single instance : IDC_CHECKSINGLE : check box + Alllow Shell : IDC_CHECKALLOWSHELL : check box + Hush specials : IDC_CHECKHUSHSPECIALS : boolean + Hush chars : IDC_CHECKHUSHCHARS : boolean + Hush checksums : IDC_CHECKHUSHCHECKSUMS: boolean + */ +void DviConfigExport(HWND hwnd) +{ + char szBuf[256]; + int i; + extern char * paper_types[]; + extern int paper_types_number; + + + /* Put every current value in its control */ + wsprintf(szBuf, "%d", resource._pixels_per_inch); + SendDlgItemMessage(hwnd, IDC_EDITBDPI, WM_SETTEXT, (WPARAM)0, (LPARAM)szBuf); + + SendDlgItemMessage(hwnd, IDC_EDITALTFONT, WM_SETTEXT, (WPARAM)0, (LPARAM)resource._alt_font); + + /* populate combo boxes */ + /* MF modes */ + for (i = 0; i < sizeof(avail_modes)/sizeof(mfmode) - 1; i++) { + SendDlgItemMessage(hwnd, IDC_COMBOMFMODE, CB_ADDSTRING, + (WPARAM) 0, (LPARAM)avail_modes[i].desc); + } + for (i = 0; i < sizeof(avail_modes)/sizeof(mfmode) - 1; i++) { + if (resource.mfmode && (strcmp(resource.mfmode, avail_modes[i].name) == 0)) { + SendDlgItemMessage(hwnd, IDC_COMBOMFMODE, CB_SELECTSTRING, + (WPARAM) i, (LPARAM)avail_modes[i].desc); + /* SendDlgItemMessage(hwnd, IDC_COMBOMFMODE, CB_SETCURSEL, + (WPARAM) i, (LPARAM)0); */ + } + } + /* Paper types */ + for (i = 0; i < paper_types_number; i+=2) { + wsprintf(szBuf, "%-10s%s", paper_types[i], paper_types[i+1]); + SendDlgItemMessage(hwnd, IDC_COMBOPAPER, CB_ADDSTRING, + (WPARAM) 0, (LPARAM)szBuf); + } + + if (resource.paper) + SendDlgItemMessage(hwnd, IDC_COMBOPAPER, CB_SELECTSTRING, + (WPARAM) 0, (LPARAM)resource.paper); + + SendDlgItemMessage(hwnd, IDC_CHECKMAKEPK, BM_SETCHECK, + (WPARAM) ( resource.makepk ? BST_CHECKED : BST_UNCHECKED), (LPARAM)0); + SendDlgItemMessage(hwnd, IDC_CHECKLISTFONTS, BM_SETCHECK, + (WPARAM)( resource._list_fonts ? BST_CHECKED : BST_UNCHECKED), (LPARAM)0); + SendDlgItemMessage(hwnd, IDC_CHECKSCAN, BM_SETCHECK, + (WPARAM)( resource.scan_flag ? BST_CHECKED : BST_UNCHECKED), (LPARAM)0); + SendDlgItemMessage(hwnd, IDC_CHECKLOG, BM_SETCHECK, + (WPARAM)( resource.log_flag ? BST_CHECKED : BST_UNCHECKED), (LPARAM)0); + SendDlgItemMessage(hwnd, IDC_CHECKSINGLE, BM_SETCHECK, + (WPARAM)( resource.single_flag ? BST_CHECKED : BST_UNCHECKED), (LPARAM)0); + SendDlgItemMessage(hwnd, IDC_CHECKHUSHSPECIALS, BM_SETCHECK, + (WPARAM)( resource._warn_spec ? BST_CHECKED : BST_UNCHECKED), (LPARAM)0); + SendDlgItemMessage(hwnd, IDC_CHECKHUSHCHARS, BM_SETCHECK, + (WPARAM)( resource._hush_chars ? BST_CHECKED : BST_UNCHECKED), (LPARAM)0); + SendDlgItemMessage(hwnd, IDC_CHECKHUSHCHECKSUMS, BM_SETCHECK, + (WPARAM)( resource._hush_chk ? BST_CHECKED : BST_UNCHECKED), (LPARAM)0); + SendDlgItemMessage(hwnd, IDC_CHECKALLOWSHELL, BM_SETCHECK, + (WPARAM)( resource.allow_shell ? BST_CHECKED : BST_UNCHECKED), (LPARAM)0); +} + +BOOL DviConfigImport(HWND hwnd) +{ + char szBuf[256], *p; + int i; + + SendDlgItemMessage(hwnd, IDC_EDITBDPI, WM_GETTEXT, (WPARAM)sizeof(szBuf), (LPARAM)szBuf); + if (resource._pixels_per_inch = atoi(szBuf)) + xputenv("BDPI", szBuf); + + SendDlgItemMessage(hwnd, IDC_EDITALTFONT, WM_GETTEXT, (WPARAM)sizeof(szBuf), (LPARAM)szBuf); + if (resource._alt_font) + free(resource._alt_font); + resource._alt_font = strdup(szBuf); + + SendDlgItemMessage(hwnd, IDC_COMBOMFMODE, WM_GETTEXT, (WPARAM)sizeof(szBuf), (LPARAM)szBuf); + if (resource.mfmode) + free(resource.mfmode); + + for (i = 0; i < sizeof(avail_modes)/sizeof(mfmode) - 1; i++) { + if (strcmp(szBuf, avail_modes[i].desc) == 0) { + resource.mfmode = strdup(avail_modes[i].name); + xputenv("MODE", resource.mfmode); + break; + } + } +#if 0 + fprintf(stderr, "Dvi config import putenv MODE\n"); +#endif + SendDlgItemMessage(hwnd, IDC_COMBOPAPER, WM_GETTEXT, (WPARAM)sizeof(szBuf), (LPARAM)szBuf); + if (resource.paper) + free(resource.paper); + + if (*szBuf) { + for (p = szBuf; *p && p < szBuf+sizeof(szBuf); p++) + if (*p == ' ') { + *p = '\0'; + break; + } + resource.paper = strdup(szBuf); + set_paper_type(); + init_page(); + } + + resource.makepk = (SendDlgItemMessage(hwnd, IDC_CHECKMAKEPK, BM_GETCHECK, + (WPARAM) 0, (LPARAM)0) == BST_CHECKED); + + resource._list_fonts = (SendDlgItemMessage(hwnd, IDC_CHECKLISTFONTS, + BM_GETCHECK, (WPARAM) 0, (LPARAM)0) == BST_CHECKED); + resource.scan_flag = (SendDlgItemMessage(hwnd, IDC_CHECKSCAN, + BM_GETCHECK, (WPARAM) 0, (LPARAM)0) == BST_CHECKED); + resource.log_flag = (SendDlgItemMessage(hwnd, IDC_CHECKLOG, + BM_GETCHECK, (WPARAM) 0, (LPARAM)0) == BST_CHECKED); + resource.single_flag = (SendDlgItemMessage(hwnd, IDC_CHECKSINGLE, + BM_GETCHECK, (WPARAM) 0, (LPARAM)0) == BST_CHECKED); + resource._warn_spec = (SendDlgItemMessage(hwnd, IDC_CHECKHUSHSPECIALS, + BM_GETCHECK, (WPARAM) 0, (LPARAM)0) == BST_CHECKED); + resource._hush_chars = (SendDlgItemMessage(hwnd, IDC_CHECKHUSHCHARS, + BM_GETCHECK,(WPARAM) 0, (LPARAM)0) == BST_CHECKED); + resource._hush_chk = (SendDlgItemMessage(hwnd, IDC_CHECKHUSHCHECKSUMS, + BM_GETCHECK, (WPARAM) 0, (LPARAM)0) == BST_CHECKED); + resource.allow_shell = (SendDlgItemMessage(hwnd, IDC_CHECKALLOWSHELL, + BM_GETCHECK, (WPARAM) 0, (LPARAM)0) == BST_CHECKED); + + return TRUE; +} + +BOOL DviConfigValidate(HWND hwnd) +{ + + return TRUE; +} + +void UpdateConfiguration() +{ + extern Boolean init_dvi_file(void); + extern void ReopenDviFile(void); + + initcolor(); + /* FIXME : this should happen only if mode or bdpi changed + or shrink factor has changed. */ + reset_fonts(); + reconfig(); + SendMessage(hWndDraw, WM_ERASEBKGND, (WPARAM)GetDC(hWndDraw), 0); + ChangePage(0); +} + +/* + Processes WM_COMMAND sent to the DviConfig box. + */ + +LRESULT MsgDviConfigCommand(HWND hwnd, + UINT uMessage, + WPARAM wparam, + LPARAM lparam) +{ + return DispCommand(&cmdiDviConfig, hwnd, wparam, lparam); +} + +LRESULT MsgDviConfigInit(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + DviConfigExport(hdlg); + return 0; +} + +LRESULT MsgDviConfigNotify(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + HWND hwndPSheet = ((NMHDR FAR *) lparam)->hwndFrom; + switch (((NMHDR FAR *) lparam)->code) { + case PSN_APPLY: + if (DviConfigImport(hdlg)) { + SendMessage(hwndPSheet, PSM_UNCHANGED, (WPARAM)hdlg, 0); + SetWindowLong(hwndPSheet, DWL_MSGRESULT, PSNRET_NOERROR); + UpdateConfiguration(); + } else + SetWindowLong(hwndPSheet, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE); + break; + case PSN_HELP: + { + /* char szBuf[PATH_MAX]; /* buffer for name of help file */ + /* Display help for the Dvi File options. */ + } + return TRUE; + break; + case PSN_KILLACTIVE: + if (DviConfigValidate(hdlg)) { + SetWindowLong(hwndPSheet, DWL_MSGRESULT, FALSE); + } + else { + SetWindowLong(hwndPSheet, DWL_MSGRESULT, TRUE); + } + break; + case PSN_QUERYCANCEL: + /* Accept cancelation */ + return FALSE; + break; + default: + break; + } + return 0; +} + +/* + OK has been clicked on, free the box and related resources. + */ + +LRESULT CmdDviConfigOK(HWND hdlg, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + /* EndDialog(hdlg, TRUE); /* Exit the dialog */ + return 0; +} + +/* + Cancel has been clicked on, free the box and related resources. + */ + +LRESULT CmdDviConfigCancel(HWND hdlg, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + /* EndDialog(hdlg, TRUE); /* Exit the dialog */ + return 0; +} + +/* + Process messages for the DviConfig box. + */ + +LRESULT CALLBACK DviConfigDlgProc(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + return DispMessage(&msdiDviConfig, hdlg, uMessage, wparam, lparam); +} + +/* + View Page configuration dialog box. + */ + +/* + List of controls in this dialog box. + Postscript : IDC_CHECKPOSTSCRIPT + Antialiasing : IDC_CHECKALIASING + GS Antialiasing : IDC_CHECKGSALPHA + Reverse video : IDC_CHECKREVIDEO + Density : IDC_EDITDENSITY + Gamma : IDC_EDITGAMMA + Grid 1 color : + Grid 2 color : + Grid 3 color : + Mag size 1 : IDC_EDITMGS1 + Mag size 2 : IDC_EDITMGS2 + Mag size 3 : IDC_EDITMGS3 + */ + +void ViewConfigExport(HWND hwnd) +{ + int i; + char szBuf[256]; + + /* Put every current value in its control */ + sprintf(szBuf, "%2.4f", resource._gamma); + SendDlgItemMessage(hwnd, IDC_EDITGAMMA, WM_SETTEXT, (WPARAM)0, (LPARAM)szBuf); + wsprintf(szBuf, "%d", resource._density); + SendDlgItemMessage(hwnd, IDC_EDITDENSITY, WM_SETTEXT, (WPARAM)0, (LPARAM)szBuf); + + wsprintf(szBuf, "%dx%d", mg_size[0].w, mg_size[0].h); + SendDlgItemMessage(hwnd, IDC_EDITMGS1, WM_SETTEXT, (WPARAM)0, (LPARAM)szBuf); + wsprintf(szBuf, "%dx%d", mg_size[1].w, mg_size[1].h); + SendDlgItemMessage(hwnd, IDC_EDITMGS2, WM_SETTEXT, (WPARAM)0, (LPARAM)szBuf); + wsprintf(szBuf, "%dx%d", mg_size[2].w, mg_size[2].h); + SendDlgItemMessage(hwnd, IDC_EDITMGS3, WM_SETTEXT, (WPARAM)0, (LPARAM)szBuf); + + SendDlgItemMessage(hwnd, IDC_CHECKGSALPHA, BM_SETCHECK, + (WPARAM) ( resource.gs_alpha ? BST_CHECKED : BST_UNCHECKED), (LPARAM)0); + SendDlgItemMessage(hwnd, IDC_CHECKINMEMORY, BM_SETCHECK, + (WPARAM) ( resource.in_memory ? BST_CHECKED : BST_UNCHECKED), (LPARAM)0); + SendDlgItemMessage(hwnd, IDC_CHECKPOSTSCRIPT, BM_SETCHECK, + (WPARAM) ( resource._postscript ? BST_CHECKED : BST_UNCHECKED), (LPARAM)0); + SendDlgItemMessage(hwnd, IDC_CHECKALIASING, BM_SETCHECK, + (WPARAM) ( resource._use_grey ? BST_CHECKED : BST_UNCHECKED), (LPARAM)0); + SendDlgItemMessage(hwnd, IDC_CHECKREVIDEO, BM_SETCHECK, + (WPARAM) ( resource.reverse ? BST_CHECKED : BST_UNCHECKED), (LPARAM)0); + +#ifdef TRANSFORM + if (IS_WIN95 || IS_WIN98) { + SendDlgItemMessage(hwnd, IDC_CHECKXFORM, BN_DISABLE, 0, 0); + resource.use_xform = False; + } + else { + fprintf(stderr, "set use_xform is %s\n", (resource.use_xform ? "true" : "false")); + SendDlgItemMessage(hwnd, IDC_CHECKXFORM, BM_SETCHECK, + (WPARAM)( resource.use_xform ? BST_CHECKED : BST_UNCHECKED), (LPARAM)0); + } +#else + SendDlgItemMessage(hwnd, IDC_CHECKXFORM, BN_DISABLE, 0, 0); +#endif + + /* Colors */ + for (i = 0; i < win32_color_map_size; i++) { + wsprintf(szBuf, "%s", win32_color_map[i].name); + SendDlgItemMessage(hwnd, IDC_COMBO_FORE_COLOR, CB_ADDSTRING, + (WPARAM) 0, (LPARAM)szBuf); + SendDlgItemMessage(hwnd, IDC_COMBO_BACK_COLOR, CB_ADDSTRING, + (WPARAM) 0, (LPARAM)szBuf); + } + if (resource.fore_color) + SendDlgItemMessage(hwnd, IDC_COMBO_FORE_COLOR, CB_SELECTSTRING, + (WPARAM) 0, (LPARAM)resource.fore_color); + if (resource.back_color) + SendDlgItemMessage(hwnd, IDC_COMBO_BACK_COLOR, CB_SELECTSTRING, + (WPARAM) 0, (LPARAM)resource.back_color); + +} + +BOOL ViewConfigImport(HWND hwnd) +{ + char szBuf[256]; + int i; + + SendDlgItemMessage(hwnd, IDC_EDITGAMMA, WM_GETTEXT, (WPARAM)sizeof(szBuf), (LPARAM)szBuf); + resource._gamma = atof(szBuf); + + SendDlgItemMessage(hwnd, IDC_EDITDENSITY, WM_GETTEXT, (WPARAM)sizeof(szBuf), (LPARAM)szBuf); + resource._density = atoi(szBuf); + + SendDlgItemMessage(hwnd, IDC_EDITMGS1, WM_GETTEXT, (WPARAM)sizeof(szBuf), (LPARAM)szBuf); + if (resource.mg_arg[0]) + free(resource.mg_arg[0]); + resource.mg_arg[0] = strdup(szBuf); + SendDlgItemMessage(hwnd, IDC_EDITMGS2, WM_GETTEXT, (WPARAM)sizeof(szBuf), (LPARAM)szBuf); + if (resource.mg_arg[1]) + free(resource.mg_arg[1]); + resource.mg_arg[1] = strdup(szBuf); + SendDlgItemMessage(hwnd, IDC_EDITMGS3, WM_GETTEXT, (WPARAM)sizeof(szBuf), (LPARAM)szBuf); + if (resource.mg_arg[2]) + free(resource.mg_arg[2]); + resource.mg_arg[2] = strdup(szBuf); + + for (i = 0; i < 3; ++i) + if (resource.mg_arg[i] != NULL) { + char *s; + + mg_size[i].w = mg_size[i].h = atoi(resource.mg_arg[i]); + s = strchr(resource.mg_arg[i], 'x'); + if (s != NULL) { + mg_size[i].h = atoi(s + 1); + if (mg_size[i].h <= 0) mg_size[i].w = 0; + } + } + + resource.gs_alpha = (SendDlgItemMessage(hwnd, IDC_CHECKGSALPHA, BM_GETCHECK, + (WPARAM) 0, (LPARAM)0) == BST_CHECKED); + resource.in_memory = (SendDlgItemMessage(hwnd, IDC_CHECKINMEMORY, BM_GETCHECK, + (WPARAM) 0, (LPARAM)0) == BST_CHECKED); + resource._use_grey = (SendDlgItemMessage(hwnd, IDC_CHECKALIASING, BM_GETCHECK, + (WPARAM) 0, (LPARAM)0) == BST_CHECKED); + resource._postscript = (SendDlgItemMessage(hwnd, IDC_CHECKPOSTSCRIPT, BM_GETCHECK, + (WPARAM) 0, (LPARAM)0) == BST_CHECKED); + resource.reverse = (SendDlgItemMessage(hwnd, IDC_CHECKREVIDEO, BM_GETCHECK, + (WPARAM) 0, (LPARAM)0) == BST_CHECKED); +#ifdef TRANSFORM + if (IS_WIN95 || IS_WIN98) { + resource.use_xform = False; + } + else { + resource.use_xform = (SendDlgItemMessage(hwnd, IDC_CHECKXFORM, + BM_GETCHECK, (WPARAM) 0, (LPARAM) 0) == BST_CHECKED); + fprintf(stderr, "get use_xform is %s\n", (resource.use_xform ? "true" : "false")); + if (resource.use_xform) { + extern void init_xfrm_stack(void); + init_xfrm_stack(); + ChangePage(0); + } + } +#else + resource.use_xform = False; +#endif + + SendDlgItemMessage(hwnd, IDC_COMBO_FORE_COLOR, + WM_GETTEXT, (WPARAM)sizeof(szBuf), (LPARAM)szBuf); + if (resource.fore_color) + free(resource.fore_color); + resource.fore_color = xstrdup(szBuf); + + SendDlgItemMessage(hwnd, IDC_COMBO_BACK_COLOR, + WM_GETTEXT, (WPARAM)sizeof(szBuf), (LPARAM)szBuf); + if (resource.back_color) + free(resource.back_color); + resource.back_color = xstrdup(szBuf); + + return TRUE; +} + +BOOL ViewConfigValidate(HWND hwnd) +{ + + return TRUE; +} + +/* + Processes WM_COMMAND sent to the ViewConfig box. + */ + +LRESULT MsgViewConfigCommand(HWND hwnd, + UINT uMessage, + WPARAM wparam, + LPARAM lparam) +{ + return DispCommand(&cmdiViewConfig, hwnd, wparam, lparam); +} + +LRESULT MsgViewConfigInit(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + /* Setup current values into the dialog */ + ViewConfigExport(hdlg); + return 0; +} + +LRESULT MsgViewConfigNotify(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + HWND hwndPSheet = ((NMHDR FAR *) lparam)->hwndFrom; + + switch (((NMHDR FAR *) lparam)->code) { + case PSN_APPLY: + if (ViewConfigImport(hdlg)) { + SendMessage(hwndPSheet, PSM_UNCHANGED, (WPARAM)hdlg, 0); + SetWindowLong(hwndPSheet, DWL_MSGRESULT, PSNRET_NOERROR); + UpdateConfiguration(); + } else + SetWindowLong(hwndPSheet, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE); + break; + case PSN_HELP: + { + /* char szBuf[PATH_MAX]; /* buffer for name of help file */ + /* Display help for the View Page options. */ + } + break; + case PSN_KILLACTIVE: + if (ViewConfigValidate(hdlg)) { + SetWindowLong(hwndPSheet, DWL_MSGRESULT, TRUE); + } + else { + SetWindowLong(hwndPSheet, DWL_MSGRESULT, FALSE); + } + break; + case PSN_QUERYCANCEL: + /* Accept cancelation */ + break; + default: + break; + } + return 0; +} + +/* + OK has been clicked on, free the box and related resources. + */ + +LRESULT CmdViewConfigOK(HWND hdlg, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + /* Retrieve the values in the dialog and set them as current */ + + /* EndDialog(hdlg, TRUE); /* Exit the dialog */ +#if PS + ps_destroy(); +#endif + + initcolor(); + reconfig(); + redraw_page(); + + return 0; +} + +/* + Cancel has been clicked on, free the box and related resources. + */ + +LRESULT CmdViewConfigCancel(HWND hdlg, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + /* EndDialog(hdlg, TRUE); /* Exit the dialog */ + return 0; +} + +/* + Process messages for the ViewConfig box. + */ + +LRESULT CALLBACK ViewConfigDlgProc(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + return DispMessage(&msdiViewConfig, hdlg, uMessage, wparam, lparam); +} + +int CALLBACK ConfigPSheetCallback(HWND hwnd, UINT uMsg, LPARAM lParam) +{ + if (uMsg == PSCB_INITIALIZED) + hwndPSheet = hwnd; + return 0; +} + +/* DoConfigSheet - creates a property sheet that contains two pages. + hwndOwner - handle to the owner window of the property sheet. */ + +void DoConfigPSheet(HWND hwndOwner) +{ + PROPSHEETPAGE psp[2]; + PROPSHEETHEADER psh; + int num_sheets = sizeof(psp) / sizeof(PROPSHEETPAGE); + + ZeroMemory(psp, num_sheets*sizeof(PROPSHEETPAGE)); + psp[0].dwSize = sizeof(PROPSHEETPAGE); + /* psp[0].dwFlags = PSP_USEICONID | PSP_USETITLE; */ + psp[0].hInstance = hInst; + psp[0].pszTemplate = "DLGCONFIGDVI"; + /* psp[0].pszIcon = MAKEINTRESOURCE(IDI_FONT); */ + psp[0].pfnDlgProc = DviConfigDlgProc; + /* psp[0].pszTitle = MAKEINTRESOURCE(IDS_FONT); */ + psp[0].lParam = 0; + psp[0].pfnCallback = NULL; + + psp[1].dwSize = sizeof(PROPSHEETPAGE); + /* psp[1].dwFlags = PSP_USEICONID | PSP_USETITLE; */ + psp[1].hInstance = hInst; + psp[1].pszTemplate = "DLGCONFIGVIEW"; + /* psp[1].pszIcon = MAKEINTRESOURCE(IDI_BORDER); */ + psp[1].pfnDlgProc = ViewConfigDlgProc; + /* psp[1].pszTitle = MAKEINTRESOURCE(IDS_BORDER); */ + psp[1].lParam = 0; + psp[1].pfnCallback = NULL; + + ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); + psh.dwSize = sizeof(PROPSHEETHEADER); + psh.dwFlags = /* PSH_USEICONID |*/ PSH_PROPSHEETPAGE; + psh.hwndParent = hwndOwner; + psh.hInstance = hInst; + /* psh.pszIcon = MAKEINTRESOURCE(IDI_CELL_PROPERTIES); */ + psh.pszCaption = (LPSTR) "Windvi Configuration"; + psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); + psh.nStartPage = 0; + psh.ppsp = (LPCPROPSHEETPAGE) &psp; + psh.pfnCallback = ConfigPSheetCallback; + PropertySheet(&psh); + return; +} + +LRESULT CmdWindviConfig (HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ +#if 0 + SET_CRT_DEBUG_FIELD( _CRTDBG_DELAY_FREE_MEM_DF ); + SET_CRT_DEBUG_FIELD( _CRTDBG_CHECK_ALWAYS_DF ); +#endif + DoConfigPSheet(hwnd); + return 0; +} + +LRESULT CmdTexConfig (HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + MessageBox (hwnd, + "Command Not Yet Implemented.\r\n", + "Windvi", + MB_OK | MB_ICONEXCLAMATION); + return 0; +} + diff --git a/Build/source/texk/windvi/wincolor.c b/Build/source/texk/windvi/wincolor.c new file mode 100644 index 00000000000..d530a32ca41 --- /dev/null +++ b/Build/source/texk/windvi/wincolor.c @@ -0,0 +1,880 @@ +/* + This file gathers all color related functions. + + Problems related to color support : + + - color support means supporting the specials introduced by the + color.sty LaTeX package + + 1 - supporting 8bit color modes means build a palette for each page + + 2 - supporting \pagebackground{} means tracking which fore/background + color at the beginning of each page ! Is it possible using prescaning ? + That means keeping track in a stack of the background changes + and pages where they did occur. Idem for fore colors. Then it should + be possible at beginning of each page to have the right fore_Pixel + and back_Pixel values. + + */ + +#include "wingui.h" +#include "xdvi-config.h" + +#define DEBUG_COLOR 0 + +LOGPALETTE *lpLogPal = NULL; +PALETTEENTRY pe; /* Dummy, used everywhere */ +int iLengthPal = 0; + +/* Memorize the page background colors changes */ +struct _page_bk { + COLORREF color; + int page; /* page where the \pagecolor{} occurs */ +} PageBackColor[1024]; + +struct _page_fr { + COLORREF color; + int page; /* this page begins with a non-empty color + stack */ + lpCRefStack stack; /* Stack of COLORREF to memorize the state + when this page is entered... */ +} PageForeColor[1024]; + +int LastBackChange = 0, LastForeChange = 0; + +/* Stack of colors used during prescanning. + Whenever this stack is not empty at the end of the page, + it is memoized for the next page. +*/ + +lpCRefStack scan_fore_colors; + +extern RGBQUAD QuadWhite, QuadBlack; + +/* CRefStack functions */ + +lpCRefStack InitCRefStack(int size) +{ + lpCRefStack stack; + stack = (lpCRefStack)xmalloc(sizeof(CRefStack)); + stack->s = (COLORREF *)xmalloc(sizeof(COLORREF)*size); + stack->max = size; + stack->i = 0; + return stack; +} + +BOOL CRefIsEmpty(lpCRefStack s) +{ + return (s->i == 0); +} + +BOOL CRefIsInit(lpCRefStack s) +{ + return ((s->i == 1) && (CRefTop(s) == MYRGB(0,0,0))); +} + +void CRefPush(lpCRefStack s, COLORREF c) +{ + if (s->i < s->max) { + s->s[s->i] = c; +#if DEBUG_COLOR + fprintf(stderr, "CRefPush %-8x\n", c); +#endif + ++(s->i); + } + else { + fprintf(stderr, "Error: too many pushes into stack !\n"); +#if 0 + MessageBox(hWndMain, "Max color stack depth reached", NULL, + MB_APPLMODAL | MB_ICONHAND | MB_OK ); +#endif + } +} + +COLORREF CRefPop(lpCRefStack s) +{ + if (s->i > 0) { + --(s->i); +#if DEBUG_COLOR + fprintf(stderr, "CRefPop %-8x\n", s->s[s->i]); +#endif + return(s->s[s->i]); + } + else { + fprintf(stderr, "Error : too many pop from the stack !\n"); +#if 0 + MessageBox(hWndMain, "Popped too many colors from stack", NULL, + MB_APPLMODAL | MB_ICONHAND | MB_OK); +#endif + return s->s[0]; + } +} + +COLORREF CRefTop(lpCRefStack s) +{ + if (s->i > 0) { + return s->s[s->i - 1]; + } + else { + fprintf(stderr, "Error : no top, stack is empty !\n"); + return MYRGB(0,0,0); + } +} + +lpCRefStack CRefSave(lpCRefStack s) +{ + lpCRefStack new; + new = (lpCRefStack)xmalloc(sizeof(CRefStack)); + new->max = new->i = 0; + new->s = NULL; + if (s->i > 0) { + new->s = (COLORREF *)xmalloc(s->i*sizeof(COLORREF)); + memcpy(new->s, s->s, s->i*sizeof(COLORREF)); + new->i = new->max = s->i; + } + return new; +} + +void CRefRestore(lpCRefStack dst, lpCRefStack src) +{ + if (dst->max < src->i) { + fprintf(stderr, "CRefRestore : not enough space !\n"); + return; + } + dst->i = src->i; + memcpy(dst->s, src->s, src->i*sizeof(COLORREF)); +} + +void CRefDump(lpCRefStack s, char *msg) +{ + int i; + fprintf(stderr, "%s ", msg); + if (s) { + fprintf(stderr, "max %d, top %d ", s->max, s->i); + for(i = 0; i < s->i; i++) + fprintf(stderr, "%-8x ", s->s[i]); + fprintf(stderr, "\n"); + } + else + fprintf(stderr, "(null)\n"); +} + +void CRefResetInit(lpCRefStack s, COLORREF c) +{ + s->i = 0; + CRefPush(s, c); +} + +void CRefFree(lpCRefStack s) +{ + if (s != NULL) { + if (s->s != NULL) + free(s->s); + free(s); + } +} + +COLORREF ColorInvert(COLORREF c) +{ + return MYRGB(255-GetRValue(c), 255-GetGValue(c), 255-GetBValue(c)); +} + + +RGBQUAD Color2Quad(COLORREF c) +{ + RGBQUAD q; + q.rgbReserved = 0; + q.rgbRed = GetRValue(c); + q.rgbGreen = GetGValue(c); + q.rgbBlue = GetBValue(c); + return q; +} + +void +dump_colors(char *msg) +{ + int i; + fprintf(stderr, "%s\n", msg); + fprintf(stderr," scanned_page = %d, page = %d\n", scanned_page, current_page); + for (i = 0; i <= LastBackChange; i++) + fprintf(stderr, "PageBackColor[%d] = (%d, %-8x)\n", + i, PageBackColor[i].page, PageBackColor[i].color); + for (i = 0; i < LastForeChange; i++) { + fprintf(stderr, "PageForeColor[%d] = (%d, %-8x)\n", + i, PageForeColor[i].page, PageForeColor[i].color); + CRefDump(PageForeColor[i].stack, "local stack"); + } + CRefDump(scan_fore_colors, "scan_fore_colors"); + CRefDump(color_stack, "color_stack"); + + fprintf(stderr, "\n"); +} + +#ifdef GREY + +void initialize_palette() +{ + int i; + /* The palette should be initialized with 16 grey levels right now. */ + /* Later on, we could add the grid colors. */ +#if DEBUG_COLOR + fprintf(stderr, "Initializing Palette"); +#endif + + if (lpLogPal) + free(lpLogPal); + + lpLogPal = (LPLOGPALETTE) xmalloc(sizeof(LOGPALETTE) + + 256*sizeof(PALETTEENTRY)); + lpLogPal->palVersion = 0x300; + lpLogPal->palNumEntries = iLengthPal = 16; + + pe.peFlags = PC_NOCOLLAPSE; + for (i = 0; i < 16; i++) { + pe.peRed = GetRValue(palette[i]); + pe.peGreen = GetGValue(palette[i]); + pe.peBlue = GetBValue(palette[i]); + lpLogPal->palPalEntry[i] = pe; + } + +} + +COLORREF add_color_palette(COLORREF c) +{ + int i, i_min; + int min = 256*3, dist; + COLORREF cret = c; + + pe.peRed = GetRValue(c); + pe.peGreen = GetGValue(c); + pe.peBlue = GetBValue(c); + + /* Look if any value close is already in there */ + for (i_min = i = 0; i < iLengthPal; i++) + if ((dist = abs(lpLogPal->palPalEntry[i].peRed - pe.peRed) + + abs(lpLogPal->palPalEntry[i].peGreen - pe.peGreen) + + abs(lpLogPal->palPalEntry[i].peBlue - pe.peBlue)) < min) { + i_min = i; + min = dist; + } + + if (min <= 3 || iLengthPal == 256) { + cret = MYRGB(lpLogPal->palPalEntry[i_min].peRed, + lpLogPal->palPalEntry[i_min].peGreen, + lpLogPal->palPalEntry[i_min].peBlue); + } + else { +#if DEBUG_COLOR + fprintf(stderr, "adding %-8x to palette in position %d\n", c, + lpLogPal->palNumEntries + 1); +#endif + + lpLogPal->palPalEntry[iLengthPal++] = pe; + lpLogPal->palNumEntries += 1; + } +#if DEBUG_COLOR + fprintf(stderr, "add_color_palette %-8x -> %-8x\n", c, cret); +#endif + + setup_palette(pal_rgb, 16); + + return cret; +} + +void setup_palette(RGBQUAD *palette, int num) +{ + return; + /* Put up a palette if device is palettized */ + /* FIXME : is it meaningful at all ? */ + if (maneRasterCaps & RC_PALETTE) { + HPALETTE hpal, hOldPal; +#if DEBUG_COLOR + fprintf(stderr, "Setting up palette...\n"); +#endif + if ((hpal = CreatePalette(lpLogPal)) == NULL) + Win32Error("CreatePalette"); + if ((hOldPal = SelectPalette(maneDC, hpal, TRUE)) == NULL) + Win32Error("SelectPalette"); + DeleteObject(hOldPal); + if (RealizePalette(maneDC) == GDI_ERROR) + Win32Error("RealizePalette"); + } +} + +/* + Initialize only pixeltbl[] and palette[] with black on white. +*/ +Boolean +init_pix(COLORREF back, COLORREF fore) +{ + static Boolean use_palette; + static int shrink_allocated_for = 0; + static float oldgamma = 0.0; + static COLORREF old_back, old_fore; + static Boolean bFirstTime = True; + + + int i; + Boolean warn = False; + extern BOOL bColorPage; + unsigned int sf_squared; + BYTE fc_red, fc_green, fc_blue; + BYTE bc_red, bc_green, bc_blue; + +#if DEBUG_COLOR + fprintf(stderr, "Init Pix : back %-8x fore %-8x\n", + back, fore); +#endif + /* Maybe nothing to do ! */ + + /* We can't do antialiasing on 8 bits depth screen. */ + if ((back == CLR_INVALID) + || ((maneBitsPixel <= 8) && (fore != MYRGB(0,0,0)))) { + int limit = 5; + +#if 0 + if (back == CLR_INVALID) fprintf(stderr, "Back is invalid\n"); + fprintf(stderr, "maneBitsPixel = %d\n", maneBitsPixel); +#endif + + for(i = 0; i < limit; i++) { + pal_bw[i] = QuadWhite; + pal_mask[i] = QuadBlack; + } + for(i = limit; i < 16; i++) { + pal_bw[i] = QuadBlack; + pal_mask[i] = Color2Quad(fore_Pixel); + } + old_back = back; + old_fore = fore; + return False; + } + + if (!bFirstTime + && (old_fore == fore) && (old_back == back) + && (gamma == oldgamma)) { + return False; + } + + bFirstTime = False; + old_back = back; + old_fore = fore; + oldgamma = gamma; + + /* FIXME : should use back and fore ? */ + fc_red = GetRValue(fore); + fc_green = GetGValue(fore); + fc_blue = GetBValue(fore); + bc_red = GetRValue(back); + bc_green = GetGValue(back); + bc_blue = GetBValue(back); + +#if DEBUG_COLOR + fprintf(stderr, "Initializing pix fore = %-8x, back = %-8x ...\n", fore, back); +#endif + + for (i = 0; i < 16; ++i) { + double frac = gamma > 0 ? pow((double) i / 15, 1 / gamma) + : 1 - pow((double) (15 - i) / 15, -gamma); + + palette[i] = MYRGB((frac * ((double) fc_red - bc_red) + bc_red), + (frac * ((double) fc_green - bc_green) + bc_green), + (frac * ((double) fc_blue - bc_blue) + bc_blue)); + } + + /* + pal_bw is a black & white palette, only background is white. + pal_rgb is white on background and palette for the rest. + These palettes are used to do transparent bitblt. + */ + + pal_bw[0] = QuadWhite; + pal_mask[0] = QuadBlack; + pal_rgb[0] = Color2Quad(palette[0]); + for (i = 1; i < 16; i++) { + pal_bw[i] = QuadBlack; + pal_mask[i] = pal_rgb[i] = Color2Quad(palette[i]); + } + + memcpy(bmi4.bmiColors, pal_rgb, 16*sizeof(RGBQUAD)); + + /* Make sure fore_ and back_Pixel are part of the palette */ + fore_Pixel = MYRGB(GetRValue(palette[15]), GetGValue(palette[15]), + GetBValue(palette[15])); + back_Pixel = MYRGB(GetRValue(palette[0]), GetGValue(palette[0]), + GetBValue(palette[0])); + + oldgamma = gamma; + +#if DEBUG_COLOR + fprintf(stderr, "Palette: \n"); + for (i = 0; i < 16; i++) + fprintf(stderr, "color %d = %-8x %-8x %-8x\n", i, + pal_rgb[i], pal_bw[i], pal_mask[i]); +#endif + + if (mane.shrinkfactor == 1) return warn; + + sf_squared = mane.shrinkfactor * mane.shrinkfactor; + + if (shrink_allocated_for != mane.shrinkfactor) { + if (pixeltbl != NULL) { + free((char *) pixeltbl); + if (pixeltbl_t != NULL) + free((char *) pixeltbl_t); + } + pixeltbl = xmalloc((sf_squared + 1) * sizeof(Pixel)); + if (foreGC2 != NULL) + pixeltbl_t = xmalloc((sf_squared + 1) * sizeof(Pixel)); + shrink_allocated_for = mane.shrinkfactor; + } + for (i = 0; i <= sf_squared; ++i) + pixeltbl[i] = + palette[(i * 30 + sf_squared) / (2 * sf_squared)]; + + return warn; +} + +#endif /* GREY */ + +void scan_init_fore_color() +{ + + bColorPage = !CRefIsEmpty(scan_fore_colors) + && !CRefIsInit(scan_fore_colors); + +#if DEBUG_COLOR + fprintf(stderr, "scan_init_fore_color : top stack = %-8x, fore Pixel = %-8x\n", + CRefTop(scan_fore_colors), fore_Pixel); +#endif + +#if 0 + if (((scanned_page == 0 ) || (scanned_page == current_page)) && (maneBitsPixel <= 8)) { + initialize_palette(); + } + dump_colors("scan_init"); +#endif +} + +void scan_get_last_fore_color() +{ + /* if ((c = scan_fore_colors[scan_fore_index]) != MYRGB(255, 255, 255)) { */ +#if DEBUG_COLOR + CRefDump(scan_fore_colors, "scan_get_last_fore_color :"); +#endif + if (/* !CRefIsEmpty(scan_fore_colors) && */ ! CRefIsInit(scan_fore_colors)) { + /* memorized it as the stack for the next page */ + PageForeColor[LastForeChange].page = scanned_page + 1; + PageForeColor[LastForeChange].color = CRefTop(scan_fore_colors); + PageForeColor[LastForeChange].stack = CRefSave(scan_fore_colors); +#if DEBUG_COLOR + fprintf(stderr, "Memorizing color stack at the end of page %d\n", scanned_page); + CRefDump(PageForeColor[LastForeChange].stack, "PageForeColor[].stack"); +#endif + LastForeChange++; + } + + { + COLORREF new_back_Pixel = get_back_color(current_page); + if (back_Pixel != new_back_Pixel) { + back_Pixel = new_back_Pixel; + if (backBrush) + DeleteObject(backBrush); +#if DEBUG_COLOR + fprintf(stderr, "scan_get_fore_color() : Creating back brush %-8x\n", back_Pixel); +#endif + backBrush = CreateSolidBrush(back_Pixel); + } + } +} + +void +scan_colors(char *cp) +{ + char *p; + COLORREF c = MYRGB(0,0,0); + extern BOOL bColorPage; + +#if DEBUG_COLOR + fprintf(stderr, "Pre-scanning colors page %d : %s\n", scanned_page, cp); +#endif + + if (memicmp(cp, "background", 10) == 0) { + p = cp + 11; + /* background(p); */ + /* Store the background color */ + if (scanned_page > PageBackColor[LastBackChange].page) { + ++LastBackChange; +#if DEBUG_COLOR + fprintf(stderr, "adding new last back change (%d, %-8x)\n", + scanned_page, string_to_colorref(p)); +#endif + PageBackColor[LastBackChange].page = scanned_page; + PageBackColor[LastBackChange].color = c = string_to_colorref(p); + bColorPage = bColorPage || (c != string_to_colorref(resource.back_color)); + } + } + else if (memicmp(cp, "color", 5) == 0) { + p = cp + 6; + while ( *p <= ' ' ) p++ ; + if (memicmp(p, "push", 4) == 0) { + p += 5; + c = string_to_colorref(p); + if ((scanned_page == current_page) && (maneBitsPixel <= 8)) { + c = add_color_palette(c); + } + CRefPush(scan_fore_colors, c); +#if DEBUG_COLOR + fprintf(stderr, "Pushing scan color %-8x\n", c); +#endif + bColorPage = bColorPage || (c != string_to_colorref(resource.fore_color)); + } + else if (memicmp(p, "pop", 3) == 0) { + c = CRefPop(scan_fore_colors); +#if DEBUG_COLOR + fprintf(stderr, "pop scan color %-8x\n", c); +#endif + } + else { + c = string_to_colorref(p); +#if DEBUG_COLOR + fprintf(stderr, "reset color stack %-8x\n", c); +#endif + if ((scanned_page == current_page) && (maneBitsPixel <= 8)) { + c = add_color_palette(c); + } + CRefResetInit(scan_fore_colors, c); + } + } +#if DEBUG_COLOR + dump_colors("scan specials"); +#endif +} + +COLORREF get_back_color(int page) +{ + COLORREF cret; + int i; + /* page background is a bit different : it is sticky through page changes. */ + cret = back_Pixel; + /* get the color preceding */ + for (i = 0; i <= LastBackChange; i++) + if (page < PageBackColor[i].page) + break; + else + cret = PageBackColor[i].color; + return cret; +} + +void +init_colors() +{ + /* FIXME : this is called foar too often ! + Look at redraw() in winevt.c */ + + static Boolean warn_done = False; + Boolean warn = False; + int i; + RGBQUAD c; + HPEN oldPen; + HBRUSH oldBrush; + COLORREF new_back_Pixel, new_fore_Pixel; + extern int pen_size; + +#if DEBUG_COLOR + dump_colors("init_colors!!!\n"); +#endif + /* Looking for state to be restored */ + for (i = 0; i < LastForeChange; i++) { + if (PageForeColor[i].page == current_page) { + /* copy the color stack */ +#if DEBUG_COLOR + fprintf(stderr, "restoring stack for page %d from PageForeColor[%d]\n", + current_page, i); + CRefDump(PageForeColor[i].stack, "stack restored : "); +#endif + CRefRestore(scan_fore_colors, PageForeColor[i].stack); + CRefRestore(color_stack, PageForeColor[i].stack); + new_fore_Pixel = CRefTop(color_stack); + break; + } + else if (PageForeColor[i].page > current_page) { + CRefResetInit(color_stack, string_to_colorref(resource.fore_color)); + CRefResetInit(scan_fore_colors, string_to_colorref(resource.fore_color)); + new_fore_Pixel = CRefTop(color_stack); +#if DEBUG_COLOR + fprintf(stderr, "Resetted scan_fore_colors\n"); + CRefDump(scan_fore_colors, "stack resetted : "); +#endif + break; + } + } + + if (i == LastForeChange) { + CRefResetInit(color_stack, string_to_colorref(resource.fore_color)); + CRefResetInit(scan_fore_colors, string_to_colorref(resource.fore_color)); + new_fore_Pixel = CRefTop(color_stack); +#if DEBUG_COLOR + fprintf(stderr, "Resetted scan_fore_colors\n"); + CRefDump(scan_fore_colors, "stack resetted : "); +#endif + } + + /* page background is a bit different : it is sticky through page changes. */ + new_back_Pixel = get_back_color(current_page); +#if DEBUG_COLOR + fprintf(stderr, "init_colors looking for bg color, found %-8x (previous %-8x)\n", + new_back_Pixel, back_Pixel); +#endif + +#if 0 + /* Unneeded ? */ + SetBkMode(foreGC, OPAQUE); + SetBkColor(foreGC, back_Pixel); +#endif + + c.rgbReserved = 0; + + if (new_back_Pixel != back_Pixel) { + back_Pixel = new_back_Pixel; + + /* Do not allow resource leaks ! */ + if (backBrush) + DeleteObject(backBrush); + backBrush = CreateSolidBrush(back_Pixel); +#if DEBUG_COLOR + fprintf(stderr, "init_colors(): Creating back brush %-8x\n", back_Pixel); +#endif + } + + + /* Setup pens and brushes */ + + if (new_fore_Pixel != fore_Pixel) { + fore_Pixel = new_fore_Pixel; + +#if DEBUG_COLOR + fprintf(stderr, "init_colors fore = %x\n", fore_Pixel); +#endif + if (forePen) + if (!DeleteObject(forePen)) + Win32Error("init_colors/DeleteObject/forePen"); + if ((forePen = CreatePen(PS_SOLID, 1, fore_Pixel)) == NULL) { + Win32Error("init_colors/CreatePen(fore_pixel) failed."); + } + if (foreBrush) + if (!DeleteObject(foreBrush)) + Win32Error("init_colors/DeleteObject/foreBrush"); + if ((foreBrush = CreateSolidBrush(fore_Pixel)) == NULL) { + Win32Error("init_colors/CreateSolidBrush(fore_pixel) failed."); + } + + if (foreTPicPen) + DeleteObject(foreTPicPen); + foreTPicPen = CreatePen(PS_SOLID, pen_size, fore_Pixel); + if (foreTPicBrush) + DeleteObject(foreTPicBrush); + foreTPicBrush = CreateSolidBrush(fore_Pixel); + } + + c.rgbBlue = GetBValue(back_Pixel); + c.rgbRed = GetRValue(back_Pixel); + c.rgbGreen = GetGValue(back_Pixel); + bmi1.bmiColors[0] = c; + + c.rgbBlue = GetBValue(fore_Pixel); + c.rgbRed = GetRValue(fore_Pixel); + c.rgbGreen = GetGValue(fore_Pixel); + bmi1.bmiColors[1] = c; + +#ifdef GREY + if (use_grey) { + warn = init_pix(new_back_Pixel, new_fore_Pixel); + } +#endif + +#if 0 + if (warn && !warn_done) { + Puts("Note: overstrike characters may be incorrect."); + warn_done = True; /* Print warning only once. */ + } +#endif +} + +/* + + FIXME: create a pool of pens and brushes to avoid + all this mess when moving the mag. glass on a + color page. +*/ + +void SetForeColor(COLORREF c) +{ + HBRUSH oldBrush; + HPEN oldPen; + extern int pen_size; + +#if DEBUG_COLOR + fprintf(stderr, "SetForeColor %8x\n", c); +#endif + + if (c != fore_Pixel) + bColorPage = TRUE; + + fore_Pixel = c; + +#if 1 + if (forePen) + if (!DeleteObject(forePen)) + Win32Error("init_colors/DeleteObject/forePen"); + if ((forePen = CreatePen(PS_SOLID, 1, fore_Pixel)) == NULL) { + Win32Error("init_colors/CreatePen(fore_pixel) failed."); + } + if (foreBrush) + if (!DeleteObject(foreBrush)) + Win32Error("init_colors/DeleteObject/foreBrush"); + if ((foreBrush = CreateSolidBrush(fore_Pixel)) == NULL) { + Win32Error("init_colors/CreateSolidBrush(fore_pixel) failed."); + } + if (foreTPicPen) + DeleteObject(foreTPicPen); + foreTPicPen = CreatePen(PS_SOLID, pen_size, fore_Pixel); + if (foreTPicBrush) + DeleteObject(foreTPicBrush); + foreTPicBrush = CreateSolidBrush(fore_Pixel); + +#else + /* Setup pens and brushes */ + if ((forePen = CreatePen(PS_SOLID, 1, fore_Pixel)) == NULL) { + Win32Error("SetForeColor/CreatePen failed."); + } + else { + if ((oldPen = SelectObject(foreGC, forePen)) == NULL) + Win32Error("SelectObject/foreGC forePen"); + else + DeleteObject(oldPen); + } + if ((foreBrush = CreateSolidBrush(fore_Pixel)) == NULL) { + Win32Error("SetForeColor/CreateSolidBrush failed."); + } + else { + if ((oldBrush = SelectObject(foreGC, foreBrush)) == NULL) + Win32Error("SelectObject/foreGC foreBrush"); + else + DeleteObject(oldBrush); + } +#endif +} + +void SetBackColor(COLORREF c) +{ +#if DEBUG_COLOR + fprintf(stderr, "Setting back color to %-8x\nbefore :\n", c); + dump_colors("SetBackColor"); + fprintf(stderr, "current_page %d, last change (%d, %-8x)\n", + current_page, PageBackColor[LastBackChange].page, + PageBackColor[LastBackChange].color); +#endif + + if (c != back_Pixel) + bColorPage = TRUE; + + back_Pixel = c; + + if (current_page > PageBackColor[LastBackChange].page) { + LastBackChange++; + fprintf(stderr, "adding new last change (%d, %-8x)\n", + current_page, back_Pixel); + + PageBackColor[LastBackChange].color = back_Pixel; + PageBackColor[LastBackChange].page = current_page; + } + /* Do not allow resource leaks ! */ + if (backBrush) + DeleteObject(backBrush); + + backBrush = CreateSolidBrush(back_Pixel); + +#if DEBUG_COLOR + fprintf(stderr, "SetBackColor: creating new back brush %-8x\n", back_Pixel); +#endif +#if 0 + if (! isPrinting) + SendMessage(hWndDraw, WM_ERASEBKGND, GetDC(currwin.win), 0); +#endif + +} + +/* + This should be called only once at the very beginning of the + current dvi file. + */ + +void initcolor() +{ + int i; + extern int pen_size; + /* Setup default color as black, background color as white */ + + /* Free any used resources */ + CRefFree(scan_fore_colors); + CRefFree(color_stack); + + if (LastForeChange > 0) { + for (i = 0; i < LastForeChange; i++) { + if (PageForeColor[i].stack) + CRefFree(PageForeColor[i].stack); + } + } + scanned_page = scanned_page_reset = -1; + + fore_Pixel = string_to_colorref(resource.fore_color); + back_Pixel = string_to_colorref(resource.back_color); + + LastForeChange = 0; + PageForeColor[0].color = fore_Pixel; + PageForeColor[0].page = 0; + + if (forePen) + if (!DeleteObject(forePen)) + Win32Error("init_colors/DeleteObject/forePen"); + if ((forePen = CreatePen(PS_SOLID, 1, fore_Pixel)) == NULL) { + Win32Error("init_colors/CreatePen(fore_pixel) failed."); + } + if (foreBrush) + if (!DeleteObject(foreBrush)) + Win32Error("init_colors/DeleteObject/foreBrush"); + if ((foreBrush = CreateSolidBrush(fore_Pixel)) == NULL) { + Win32Error("init_colors/CreateSolidBrush(fore_pixel) failed."); + } + + if (foreTPicPen) + DeleteObject(foreTPicPen); + foreTPicPen = CreatePen(PS_SOLID, pen_size, fore_Pixel); + if (foreTPicBrush) + DeleteObject(foreTPicBrush); + foreTPicBrush = CreateSolidBrush(fore_Pixel); + + LastBackChange = 0; + PageBackColor[0].color = back_Pixel; + PageBackColor[0].page = -1; + + if (backBrush) + DeleteObject(backBrush); + backBrush = CreateSolidBrush(back_Pixel); + + + scan_fore_colors = InitCRefStack(COLOR_STACK_DEPTH); + color_stack = InitCRefStack(COLOR_STACK_DEPTH); + + CRefPush(scan_fore_colors, fore_Pixel ); + CRefPush(color_stack, fore_Pixel); + + if (maneBitsPixel <= 8) + initialize_palette(); + +#if DEBUG_COLOR + fprintf(stderr, "initcolor() called\n"); +#endif + init_colors(); +} diff --git a/Build/source/texk/windvi/windib.c b/Build/source/texk/windvi/windib.c new file mode 100644 index 00000000000..0e532a5d453 --- /dev/null +++ b/Build/source/texk/windvi/windib.c @@ -0,0 +1,24 @@ +/* + windib.c : implementation file + Time-stamp: "99/07/18 00:52:50 popineau" + + Copyright (C) 1999 + Fabrice Popineau <Fabrice.Popineau@supelec.fr> + + This file is part of Windvi. + + Windvi 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. + + Windvi 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 Yap; if not, write to the Free Software Foundation, 59 + Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + + diff --git a/Build/source/texk/windvi/windraw.c b/Build/source/texk/windvi/windraw.c new file mode 100644 index 00000000000..67726684b23 --- /dev/null +++ b/Build/source/texk/windvi/windraw.c @@ -0,0 +1,1578 @@ +#include "wingui.h" +#include "xdvi-config.h" +#include "gsdll.h" +#include "version.h" + +#ifndef WIN32 +#include "WWWLib.h" +#include "WWWInit.h" +#endif + +#ifdef HTEX +/* Application name and version for w3c-libwww routines. + This is what will show up in httpd's agent_log files. +*/ +#ifdef Omega +char *HTAppName = "owindvi"; +#else +char *HTAppName = "windvi"; +#endif +char *HTAppVersion = XDVERSION; + +/* Create the anchor information stuff at the bottom of the page */ + +/* Anchor search: a dialog box */ +/* anchorinfo = Ascii text widget */ + +char anchorsearchstring[1024]; +char anchorask[] = "Access new URL:"; + +#endif + +#define mask_mag(ev) ((ev & (MK_LBUTTON | MK_MBUTTON | MK_RBUTTON)) && !(ev & (MK_SHIFT | MK_CONTROL))) +#define mask_sethome(ev) ((ev & MK_LBUTTON) && (ev & MK_SHIFT)) +#define mask_srcspecial(ev) ((ev & MK_RBUTTON) && (ev & MK_SHIFT)) +#define mask_opennewframe(ev) ((ev & MK_LBUTTON) && (ev & MK_CONTROL)) + +/***************************************************************************** + Drawing child window + ****************************************************************************/ +HWND hWndDraw; +BOOL bDrawKeep = FALSE; +HDC hdcDrawSave = 0; +static HRGN hrgnScroll = 0; + +LRESULT CALLBACK DrawProc(HWND, UINT, WPARAM, LPARAM); + +/* Drawing window message table definition. */ +MSD rgmsdDraw[] = +{ + {WM_CREATE, MsgDrawCreate }, + /* {WM_SIZE, MsgDrawSize }, */ + {WM_HSCROLL, MsgDrawHScroll }, + {WM_VSCROLL, MsgDrawVScroll }, + {WM_MOUSEMOVE, MsgDrawMousemove }, + /* {WM_COMMAND, MsgDrawCommand }, */ + {WM_PAINT, MsgDrawPaint }, + /* {WM_ERASEBKGND, MsgDrawEraseBkgnd}, */ + /* {WM_NCPAINT, MsgDrawNCPaint }, */ + {WM_LBUTTONDOWN,MsgDrawEnterMagL }, + {WM_LBUTTONUP, MsgDrawQuitMagL }, + {WM_MBUTTONDOWN,MsgDrawEnterMagM }, + {WM_MBUTTONUP, MsgDrawQuitMagL }, + {WM_RBUTTONDOWN,MsgDrawEnterMagR }, + {WM_RBUTTONUP, MsgDrawQuitMagL } +}; + +MSDI msdiDraw = +{ + sizeof(rgmsdDraw) / sizeof(MSD), + rgmsdDraw, + edwpWindow +}; + +/* Drawing window command table definition. */ +CMD rgcmdDraw[] = +{ + {IDM_FILEOPEN, CmdStub} +}; + +CMDI cmdiDraw = +{ + sizeof(rgcmdDraw) / sizeof(CMD), + rgcmdDraw, + edwpNone +}; + +/***************************************************************************** + Magnifying child window + ****************************************************************************/ +HWND hWndMagnify; +HDC magDC, magMemDC; +BOOL bMagDisp = FALSE; /* Mag. Glass is displayed */ +BOOL bSetHome = FALSE; /* User is setting home position */ +BOOL bSrcSpecial = FALSE; /* User wants to jump to the next src special */ + +int magWidth, magHeight; + +LRESULT CALLBACK MagnifyProc(HWND, UINT, WPARAM, LPARAM); + +/* Magnifying window message table definition. */ +MSD rgmsdMagnify[] = +{ + {WM_CREATE, MsgMagnifyCreate }, + /* {WM_SIZE, MsgMagnifySize }, + {WM_HSCROLL, MsgMagnifyHScroll }, + {WM_VSCROLL, MsgMagnifyVScroll }, + {WM_MOUSEMOVE, MsgMagnifyMousemove }, + {WM_COMMAND, MsgMagnifyCommand }, */ + /* {WM_ERASEBKGND, MsgMagnifyEraseBkgnd}, */ + {WM_PAINT, MsgMagnifyPaint } +}; + +MSDI msdiMagnify = +{ + sizeof(rgmsdMagnify) / sizeof(MSD), + rgmsdMagnify, + edwpWindow +}; + +/* Magnifying window command table definition. */ +CMD rgcmdMagnify[] = +{ + {IDM_FILEOPEN, CmdStub} +}; + +CMDI cmdiMagnify = +{ + sizeof(rgcmdMagnify) / sizeof(CMD), + rgcmdMagnify, + edwpNone +}; + +/* + + Magnifying glass + + */ +BOOL CreateMagnify(HWND hwndParent) +{ + extern HBRUSH foreBrush, backBrush; + extern HPEN forePen; + + hWndMagnify = CreateWindow("MagnifyGlass", + NULL, + WS_BORDER | WS_POPUP | WS_DISABLED, + /* | WS_CLIPSIBLINGS, */ + 0, 0, 50, 50, + hwndParent, + NULL, + hInst, + NULL); + if (hWndMagnify == NULL) { + Win32Error("CreateWindow/Magnify"); + return FALSE; + } + alt.win = hWndMagnify; + magDC = GetDC(hWndMagnify); + +#if 1 +#ifdef TRANSFORM + if (IS_NT) + SetGraphicsMode(magDC, GM_ADVANCED); +#endif +#endif + + if (resource.in_memory) { + magMemDC = CreateCompatibleDC(magDC); +#ifdef TRANSFORM + if (IS_NT) + SetGraphicsMode(magDC, GM_ADVANCED); +#endif + } + else { + magMemDC = magDC; + } + + SetBkMode(magDC, OPAQUE); + SetBkColor(magDC, back_Pixel); + + return TRUE; +} + + +LRESULT CALLBACK MagnifyProc(HWND hwnd, UINT uMessage, + WPARAM wparam, LPARAM lparam) +{ + return DispMessage(&msdiMagnify, hwnd, uMessage, wparam, lparam); +} + +LRESULT MsgMagnifyCreate(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + RECT r; +#if 0 + GetClientRect(hwnd, &r); + if (wparam) FillRect((HDC)wparam, &r, backBrush); +#endif + return 0; +} + +LRESULT MsgMagnifyEraseBkgnd(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + RECT r; + GetClientRect(hwnd, &r); + FillRect((HDC)wparam, &r, backBrush); + return TRUE; +} + +LRESULT MsgMagnifyPaint(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + PAINTSTRUCT ps; + POINT ptOrg = { 0, 0}; + + BeginPaint(hwnd, &ps); + + GetWindowOrgEx(maneDrawDC, &ptOrg); + + if (resource.in_memory) { + HBRUSH oldBrush; +#if 0 + oldBrush = SelectObject(magDC, foreBrush); +#endif + /* We have to paint in ps.rcPaint, from memory dib. */ + if (!BitBlt(magDC, + ps.rcPaint.left, ps.rcPaint.top, + ps.rcPaint.right - ps.rcPaint.left, + ps.rcPaint.bottom - ps.rcPaint.top, + magMemDC, + ps.rcPaint.left, + ps.rcPaint.top, SRCCOPY)) + Win32Error("Draw Magnify/BitBlt"); +#if 0 + SelectObject(magDC, oldBrush); +#endif + } + else { + /* We have to paint directly onto the screen */ + extern void redraw(struct WindowRec *); + RECT altRect; + + /* swapping to mag. glass device contexts */ + foreGC = ruleGC = highGC = ps.hdc; + + alt.base_x = (xMousePos + xCurrentScroll + ptOrg.x)*mane.shrinkfactor - magWidth; + alt.base_y = (yMousePos + yCurrentScroll + ptOrg.y)*mane.shrinkfactor - magHeight; + alt.min_x = ps.rcPaint.left; + alt.min_y = ps.rcPaint.top; + alt.max_x = ps.rcPaint.right; + alt.max_y = ps.rcPaint.bottom; + alt.width = ps.rcPaint.right - ps.rcPaint.left; + alt.height = ps.rcPaint.bottom - ps.rcPaint.bottom; +#if 0 + fprintf(stderr, "Painting in base (%d %d) (%d %d) - (%d %d)\n", + alt.base_x, alt.base_y, alt.min_x, alt.min_y, alt.max_x, alt.max_y); +#endif +#if 1 + /* draw background */ + { + RECT rectBg; + rectBg.left = max(0, alt.min_x); + rectBg.top = max(0, alt.min_y); + rectBg.right = min(alt.max_x, unshrunk_paper_w - alt.base_x); + rectBg.bottom = min(alt.max_y, unshrunk_paper_h - alt.base_y); + FillRect(magDC, &rectBg, backBrush); + } +#if 0 + draw_rulers(alt.width, alt.height, magDC); +#endif +#endif + allowDrawingChars = TRUE; + redraw(&alt); + + if (resource.reverse) { + PatBlt(foreGC, alt.min_x, alt.min_y, alt.max_x, alt.max_y, DSTINVERT); + } + /* and back to drawing window dcs */ + foreGC = ruleGC = highGC = maneDrawDC; + } + + EndPaint(hwnd, &ps); + return 0; +} + +/* + Process messages for the about box. + */ + +LRESULT CALLBACK DrawProc(HWND hwnd, UINT uMessage, + WPARAM wparam, LPARAM lparam) +{ + return DispMessage(&msdiDraw, hwnd, uMessage, wparam, lparam); +} + +/* + CreateDraw(hWndParent) : creates the drawing window (child with + scrollbars). + */ +BOOL CreateDraw(HWND hwndParent) +{ + hWndDraw = CreateWindowEx(WS_EX_CLIENTEDGE, + TEXT("ClientDrawClass"), + NULL, + WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS + | WS_HSCROLL | WS_VSCROLL, + -100, -100, 10, 10, + hwndParent, + NULL, + hInst, + NULL); + if (hWndDraw == NULL) { + Win32Error("CreateWindowEx"); + return FALSE; + } + + /* Initialize all graphic related variables */ + + InitGlobalsDraw(); + + SizeClientWindow(hWndDraw); + SetScrollBars(hWndDraw); + SetCursor(hCursArrow); + ShowWindow(hWndDraw, SW_SHOW); + + make_temporary_dir(&temporary_dir); /* For storing temporary files... */ + + if (dvi_name) { + char *title_name; + char *icon_name; + + /* + * Open the dvi file and set titles + */ + set_directory_dvifile(); +#ifdef HTEX +#ifndef WIN32 + { + char *cp = getenv("WWWBROWSER"); + if (cp) browser = cp; + } + HTProfile_newPreemptiveClient(HTAppName, HTAppVersion); + HTCacheMode_setEnabled(NO); + +#if 0 + /* Optionally, turn on tracing of WWW library calls. */ + if (debug & DBG_HYPER) { + WWWTRACE = SHOW_STREAM_TRACE; + } +#endif +#endif /* WIN32 */ + +#if T1 + /* At this point DISP, our_visual, our_depth and our_colormap must + be defined, and they are */ + init_t1(); +#endif + + /* Open the input file. Turn filename into URL first if needed */ + URL_aware = TRUE; + + if (!(URLbase || htex_is_url(dvi_name))) { + char *new_name; + int n; + + n = strlen(dvi_name); + new_name = dvi_name; + /* Find the right filename */ + if (n < sizeof(".dvi") + || strcmp(dvi_name + n - sizeof(".dvi") + 1, ".dvi") != 0) { + dvi_name = xmalloc((unsigned) n + sizeof(".dvi")); + Strcpy(dvi_name, new_name); + Strcat(dvi_name, ".dvi"); + /* Atempt $dvi_name.dvi */ + dvi_file = xfopen(dvi_name, OPEN_MODE); + if (dvi_file == NULL) { + /* Didn't work, revert to original $dvi_name */ + free(dvi_name); + dvi_name = new_name; + } + } + + /* Turn filename into URL */ + /* Escape dangers, esp. # from emacs */ +#ifdef WIN32 + new_name = xmalloc((unsigned) strlen(dvi_name)+6); + strcat(strcpy(new_name,"file:"),dvi_name); + free(dvi_name); + dvi_name = new_name; +#else + new_name=HTEscape(dvi_name,URL_PATH); + free(dvi_name); + dvi_name = xmalloc((unsigned) strlen(new_name)+6); + strcat(strcpy(dvi_name,"file:"),new_name); +#endif + /* Now we have the right filename, in a URL */ + } + +#if 0 + __asm int 3; +#endif + detach_anchor(); + if (!open_www_file()) { + fprintf(stderr,"Could not open dvi file. Exiting.\n"); + Exit(1); + } + htex_reinit(); + URL_aware = FALSE; +#else + open_dvi_file(); +#endif /* not HTEX */ + +#ifdef XFORM + reset_xform_stack(); +#endif +#ifdef SRC_SPECIALS + src_delete_all_specials(); +#endif + if (curr_page) { + current_page = (*curr_page ? atoi(curr_page) : total_pages) - 1; + if (current_page < 0 || current_page >= total_pages) usage(); + } +#if 1 + set_icon_and_title (dvi_name, &icon_name, &title_name, 1); +#endif + + { + int new_shrink; + if (resource.shrinkfactor <= 0) + new_shrink = ChooseShrink(); + else + new_shrink = resource.shrinkfactor; + + reconfig(); + ChangeZoom(new_shrink); +#if 0 + redraw_page(); + ChangePage(0); + /* FIXME : why 2 calls ? */ + redraw_page(); +#endif + ChangePage(0); + } + } + + return TRUE; +} + +#if 0 +LRESULT MsgDrawCommand(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + return 0; +} + +LRESULT MsgDrawNCPaint(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + fprintf(stderr, "NC Paint hwnd = %x, wparam = %x, lparam = %x\n", + hwnd, wparam, lparam); + /* return DefWindowProc(hwnd, uMessage, wparam, lparam); */ + return 0; +} +#endif + +LRESULT MsgDrawMousemove(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + char szBuf[80]; /* Array for formatting mouse coordinates */ + RECT altRect, oldRect; + extern void redraw(struct WindowRec *); + extern double p2u_factor; + extern const char *pos_format; +#if 0 + HRGN hrgnMag; + RECT clipRect; +#endif + int xDelta, yDelta; + POINT ptOrg = { 0, 0}; + + GetWindowOrgEx(maneDrawDC, &ptOrg); + + xMousePos = LOWORD(lparam); + yMousePos = HIWORD(lparam); + + if (bMagDisp && mask_mag(wparam)) { + POINT absPos; + /* redraw mag. glass content */ + + /* adjust magnifying glass position */ + GetWindowRect(hWndMagnify, &oldRect); + absPos.x = xMousePos - magWidth - 1; + absPos.y = yMousePos - magHeight - 1; + ClientToScreen(hwnd, &absPos); + if (SetWindowPos(hWndMagnify, HWND_TOPMOST, + absPos.x, absPos.y, + magWidth*2/* +2 */, magHeight*2 /* +2 */, + SWP_NOACTIVATE | SWP_NOSIZE /* | SWP_SHOWWINDOW */ + /* | SWP_NOCOPYBITS */ + | SWP_NOOWNERZORDER | SWP_NOZORDER) == 0) + Win32Error("SetWindowPos"); + UpdateWindow(hwnd); +#if 1 + /* UpdateWindow(hWndMagnify); */ + /* Need to redisplay the toolbar too ! */ + UpdateWindow(hWndToolbar); +#endif + /* + Redraw the in-memory bitmap for the mag. glass + */ + alt.base_x = (xMousePos + xCurrentScroll)*mane.shrinkfactor - magWidth; + alt.base_y = (yMousePos + yCurrentScroll)*mane.shrinkfactor - magHeight; + GetClientRect(alt.win, &altRect); + alt.min_x = altRect.left; + alt.min_y = altRect.top; + alt.width = altRect.right - altRect.left; + alt.height = altRect.bottom - altRect.top; + alt.max_x = altRect.right; + alt.max_y = altRect.bottom; + + /* Better than invalidating the whole rectangle, scroll the window */ + xDelta = (oldRect.left - absPos.x)*mane.shrinkfactor; + yDelta = (oldRect.top - absPos.y)*mane.shrinkfactor; + +#if 0 + /* FIXME : the whol mag glass is redrawn, not only the part invalidated + or is this because the laptop has no advanced graphic feature ? */ + fprintf(stderr, "scrolling by %d %d\n", xDelta, yDelta); +#endif + if (xDelta || yDelta) { + RECT prcUpdate; + if (ScrollWindowEx(hWndMagnify, + xDelta, yDelta, + NULL, NULL, NULL, &prcUpdate, + SW_INVALIDATE | SW_ERASE ) == ERROR) + Win32Error("ScrollWindowEx"); +#if 0 + fprintf(stderr, "prcUpdate : (%d %d) - (%d %d) mag (%d %d)\n", + prcUpdate.left, prcUpdate.top, + prcUpdate.right, prcUpdate.bottom, magWidth, magHeight); +#endif + } + + if (resource.in_memory) { +#if 0 + SelectObject(magMemDC, backBrush); +#endif + if (!FillRect(magMemDC, &altRect, backBrush)) + Win32Error("FillRect Magnifying Glass"); +#if 0 + /* FIXME : it would be nice to see the page's border in the mag. glass */ + PatBlt(magMemDC, + max(alt.min_x, -alt.base_x), + max(alt.min_y, -alt.base_y), + min(alt.max_x, ), + min(alt.max_y, ), + WHITENESS); +#endif + redraw(&alt); + /* FIXME : how to put these rulers once for all and bitblt + on top of them ? */ +#if 0 + draw_rulers(alt.width, alt.height, magMemDC); +#endif + } + UpdateWindow(hWndMagnify); + } + sprintf(szBuf, pos_format, + (xMousePos + xCurrentScroll + ptOrg.x) * mane.shrinkfactor * p2u_factor, + (yMousePos + yCurrentScroll + ptOrg.y) * mane.shrinkfactor * p2u_factor); + UpdateStatusBar(szBuf, 6, 0); + return 0; +} + +void +EnterMag(HWND hwnd, int xMousePos, int yMousePos) +{ + RECT rcClient, rcPage, rcClip, rcMag; + POINT ptClientUL, ptClientLR; + POINT mousePos, absPos, wndOrg; + + extern int numColors; + HWND hWndTop = GetTopWindow(NULL); + + /* Retrieve the page dimensions */ + rcPage.left = 0; + rcPage.top = 0; + rcPage.right = page_w - 1; + rcPage.bottom = page_h - 1; + + /* Get Window origin */ + GetWindowOrgEx(maneDrawDC, &wndOrg); + + mousePos.x = xMousePos + wndOrg.x; + mousePos.y = yMousePos + wndOrg.y; + + if (!PtInRect(&rcPage, mousePos)) { + return; + } + + if (1 /* hWndTop == hWndMain */) { + RECT rc; +#if 0 + fprintf(stderr, "Entering mag and saving main window\n"); +#endif + GetClientRect(hWndMain,&rc); + BitBlt(hdcDrawSave, 0,0,rc.right,rc.bottom, + maneDC, 0,0,SRCCOPY); + bDrawKeep = TRUE; + } + + /* FIXME: this causes a redisplay bug if xdvi is not the topmost + window */ + bMagDisp = TRUE; + + /* Capture mouse input */ + SetCapture(hwnd); + /* Retrieve the screen coordinates of the client area, + and convert them into client coordinates. */ + GetClientRect(hwnd, &rcClient); + /* Intersect both rectangles. The mag. glass will be limited + to the actual visible part of the page. */ + IntersectRect(&rcClip, &rcClient, &rcPage); + ptClientUL.x = rcClip.left; + ptClientUL.y = rcClip.top; + /* Add one to the right and bottom sides, because the + coordinates retrieved by GetClientRect do not + include the far left and lowermost pixels. */ + ptClientLR.x = rcClip.right; + ptClientLR.y = rcClip.bottom; + + /* FIXME : GetWindowOrgEx() to translate the points */ + ClientToScreen(hwnd, &ptClientUL); + ClientToScreen(hwnd, &ptClientLR); + /* Copy the client coordinates of the client area + to the rcClip structure. Confine the mouse cursor + to the client area by passing the rcClip structure + to the ClipCursor function. */ +#if 0 + fprintf(stderr, "Org %d %d\n", wndOrg.x, wndOrg.y); +#endif + SetRect(&rcClip, + ptClientUL.x - wndOrg.x, + ptClientUL.y - wndOrg.y, + ptClientLR.x - wndOrg.x, + ptClientLR.y - wndOrg.y); + ClipCursor(&rcClip); + /* Calculates the new position and size of the magnifying glass */ + mousePos.x = xMousePos - magWidth - 1; + mousePos.y = yMousePos - magHeight - 1; + /* ClientToScreen(hwnd, &mousePos); */ + rcMag.left = mousePos.x + 1; + rcMag.top = mousePos.y + 1; + /* FIXME : +1 ? */ + rcMag.right = rcMag.left + 2*magWidth + 1; + rcMag.bottom = rcMag.top + 2*magHeight + 1; + + if (resource.in_memory) { + if (oldmagDIB) { + /* There is an old magDIB, put it back in the DC + and delete the current one */ + if ((magDIB = SelectObject(magMemDC, oldmagDIB)) == NULL) + Win32Error("SelectObject/oldmagDIB"); + if (DeleteObject(magDIB) == FALSE) + Win32Error("DeleteObject/magDIB"); + } + + magDIB = CreateDIB(magMemDC, 2*magWidth, 2*magHeight, 16, NULL, NULL); + if ((oldmagDIB = SelectObject(magMemDC, magDIB)) == NULL) + Win32Error("SelectObject/magDIB"); + + if (!FillRect(magMemDC, &rcMag, backBrush)) + Win32Error("FillRect magMemDC background"); + + foreGC = ruleGC = highGC = magMemDC; + } + + /* redraw mag. glass content */ + absPos.x = xMousePos - magWidth - 1; + absPos.y = yMousePos - magHeight - 1; + ClientToScreen(hwnd, &absPos); + if (SetWindowPos(hWndMagnify, HWND_TOPMOST, + absPos.x, + absPos.y, magWidth*2/*+2*/, magHeight*2/*+2*/, + SWP_NOACTIVATE | SWP_SHOWWINDOW + | SWP_NOOWNERZORDER | SWP_NOZORDER) == 0) + Win32Error("SetWindowPos"); + /* ShowWindow(hWndMagnify, SW_SHOW); */ +} + +LRESULT MsgDrawEnterMagL(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + if (bSkipFirstClick) { + bSkipFirstClick = FALSE; + return 0; + } + + if (bMagDisp || bSetHome) + return 0; + + if (mask_sethome(wparam)) { + RECT rcClip, rcPage, rcClient; + POINT ptClientUL, ptClientLR; + bSetHome = TRUE; + SetCursor(hCursCross); + SetCapture(hwnd); + /* Retrieve the screen coordinates of the client area, + and convert them into client coordinates. */ + GetClientRect(hwnd, &rcClient); + /* Retrieve the page dimensions */ + rcPage.top = rcPage.left = 0; + rcPage.right = page_w - 1; + rcPage.bottom = page_h - 1; + /* Intersect both rectangles. The mag. glass will be limited + to the actual visible part of the page. */ + IntersectRect(&rcClip, &rcClient, &rcPage); + ptClientUL.x = rcClip.left; + ptClientUL.y = rcClip.top; + /* Add one to the right and bottom sides, because the + coordinates retrieved by GetClientRect do not + include the far left and lowermost pixels. */ + ptClientLR.x = rcClip.right; + ptClientLR.y = rcClip.bottom; + ClientToScreen(hwnd, &ptClientUL); + ClientToScreen(hwnd, &ptClientLR); + /* Copy the client coordinates of the client area + to the rcClip structure. Confine the mouse cursor + to the client area by passing the rcClip structure + to the ClipCursor function. */ + SetRect(&rcClip, ptClientUL.x, ptClientUL.y, + ptClientLR.x, ptClientLR.y); + ClipCursor(&rcClip); + UpdateStatusBar("Setting home position...", 0, 0); + } + else { +#ifdef HTEX + int x, y; + if (mask_opennewframe(wparam)) { + HTeXnext_extern = 1; + } + else { + HTeXnext_extern = 0; + } + if (pointerlocate(&x, &y)) { + /* Only do this if there's actually an href right there */ + int ret; + /* screen_to_page(&mane,x,y,&page,&px,&py); */ + ret = htex_handleref(current_page, x, y); + HTeXnext_extern = 0; + if (ret == 1) return 0; + } +#endif + magWidth = mg_size[0].w / 2; + magHeight = mg_size[0].h / 2; + EnterMag(hwnd, LOWORD(lparam), HIWORD(lparam)); + } + return 0; +} + +LRESULT MsgDrawEnterMagM(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ +#if 0 + /* Allow to open a new frame only if not running in single + instance mode ! */ + if (!resource.single_flag) { + int x, y; + if (pointerlocate(&x, &y)) { + /* Only do this if there's actually an href right there */ + int ret; + /* screen_to_page(&mane,x,y,&page,&px,&py); */ + HTeXnext_extern = 1; + ret = htex_handleref(current_page, x, y); + HTeXnext_extern = 0; + if (ret == 1) return 0; + } + } +#endif + if (bSkipFirstClick) { + bSkipFirstClick = FALSE; + return 0; + } + + if (bMagDisp || bSetHome) + return 0; + + magWidth = mg_size[1].w / 2; + magHeight = mg_size[1].h / 2; + EnterMag(hwnd, LOWORD(lparam), HIWORD(lparam)); + + return 0; +} + +LRESULT MsgDrawEnterMagR(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + if (bSkipFirstClick) { + bSkipFirstClick = FALSE; + return 0; + } + if (bMagDisp || bSetHome) + return 0; + +#ifdef SRC_SPECIALS + if (mask_srcspecial(wparam)) { + if (src_evalMode) { + int x, y; + POINT ptOrg = { 0, 0}; + GetWindowOrgEx(maneDrawDC, &ptOrg); + x = min(xMousePos + xCurrentScroll + ptOrg.x, (unsigned)page_w)/* * mane.shrinkfactor */; + y = min(yMousePos + yCurrentScroll + ptOrg.y, (unsigned)page_h)/* * mane.shrinkfactor */; + src_find_special(1, x, y); + } + } + else +#endif + { + magWidth = mg_size[2].w / 2; + magHeight = mg_size[2].h / 2; + EnterMag(hwnd, LOWORD(lparam), HIWORD(lparam)); + } + return 0; +} + +LRESULT MsgDrawQuitMagL(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + POINT ptOrg = { 0, 0}; + + GetWindowOrgEx(maneDrawDC, &ptOrg); + + if (bSetHome) { + char szBuf[128]; + /* Restore cursor */ + bSetHome = FALSE; + ClipCursor(NULL); + ReleaseCapture(); + SetCursor(hCursArrow); + home_x = min(xMousePos + xCurrentScroll + ptOrg.x, (unsigned)page_w) * mane.shrinkfactor; + home_y = min(yMousePos + yCurrentScroll + ptOrg.y, (unsigned)page_h) * mane.shrinkfactor; + if (resource.sidemargin) free(resource.sidemargin); + resource.sidemargin = pixtoa(home_x); + if (resource.topmargin) free(resource.topmargin); + resource.topmargin = pixtoa(home_y); + + wsprintf(szBuf, "Setting home to %5d, %5d", home_x, home_y); + UpdateStatusBar(szBuf, 0, 0); + } + else if (bMagDisp) { + /* removes the window */ + foreGC = ruleGC = highGC = maneDrawDC; + ShowWindow(hWndMagnify, SW_HIDE); + bMagDisp = FALSE; + UpdateWindow(hWndDraw); + /* restores the old shrink factor and redisplay page */ + ClipCursor(NULL); + ReleaseCapture(); + } + return 0; +} + +LRESULT MsgDrawCreate(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + HDC hDC = GetDC(hwnd); + HBITMAP hBitmap; + int width, height; + + /* Scroll Bars */ + xMinScroll = 0; + xMaxScroll = page_w; + /* mane.base_x = */xCurrentScroll = 0; + + yMinScroll = 0; + yMaxScroll = page_h; + /* mane.base_y = */yCurrentScroll = yMinScroll; + + fScroll = FALSE; + fSize = FALSE; + + /* When the main window is created, allocate a memory context */ + /* of the appropriate size */ + hdcDrawSave = CreateCompatibleDC(hDC); + /* Create a bitmap buffer for hdcMemSave that is */ + /* the same size as the physical screen */ + width = GetDeviceCaps(hDC, HORZRES); + height = GetDeviceCaps(hDC, VERTRES); + hBitmap = CreateCompatibleBitmap(hDC, width, height); + SelectObject(hdcDrawSave, hBitmap); + DeleteObject(hBitmap); + ReleaseDC(hwnd,hDC); + +#if 0 + /* Scrolled Region */ + if (hrgnScroll ==0) + hrgnScroll = CreateRectRgn(0, 0, 10, 10); +#endif + return 0; +} + +LRESULT MsgDrawHScroll(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + RECT r; + int xDelta; + int xNewPos; + int yDelta = 0; + + bDrawKeep = FALSE; + + GetClientRect(hwnd, &r); + + switch (LOWORD(wparam)) { + case SB_TOP: + xNewPos = xMinScroll; + break; + case SB_BOTTOM: + xNewPos = xMaxScroll; + break; + case SB_PAGEUP: + xNewPos = xCurrentScroll - (((r.right - r.left) * 2) / 3); + break; + case SB_PAGEDOWN: + xNewPos = xCurrentScroll + (((r.right - r.left) * 2) / 3); + break; + case SB_LINEUP: + xNewPos = xCurrentScroll - 5; + break; + case SB_LINEDOWN: + xNewPos = xCurrentScroll + 5; + break; + case SB_THUMBPOSITION: + xNewPos = HIWORD(wparam); + break; + default: + xNewPos = xCurrentScroll; + } + + + xNewPos = max(xMinScroll, xNewPos); + xNewPos = min(xMaxScroll - max(r.right - 1, 0), xNewPos); + +#if 0 + fprintf(stderr, "r.right = %d [%d %d %d]\n", + r.right, xMinScroll, xCurrentScroll, xMaxScroll); + fprintf(stderr, "xNewPos = %d\n", xNewPos); +#endif + + if (xNewPos == xCurrentScroll) + return 0; + + fScroll = TRUE; + + xDelta = xNewPos - xCurrentScroll; + /* mane.base_x = */xCurrentScroll = xNewPos; + ScrollWindowEx(hwnd, -xDelta, -yDelta, NULL, NULL, + (HRGN)NULL, (LPRECT)NULL, + SW_INVALIDATE | SW_ERASE); +#if 1 + UpdateWindow(hwnd); +#endif + si.cbSize = sizeof(si); + si.fMask = SIF_POS; + si.nPos = xCurrentScroll; + SetScrollInfo(hwnd, SB_HORZ, &si, TRUE); + return 0; +} + +LRESULT MsgDrawVScroll(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + RECT r; + + int xDelta = 0; + int yNewPos; + int yDelta; + + bDrawKeep = FALSE; + + GetClientRect(hwnd, &r); + if (yCurrentScroll == yMinScroll + && current_page > 0 + && (LOWORD(wparam) == SB_TOP + || LOWORD(wparam) == SB_PAGEUP + /* || LOWORD(wparam) == SB_LINEUP */)) { + ChangePage(-1); + wparam = MAKEWORD(SB_BOTTOM, HIWORD(wparam)); + } + else if (yCurrentScroll == yMaxScroll - max(r.bottom - 1, 0) + && current_page < total_pages - 1 + && (LOWORD(wparam) == SB_BOTTOM + || LOWORD(wparam) == SB_PAGEDOWN + /* || LOWORD(wparam) == SB_LINEDOWN */)) { + ChangePage(+1); + wparam = MAKEWORD(SB_TOP, HIWORD(wparam)); + } + switch (LOWORD(wparam)) { + case SB_TOP: + yNewPos = yMinScroll; + break; + case SB_BOTTOM: + yNewPos = yMaxScroll; + break; + case SB_PAGEUP: + yNewPos = yCurrentScroll - (((r.bottom - r.top) * 2) / 3); + break; + case SB_PAGEDOWN: + yNewPos = yCurrentScroll + (((r.bottom - r.top) * 2) / 3); + break; + case SB_LINEUP: + yNewPos = yCurrentScroll - 5; + break; + case SB_LINEDOWN: + yNewPos = yCurrentScroll + 5; + break; + case SB_THUMBPOSITION: + yNewPos = HIWORD(wparam); + break; + default: + yNewPos = yCurrentScroll; + } + yNewPos = max(yMinScroll, yNewPos); + yNewPos = min(yMaxScroll - max(r.bottom - 1, 0), yNewPos); + + if (yNewPos == yCurrentScroll) + return 0; + + fScroll = TRUE; + + yDelta = yNewPos - yCurrentScroll; + /* mane.base_y = */yCurrentScroll = yNewPos; + ScrollWindowEx(hwnd, -xDelta, -yDelta, NULL, NULL, + (HRGN)NULL, (LPRECT)NULL, + SW_INVALIDATE | SW_ERASE); +#if 0 + UpdateWindow(hwnd); +#endif + + si.cbSize = sizeof(si); + si.fMask = SIF_POS; + si.nPos = yCurrentScroll; + SetScrollInfo(hwnd, SB_VERT, &si, TRUE); + return 0; +} + +LRESULT MsgDrawEraseBkgnd(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + RECT r; + HDC hdc = (HDC)wparam; + + if (isPrinting) return TRUE; + + GetClientRect(hwnd, &r); + + if (resource.in_memory) { + FillRect(hdc, &r, GetStockObject (LTGRAY_BRUSH)); + } + else { + + if (debug & DBG_EVENT) + fprintf(stderr, "Erasing background with colors %x\n", back_Pixel); + + FillRect(hdc, &r, GetStockObject (LTGRAY_BRUSH)); + if (dvi_file) { + r.bottom = min(page_h - yCurrentScroll, r.bottom); + r.right = min(page_w - xCurrentScroll, r.right); + + if (debug & DBG_EVENT) + fprintf(stderr, "Erasing background, Page is in (%d x %d)\n", + r.right, r.bottom); + + FillRect(hdc, &r, backBrush); + + } + } + return TRUE; +} + +/* + We have 2 alternatives : + + - using a page for the text and BitBlt'ing this page onto the screen + But there is a serious drawback : at scale 1 and 600dpi, a color + page is about 34Mb... Not anybody can afford this easily. At least + not W9x users. So we have to do banding. Anyway, this is needed for + printing. This is the only way to guarantee that the file will be + printed on any printer. + + - directly drawing on the screen. This is rather efficient for the display. + + We choose among these 2 methods thanks to the resource.in_memory flag. +*/ + +void DrawInMemory(HDC hdcDest, HDC hdcFrom, LPRECT lprcPaint) +{ + unsigned int rop; + RECT rcGSPaint; + extern void reset_xfrm_stack(void); + + /* If no file open, just return */ + if (!dvi_name || !*dvi_name) + return; + + if (!bMagDisp) { + mane.base_x = xCurrentScroll; + mane.base_y = yCurrentScroll; + mane.min_x = lprcPaint->left; + mane.min_y = lprcPaint->top; + mane.max_x = lprcPaint->right; + mane.max_y = lprcPaint->bottom; + mane.width = lprcPaint->right - lprcPaint->left; + mane.height = lprcPaint->bottom - lprcPaint->top; + + /* + We have the page in memory. This page consist of all the pk chars + and rules/boxes. + + As pictures are drawn one onto the other, we need some kind of + transparent blt. AFAIK, the special rop code used here does the + trick. But it is slow. + + */ + +#ifdef TRANSFORM + /* FIXME : there should be a global stack in case + such transformations would span over several pages. */ + if (resource.use_xform) + reset_xfrm_stack(); +#endif + + /* Erasing background */ + { + RECT r; + r.left = mane.min_x; + r.top = mane.min_y; + r.right = min(page_w - xCurrentScroll, mane.max_x); + r.bottom = min(page_h - yCurrentScroll, mane.max_y); + FillRect(hdcFrom, &r, backBrush); + } + + /* First pass for specials */ + allowDrawingChars = FALSE; + + redraw(&mane); + +#if PS + if (resource._postscript && psToDisplay) { + rop = /* 0x008E1D7C */ SRCCOPY; + + /* if gs is active, try to make it paint its picture */ + if (gs_device) { + rcGSPaint.left = lprcPaint->left+xCurrentScroll; + rcGSPaint.right = lprcPaint->right+xCurrentScroll; + rcGSPaint.top = lprcPaint->top+yCurrentScroll; + rcGSPaint.bottom = lprcPaint->bottom+yCurrentScroll; +#if 0 + fprintf(stderr, "gs: redrawing\n"); +#endif + (*pgsdll_draw)(gs_device, hdcFrom, lprcPaint, &rcGSPaint); + } + } + else +#endif + rop = SRCCOPY; + + allowDrawingChars = TRUE; + + redraw(&mane); + } + + /* We have to paint in lprcPaint. */ + if (!BitBlt(hdcDest, + lprcPaint->left, lprcPaint->top, + lprcPaint->right - lprcPaint->left, + lprcPaint->bottom - lprcPaint->top, + hdcFrom, + lprcPaint->left+xCurrentScroll, + lprcPaint->top+yCurrentScroll, SRCCOPY)) { + Win32Error("Draw Page/BitBlt"); + fprintf(stderr, "BitBlt page failed\nRectangle to be painted : l = %d t = %d r = %d b = %d\n", + lprcPaint->left, lprcPaint->top, + lprcPaint->right, lprcPaint->bottom); + fprintf(stderr, "Rectangle to be updated : l = %d t = %d r = %d b = %d\n", + lprcPaint->left, lprcPaint->top, + lprcPaint->right, lprcPaint->bottom); + fprintf(stderr, "Rectangle for page : l = %d t = %d r = %d b = %d\n", + 0, 0, page_w - xCurrentScroll, page_h - yCurrentScroll); + fprintf(stderr, "Page width = %d\nPage height = %d\nScroll %d %d\n", + page_w, page_h, xCurrentScroll, yCurrentScroll); + } +} + + +void DrawOnScreen(HDC hdcDest, HDC hdcFrom, LPRECT lprcPaint) +{ + extern void reset_xfrm_stack(void); + /* + We want to draw directly onto the screen. + */ + + mane.base_x = xCurrentScroll; + mane.base_y = yCurrentScroll; + mane.min_x = lprcPaint->left; + mane.min_y = lprcPaint->top; + mane.max_x = lprcPaint->right; + mane.max_y = lprcPaint->bottom; + mane.width = lprcPaint->right - lprcPaint->left; + mane.height = lprcPaint->bottom - lprcPaint->top; + + /* If no file open, just return */ + if (!dvi_name || !*dvi_name) + return; + +#ifdef TRANSFORM + /* FIXME : there should be a global stack in case + such transformations would span over several pages. */ + if (resource.use_xform) + reset_xfrm_stack(); +#endif + + /* + FIXME : remove this and process directly. + */ + + /* First pass for specials */ + allowDrawingChars = FALSE; + + redraw(&mane); + +#if PS + if (resource._postscript && psToDisplay) { + /* if gs is active, try to make it paint its picture */ + if (gs_device) { +#if 0 + fprintf(stderr, "gs: redrawing\n"); + fprintf(stderr, "repaint : %d %d %d %d\n", + lprcPaint->left, lprcPaint->top, + lprcPaint->right, lprcPaint->bottom); +#endif + (*pgsdll_lock_device)(gs_device, 1); + (*pgsdll_draw)(gs_device, hdcDest, lprcPaint, lprcPaint); + (*pgsdll_lock_device)(gs_device, 0); + } + } + + allowDrawingChars = TRUE; + +#if 0 + fprintf(stderr, "repaint : %d %d %d %d ps = %d\n", + lprcPaint->left, lprcPaint->top, + lprcPaint->right, lprcPaint->bottom, psToDisplay); +#endif + redraw(&mane); +#endif + + if (resource.reverse) { + PatBlt(hdcDest, lprcPaint->left, lprcPaint->top, lprcPaint->right, lprcPaint->bottom, DSTINVERT); + } + +} + +void DoDrawPaint(HDC hdcDest, HDC hdcFrom, LPRECT lprcPaint) +{ + RECT rcToPaint, rcPage; + + rcPage.left = 0; + rcPage.right = page_w - xCurrentScroll; + rcPage.top = 0; + rcPage.bottom = page_h - yCurrentScroll; + + IntersectRect(&rcToPaint, lprcPaint, &rcPage); + + if (resource.in_memory) + DrawInMemory(hdcDest, hdcFrom, &rcToPaint); + else + DrawOnScreen(hdcDest, hdcFrom, &rcToPaint); +} + +LRESULT MsgDrawPaint(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + PAINTSTRUCT ps; + + /* No redrawing while printing. Should not happen, but who knows ? */ + HDC hDC = BeginPaint(hwnd, &ps); + + if (!isPrinting) { + + /* FIXME : Is there anyway to optimize this + wrt to the mag. glass moving ? */ + if (bDrawKeep || bMagDisp) { + /* Repaint from the memory context */ + BitBlt(ps.hdc, ps.rcPaint.left, ps.rcPaint.top, + (ps.rcPaint.right - ps.rcPaint.left), + (ps.rcPaint.bottom - ps.rcPaint.top), + hdcDrawSave, ps.rcPaint.left,ps.rcPaint.top, SRCCOPY); + } + else { + /* New data, so need to do some work */ + RECT rc; + HWND hWndTop = GetTopWindow(NULL); +#if 0 + fprintf(stderr, "Redrawing (%d, %d) - (%d x %d)\n", + ps.rcPaint.left, ps.rcPaint.top, + ps.rcPaint.right - ps.rcPaint.left, + ps.rcPaint.bottom - ps.rcPaint.top); +#endif + DoDrawPaint(maneDC, maneDrawDC, &(ps.rcPaint)); + /* The screen has been redrawn manually; now update */ + /* the memory context and set fKeep=TRUE. */ + if (hWndTop == hWndMain /* || hWndTop == hWndDraw || hWndTop == hWndMagnify */) { + GetClientRect(hwnd,&rc); + BitBlt(hdcDrawSave, 0,0,rc.right,rc.bottom, + hDC, 0,0,SRCCOPY); + bDrawKeep = TRUE; + } + else { +#if 0 + fprintf(stderr, "Active window is *not* draw window\n"); +#endif + } + } + } + EndPaint(hwnd, &ps); + return 0; +} + +/* + FUNCTION: InitGlobalsDraw() + PURPOSE : Initialize all graphic-relative variables needed. + Can be done only after hWndDraw has been created. + Must be done before trying to open a dvi file. +*/ + +void InitGlobalsDraw() +{ + extern void initcolor(void); + extern void init_xfrm_stack(void); + + currwin.win = mane.win = hWndDraw; + + /* It has its own_dc */ + maneDC = GetDC(hWndDraw); + + maneHorzRes = GetDeviceCaps(maneDC, HORZRES); + maneVertRes = GetDeviceCaps(maneDC, VERTRES); + maneLogPixelsX = GetDeviceCaps(maneDC, LOGPIXELSX); + maneLogPixelsY = GetDeviceCaps(maneDC, LOGPIXELSY); + maneBitsPixel = GetDeviceCaps(maneDC, BITSPIXEL); + maneSizePalette = GetDeviceCaps(maneDC, SIZEPALETTE); + maneColorRes = GetDeviceCaps(maneDC, COLORRES); + maneRasterCaps = GetDeviceCaps(maneDC, RASTERCAPS); + +#ifdef GREY + if (maneBitsPixel >= 8 && use_grey) { + numColors = 16; + } + else { + numColors = 1; + } +#else + numColors = 1; +#endif + + if (!(maneRasterCaps & RC_BITBLT)) { + MessageBox(hWndMain, + "Can't use the BitBlt() function\r\non your display. Exiting...", + NULL, MB_OK | MB_ICONERROR | MB_APPLMODAL); + CleanExit(1); + } + if (!(maneRasterCaps & RC_STRETCHDIB)) { + MessageBox(hWndMain, + "Can't use the StretchDIBits() function\r\non your display. Exiting...", + NULL, MB_OK | MB_ICONERROR | MB_APPLMODAL); + CleanExit(1); + } + if (!(maneRasterCaps & RC_BITMAP64)) { + MessageBox(hWndMain, + "Device does not support >64k bitmaps. Exiting...", + NULL, MB_OK | MB_ICONERROR | MB_APPLMODAL); + CleanExit(1); + } +#if 0 + fprintf(stderr, "Caps = %x\n", maneRasterCaps); + fprintf(stderr, "Hres = %d, Yres = %d, lpx = %d, lpy = %d\n", + maneHorzRes, maneVertRes, maneLogPixelsX, maneLogPixelsY); + fprintf(stderr, "bits/pix = %d, size palette = %d, colorres = %d\n", + maneBitsPixel, maneSizePalette, maneColorRes); +#endif + +#if 0 + /* Device context for drawing and the associated bitmap. */ + if ((imageDC = CreateCompatibleDC(maneDC)) == NULL) + Win32Error("CreateCompatibleDC imageDC"); +#endif + + if (resource.in_memory) { + maneDrawMemDC = CreateCompatibleDC(maneDC); + if (maneDrawMemDC == NULL) + Win32Error("CreateCompatibleDC maneDrawMemDC"); + + foreGC = ruleGC = highGC = maneDrawDC = maneDrawMemDC; + + grid1GC = grid2GC = grid3GC = maneDrawDC; + foreGC2 = NULL; /* not used under Win32 */ + } + else { + foreGC = ruleGC = highGC = maneDrawDC = GetDC(hWndDraw); + grid1GC = grid2GC = grid3GC = foreGC; + magMemDC = foreGC2 = NULL; /* not used under Win32 */ + } + +#ifdef TRANSFORM + if (IS_NT) + SetGraphicsMode(maneDrawDC, GM_ADVANCED); + + if (resource.use_xform) { + if (IS_WIN95) { + fprintf(stderr, "The xform feature is not available under Win95.\n"); + fprintf(stderr, "Use the View -> Options dialog box to configure\n"); + fprintf(stderr, "or run `windvi +xform' to reset the option.\n"); + } + else { + init_xfrm_stack(); + } + } +#endif + + SetStretchBltMode(foreGC, COLORONCOLOR); + SetStretchBltMode(maneDC, COLORONCOLOR); + + initcolor(); + + + /* This little image is not used anymore. We are doing + everything straight in bitmaps */ + image = XCreateImage(DISP, maneDrawDC, numColors, XYBitmap, 0, + (char *)NULL, 0, 0, BMBITS, 0); + + + bmi1.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmi1.bmiHeader.biPlanes = 1; + bmi1.bmiHeader.biBitCount = 1; + bmi1.bmiHeader.biCompression = BI_RGB; + bmi1.bmiHeader.biXPelsPerMeter = 0; + bmi1.bmiHeader.biYPelsPerMeter = 0; + bmi1.bmiHeader.biClrUsed = 0; + bmi1.bmiHeader.biClrImportant = 0; + + bmi4.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmi4.bmiHeader.biPlanes = 1; + bmi4.bmiHeader.biBitCount = 4; + bmi4.bmiHeader.biCompression = BI_RGB; + bmi4.bmiHeader.biXPelsPerMeter = 0; + bmi4.bmiHeader.biYPelsPerMeter = 0; + bmi4.bmiHeader.biClrUsed = 0; + bmi4.bmiHeader.biClrImportant = 0; + + bmi8.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmi8.bmiHeader.biPlanes = 1; + bmi8.bmiHeader.biBitCount = 8; + bmi8.bmiHeader.biCompression = BI_RGB; + bmi8.bmiHeader.biXPelsPerMeter = 0; + bmi8.bmiHeader.biYPelsPerMeter = 0; + bmi8.bmiHeader.biClrUsed = 0; + bmi8.bmiHeader.biClrImportant = 0; + + bmi24.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + bmi24.bmiHeader.biPlanes = 1; + bmi24.bmiHeader.biBitCount = 24; + bmi24.bmiHeader.biCompression = BI_RGB; + bmi24.bmiHeader.biXPelsPerMeter = 0; + bmi24.bmiHeader.biYPelsPerMeter = 0; + bmi24.bmiHeader.biClrUsed = 0; + bmi24.bmiHeader.biClrImportant = 0; + + + /* + Setting geometry + */ + /* Where to create the window ? + Thanks to suggestions by Stanley A. Sawyer <sawyer@math.wustl.edu> + this code has been improved. + ------------------------------------------------------------------------- + The main window will be loaded at (xval,yval) (the upper-left (UL) + corner of the window) with widths (xsize,ysize). + The physical screen size is stored in global variables (maxx,maxy). + The code below first checks if there is an instance of a program of + type ``window class=vshowclass'' already running. If so, the new window + is cascaded off the old by v4size pixels at the UL corner. + ``FindWindow()'' seems to find the last-run instance, so that the + result can be a nice cascade of windows. + If there are no pre-existing instances, the code then checks for a + Taskbar on either the left-hand-side or the top of the screen. If the + Taskbar is in either position, (xval,yval) is set to avoid overlaying + them. If not, the default xval=yval=10 is used. + The code can be improved by checking the Taskbar position if the + previous instance window is too far from the UL corner of the screen, + but the following should work fine in most cases. + ------------------------------------------------------------------------- + */ + /* + FIXME : should we implement several policies + - user might want to open the new window exactly + on top of the previous one, + - or cascade windows, + - or ... + */ + { + int off_x, off_y, width, height; + int v4size = 25; /* cascading by this number of pixels */ + RECT rectDesktop, r; + extern BOOL bPrevInstance; + extern RECT rectWndPrev; + APPBARDATA abd = { sizeof(APPBARDATA), NULL }; + int abd_width = 0, abd_height = 0; + + GetWindowRect(hWndMain, &r); + off_x = r.left; + off_y = r.top; + width = r.right - r.left; + height = r.bottom - r.top; + + /* Get APPBAR information */ + abd.cbSize = sizeof(APPBARDATA); + if (SHAppBarMessage(ABM_GETTASKBARPOS, &abd)) { + /* The Taskbar is at positions */ + /* abd.rc.left, abd.rc.right, abd.rc.top, abd.rc.bottom */ + /* The variable at the long screen boundary is negative, */ + /* which locates the Taskbar. */ +#if 0 + fprintf(stderr, "Appbar : (%d %d) -- (%d %d)\n", + abd.rc.left, abd.rc.top, + abd.rc.right, abd.rc.bottom); +#endif + if (abd.rc.left<0 && abd.rc.right < maneHorzRes/2) { + abd_width = abd.rc.right; + } + else if (abd.rc.top<0 && abd.rc.bottom < maneVertRes/2) { + abd_height = abd.rc.bottom; + } + } + + if (bPrevInstance && !resource.single_flag) { + /* if there is a previous instance, rely on it. */ + off_x = (rectWndPrev.left> maneHorzRes / 3) + ? 10 + v4size + : rectWndPrev.left+v4size; + off_y = (rectWndPrev.top > maneVertRes / 3) + ? 10 + v4size + : rectWndPrev.top+v4size; + width = rectWndPrev.right - rectWndPrev.left; + height = rectWndPrev.bottom - rectWndPrev.top; +#if 0 + fprintf(stderr, "Prev inst : @(%d,%d) (%d x %d)\n", + off_x, off_y, width, height); +#endif + } + + else if (geometry) { + RECT r; + int flag = XParseGeometry(geometry, &off_x, &off_y, + &width, &height); +#ifndef WIN32 + if (flag & (XValue | YValue)) + size_hints.flags |= USPosition; + if (flag & (WidthValue | HeightValue)) + size_hints.flags |= USSize; +#endif + if (flag & XNegative) off_x += maneHorzRes - width; + if (flag & YNegative) off_y += maneVertRes - height; + } + else { + /* + if no geometry has been given, make the main window big enough. + */ + width = (int)(maneVertRes - abd_height * 0.618); + height = maneVertRes - abd_height; +#if 0 + fprintf(stderr, "Nothing : @(%d,%d) (%d x %d)\n", + off_x, off_y, width, height); +#endif + } + if (!(MoveWindow(hWndMain, + off_x, off_y, + width, height, + TRUE))) + Win32Error("no Geometry/MoveWindow"); + } + +} diff --git a/Build/source/texk/windvi/windvi.RES b/Build/source/texk/windvi/windvi.RES Binary files differnew file mode 100644 index 00000000000..fbd3b879fc7 --- /dev/null +++ b/Build/source/texk/windvi/windvi.RES diff --git a/Build/source/texk/windvi/windvi.c b/Build/source/texk/windvi/windvi.c new file mode 100644 index 00000000000..eb5f7e2e2b6 --- /dev/null +++ b/Build/source/texk/windvi/windvi.c @@ -0,0 +1,3354 @@ +#include "wingui.h" + +/* C RunTime Header Files */ +#ifndef DEBUG_GUI +#include <kpathsea/c-minmax.h> +#endif + + +LRESULT DispDefault(EDWP, HWND, UINT, WPARAM, LPARAM); + +/* Functions defined in winevt.c */ +#include <stdio.h> +#include <setjmp.h> +#include "xdvi-config.h" + +/* + System type +*/ +int iSystemType = -1; + +int GetSystemType(void); + +/**************************************************************************** + Global Variables + ***************************************************************************/ + +HINSTANCE hInst; /* Current instance */ +char szAppName[100]; /* Name of the app */ +char szTitle[100]; /* The title bar text */ +HWND hWndMain; /* Application main window handle */ +HWND hWndDraw; /* The window with the dvi page */ +HWND hViewLog = NULL; /* Logging window */ +HDC maneDC; /* DC for the screen window */ +HBITMAP maneDIB; /* In memory bitmap for the dvi page */ +HBITMAP magDIB; /* In memory bitmap for the magnifying glass */ +HMENU hMenuMain; /* Main menu */ + +char *szLogFileName; /* Temporary log file for kpathsea */ +HANDLE hCrtIn, hCrtOut, hCrtErr; /* Standard handles */ +/* hCrtOut and hCrtErr are the same handle, duplicated + from the writable part of a pipe. + */ +HANDLE hLogIn; /* One side of the pipe for logging */ +/* + Logging needs 2 threads : + - one sentinel for reading on the other (readable) end of the pipe + - one loop message for the hViewLog window. + With these threads, anybody writing on stdout/stderr will + make hViewLog pop up, and the writings will be displayed + almost synchronously. + */ +HANDLE hViewLogThread = 0, + hLogLoopThread = 0; +BOOL bLogShown; /* Log window is shown */ + +int tbHeight, sbHeight; /* Toolbar and Status bar heights */ +int maneHeight, maneWidth; /* hWndDraw height and width */ +RECT maneRect; /* hWndDraw Rect */ +RECT rectWndPrev; /* Previous instance window rectangle */ +BOOL bPrevInstance = FALSE; /* Is there a previous instance ? */ +BOOL bSkipFirstClick = FALSE; /* Avoid mag. glass at click to gain focus. */ + +/* Scrollbars' variables */ +SCROLLINFO si; +int xMinScroll; +int xMaxScroll; +int xCurrentScroll; +int yMinScroll; +int yMaxScroll; +int yCurrentScroll; +BOOL fScroll; +BOOL fSize; + +BOOL bInitComplete = FALSE; /* Initialization phase completed */ + +/* Mouse Position */ +int xMousePos; +int yMousePos; + +/* + Last used files. + This is a queue. It is addressed in thae arry, indexes modulo number of + entries. Two values tell the head and tail of the queue. +*/ +char **lpLastUsedFiles; +int iLastUsedFilesNum; +int iLastCurrentUsed, iLastLatestUsed; + +/***************************************************************************** + Main window message table definition. + ****************************************************************************/ +MSD rgmsd[] = +{ + {WM_CREATE, MsgCreate }, + {WM_SIZE, MsgSize }, + {WM_MOVE, MsgMove }, + {WM_DROPFILES, MsgDropFiles }, + {WM_COMMAND, MsgCommand }, + {WM_NOTIFY, MsgNotify }, + {WM_MENUSELECT, MsgMenuSelect}, + {WM_DESTROY, MsgDestroy }, + {WM_CHAR, MsgChar }, + {WM_KEYDOWN, MsgKeyDown }, + {WM_ACTIVATE, MsgActivate }, + {WM_COPYDATA, MsgCopyData } + /* {WM_PAINT, MsgPaint } */ +}; + +MSDI msdiMain = +{ + sizeof(rgmsd) / sizeof(MSD), + rgmsd, + edwpWindow +}; + + +/* Main window command table definition. */ +CMD rgcmd[] = +{ + {IDM_FILEOPEN, CmdOpen}, + {IDM_FILECLOSE, CmdClose}, + {IDM_FILEPRINT, CmdFilePrint}, + {IDM_FILEPRINTDVIPS, CmdFilePrint}, + {IDM_FILEPAGESU, CmdStub}, + {IDM_FILEPRINTSU, CmdFilePrSetup}, + {IDM_EXIT, CmdExit}, + + {IDM_FILE_RECENT, CmdOpenRecentFile}, + {IDM_FILE_RECENT1, CmdOpenRecentFile}, + {IDM_FILE_RECENT2, CmdOpenRecentFile}, + {IDM_FILE_RECENT3, CmdOpenRecentFile}, + {IDM_FILE_RECENT4, CmdOpenRecentFile}, + {IDM_FILE_RECENT5, CmdOpenRecentFile}, + {IDM_FILE_RECENT6, CmdOpenRecentFile}, + {IDM_FILE_RECENT7, CmdOpenRecentFile}, + {IDM_FILE_RECENT8, CmdOpenRecentFile}, + {IDM_FILE_RECENT9, CmdOpenRecentFile}, + + {IDM_ZOOMIN, CmdZoomIn}, + {IDM_ZOOMOUT, CmdZoomOut}, + {IDM_REDRAWPAGE, CmdRedrawPage}, + {IDM_KEEPPOS, CmdKeepPosition}, + {IDM_TOGGLEPS, CmdTogglePS}, + {IDM_TOGGLEGRID, CmdToggleGrid}, + + {IDM_NEXTPAGE, CmdNextPage}, + {IDM_PREVIOUSPAGE,CmdPreviousPage}, + {IDM_NEXT5, CmdNext5}, + {IDM_PREVIOUS5, CmdPrevious5}, + {IDM_NEXT10, CmdNext10}, + {IDM_PREVIOUS10, CmdPrevious10}, + {IDM_GOTOPAGE, CmdGotoPage}, + {IDM_SRCSPECIALS, CmdSrcSpecials}, + {IDM_FIRSTPAGE, CmdFirstPage}, + {IDM_LASTPAGE, CmdLastPage}, + +#ifdef HTEX + {IDM_URLBACK, CmdUrlBack}, +#endif + {ID_OPTIONS_WINDVI, CmdWindviConfig}, + {ID_OPTIONS_TEXCONFIG, CmdTexConfig}, + + {IDM_HELPTOPICS, CmdHelpTopics}, + /* {IDM_HELPCONTENTS, CmdHelpContents}, */ + /* {IDM_HELPSEARCH, CmdHelpSearch}, */ + /* {IDM_HELPHELP, CmdHelpHelp}, */ + {IDM_VIEW_LOG, CmdViewLog}, + {IDM_ABOUT, CmdAbout}, +}; + +CMDI cmdiMain = +{ + sizeof(rgcmd) / sizeof(CMD), + rgcmd, + edwpWindow +}; + +/***************************************************************************** + Toolbar window + ****************************************************************************/ +HWND hWndToolbar; + +int bVertToolbar = 0; +/* +**TODO** Change the following values to match your toolbar bitmap + +NUMIMAGES = Number of images in toolbar.bmp. Note that this is not +the same as the number of elements on the toolbar. +IMAGEWIDTH = Width of a single button image in toolbar.bmp +IMAGEHEIGHT = Height of a single button image in toolbar.bmp +BUTTONWIDTH = Width of a button on the toolbar (zero = default) +BUTTONHEIGHT = Height of a button on the toolbar (zero = default) +*/ + +#define NUMIMAGES 17 + +#define IMAGEWIDTH 18 +#define IMAGEHEIGHT 17 +#define BUTTONWIDTH 0 +#define BUTTONHEIGHT 0 + +/* +**TODO** Add/remove entries in the following array to define the +toolbar buttons (see documentation for TBBUTTON). +*/ + +TBBUTTON tbButton[] = +{ + {0, IDM_FILEOPEN, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0}, + {1, IDM_FILEPRINT, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0}, + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0}, + {2, IDM_ZOOMIN, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0}, + {3, IDM_ZOOMOUT, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0}, + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0}, + {4, IDM_PREVIOUS10, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0}, + {6, IDM_PREVIOUS5, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0}, + {8, IDM_PREVIOUSPAGE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0}, + {11, IDM_REDRAWPAGE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0}, + {9, IDM_NEXTPAGE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0}, + {7, IDM_NEXT5, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0}, + {5, IDM_NEXT10, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0}, + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0}, + {13,IDM_GOTOPAGE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0}, + {16,IDM_SRCSPECIALS, +#ifdef SRC_SPECIALS + TBSTATE_ENABLED, +#else + TBSTATE_HIDDEN, +#endif + TBSTYLE_BUTTON | TBSTYLE_CHECK, 0, 0}, + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0}, + {10,IDM_TOGGLEGRID, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, 0}, + {12,IDM_TOGGLEPS, +#ifdef PS_GS + TBSTATE_ENABLED, +#else + TBSTATE_HIDDEN, +#endif + TBSTYLE_BUTTON | TBSTYLE_CHECK, 0, 0}, + {15,IDM_BOOKMODE, TBSTATE_ENABLED, TBSTYLE_BUTTON | TBSTYLE_CHECK, 0, 0}, + {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, 0}, + {14,IDM_URLBACK, +#ifdef HTEX + TBSTATE_ENABLED, +#else + TBSTATE_HIDDEN, +#endif + TBSTYLE_BUTTON, 0, 0}, +}; + +/**************************************************************************** + Status Bar Window + ****************************************************************************/ +HWND hWndStatusbar; + +/* **TODO** Add entries to this array for each popup menu in the same + positions as they appear in the main menu. Remember to define + the ID's in globals.h and add the strings to windvi.rc. */ + +UINT idPopup[] = +{ + IDS_FILEMENU, + IDS_MOVEMENU, + IDS_VIEWMENU, + IDS_HELPMENU, +}; + +/* + 6 -> 123,123 + 5 -> Cursor Pos: + 4 -> 999 + 3 -> Scaling: + 2 -> 999999 + 1 -> Page: + */ + +/*****************************************************************************/ + +/* + FUNCTION: WinMain(HANDLE, HANDLE, LPSTR, int) + + PURPOSE: Entry point for the application. + + COMMENTS: + + This function initializes the application and processes the + message loop. +*/ +int APIENTRY WinMain(HINSTANCE hInstance, + HINSTANCE hPrevInstance, + LPSTR lpCmdLine, + int nCmdShow) +{ + MSG msg; + HANDLE hAccelTable; + + /* Initialize global strings */ + lstrcpy (szAppName, SZAPPNAME); + LoadString (hInstance, IDS_APPNAME, szTitle, 100); + + /* Setup standard io, real-time logging ... */ + SetupEnv(); + + /* are we nt, w9x ? */ + iSystemType = GetSystemType(); + + /* Get all information from command line */ + ParseCmdLine(GetCommandLine()); + + if (!hPrevInstance) { + /* Perform instance initialization: */ + if (!InitApplication(hInstance)) { + CleanUp(); + return (FALSE); + } + } + + /* Perform application initialization: */ + if (!InitInstance(hInstance, nCmdShow)) { + CleanUp(); + return (FALSE); + } + +#if 0 + hAccelTable = LoadAccelerators (hInstance, szAppName); +#endif + + bInitComplete = TRUE; + SetForegroundWindow(hWndMain); + /* Main message loop: */ + while (GetMessage(&msg, NULL, 0, 0)) { +#if 0 + if (!TranslateAccelerator (msg.hwnd, hAccelTable, &msg)) { +#endif + TranslateMessage(&msg); + DispatchMessage(&msg); +#if 0 + } +#endif + } + CleanUp(); +#if 0 + DestroyWindow(hWndMain); +#endif + return (msg.wParam); +} + +/* + FUNCTION: SetupEnv() + PURPOSE: initializing stdi, stdout, stderr, redirecting output to the + view log window in real-time. +*/ +void SetupEnv() +{ + SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE }; + HANDLE current_pid, hTmpOut; + DWORD idLogThread; + FILE *hf; + int fdIn, fdOut, fdErr; + int i; + extern char tick_tmp[]; + + /* if _DEBUG is not defined, these macros will result in nothing. */ + SETUP_CRTDBG; + /* Set the debug-heap flag so that freed blocks are kept on the + linked list, to catch any inadvertent use of freed memory */ + /* SET_CRT_DEBUG_FIELD( _CRTDBG_DELAY_FREE_MEM_DF ); + SET_CRT_DEBUG_FIELD( _CRTDBG_CHECK_ALWAYS_DF ); */ + +#if 0 + /* maybe we could still have an option to write log to some temp file ? */ + szLogFileName = xmalloc(260); + if (GetTempFileName(szTempPath, "xdvi", 0, szLogFileName) == 0) + Win32Error("GetTempFileName"); +#endif + + if (GetTempPath(PATH_MAX, tick_tmp) == 0) + Win32Error("GetTempPath/tick_tmp"); + + hCrtIn = CreateFile("NUL", GENERIC_READ, FILE_SHARE_READ, + &sa, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); + if (SetStdHandle(STD_INPUT_HANDLE, hCrtIn) == FALSE) + Win32Error("SetStdHandle/hCrtIn"); + + if (CreatePipe(&hLogIn, &hTmpOut, &sa, 0) == FALSE) { + Win32Error("Init/CreatePipe"); + } + + current_pid = GetCurrentProcess(); + + if (DuplicateHandle(current_pid, hTmpOut, + current_pid, &hCrtOut, + 0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE) + Win32Error("DuplicateHandle/OutErr"); + + if (DuplicateHandle(current_pid, hTmpOut, + current_pid, &hCrtErr, + 0, TRUE, DUPLICATE_SAME_ACCESS) == FALSE) + Win32Error("DuplicateHandle/OutErr"); + + + CloseHandleAndClear(&hTmpOut); + + if (SetStdHandle(STD_OUTPUT_HANDLE, hCrtOut) == FALSE) + Win32Error("SetStdHandle/hCrtOut"); + + if (SetStdHandle(STD_ERROR_HANDLE, hCrtErr) == FALSE) + Win32Error("SetStdHandle/hCrtErr"); + + fdIn = _open_osfhandle((long) hCrtIn, + // (long) GetStdHandle(STD_INPUT_HANDLE), + _O_TEXT + ); + hf = _fdopen( fdIn, "r" ); + *stdin = *hf; + i = setvbuf( stdin, NULL, _IONBF, 0 ); + + fdOut = _open_osfhandle((long) hCrtOut, + // (long) GetStdHandle(STD_OUTPUT_HANDLE), + _O_TEXT + ); + hf = _fdopen( fdOut, "w" ); + *stdout = *hf; + i = setvbuf( stdout, NULL, _IONBF, 0 ); + + fdErr = _open_osfhandle((long) hCrtErr, + // (long) GetStdHandle(STD_ERROR_HANDLE), + _O_TEXT + ); + hf = _fdopen( fdErr, "w" ); + *stderr = *hf; + i = setvbuf( stderr, NULL, _IONBF, 0 ); + + /* Run a thread for the ViewLog dialog box. The thread will + wait for something to read on hLogIn. */ + if ((hViewLogThread = CreateThread(&sa, /* security attributes */ + 0, /* default stack size */ + ViewLogSentinel, /* start address of thread */ + 0, /* parameter */ + 0, /* creation flags */ + &idLogThread /* thread id */ + )) == NULL) + Win32Error("Log/CreateThread"); +#if 0 + fprintf(stderr, "Setupenv done\n"); +#endif +} + +/* + FUNCTION: InitApplication(HANDLE) + + PURPOSE: Initializes window data and registers window class + + COMMENTS: + + In this function, we initialize a window class by filling out a data + structure of type WNDCLASS and calling either RegisterClass or + the internal MyRegisterClass. +*/ +BOOL InitApplication(HINSTANCE hInstance) +{ + WNDCLASSEX wc; + HWND hWndPrev; + HANDLE hMutex; + +#if 0 + /* Win32 will always set hPrevInstance to NULL, so lets check + things a little closer. This is because we only want a single + version of this app to run at a time */ + hwnd = FindWindow (szAppName, szTitle); + if (hwnd) { + /* We found another version of ourself. Lets defer to it: */ + if (IsIconic(hwnd)) { + ShowWindow(hwnd, SW_RESTORE); + } + SetForegroundWindow (hwnd); + + /* If this app actually had any functionality, we would + also want to communicate any action that our 'twin' + should now perform based on how the user tried to + execute us. */ + return FALSE; + } +#endif + + hWndPrev = FindWindow(szAppName, NULL); + if (hWndPrev) { + GetWindowRect(hWndPrev, &rectWndPrev); + bPrevInstance = TRUE; + } + + /* hPrevInstance is always NULL under Win32. We have been asked to run only one instance + of windvi. Next instance will have to wake up the first one, and send it : + - at least new working directory and file name + - other params ? With the restriction that we cannot send pointers. */ + if (resource.single_flag) { + COPYDATASTRUCT CopyData; + SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE }; + struct data_exchange DataEx; + + /* We create a mutex to be sure to be alone, but only if the option + single_instance has been given. */ + + if ((hMutex = CreateMutex(&sa, TRUE, "WindviMutex")) == NULL) { + Win32Error("WinMain/CreateMutex"); + return FALSE; + } + if (GetLastError() == ERROR_ALREADY_EXISTS) { + /* send the right message to the existing instance */ + if (!hWndPrev) { + MessageBox(hWndMain, "Can't find the previous instance.", NULL, MB_APPLMODAL | MB_ICONHAND | MB_OK); + return FALSE; + } + /* We found another version of ourself. Lets defer to it: */ + if (IsIconic(hWndPrev)) { + ShowWindow(hWndPrev, SW_RESTORE); + } + if (!SetForegroundWindow(hWndPrev)) + Win32Error("WinMain/SetForegroundWindow"); + /* We send the data_exchange structure ! */ + GetCurrentDirectory(sizeof(DataEx.cwd), DataEx.cwd); + lstrcpy(DataEx.dviname, dvi_name); + + if (curr_page) { + current_page = (*curr_page ? atoi(curr_page) : 1) - 1; + } + + DataEx.currentpage = current_page; + DataEx.shrinkfactor = mane.shrinkfactor; + CopyData.dwData = 0; + CopyData.cbData = sizeof(DataEx); + CopyData.lpData = &DataEx; + SendMessage(hWndPrev, WM_COPYDATA, (WPARAM)NULL, (LPARAM)&CopyData); + /* and exit */ + return FALSE; + } + } + + + /* Fill in window class structure with parameters that describe + the main window. */ + /* CS_OWNDC : un DC pour chaque fenêtre de la classe */ + wc.cbSize = sizeof(WNDCLASSEX); + wc.lpszClassName = szAppName; + wc.hInstance = hInstance; + wc.lpfnWndProc = (WNDPROC)WndProc; + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.hIcon = LoadIcon (hInstance, MAKEINTRESOURCE(IDI_APPICON)); + wc.lpszMenuName = szAppName; + wc.style = CS_OWNDC; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hbrBackground = (HBRUSH) (COLOR_WINDOW+1); + wc.hIconSm = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_APPICON)); + /* wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);*/ + + + if (!RegisterClassEx(&wc)) { + /* Assume we are running on NT where RegisterClassEx() is + not implemented, so let's try calling RegisterClass(). */ + + if (!RegisterClass((LPWNDCLASS)&wc.style)) { + Win32Error("RegisterClassEx"); + return FALSE; + } + } + + wc.lpszClassName = "ClientDrawClass"; + wc.hInstance = hInstance; + wc.lpfnWndProc = (WNDPROC)DrawProc; + wc.hCursor = NULL; /* Different cursors may be loaded */ + wc.hIcon = LoadIcon (hInstance, MAKEINTRESOURCE(IDI_APPICON)); + wc.lpszMenuName = NULL; + wc.hbrBackground = GetStockObject(LTGRAY_BRUSH); + wc.style = CS_OWNDC /* 0| CS_HREDRAW | CS_VREDRAW | CS_BYTEALIGNCLIENT */; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hIcon = LoadIcon (hInstance, MAKEINTRESOURCE(IDI_APPICON)); + + + if (!RegisterClassEx(&wc)) { + /* Assume we are running on NT where RegisterClassEx() is + not implemented, so let's try calling RegisterClass(). */ + + if (!RegisterClass((LPWNDCLASS)&wc.style)) { + Win32Error("RegisterClassEx"); + return FALSE; + } + } + + wc.lpszClassName = "MagnifyGlass"; + wc.hInstance = hInstance; + wc.lpfnWndProc = (WNDPROC)MagnifyProc; + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.hIcon = LoadIcon (hInstance, MAKEINTRESOURCE(IDI_APPICON)); + wc.lpszMenuName = NULL; + wc.hbrBackground = GetStockObject(LTGRAY_BRUSH); + wc.style = CS_OWNDC /* | CS_HREDRAW | CS_VREDRAW | CS_BYTEALIGNCLIENT */; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hIcon = LoadIcon (hInstance, MAKEINTRESOURCE(IDI_APPICON)); + + + if (!RegisterClassEx(&wc)) { + /* Assume we are running on NT where RegisterClassEx() is + not implemented, so let's try calling RegisterClass(). */ + + if (!RegisterClass((LPWNDCLASS)&wc.style)) { + Win32Error("RegisterClassEx"); + return FALSE; + } + } + + return TRUE; +} + +/* + FUNCTION: InitInstance(HANDLE, int) + + PURPOSE: Saves instance handle and creates main window + + COMMENTS: + + In this function, we save the instance handle in a global variable and + create and display the main program window. + */ +BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) +{ + extern void UpdateMainMenuUsedFiles(void); + hInst = hInstance; /* Store instance handle in our global variable */ + + magDIB = maneDIB = NULL; + + /* Setup bswap function */ + bswap = (check_386() ? bswap_c : bswap_asm); + + /* setup units */ + pixel_to_unit(); + +#ifdef _TRACE + fprintf(stderr, "w = %d, h = %d\n", page_w, page_h); +#endif + + hCursWait = LoadCursor(NULL, IDC_WAIT); + hCursArrow = LoadCursor(NULL, IDC_ARROW); + hCursCross = LoadCursor(NULL, IDC_CROSS); +/* BEGIN CHUNK xdvi.c 2 */ +#ifdef SRC_SPECIALS + hCursSrc = LoadCursor(NULL, IDC_IBEAM); +#endif +/* END CHUNK xdvi.c 2 */ + + hWndMain = CreateWindowEx(WS_EX_ACCEPTFILES, szAppName, szTitle, + WS_OVERLAPPEDWINDOW /*| WS_CLIPCHILDREN */, + CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, + NULL, NULL, hInstance, NULL); + + if (!hWndMain) { + Win32Error("CreateWindow"); + return (FALSE); + } + if (!CreateTBar(hWndMain)) + return FALSE; + if (!CreateSBar(hWndMain)) + return FALSE; + if (!CreateDraw(hWndMain)) + return FALSE; + if (!CreateMagnify(hWndDraw)) + return FALSE; + + hMenuMain = GetMenu(hWndMain); + CheckMenuItem(hMenuMain, IDM_TOGGLEPS, (resource._postscript ? MF_CHECKED : MF_UNCHECKED)); + CheckMenuItem(hMenuMain, IDM_TOGGLEGRID, (resource._grid_mode ? MF_CHECKED : MF_UNCHECKED)); + CheckMenuItem(hMenuMain, IDM_KEEPPOS, (resource.keep_flag ? MF_CHECKED : MF_UNCHECKED)); + + UpdateMainMenuUsedFiles(); + + ShowWindow(hWndMain, nCmdShow); + return (TRUE); +} + +/* + FUNCTION: DispMessage(LPMSDI, HWND, UINT, WPARAM, LPARAM) + + PURPOSE: Call the function associated with a message. + + PARAMETERS: + lpmsdi - Structure containing the message dispatch information. + hwnd - The window handle + uMessage - The message number + wparam - Message specific data + lparam - Message specific data + + RETURN VALUE: + The value returned by the message function that was called. + + COMMENTS: + Runs the table of messages stored in lpmsdi->rgmsd searching + for a message number that matches uMessage. If a match is found, + call the associated function. Otherwise, call DispDefault to + call the default function, if any, associated with the message + structure. In either case, return the value recieved from the + message or default function. + */ + +LRESULT DispMessage(LPMSDI lpmsdi, + HWND hwnd, + UINT uMessage, + WPARAM wparam, + LPARAM lparam) +{ + int imsd = 0; + + MSD *rgmsd = lpmsdi->rgmsd; + int cmsd = lpmsdi->cmsd; + + for (imsd = 0; imsd < cmsd; imsd++) + { + if (rgmsd[imsd].uMessage == uMessage) + return rgmsd[imsd].pfnmsg(hwnd, uMessage, wparam, lparam); + } + + return DispDefault(lpmsdi->edwp, hwnd, uMessage, wparam, lparam); +} + +/* + FUNCTION: DispCommand(LPCMDI, HWND, WPARAM, LPARAM) + + PURPOSE: Call the function associated with a command. + + PARAMETERS: + lpcmdi - Structure containing the command dispatch information. + hwnd - The window handle + GET_WM_COMMAND_ID(wparam, lparam) - Identifier of the menu item, + control, or accelerator. + GET_WM_COMMAND_CMD(wparam, lparam) - Notification code. + GET_WM_COMMAND_HWND(wparam, lparam) - The control handle or NULL. + + RETURN VALUE: + The value returned by the command function that was called. + + COMMENTS: + Runs the table of commands stored in lpcmdi->rgcmd searching + for a command number that matches wCommand. If a match is found, + call the associated function. Otherwise, call DispDefault to + call the default function, if any, associated with the command + structure. In either case, return the value recieved from the + command or default function. + */ + + +LRESULT DispCommand(LPCMDI lpcmdi, + HWND hwnd, + WPARAM wparam, + LPARAM lparam) +{ + LRESULT lRet = 0; + WORD wCommand = GET_WM_COMMAND_ID(wparam, lparam); + int icmd; + + CMD *rgcmd = lpcmdi->rgcmd; + int ccmd = lpcmdi->ccmd; + + /* Message packing of wparam and lparam have changed for Win32, + so use the GET_WM_COMMAND macro to unpack the commnad */ + + for (icmd = 0; icmd < ccmd; icmd++) { + if (rgcmd[icmd].wCommand == wCommand) { + return rgcmd[icmd].pfncmd(hwnd, + wCommand, + GET_WM_COMMAND_CMD(wparam, lparam), + GET_WM_COMMAND_HWND(wparam, lparam)); + } + } + + return DispDefault(lpcmdi->edwp, hwnd, WM_COMMAND, wparam, lparam); +} + + + +/* + FUNCTION: DispDefault(EDWP, HWND, UINT, WPARAM, LPARAM) + + PURPOSE: Call the appropriate default window procedure. + + PARAMETERS: + edwp - Enumerate specifying the appropriate default winow procedure. + hwnd - The window handle + uMessage - The message number + wparam - Message specific data + lparam - Message specific data + + RETURN VALUE: + If there is a default proc, return the value returned by the + default proc. Otherwise, return 0. + + COMMENTS: + Calls the default procedure associated with edwp using the specified + parameters. + */ + +LRESULT DispDefault(EDWP edwp, + HWND hwnd, + UINT uMessage, + WPARAM wparam, + LPARAM lparam) +{ + switch (edwp) + { + case edwpNone: + return 0; + case edwpWindow: + return DefWindowProc(hwnd, uMessage, wparam, lparam); + case edwpDialog: + return DefDlgProc(hwnd, uMessage, wparam, lparam); + case edwpMDIFrame: + return DefFrameProc(hwnd, NULL, uMessage, wparam, lparam); + case edwpMDIChild: + return DefMDIChildProc(hwnd, uMessage, wparam, lparam); + } + return 0; +} + +/***************************************************************************** + Main Window messages + ****************************************************************************/ + +/* + FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM) + + PURPOSE: Processes messages for the main window. + + PARAMETERS: + hwnd - window handle + uMessage - message number + wparam - additional information (dependant on message number) + lparam - additional information (dependant on message number) + + RETURN VALUE: + The return value depends on the message number. If the message + is implemented in the message dispatch table, the return value is + the value returned by the message handling function. Otherwise, + the return value is the value returned by the default window procedure. + + COMMENTS: + Call the DispMessage() function with the main window's message dispatch + information (msdiMain) and the message specific information. + */ + +LRESULT CALLBACK WndProc(HWND hwnd, + UINT uMessage, + WPARAM wparam, + LPARAM lparam) +{ + return DispMessage(&msdiMain, hwnd, uMessage, wparam, lparam); +} + +/* + FUNCTION: MsgCommand(HWND, UINT, WPARAM, LPARAM) + + PURPOSE: Handle the WM_COMMAND messages for the main window. + + PARAMETERS: + hwnd - window handle + uMessage - WM_COMMAND (Unused) + GET_WM_COMMAND_ID(wparam, lparam) - Command identifier + GET_WM_COMMAND_HWND(wparam, lparam) - Control handle + + RETURN VALUE: + The return value depends on the message number. If the message + is implemented in the message dispatch table, the return value is + the value returned by the message handling function. Otherwise, + the return value is the value returned by the default window procedure. + + COMMENTS: + Call the DispCommand() function with the main window's command dispatch + information (cmdiMain) and the command specific information. + */ + +LRESULT MsgCommand(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + return DispCommand(&cmdiMain, hwnd, wparam, lparam); +} + + +/* + FUNCTION: MsgCreate(HWND, UINT, WPARAM, LPARAM) + + PURPOSE: Handle the WM_CREATE messages for the main window. + and call InitCommonControls() API to initialize the + common control library. + + PARAMETERS: + hwnd - window handle + + RETURN VALUE: + Return 0 if the StatusBar and ToolBar Windows could be created + successfully. Otherwise, returns -1 to abort the main window + creation. + + COMMENTS: + Call the CreateTSBars function with the main window's window handle + information (msdiMain). + */ + +LRESULT MsgCreate(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + int nRet = -1; + FARPROC icce; + + top_level = hwnd; + + if (!(icce = GetProcAddress(GetModuleHandle("comctl32.dll"), + "InitCommonControlsEx"))) { +#if 0 + fprintf(stderr, "Not running the latest comctl32.dll\n"); +#endif + bVertToolbar = 0; + InitCommonControls() ; /* Initialize the common control library. */ + } + else { + INITCOMMONCONTROLSEX icc = { sizeof(INITCOMMONCONTROLSEX), + ICC_BAR_CLASSES }; + if ((*icce)(&icc) == FALSE) + Win32Error("InitCommonControlsEx");; + bVertToolbar = 1; + } + + DragAcceptFiles(hwnd, TRUE); + + return 0; +} + +void UpdateGeometry() +{ + RECT r; + char buf[256]; + + /* Avoid updating when in iconic form */ + if (IsIconic(hWndMain)) return; + + /* Update the geometry string */ + GetWindowRect(hWndMain, &r); + + sprintf(buf, "%ux%u%+d%+d", + r.right - r.left, + r.bottom - r.top, + /* be safe, do not allow huge numbers */ + (r.left < 0 ? 0 : r.left) % maneHorzRes, + (r.top < 0 ? 0 : r.top) % maneVertRes + ); + if (geometry) free(geometry); + geometry = strdup(buf); +} + +/* + FUNCTION: MsgSize(HWND, UINT, WPARAM, LPARAM) + + PURPOSE: This function resizes the toolbar and statusbar controls. + + + PARAMETERS: + + hwnd - Window handle (Used) + uMessage - Message number (Used) + wparam - Extra data (Used) + lparam - Extra data (Used) + + RETURN VALUE: + + Always returns 0 - Message handled + + COMMENTS: + + When the window procdure that has the status and tool bar controls + receive the WM_SIZE message, it has to pass the message on to these + controls so that these controls can adjust their size accordingly. + */ + + +LRESULT MsgSize(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + fSize = TRUE; + + SendMessage(hWndStatusbar, uMessage, wparam, lparam); + SendMessage(hWndToolbar, uMessage, wparam, lparam); + + /* Re-position the panes in the status bar */ + InitializeStatusBar(hwnd); + + /* Re-size client window relative to the tool/status bars */ + if (wparam != SIZE_MINIMIZED) + SizeClientWindow(hwnd); + + UpdateGeometry(); + + return 0; +} +/* + We need to update geometry in case of moving. + */ +LRESULT MsgMove(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + UpdateGeometry(); + return 0; +} + +void SetScrollBars(HWND hwnd) +{ + RECT r; + + GetClientRect(hwnd, &r); + + /* Scrollbars */ + xMinScroll = 0; + xMaxScroll = max((unsigned)page_w, r.right) - 1; + /* mane.base_x = */xCurrentScroll = min(xCurrentScroll, xMaxScroll - max(r.right-1, 0)); + + si.cbSize = sizeof(si); + si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS; + si.nMin = xMinScroll; + si.nMax = xMaxScroll; + si.nPage = r.right; + si.nPos = xCurrentScroll; + SetScrollInfo(hwnd, SB_HORZ, &si, TRUE); + + yMinScroll = 0; + yMaxScroll = max((unsigned)page_h, r.bottom) - 1; + /* mane.base_y = */yCurrentScroll = min(yCurrentScroll, yMaxScroll - max(r.bottom-1, 0)); + + si.cbSize = sizeof(si); + si.fMask = SIF_RANGE | SIF_PAGE | SIF_POS; + si.nMin = yMinScroll; + si.nMax = yMaxScroll; + si.nPage = r.bottom; + si.nPos = yCurrentScroll; + SetScrollInfo(hwnd, SB_VERT, &si, TRUE); + +#ifdef _TRACE + fprintf(stderr, "Page %d x %d\nScrollbars to [%d, %d, %d] and [%d, %d, %d]\n", + r.right, r.bottom, + xMinScroll, xCurrentScroll, xMaxScroll, + yMinScroll, yCurrentScroll, yMaxScroll); +#endif +} + +void SizeClientWindow(HWND hwnd) +{ + int xNewSize, yNewSize; + POINT ptOldOrg; + int xorg, yorg; + RECT r; + int parentWidth, parentHeight; + /* Re-position the child window */ + + GetClientRect(hwnd, &r); + parentHeight = r.bottom; + parentWidth = r.right; + GetClientRect(hWndToolbar, &r); + tbHeight = r.bottom; + GetClientRect(hWndStatusbar, &r); + sbHeight = r.bottom; + + maneRect.left = 0; + maneRect.right = parentWidth; + maneRect.top = 0; + maneRect.bottom = parentHeight - sbHeight -tbHeight - 1; + + xNewSize = parentWidth; + yNewSize = parentHeight - sbHeight -tbHeight; + + /* FIXME: try to SetWindowPos() instead */ + SetWindowPos(hWndDraw, HWND_TOPMOST, 0, tbHeight+1, + xNewSize, yNewSize, + SWP_NOACTIVATE | SWP_DEFERERASE | SWP_SHOWWINDOW + | SWP_NOOWNERZORDER | SWP_NOZORDER); + + GetClientRect(hWndDraw, &r); + + maneWidth = r.right; + maneHeight = r.bottom; + + SetScrollBars(hWndDraw); + +#if 1 +/* GdiFlush(); */ +/* UpdateWindow(hWndDraw); */ + /* FIXME : adjust the position of the page */ + if (maneDrawDC && hWndDraw && bInitComplete) { + GetWindowOrgEx(maneDrawDC, &ptOldOrg); + if (mane.win == hWndDraw && GetClientRect(hWndDraw, &maneRect)) { + int xorg = (int)(page_w - maneRect.right)/2; + int yorg = (int)(page_h - maneRect.bottom)/2; + xorg = min(0, xorg); + yorg = min(0, yorg); +#if 0 + fprintf(stderr, "Old org (%ld, %ld) New org (%ld, %ld) page %d %d rect %d %d\n", + ptOldOrg.x, ptOldOrg.y, + xorg, yorg, page_w, page_h, maneRect.right, maneRect.bottom); +#endif + ScrollWindowEx(hWndDraw, + - xorg + ptOldOrg.x, - yorg + ptOldOrg.y, + NULL, NULL, (HRGN)NULL, (LPRECT)NULL, + SW_INVALIDATE | SW_ERASE); +/* fprintf(stderr, "scrolled window by %d, %d\n", */ +/* - xorg + ptOldOrg.x, - yorg + ptOldOrg.y); */ +/* GdiFlush(); */ +/* UpdateWindow(hWndDraw); */ + if (SetWindowOrgEx(maneDrawDC, xorg, yorg, NULL) == 0) { + Win32Error("MsgDrawPaint/SetWindowOrgEx(x,y)"); + } +/* fprintf(stderr, "Set new org @ (%ld, %ld)\n", xorg, yorg); */ +/* GdiFlush(); */ +/* UpdateWindow(hWndDraw); */ + } + else { + Win32Error("MsgDrawPaint/GetClientRect(hwnd)"); + } + } +#endif +} + +/* + FUNCTION: MsgDestroy(HWND, UINT, WPARAM, LPARAM) + + PURPOSE: Calls PostQuitMessage(). + + PARAMETERS: + + hwnd - Window handle (Unused) + uMessage - Message number (Unused) + wparam - Extra data (Unused) + lparam - Extra data (Unused) + + RETURN VALUE: + + Always returns 0 - Message handled + + COMMENTS: + */ + + +LRESULT MsgDestroy(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + DragAcceptFiles(hwnd, FALSE); + SaveOptions(); + + PostQuitMessage(0); + return 0; +} + +/* + FUNCTION: CmdExit(HWND, WORD, WORD, HWND) + + PURPOSE: Exit the application. + + PARAMETERS: + hwnd - The window. + wCommand - IDM_EXIT (unused) + wNotify - Notification number (unused) + hwndCtrl - NULL (unused) + + RETURN VALUE: + Always returns 0 - command handled. + + COMMENTS: + */ + + +LRESULT CmdExit(HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + DragAcceptFiles(hwnd, FALSE); + SaveOptions(); + + PostQuitMessage(0); + return 0; +} + +/* + Status Bar functions + */ + +LRESULT MsgDropFiles(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + WORD cFiles; + char lpszFile[MAX_PATH]; + + cFiles = DragQueryFile((HANDLE) wparam, 0xFFFFFFFF, (LPSTR) NULL, 0); + if (cFiles != 1) { + MessageBox(hWndMain, "Only one dvi file open.", NULL, MB_APPLMODAL | MB_ICONHAND | MB_OK); + } + DragQueryFile((HANDLE) wparam, 0, lpszFile, sizeof(lpszFile)); + dvi_name = xstrdup(lpszFile); + DragFinish((HANDLE) wparam); + + open_dvi_file(); + if (reconfig() == FALSE) { + char buf[40]; + mane.shrinkfactor +=3; + wsprintf(buf, "New shrink factor : %d\n", mane.shrinkfactor); + UpdateStatusBar(buf, 0, 0); + if (reconfig() == FALSE) { + MessageBox(hWndMain, "Can't allocate page bitmap !\r\nPlease report this error.", NULL, MB_APPLMODAL | MB_ICONERROR | MB_OK); + CleanExit(1); + } + } + redraw_page(); + SetForegroundWindow(hwnd); + + return 0; + +} +#if 0 +/* + FUNCTION: MsgTimer(HWND, UINT, WPARAM, LPARAM) + + PURPOSE: Calls GetLocalTime() to set the time on the status bar + + + PARAMETERS: + + hwnd - Window handle (Unused) + uMessage - Message number (Unused) + wparam - Extra data (Unused) + lparam - Extra data (Unused) + + RETURN VALUE: + + Always returns 0 - Message handled + + COMMENTS: + + Every time the window procedure receives a Timer message, it calls + GetLocalTime() to obtain the time and then formats the time into + a string. The time sting is then displayed on the status bar. + */ + +LRESULT MsgTimer(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + char szBuf[16]; /* Temp buffer. */ + SYSTEMTIME sysTime; + + + GetLocalTime(&sysTime); + + wsprintf(szBuf, + "%2d:%02d:%02d %s", + (sysTime.wHour == 0 ? 12 : + (sysTime.wHour <= 12 ? sysTime.wHour : sysTime.wHour -12)), + sysTime.wMinute, + sysTime.wSecond, + (sysTime.wHour < 12 ? "AM":"PM")); + + UpdateStatusBar(szBuf, 8, 0); + return 0; +} + +/* + FUNCTION: MsgMousemove(HWND, UINT, WPARAM, LPARAM) + + PURPOSE: Obtains the Cursor position to display coordinates on + the status bar. + + PARAMETERS: + + hwnd - Window handle (Unused) + uMessage - Message number (Unused) + wparam - Extra data (Unused) + lparam - Extra data (Used) + + RETURN VALUE: + + Always returns 0 - Message handled + + COMMENTS: + + The mouse coordinates (x and y) are in the HI And LO words + of LPARAM + */ + + +LRESULT MsgMousemove(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + char szBuf[20]; /* Array for formatting mouse coordinates */ + + wsprintf(szBuf, "%d,%d", LOWORD(lparam), HIWORD(lparam)); + UpdateStatusBar(szBuf, 6, 0); + return 0; +} +#endif + +/* + FUNCTION: MsgMenuSelect(HWND, UINT, WPARAM, LPARAM) + + PURPOSE: Upadates menu selections on the status bar. + + + PARAMETERS: + + hwnd - Window handle (Used) + uMessage - Message number (Used) + wparam - Extra data (Used) + lparam - Extra data (Used) + + RETURN VALUE: + + Always returns 0 - Message handled + + COMMENTS: + This message is sent when the user selects menu items by + by pulling down a popup menu move the mouse around to highlite + different menu items. + */ + +LRESULT MsgMenuSelect(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + static char szBuffer[128]; + UINT nStringID = 0; + UINT fuFlags = GET_WM_MENUSELECT_FLAGS(wparam, lparam) & 0xffff; + UINT uCmd = GET_WM_MENUSELECT_CMD(wparam, lparam); + HMENU hMenu = GET_WM_MENUSELECT_HMENU(wparam, lparam); + + + szBuffer[0] = 0; /* First reset the buffer */ + + + if (fuFlags == 0xffff && hMenu == NULL) /* Menu has been closed */ + nStringID = IDS_DESCRIPTION; + + else if (fuFlags & MFT_SEPARATOR) /* Ignore separators */ + nStringID = 0; + + else if (fuFlags & MF_POPUP) /* Popup menu */ + { + if (fuFlags & MF_SYSMENU) /* System menu */ + nStringID = IDS_SYSMENU; + + else + /* Get string ID for popup menu from idPopup array. */ + nStringID = ((uCmd < sizeof(idPopup)/sizeof(idPopup[0])) ? + idPopup[uCmd] : 0); + } /* for MF_POPUP */ + + else /* Must be a command item */ + nStringID = uCmd; /* String ID == Command ID */ + + /* Load the string if we have an ID */ + if (0 != nStringID) + LoadString(hInst, nStringID, szBuffer, sizeof(szBuffer)); + + /* Finally... send the string to the status bar */ + UpdateStatusBar(szBuffer, 0, 0); + + return 0; +} + + +/* + FUNCTION: InitializeStatusBar(HWND) + + PURPOSE: Initialize statusbar control with time and mouse positions. + + + PARAMETERS: + + hwndParent - Window handle of the status bar's parent + + + RETURN VALUE: NONE + + + COMMENTS: + + This function initializes the time and mouse positions sections of + the statubar window. The Date for the time section is obtained by + calling SetTimer API. When the timer messages start comming in, + GetSytemTime() to fill the time section. + The WPARAM of SB_SETTEXT is divided into 2 parameters. The LOWORD + determines which section/part the text goes into, and the HIWORD + tells how the bar is drawn (popin or popout). + */ + +void InitializeStatusBar(HWND hwndParent) +{ + const cSpaceInBetween = 8; + char szBuf[20]; + int ptArray[7]; /* Array defining the number of parts/sections */ + SIZE size; /* the Status bar will display. */ + RECT rect; + HDC hDC; + + /* + * Fill in the ptArray... + */ + + hDC = GetDC(hwndParent); + GetClientRect(hwndParent, &rect); + + ptArray[6] = rect.right; + + if (GetTextExtentPoint(hDC, "999999.999xx x 999999.999xx", 27, &size)) + ptArray[5] = ptArray[6] - (size.cx) - cSpaceInBetween; + else + ptArray[5] = 0; + + if (GetTextExtentPoint(hDC, "Cursor Pos:", 12, &size)) + ptArray[4] = ptArray[5] - (size.cx) - cSpaceInBetween; + else + ptArray[4] = 0; + + if (GetTextExtentPoint(hDC, "999", 2, &size)) + ptArray[3] = ptArray[4] - (size.cx) - cSpaceInBetween; + else + ptArray[3] = 0; + + if (GetTextExtentPoint(hDC, "Scaling:", 9, &size)) + ptArray[2] = ptArray[3] - (size.cx) - cSpaceInBetween; + else + ptArray[2] = 0; + + if (GetTextExtentPoint(hDC, "99999 of 99999", 14, &size)) + ptArray[1] = ptArray[2] - (size.cx) - cSpaceInBetween; + else + ptArray[1] = 0; + + if (GetTextExtentPoint(hDC, "Page:", 6, &size)) + ptArray[0] = ptArray[1] - (size.cx) - cSpaceInBetween; + else + ptArray[0] = 0; + + ReleaseDC(hwndParent, hDC); + + SendMessage(hWndStatusbar, + SB_SETPARTS, + sizeof(ptArray)/sizeof(ptArray[0]), + (LPARAM)(LPINT)ptArray); + + UpdateStatusBar(SZDESCRIPTION, 0, 0); + UpdateStatusBar("Page:", 1, SBT_POPOUT); + wsprintf(szBuf, "%5d of %5d", current_page+1, total_pages); + UpdateStatusBar(szBuf, 2, 0); + UpdateStatusBar("Page:", 1, SBT_POPOUT); + UpdateStatusBar("Scaling:", 3, SBT_POPOUT); + wsprintf(szBuf, "%2d", mane.shrinkfactor); + UpdateStatusBar(szBuf, 4, 0); + UpdateStatusBar("Cursor Pos:", 5, SBT_POPOUT); +} + +/* + FUNCTION: CreateSBar(HWND, UINT, WPARAM, LPARAM) + + PURPOSE: Calls CreateStatusWindow() to create the status bar + + + PARAMETERS: + + hwndParent - Window handle of the status bar's parent + + RETURN VALUE: + + If both controls were created successfully Return TRUE, + else returns FALSE. + + COMMENTS: + */ + +BOOL CreateSBar(HWND hwndParent) +{ + hWndStatusbar = CreateStatusWindow(WS_CHILD | WS_VISIBLE | WS_BORDER, + SZDESCRIPTION, + hwndParent, + IDM_STATUSBAR); + if(hWndStatusbar) + { + InitializeStatusBar(hwndParent); + return TRUE; + } + + return FALSE; +} + + +/* + FUNCTION: UpdateStatusBar(HWND) + + PURPOSE: Updates the statusbar control with appropriate text + + + PARAMETERS: + + lpszStatusString - text to be displayed + partNumber - which part of the status bar to display text in + displayFlags - display flags + + + RETURN VALUE: NONE + + + COMMENTS: + None + */ + + +void UpdateStatusBar(LPSTR lpszStatusString, WORD partNumber, WORD displayFlags) +{ + + SendMessage(hWndStatusbar, + SB_SETTEXT, + partNumber | displayFlags, + (LPARAM)lpszStatusString); +} + +/* + FUNCTION: CreateTBar(HWND) + + PURPOSE: Calls CreateToolBarEx() + + + PARAMETERS: + + hwnd - Window handle : Used for the hWndParent parameter of the control. + + RETURN VALUE: + + If toolbar control was created successfully Return TRUE, + else returns FALSE. + + COMMENTS: + */ + + +BOOL CreateTBar(HWND hwnd) +{ + DWORD style = WS_CHILD | WS_VISIBLE | TBSTYLE_TOOLTIPS; + + hWndToolbar = CreateToolbarEx(hwnd, + style, + IDR_TOOLBAR1, + NUMIMAGES, + hInst, + IDR_TOOLBAR1, + tbButton, + sizeof(tbButton)/sizeof(TBBUTTON), + BUTTONWIDTH, + BUTTONHEIGHT, + IMAGEWIDTH, + IMAGEHEIGHT, + sizeof(TBBUTTON)); + if (hWndToolbar != NULL) { + ShowWindow(hWndToolbar, SW_SHOW); + return TRUE; + } + + return FALSE; +} + +/* + FUNCTION: MsgNotify(HWND, UINT, WPARAM, LPARAM) + + PURPOSE: WM_NOTIFY is sent to the parent window to get the + tooltip text assoc'd with that toolbar button. + + PARAMETERS: + + hwnd - Window handle (Unused) + uMessage - Message number (Unused) + wparam - Extra data (Unused) + lparam - TOOLTIPTEXT FAR* + + RETURN VALUE: + Always returns 0 - Message handled + + + COMMENTS: + This message fills in the lpszText field of the TOOLTIPTEXT + structure if code == TTN_NEEDTEXT + */ + +LRESULT MsgNotify(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + LPTOOLTIPTEXT lpToolTipText; + static char szBuffer[64]; + + lpToolTipText = (LPTOOLTIPTEXT)lparam; + if (lpToolTipText->hdr.code == TTN_NEEDTEXT) + { + LoadString(hInst, + lpToolTipText->hdr.idFrom, /* string ID == command ID */ + szBuffer, + sizeof(szBuffer)); + + lpToolTipText->lpszText = szBuffer; + } + return 0; +} + + + +/* + Miscellaneous functions + */ +/* + FUNCTION: CenterWindow(HWND, HWND) + + PURPOSE: Center one window over another. + + PARAMETERS: + hwndChild - The handle of the window to be centered. + hwndParent- The handle of the window to center on. + + RETURN VALUE: + + TRUE - Success + FALSE - Failure + + COMMENTS: + + Dialog boxes take on the screen position that they were designed + at, which is not always appropriate. Centering the dialog over a + particular window usually results in a better position. + */ + +BOOL CenterWindow(HWND hwndChild, HWND hwndParent) +{ + RECT rcChild, rcParent; + int cxChild, cyChild, cxParent, cyParent; + int cxScreen, cyScreen, xNew, yNew; + HDC hdc; + + /* Get the Height and Width of the child window */ + GetWindowRect(hwndChild, &rcChild); + cxChild = rcChild.right - rcChild.left; + cyChild = rcChild.bottom - rcChild.top; + + /* Get the Height and Width of the parent window */ + GetWindowRect(hwndParent, &rcParent); + cxParent = rcParent.right - rcParent.left; + cyParent = rcParent.bottom - rcParent.top; + + /* Get the display limits */ + hdc = GetDC(hwndChild); + cxScreen = GetDeviceCaps(hdc, HORZRES); + cyScreen = GetDeviceCaps(hdc, VERTRES); + ReleaseDC(hwndChild, hdc); + + /* Calculate new X position, then adjust for screen */ + xNew = rcParent.left + ((cxParent - cxChild) / 2); + if (xNew < 0) + { + xNew = 0; + } + else if ((xNew + cxChild) > cxScreen) + { + xNew = cxScreen - cxChild; + } + + /* Calculate new Y position, then adjust for screen */ + yNew = rcParent.top + ((cyParent - cyChild) / 2); + if (yNew < 0) + { + yNew = 0; + } + else if ((yNew + cyChild) > cyScreen) + { + yNew = cyScreen - cyChild; + } + + /* Set it, and return */ + return SetWindowPos(hwndChild, + NULL, + xNew, yNew, + 0, 0, + SWP_NOSIZE | SWP_NOZORDER); +} + + +/* + FUNCTION: CmdStub(HWND, WORD, WORD, HWND) + + PURPOSE: Display statusbar updates by calling UpdateStatusBar + + PARAMETERS: + hwnd - The window. + wCommand - Menu command ID + wNotify - Notification number (unused) + hwndCtrl - NULL (unused) + + RETURN VALUE: + Always returns 0 - command handled. + + COMMENTS: + Assumes there is a resource string describing this command with the + same ID as the command ID. Loads the string and calls UpdateStatusBar + to put the string into main pane of the status bar. + */ + +LRESULT CmdStub(HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + char szBuffer[50]; + int cbWritten = 0; + + cbWritten = LoadString(hInst, wCommand, szBuffer, sizeof(szBuffer)); + if(cbWritten == 0) + { + lstrcpy(szBuffer, "Unknown Command"); + UpdateStatusBar(szBuffer, 0, 0); + } + else + { + UpdateStatusBar(szBuffer, 0, 0); + MessageBox (hwnd, + "Command Not Yet Implemented.\r\n", + "Windvi", + MB_OK | MB_ICONEXCLAMATION); + } + /* + * Once the command is executed, set the statusbar text to + * original text. + */ + UpdateStatusBar(SZDESCRIPTION, 0, 0); + + return 0; +} +/* + Utility functions +*/ + +#if 0 + +/**************************************************************************** + * * + * FUNCTION : PaletteSize(VOID FAR * pv) * + * * + * PURPOSE : Calculates the palette size in bytes. If the info. block * + * is of the BITMAPCOREHEADER type, the number of colors is * + * multiplied by 3 to give the palette size, otherwise the * + * number of colors is multiplied by 4. * + * * + * RETURNS : Palette size in number of bytes. * + * * + ****************************************************************************/ +WORD PaletteSize (VOID FAR * pv) +{ + LPBITMAPINFOHEADER lpbi; + WORD NumColors; + lpbi = (LPBITMAPINFOHEADER)pv; + /* NumColors = DibNumColors(lpbi); */ + NumColors = lpbi->biBitCount; + if (lpbi->biSize == sizeof(BITMAPCOREHEADER)) + return (WORD)(NumColors * sizeof(RGBTRIPLE)); + else + return (WORD)(NumColors * sizeof(RGBQUAD)); +} + +/**************************************************************************** + * * + * FUNCTION : DibBlt( HDC hdc, * + * int x0, int y0, * + * int dx, int dy, * + * HANDLE hdib, * + * int x1, int y1, * + * LONG rop) * + * * + +* PURPOSE : Draws a bitmap in CF_DIB format, using SetDIBits to device.* + * taking the same parameters as BitBlt(). * + * * + * RETURNS : TRUE - if function succeeds. * + * FALSE - otherwise. * + * * + ****************************************************************************/ +BOOL DibBlt ( + HDC hdc, + INT x0, + INT y0, + INT dx, + INT dy, + HANDLE hdib, + INT x1, + INT y1, + LONG rop) +{ + LPBITMAPINFOHEADER lpbi; + LPSTR pBuf; + DIBSECTION ds; + + if (!hdib) + return PatBlt(hdc,x0,y0,dx,dy,rop); + + /* our dibs are created with CreateDIBsection(), + so are DIBSECTION. We need to retrieve them with GetObject(). + FIXME : this does not work as-is. + */ + + if (GetObject(hdib, sizeof(DIBSECTION), &ds) == 0) + Win32Error("DibBlt/GetObject"); + + /* lpbi = (VOID FAR *)GlobalLock(hdib); */ + lpbi = &(ds.dsBmih); + + if (!lpbi) + return FALSE; + + /* pBuf = (LPSTR)lpbi + (WORD)lpbi->biSize + PaletteSize(lpbi); */ + pBuf = (LPSTR)lpbi + (WORD)lpbi->biSize + + lpbi->biBitCount * sizeof(RGBQUAD); + if (SetDIBitsToDevice (hdc, x0, y0, dx, dy, + x1,y1, + x1, + dy, + pBuf, (LPBITMAPINFO)lpbi, + DIB_RGB_COLORS ) == 0) + Win32Error("DibBlt/SetDIBitsToDevice"); + + /* GlobalUnlock(hdib); */ + return TRUE; +} + +#endif + +static char full_dviname[512]; + +void CloseDviFile() +{ + char *fp, *name; + + /* Nothing to close ? */ + if (!dvi_file) + return; + + if (dvistate != SAVED) { + /* Just in case we have tried to change directory : retain + the full name. */ + + /* Get the full file name */ +#if 1 + /* Beware : might have added file: + FIXME: there should be a copy of original dvi_name + rather that parsing it back ! + In fact, dvi_name must be made absolute first. + */ + if (memicmp(dvi_name, "file:", 5) == 0) { + if (GetFullPathName(dvi_name+5, sizeof(full_dviname), full_dviname, &fp) == 0) + Win32Error("CloseDviFile/GetFullPathName"); + } + else +#endif + if (GetFullPathName(dvi_name, sizeof(full_dviname), full_dviname, &fp) == 0) { + Win32Error("CloseDviFile/GetFullPathName"); + } + + dvistate = SAVED; + dvipos = ftell(dvi_file); + fclose(dvi_file); + dvi_file = NULL; +#if 0 + fprintf(stderr, "Dvi file %s is closed\n", dvi_name); +#endif + } +} + +void ReopenDviFile() +{ + if (dvistate == SAVED && dvi_file == NULL) { + dvi_file = fopen(full_dviname, OPEN_MODE); + if (dvi_file) { + /* user may have destroyed it ! + FIXME: this needs testing */ + fseek(dvi_file, dvipos, SEEK_SET); + } + dvistate = RESTORED; +#if 0 + fprintf(stderr, "Dvi file %s is reopened\n", dvi_name); +#endif + } +} + +BOOL IsOpenedDviFile() +{ + return dvistate == RESTORED; +} + +LRESULT MsgActivate(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + extern Boolean check_dvi_file(); + int fActive = LOWORD(wparam); + + if (debug & DBG_EVENT) { + fprintf(stderr, "Activate Draw: mag %s, set_home %s, init %scomplete, activated by %s\n", + (bMagDisp ? "on" : "off"), + (bSetHome ? "on" : "off"), + (bInitComplete ? "" : "in"), + (fActive == WA_CLICKACTIVE ? "click" : "other than click")); + } + + if (!bInitComplete || !dvi_file) + return; + + if (/* !bMagDisp && !bSetHome && */ bInitComplete) { + if (fActive == WA_ACTIVE) + bSkipFirstClick = FALSE; + else if (fActive == WA_CLICKACTIVE) + bSkipFirstClick = TRUE; + if (fActive == WA_ACTIVE || fActive == WA_CLICKACTIVE) { + /* We are being activated */ + /* Reopen dvi file */ + ReopenDviFile(); + if (resource.scan_flag) { + if (dvi_file) check_dvi_file(); + /* ChangePage(0); */ + } + } + else if (fActive == WA_INACTIVE) { + /* We are being deactivated */ + if (bMagDisp) { + /* Remove the mag glass ! + Look at windraw.c for more precisions. + */ + foreGC = ruleGC = highGC = maneDrawDC; + fprintf(stderr, "hiding mag glass\n"); + ShowWindow(hWndMagnify, SW_HIDE); + bMagDisp = FALSE; + /* FIXME : is this needed ? */ + bDrawKeep = FALSE; + UpdateWindow(hWndDraw); + /* restores the old shrink factor and redisplay page */ + ClipCursor(NULL); + ReleaseCapture(); + } + else if (bSetHome) { + /* Restore cursor */ + bSetHome = FALSE; + ClipCursor(NULL); + ReleaseCapture(); + SetCursor(hCursArrow); + } + /* Save dvi file params & close it if possible */ + if (dvi_file) { + CloseDviFile(); + } + } + } + + return 0; +} + + +LRESULT MsgCopyData(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + char oldDir[256]; + int fa; + struct data_exchange *lpDataEx = (struct data_exchange *)(((COPYDATASTRUCT *)lparam)->lpData); + +#if 0 + MessageBox(hWndMain, lpDataEx->cwd, lpDataEx->dviname, + MB_APPLMODAL | MB_ICONINFORMATION); +#endif + /* Should we check for new file existence ? */ + GetCurrentDirectory(sizeof(oldDir), oldDir); + SetCurrentDirectory(lpDataEx->cwd); + NormalizeDviName(sizeof(lpDataEx->dviname), lpDataEx->dviname); + if (((fa = GetFileAttributes(lpDataEx->dviname)) != 0xFFFFFFFF) + && ((fa & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY)) { + CloseCurrentFile(); + mane.shrinkfactor = lpDataEx->shrinkfactor; + current_page = lpDataEx->currentpage; + wsprintf(oldDir, "page %d shrink %d", current_page, mane.shrinkfactor); +#if 0 + MessageBox(hWndMain, oldDir, lpDataEx->dviname, + MB_APPLMODAL | MB_ICONINFORMATION); +#endif + OpenCurrentFile(lpDataEx->dviname); + SetForegroundWindow(hwnd); + } + else { + MessageBox(hWndMain, "Can't find file !", lpDataEx->dviname, + MB_APPLMODAL | MB_ICONERROR); + SetCurrentDirectory(oldDir); + } + return TRUE; +} + +#define TRSIZE 100 + +/* BEGIN CHUNK events.c 1 */ +#ifdef SRC_SPECIALS +#define src_jumpButton resource._src_jumpButton +#endif +/* END CHUNK events.c 1 */ + +LRESULT MsgChar(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + char szBuf[80]; + static BOOL has_arg = FALSE; + static int number = 0; + static int sign = 1; + char ch; + BOOL arg0; + int number0; +/* BEGIN CHUNK events.c 3 */ + int src_x, src_y; +/* END CHUNK events.c 3 */ + + ch = wparam; + +#if 0 + printf("char %c (%d) (%x) \n", ch, ch, ch); +#endif + if (ch >= '0' && ch <= '9') { + has_arg = TRUE; + number = number * 10 + sign * (ch - '0'); + return 0; + } + else if (ch == '-') { + has_arg = TRUE; + sign = -1; + number = 0; + return 0; + } + number0 = number; + number = 0; + sign = 1; + arg0 = has_arg; + has_arg = FALSE; +#if 0 + printf("arg0 %d number0 %d\n", arg0, number0); +#endif + switch (wparam) { + + case 'Z': + debug = (arg0 ? number0 : -1); + break; + + case 'q': + case 'Q': + case '\003': /* control-C */ + case '\004': /* control-D */ +#ifdef VMS + case '\032': /* control-Z */ + if (MessageBox(hWndMain, "Really want to quit ?", "Exit", + MB_APPLMODAL | MB_ICONQUESTION | MB_OKCANCEL) == IDOK) + PostQuitMessage((ch == 'Q') ? 2 : 0); + break; +#endif +#if PS + ps_destroy(); +#endif + + case 'n': + case 'f': + case ' ': + /* case '\r': */ + /* case '\n': */ + /* scroll forward; i.e. go to relative page */ + ChangePage(arg0 ? number0 : 1); + break; +#ifdef HTEX + case 'F': /* Follow link forward! */ + { + int x, y; + if (pointerlocate(&x, &y)) { + /* screen_to_page(&mane,s_x,s_y,&page,&px,&py); */ + (void) htex_handleref(current_page, x, y); +#if 0 + redraw_page(); +#endif + } + } + return 0; /* Should goto bad if problem arises? */ + case 'B': /* Go back to previous anchor. */ + htex_goback(); /* Should goto bad if problem arises? */ +#if 0 + redraw_page(); +#endif + return 0; +#endif + + case 'p': + case 'b': + /* case '\b': + case '\177': Del */ + /* scroll backward */ + ChangePage( - (arg0 ? number0 : 1)); + break; + + case '<': + ChangePage(-current_page); + break; + + case 'g': + case 'j': + case '>': + /* go to absolute page (last by default) */ + ChangePage((arg0 ? number0 - pageno_correct : + total_pages - 1) - current_page); + break; + + case '?': + case 'h': + case 'H': /* Help */ + show_help(); + return 0; + + case 'P': /* declare current page */ + pageno_correct = arg0 * number0 - current_page; + return 0; + + case 'k': + resource.keep_flag = (arg0 ? number0 : !resource.keep_flag); + CheckMenuItem(hMenuMain, IDM_KEEPPOS, (resource.keep_flag ? MF_CHECKED : MF_UNCHECKED)); + wsprintf(szBuf, "Home position %skept.", (resource.keep_flag ? "" : "not ")); + UpdateStatusBar(szBuf, 0, 0); + break; + + case '\f': + /* redisplay current page */ + ChangePage(0); + break; + + case '^': + home(TRUE); + break; + + case 'l': + SendMessage(hWndDraw, WM_HSCROLL, MAKELONG(SB_PAGEUP, 0), 0L); + break; + + case 'r': + SendMessage(hWndDraw, WM_HSCROLL, MAKELONG(SB_PAGEDOWN, 0), 0L); + break; + + case 'u': + SendMessage(hWndDraw, WM_VSCROLL, MAKELONG(SB_PAGEUP, 0), 0L); + break; + + case 'd': + SendMessage(hWndDraw, WM_VSCROLL, MAKELONG(SB_PAGEDOWN, 0), 0L); + break; + + case 'c': +#ifndef WIN32 + scrollwindow(&mane, mane.base_x + eventp->xkey.x - clip_w/2, + mane.base_y + eventp->xkey.y - clip_h/2); + if (x_bar) paint_x_bar(); + if (y_bar) paint_y_bar(); + XWarpPointer(DISP, None, None, 0, 0, 0, 0, + clip_w/2 - eventp->xkey.x, clip_h/2 - eventp->xkey.y); + return; +#else + break; +#endif + case 'M': + { + POINT ptOrg = { 0, 0}; + GetWindowOrgEx(maneDrawDC, &ptOrg); + home_x = min(xMousePos + xCurrentScroll + ptOrg.x, (unsigned) page_w) * mane.shrinkfactor; + home_y = min(yMousePos + yCurrentScroll + ptOrg.y, (unsigned) page_h) * mane.shrinkfactor; + if (resource.sidemargin) free(resource.sidemargin); + resource.sidemargin = pixtoa(home_x); + if (resource.topmargin) free(resource.topmargin); + resource.topmargin = pixtoa(home_y); + + wsprintf(szBuf, "Setting home to %5d, %5d", home_x, home_y); + UpdateStatusBar(szBuf, 0, 0); + } + break; +/* BEGIN CHUNK events.c 4 */ +#ifdef SRC_SPECIALS + case 'X': + { + POINT ptOrg = { 0, 0}; + GetWindowOrgEx(maneDrawDC, &ptOrg); + src_x = min(xMousePos + ptOrg.x + xCurrentScroll, (unsigned) page_w) /* * mane.shrinkfactor */; + src_y = min(yMousePos + ptOrg.y + yCurrentScroll, (unsigned) page_h) /* * mane.shrinkfactor */; + /* just highlight next special without calling editor for it */ + src_find_special(0, src_x, src_y); + } + return; +#endif +/* END CHUNK events.c 4 */ + + case 's': + if (!arg0) { + int temp; + + number0 = ROUNDUP(unshrunk_page_w, window_w - 2); + temp = ROUNDUP(unshrunk_page_h, window_h - 2); + if (number0 < temp) number0 = temp; + } + if (number0 <= 0) goto bad; + if (number0 == mane.shrinkfactor) return 0; + + ChangeZoom(number0); + break; + +/* BEGIN CHUNK events.c 6 */ +#ifdef SRC_SPECIALS + /* + * Control-S toggles visibility of src specials + * (mnemonic for isearch in Emacs ;-) + * Also changes the cursor to emphasize the new mode. + */ + case '\023': /* Control-S */ + if (src_evalMode) { + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "SRC specials OFF\n"); + } + /* free src_arr */ + src_cleanup(); + src_evalMode = False; + SetCursor(hCursArrow); + } + else { + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "SRC specials ON\n"); + } + src_evalMode = True; + /* used to have this in addition to emphasize the mode, + * but usage seems more coherent without it: */ + /* src_tickVisibility = True; */ + SetCursor(hCursSrc); + } + redraw_page(); + break; + case 'T': + /* + * change shape of specials, but only when they're visible; + * this makes the key usable for other purposes in ordinary mode. + * However, it seems that in ordinary mode `T' already does the same + * as Ctrl-p: print the Unit/bitord/byteord stuff; what's + * the reason for this ??? + */ + if (src_evalMode) { + src_tickShape++; + if (src_tickShape > SPECIAL_SHAPE_MAX_NUM) { + src_tickShape = 0; + } + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "changing shape to \"%d\"\n", src_tickShape); + } + if (src_tickVisibility) { + redraw_page(); + } + break; + } +#ifndef PS_GS + case 'V': + if (src_evalMode) { + /* + * toggle visibility of src specials + */ + if (src_tickVisibility) { + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "SRC special visibility OFF\n"); + } + src_tickVisibility = False; + } + else { + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "SRC special visibility ON\n"); + } + src_tickVisibility = True; + } + redraw_page(); + return; + } +#endif /* PS_GS */ +#endif /* SRC_SPECIALS */ +/* END CHUNK events.c 6 */ + case 'S': + if (!arg0) goto bad; +#ifdef GREY + if (use_grey) { + float newgamma = number0 != 0 ? number0 / 100.0 : 1.0; + + if (newgamma == gamma) return 0; + gamma = newgamma; + init_colors(); + ChangePage(0); + return 0; + } +#endif + if (number0 < 0) goto bad; + if (number0 == density) return 0; + density = number0; + reset_fonts(); + if (mane.shrinkfactor == 1) return 0; + ChangePage(0); + break; + + case 't': + { /* toggle through magnifier ruler tick units */ + extern void pixel_to_unit(void); + extern char * pos_format; + extern double p2u_factor; + char szBuf[80]; + int k = 0; + static char *TeX_units[] = { + "bp", "cc", "cm", "dd", "in", "mm", "pc", "pt", "sp", + }; + POINT ptOrg = { 0, 0}; + GetWindowOrgEx(maneDrawDC, &ptOrg); + + for (k = 0; k < sizeof(TeX_units)/sizeof(TeX_units[0]); ++k) + if (strcmp(resource._tick_units,TeX_units[k]) == 0) + break; + k++; + if (k >= sizeof(TeX_units)/sizeof(TeX_units[0])) + k = 0; + resource._tick_units = TeX_units[k]; + pixel_to_unit(); + wsprintf(szBuf, "Ruler units = %.2s\n", resource._tick_units); + UpdateStatusBar(szBuf, 0, 0); + sprintf(szBuf, pos_format, + (xMousePos + xCurrentScroll + ptOrg.x) * mane.shrinkfactor * p2u_factor, + (yMousePos + yCurrentScroll + ptOrg.y) * mane.shrinkfactor * p2u_factor); + UpdateStatusBar(szBuf, 6, 0); + } + break; + + case 'G': + use_grey = (arg0 ? number0 : !use_grey); + if (use_grey) init_colors(); + reset_fonts(); + ChangePage(0); + break; + + case 'D': + grid_mode = (arg0 ? number0 : !grid_mode ); + init_page(); + reconfig(); + ChangePage(0); + break; + + +#if PS + case 'v': + if (!arg0 || resource._postscript != !number0) { + resource._postscript = !resource._postscript; + if (resource._postscript) scanned_page = scanned_page_bak; + psp.toggle(); + } + ChangePage(0); + break; +#endif + +#ifdef SELFILE + case '\006': /* control-f */ + ++dvi_time ; /* notice we want a new file in check_dvi_file */ + ChangePage(0); + break ; +#endif /* SELFILE */ + +#if PS_GS + case 'V': +/* BEGIN CHUNK events.c 7 */ +#ifdef SRC_SPECIALS + if (src_evalMode) { + /* + * toggle visibility of src specials + */ + if (src_tickVisibility) { + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "SRC special visibility OFF\n"); + } + src_tickVisibility = False; + } + else { + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "SRC special visibility ON\n"); + } + src_tickVisibility = True; + } + redraw_page(); + return; + } + else { +#endif +/* END CHUNK events.c 7 */ + if (!arg0 || resource.gs_alpha != !number0) + resource.gs_alpha = !resource.gs_alpha; + break; +/* BEGIN CHUNK events.c 8 */ +#ifdef SRC_SPECIALS + } +#endif +/* END CHUNK events.c 8 */ +#endif + + case 'R': + /* reread DVI file */ + --dvi_time; /* then it will notice a change */ + ChangePage(0); + break; + default: + break; + } + + goto good; + + bad: + if (MessageBeep(0xFFFFFFFF) == 0) + Win32Error("HandleKey/MessageBeep"); + good: + return 0; +} + +LRESULT MsgKeyDown(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + WORD wScrollNotify = 0xFFFF; + UINT msg = WM_VSCROLL; + int new_zoom = shrink_factor, + rel_page = 0; + +#define SHIFTED 0x8000 +#define KEYCOUNT 0x000F + + int ctrl = (GetKeyState(VK_CONTROL) & SHIFTED); + int shift = (GetKeyState(VK_SHIFT) & SHIFTED); + int l_alt = (GetKeyState(VK_LMENU) & SHIFTED); + int r_alt = (GetKeyState(VK_RMENU) & SHIFTED); + int count = lparam & KEYCOUNT; + +#if 0 + fprintf(stderr, "ctrl = %x, shift = %x, wparam = %x, count = %x\n", + ctrl, shift, wparam, count); +#endif + + switch (wparam) { + case VK_LEFT: + msg = WM_HSCROLL; + if (ctrl) + wScrollNotify = SB_LEFT; + else if (shift) + wScrollNotify = SB_PAGELEFT; + else + wScrollNotify = SB_LINELEFT; + break; + + case VK_RIGHT: + msg = WM_HSCROLL; + if (ctrl) + wScrollNotify = SB_RIGHT; + else if (shift) + wScrollNotify = SB_PAGERIGHT; + else + wScrollNotify = SB_LINERIGHT; + break; + + case VK_UP: + msg = WM_VSCROLL; + if (ctrl) + wScrollNotify = SB_TOP; + else if (shift) + wScrollNotify = SB_PAGEUP; + else + wScrollNotify = SB_LINEUP; + break; + + case VK_DOWN: + msg = WM_VSCROLL; + if (ctrl) + wScrollNotify = SB_BOTTOM; + else if (shift) + wScrollNotify = SB_PAGEDOWN; + else + wScrollNotify = SB_LINEDOWN; + break; + + case VK_PRIOR: + if (ctrl) + ChangePage(-current_page); + wScrollNotify = SB_PAGEUP; + break; + + case VK_NEXT: + if (ctrl) + ChangePage(total_pages - 1 - current_page); + wScrollNotify = SB_PAGEDOWN; + break; + + case VK_END: + /* Only vertical end */ + wScrollNotify = SB_BOTTOM; + break; + + case VK_HOME: + home(TRUE); + break; + + case VK_ADD: + new_zoom -= count; + break; + + case VK_SUBTRACT: + new_zoom += count; + break; + + case VK_RETURN: + rel_page = count; + break; + + case VK_BACK: + rel_page = -count; + break; + + case 'L': + if (ctrl) { + ChangePage(0); + } + break; + + } +#if 0 + fprintf(stderr, "wScrollNotify = %x msg = %x\n", wScrollNotify, msg); +#endif + if (new_zoom != shrink_factor) + ChangeZoom(new_zoom); + if (rel_page != 0) + ChangePage(rel_page); + if (wScrollNotify != 0xFFFF) { + int i; + for (i = 0; i < count; i++) + SendMessage(hWndDraw, msg, MAKELONG(wScrollNotify, 0), 0L); + } + return 0; +} + + +LRESULT CmdOpen (HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + extern FILE *select_filename(int, int); + extern void open_dvi_file(); + + if (dvi_file = select_filename(TRUE, TRUE)) { + open_dvi_file(); + if (reconfig() == FALSE) { + char buf[40]; + mane.shrinkfactor +=3; + wsprintf(buf, "New shrink factor : %d\n", mane.shrinkfactor); + UpdateStatusBar(buf, 0, 0); + if (reconfig() == FALSE) { + MessageBox(hWndMain, "Can't allocate page bitmap !\r\nPlease report this error.", NULL, MB_APPLMODAL | MB_ICONERROR | MB_OK); + CleanExit(1); + } + }; +#if 0 + redraw_page(); +#else + ChangeZoom(resource.shrinkfactor); +#endif + ChangePage(0); + SetForegroundWindow(hwnd); + } + return 0; +} + +LRESULT CmdOpenRecentFile (HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + extern void UpdateMainMenuUsedFiles(void); + + int nCount = wCommand - IDM_FILE_RECENT; + char *new_name, *new_cwd, *last_sep, *p; + char oldDir[260]; + int fa, i; + + new_name = strdup(p = lpLastUsedFiles[nCount]); + + /* shift the first files down to this one */ + for (i = nCount; i >= 1; i--) + lpLastUsedFiles[i] = lpLastUsedFiles[i-1]; + lpLastUsedFiles[0] = p; + UpdateMainMenuUsedFiles(); + + if ((last_sep = strrchr(new_name, '/')) == NULL) + last_sep = strrchr(new_name, '\\'); + + if (!last_sep) + return 0; + + *last_sep = '\0'; + new_cwd = new_name; + new_name = last_sep+1; + + /* Should we check for new file existence ? */ + GetCurrentDirectory(sizeof(oldDir), oldDir); + SetCurrentDirectory(new_cwd); + if (((fa = GetFileAttributes(new_name)) != 0xFFFFFFFF) + && ((fa & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY)) { + CloseCurrentFile(); + current_page = 0; +#if 0 + MessageBox(hWndMain, oldDir, lpDataEx->dviname, + MB_APPLMODAL | MB_ICONINFORMATION); +#endif + OpenCurrentFile(new_name); + if (reconfig() == FALSE) { + char buf[40]; + mane.shrinkfactor +=3; + wsprintf(buf, "New shrink factor : %d\n", mane.shrinkfactor); + UpdateStatusBar(buf, 0, 0); + if (reconfig() == FALSE) { + MessageBox(hWndMain, "Can't allocate page bitmap !\r\nPlease report this error.", NULL, MB_APPLMODAL | MB_ICONERROR | MB_OK); + CleanExit(1); + } + }; +#if 0 + redraw_page(); +#endif + ChangePage(0); + SetForegroundWindow(hwnd); + } + else { + MessageBox(hWndMain, "Can't find file !", new_name, + MB_APPLMODAL | MB_ICONERROR); + SetCurrentDirectory(oldDir); + } + free(new_cwd); + return 0; +} + +LRESULT CmdClose (HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + if (dvi_file) + CloseDviFile(); + if (dvi_name) { + free(dvi_name); + dvi_name = NULL; + set_icon_and_title("", NULL, NULL, 1); + } + redraw_page(); + return 0; +} + +/* Choose a decent shrink factor, given the page size + and the screen params */ +int ChooseShrink() +{ + extern HWND hWndMain, hWndDraw; + RECT rcTotal, rcDraw; + int total_width, total_height, draw_width, draw_height; + int usable_screen_width, usable_screen_height; + int xNewSize, yNewSize; + int shrink_x, shrink_y; + char szBuf[80]; + + /* + Principle : get the size of the non-drawing area + remove it from the size of the screen + and calculate the best shrink factor of this size + next resize the frame window + */ + GetWindowRect(hWndMain, &rcTotal); + GetWindowRect(hWndDraw, &rcDraw); + total_width = rcTotal.right - rcTotal.left; + total_height = rcTotal.bottom - rcTotal.top; + draw_width = rcDraw.right - rcDraw.left; + draw_height = rcDraw.bottom - rcDraw.top; + usable_screen_width = maneHorzRes - (total_width - draw_width); + usable_screen_height = maneVertRes - (total_height - draw_height); + + shrink_x = ROUNDUP(unshrunk_page_w, draw_width); + shrink_y = ROUNDUP(unshrunk_page_h, draw_height); + if (shrink_x > shrink_y) shrink_x = shrink_y; + + xNewSize = ROUNDUP(unshrunk_page_w,shrink_x) + + (total_width - draw_width) + 1; + yNewSize = ROUNDUP(unshrunk_page_h,shrink_x) + + (total_height - draw_height) + 1; + + wsprintf(szBuf, "Shrink choosen %d (%d x %d)", shrink_x, + xNewSize, yNewSize); + UpdateStatusBar(szBuf, 0, 0); + return shrink_x; +} + +void ChangeZoom(int new_shrink) +{ + char szBuf[20]; + + if (new_shrink <= 0 || new_shrink == mane.shrinkfactor) + return; + + mane.shrinkfactor = new_shrink; + init_page(); +#if 0 + fprintf(stderr, "new_shrink (%d) != bak_shrink (%d)\n", + new_shrink, bak_shrink); +#endif + if (new_shrink != 1 && new_shrink != bak_shrink) { + bak_shrink = new_shrink; +#ifdef GREY + /* if (use_grey) init_pix(RGB(0,0,0), RGB(255,255,255)); */ + if (use_grey) + init_pix(string_to_colorref(resource.fore_color), + string_to_colorref(resource.back_color)); +#endif + } + if (reconfig() == FALSE) { + char buf[40]; + mane.shrinkfactor += 1; + wsprintf(buf, "Can't allocate bitmap for this shrink factor."); + UpdateStatusBar(buf, 0, 0); + init_page(); + if (reconfig() == FALSE) { + MessageBox(hWndMain, "Not enough storage for page bitmap\r\n", + NULL, MB_OK | MB_APPLMODAL | MB_ICONERROR); + CleanExit(1); + } + } + reset_fonts(); + /* In case the ScrollBars will disappear */ + SetScrollBars(hWndDraw); + redraw_page(); + resource.shrinkfactor = mane.shrinkfactor; + wsprintf(szBuf, "%2d", mane.shrinkfactor); + UpdateStatusBar(szBuf, 4, 0); +} + +LRESULT CmdZoomIn(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + ChangeZoom(mane.shrinkfactor - 1); + return 0; +} + +LRESULT CmdZoomOut(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + ChangeZoom(mane.shrinkfactor + 1); + return 0; +} + +LRESULT CmdTogglePS(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + resource._postscript = (resource._postscript ? 0 : 1); + CheckMenuItem(hMenuMain, IDM_TOGGLEPS, (resource._postscript ? MF_CHECKED : MF_UNCHECKED)); + if (resource._postscript) scanned_page = scanned_page_bak; + psp.toggle(); + redraw_page(); + return 0; +} + +LRESULT CmdToggleGrid(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + char szBuf[80]; + float sep = 0.0; + + resource._grid_mode = (resource._grid_mode + 1) % 4; + if (resource._grid_mode == 3) { + sep = (float)ROUNDUP(unshrunk_paper_unit, shrink_factor) / 4.0; + sprintf(szBuf, "Grid mode %4.2f pixels", sep); + } + else if (resource._grid_mode == 2) { + sep = (float)ROUNDUP(unshrunk_paper_unit, shrink_factor) / 2.0; + sprintf(szBuf, "Grid mode %4.2f pixels", sep); + } + else if (resource._grid_mode == 1) { + sep = (float)ROUNDUP(unshrunk_paper_unit, shrink_factor); + sprintf(szBuf, "Grid mode %4.2f pixels", sep); + } + else + sprintf(szBuf, "Grid mode off"); + + UpdateStatusBar(szBuf, 0, 0); + CheckMenuItem(hMenuMain, IDM_TOGGLEGRID, (resource._grid_mode ? MF_CHECKED : MF_UNCHECKED)); + init_page(); + redraw_page(); + return 0; +} + +/* + Warning : ChangePage takes a relative count + */ +void ChangePage(int count) +{ + extern int total_pages; + char szBuf[20]; + if (count == 0) { + /* Explicit call to redraw the current page */ + redraw_page(); + } + else { + int next_page; +#ifdef BOOK_MODE + if (resource.book_mode) { + if (count == 1 || count == -1) { + /* in this case, should be 2 */ + next_page = current_page + 2*count; + } + /* ensure that the left page is even */ + current_page = (current_page % 2 ? current_page - 1 : current_page); + } + else { + next_page = current_page + count; + } +#else + next_page = current_page + count; +#endif +#if 1 + next_page = min(next_page, total_pages - 1); + next_page = max(next_page, 0); + if (current_page != next_page) { + /* BEGIN CHUNK events.c 0 */ +#ifdef SRC_SPECIALS + src_delete_all_specials(); +#endif +/* END CHUNK events.c 0 */ + current_page = next_page; + warn_spec_now = warn_spec; + redraw_page(); + } +#else + if (0 <= next_page && next_page < total_pages) { + current_page = next_page; + warn_spec_now = warn_spec; + redraw_page(); + } +#endif + } +#ifdef BOOK_MODE + if (resource.book_mode) { + wsprintf(szBuf, "%5d-%5d of %5d", current_page+1, current_page+2, total_pages); + } + else { + wsprintf(szBuf, "%5d of %5d", current_page+1, total_pages); + } +#else + wsprintf(szBuf, "%5d of %5d", current_page+1, total_pages); +#endif + UpdateStatusBar(szBuf, 2, 0); +} + +LRESULT CmdNextPage(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + ChangePage(+1); + return 0; +} + +LRESULT CmdPreviousPage(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + ChangePage(-1); + return 0; +} + +LRESULT CmdNext5(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + ChangePage(+5); + return 0; +} + +LRESULT CmdPrevious5(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + ChangePage(-5); + return 0; +} + +LRESULT CmdNext10(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + ChangePage(+10); + return 0; +} + +LRESULT CmdPrevious10(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + ChangePage(-10); + return 0; +} + +LRESULT CmdFirstPage(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + ChangePage(- current_page); + return 0; +} + +LRESULT CmdLastPage(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + ChangePage(total_pages - current_page - 1); + return 0; +} + +LRESULT CmdRedrawPage(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + warn_spec_now = warn_spec; + redraw_page(); + return 0; +} + +LRESULT CmdKeepPosition(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + char szBuf[80]; + + resource.keep_flag = !resource.keep_flag; + CheckMenuItem(hMenuMain, IDM_KEEPPOS, (resource.keep_flag ? MF_CHECKED : MF_UNCHECKED)); + wsprintf(szBuf, "Home position %s kept.", (resource.keep_flag ? "" : "not")); + UpdateStatusBar(szBuf, 0, 0); + return 0; +} + +LRESULT CmdGotoPage(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + DialogBox(hInst, "DlgGotoPage", hwnd, (DLGPROC)DlgGotoPage); + return 0; +} + +LRESULT CmdSrcSpecials(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + /* BEGIN CHUNK events.c 2 */ +#ifdef SRC_SPECIALS + if (src_evalMode) { + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "SRC specials OFF\n"); + } + /* free src_arr */ + src_cleanup(); + src_evalMode = False; + SetCursor(hCursArrow); + } + else { + if (src_warn_verbosity >= SRC_WARNINGS_MEDIUM) { + Fprintf(stdout, "SRC specials ON\n"); + } + src_evalMode = True; + /* used to have this too to make the mode clearer, but usage seems more coherent without it: */ + /* src_tickVisibility = True; */ + SetCursor(hCursSrc); + } + redraw_page(); +#endif +/* END CHUNK events.c 2 */ + return 0; +} + +#ifdef HTEX +LRESULT CmdUrlBack(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + htex_goback(); +#if 0 + redraw_page(); +#endif + return 0; +} +#endif + +LRESULT CmdViewLog(HWND hwnd, WORD wCommand, + WORD wNotify, HWND hwndCtrl) +{ + ShowWindow(hViewLog, SW_SHOW); + bLogShown = TRUE; + return 0; +} + +void CleanUp() +{ +#ifdef TRANSFORM + extern HRGN hClipRgn; +#endif + +#ifdef PS +#ifdef TRANSFORM + extern HANDLE hGsEvent; +#endif +#endif + + extern HDC hdcDrawSave; + +#if 0 + __asm int 3; +#endif + + _fcloseall(); + +#ifdef PS + if (hGsDll) { + ps_destroy(); + gs_dll_release(); + } +#endif + +#ifdef HTEX + htex_cleanup(0); +#endif + + remove_temporary_dir(); + +#if 0 + /* resources that should be freed */ + /* + Colors + */ + CRefFree(scan_fore_colors); +#endif + + FreeOptions(); + +#if 0 + MessageBox( NULL, "LogLoopThread finished", "", MB_OK|MB_ICONINFORMATION ); +#endif + + /* close any handle */ + fprintf(stderr, "\n"); + _flushall(); + + fclose(stdin); + fclose(stdout); + fclose(stderr); + + if (dvi_file) + Fclose(dvi_file); + + /* terminate thread */ + if (WaitForSingleObject(hViewLogThread, 2000) == WAIT_TIMEOUT) { + /* This is really unclean. From 20/04/99, it seems that closing + stdout and stderr is not enough to make the ReadFile() + call return broken_pipe. So we have to make it the hard way. */ + // MessageBox( NULL, "ViewLog thread does not want to shut down...", "", MB_OK|MB_ICONINFORMATION ); + TerminateThread(hViewLogThread, 1); + CloseHandleAndClear(&hViewLogThread); + PostMessage(hViewLog, WM_QUIT, 0, 0); + if (WaitForSingleObject(hLogLoopThread, 250) == WAIT_TIMEOUT) { + TerminateThread(hLogLoopThread, 1); + } + CloseHandleAndClear(&hLogLoopThread); + } + + CloseHandleAndClear(&hLogIn); + CloseHandleAndClear(&hViewLogThread); + + + /* Deallocate gdi resources */ + if (forePen && !DeleteObject(forePen)) + Win32Error("CleanUp/DeleteObject/forePen"); + if (foreBrush && !DeleteObject(foreBrush)) + Win32Error("CleanUp/DeleteObject/foreBrush"); + if (backBrush && !DeleteObject(backBrush)) + Win32Error("CleanUp/DeleteObject/backBrush"); + if (backTPicPen && !DeleteObject(backTPicPen)) + Win32Error("CleanUp/DeleteObject/backTPicPen"); + if (foreTPicPen && !DeleteObject(foreTPicPen)) + Win32Error("CleanUp/DeleteObject/foreTPicPen"); + if (foreTPicBrush && !DeleteObject(foreTPicBrush)) + Win32Error("CleanUp/DeleteObject/foreTPicBrush"); + + if (resource.in_memory) { + if (oldmaneDIB) { + /* There is an old maneDIB, put it back in the DC + and delete the current one */ + if ((maneDIB = SelectObject(maneDrawDC, oldmaneDIB)) == NULL) + Win32Error("reconfig/SelectObject"); + if (DeleteObject(maneDIB) == FALSE) + Win32Error("DeleteObject/maneDIB"); + } + + if (oldmagDIB) { + /* There is an old magDIB, put it back in the DC + and delete the current one */ + if ((magDIB = SelectObject(magMemDC, oldmagDIB)) == NULL) + Win32Error("SelectObject/oldmagDIB"); + if (DeleteObject(magDIB) == FALSE) + Win32Error("DeleteObject/magDIB"); + } + + if (maneDrawDC && !DeleteDC(maneDrawDC)) Win32Error("CleanUp/DeleteDC/maneDrawDC"); + if (magMemDC && !DeleteDC(magMemDC)) Win32Error("CleanUp/DeleteDC/magMemDC"); + } + + if (hdcDrawSave) DeleteDC(hdcDrawSave); + +#ifdef TRANSFORM + if (hClipRgn) + DeleteObject(hClipRgn); +#endif +} + +void CleanExit(int code) +{ + CleanUp(); + ExitProcess(code); +} +/* + Be warned: the string has to be used before this function is called + a second time. + */ +LPTSTR GetStringRes (int id) +{ + static TCHAR buffer[MAX_PATH]; + + buffer[0]=0; + LoadString (GetModuleHandle (NULL), id, buffer, MAX_PATH); + return buffer; +} + + +LRESULT CmdHelpTopics(HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + ReadHelp (hwnd, SZAPPNAME".HTML"); + return 0; +} + +#if 0 +LRESULT CmdHelpContents(HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + BOOL bGotHelp; + /* Not called in Windows 95 */ + bGotHelp = WinHelp (hwnd, SZAPPNAME".HLP", HELP_CONTENTS,(DWORD)0); + if (!bGotHelp) { + MessageBox (GetFocus(), GetStringRes(IDS_NO_HELP), + szAppName, MB_OK|MB_ICONHAND); + } + return 0; +} + +LRESULT CmdHelpSearch(HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + /* Not called in Windows 95 */ + if (!WinHelp(hwnd, SZAPPNAME".HLP", HELP_PARTIALKEY, (DWORD)(LPSTR)"")) { + MessageBox (GetFocus(), GetStringRes(IDS_NO_HELP), + szAppName, MB_OK|MB_ICONHAND); + } + return 0; +} + +LRESULT CmdHelpHelp(HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + /* Not called in Windows 95 */ + if(!WinHelp(hwnd, (LPSTR)NULL, HELP_HELPONHELP, 0)) { + MessageBox (GetFocus(), GetStringRes(IDS_NO_HELP), + szAppName, MB_OK|MB_ICONHAND); + } + return 0; +} +#endif + +/*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F + Function: GetErrorMsg + Summary: Accepts a Win32 error code and retrieves a human readable + system message for it. Args: HRESULT hr + SCODE error code. LPTSTR pszMsg + Pointer string where message will be placed. + UINT uiSize Max size of the msg string. + Returns: BOOL TRUE if hr was error; FALSE if not. +F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/ +BOOL GetErrorMsg(HRESULT hr, LPTSTR pszMsg, UINT uiSize) +{ + BOOL bErr = FAILED(hr); + DWORD dwSize; + if (bErr) { + memset(pszMsg, 0, uiSize * sizeof(TCHAR)); + dwSize = FormatMessage(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, hr, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), + pszMsg, uiSize, NULL); + if (dwSize>2) { + /* Take out the trailing CRLF. */ + pszMsg[--dwSize] = 0; + pszMsg[--dwSize] = 0; + } + } + return bErr; +} + +/*F+F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F+++F + Function: HrMsg + Summary: HRESULT Error Message box. Takes standard result code, + looks it up in the system tables, and shows a message + box with the error code (in hex) and the associated + system message. Args: HWND hWndOwner, + Handle to owner parent window. LPTSTR pszTitle + User message string (eg, designating the attempted function). + Appears in dialog title bar. HRESULT hr, + Standard result code. Returns: void +F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F---F-F*/ +void HrMsg(HWND hWndOwner, LPTSTR pszTitle, HRESULT hr) +{ + TCHAR szMsg[MAX_PATH]; + TCHAR szErrMsg[MAX_PATH]; + int iResult; + wsprintf(szMsg, TEXT("Error=0x%X:\r\n"), hr); + GetErrorMsg(hr, szErrMsg, MAX_PATH); + lstrcat(szMsg, szErrMsg); + iResult = MessageBox(hWndOwner, szMsg, pszTitle, MB_OK | MB_ICONEXCLAMATION); + return; +} + +/* + We can replace the WinHelp() system by html files using this. + */ +void ReadHelp(HWND hWndOwner, LPTSTR pszHelpFile) +{ +#define NOBROWSE_ERROR_STR "Can't run browser." +#define NOHTM_ERROR_STR "Can't find .HTM file." +#define ERROR_TITLE_STR "-Error-" + int iRes; + LPSTR lpFullHelpFile = NULL; + if (NULL != pszHelpFile) { + /* First check if the .HTM help file is there at all. */ + lpFullHelpFile = kpse_var_expand("$TEXMFMAIN/doc/html/windvi/windvi.html"); + MessageBox(hWndOwner, lpFullHelpFile, "Help File", + MB_OK | MB_ICONEXCLAMATION); + if (!lpFullHelpFile || GetFileAttributes(lpFullHelpFile) == -1) + lpFullHelpFile = kpse_find_file(pszHelpFile, kpse_texdoc_format, TRUE); + if (lpFullHelpFile) { + /* Use shell to invoke web browser on the HTML help file. */ + iRes = (int) ShellExecute(hWndOwner, TEXT("open"), lpFullHelpFile, + NULL, NULL, SW_SHOWNORMAL); + if (iRes <= 32) { + /* If unable to browse then put up an error box. */ + Win32Error(TEXT(NOBROWSE_ERROR_STR)); + } + } + else { + /* If the .HTM file doesn't exist then put up an error box. */ + iRes = MessageBox(hWndOwner, TEXT(NOHTM_ERROR_STR), TEXT(ERROR_TITLE_STR), + MB_OK | MB_ICONEXCLAMATION); + } + } + return; +} + +/* + Add Last Used Files to main menu +*/ + +#define RECENT_POSITION 8 + +void UpdateMainMenuUsedFiles() +{ + int nCount; + TCHAR szTemp[MAX_PATH + 6]; + HMENU hMenu; + MENUITEMINFO ItemInfo; + + /* Validate parameters. */ + if (!IsWindow(hWndMain)) { + return; + } + + if ((hMenu = GetSubMenu(GetMenu(hWndMain), 0)) == NULL) + Win32Error("UpdateMainMenuUsedFiled/GetSubMenu"); + + for (nCount = 0; nCount < iLastUsedFilesNum; nCount++) { + /* Only add strings that are not null or zero length. */ + if ((lpLastUsedFiles[nCount] != NULL) && (lstrlen(lpLastUsedFiles[nCount]) != 0)) { + /* Build recent file menu string. */ + wsprintf(szTemp, __TEXT("&%d %s"), nCount +1, lpLastUsedFiles[nCount]); + + /* Determine if replacing item or inserting.*/ + memset(&ItemInfo, 0, sizeof(MENUITEMINFO)); + ItemInfo.cbSize = sizeof(MENUITEMINFO); + ItemInfo.fMask = MIIM_TYPE; + GetMenuItemInfo(hMenu, RECENT_POSITION + nCount, TRUE, &ItemInfo); + if (MFT_SEPARATOR == ItemInfo.fType) { + /* Insert item. MIIM_ID */ + ItemInfo.fMask = MIIM_TYPE | MIIM_ID; + ItemInfo.wID = IDM_FILE_RECENT + nCount; + ItemInfo.fType = MFT_STRING; + ItemInfo.dwTypeData = szTemp; + ItemInfo.cch = lstrlen(ItemInfo.dwTypeData); + InsertMenuItem(hMenu, RECENT_POSITION + nCount, TRUE, &ItemInfo); + } + else { + /* Replace menu item. */ + ItemInfo.fMask = MIIM_TYPE | MIIM_STATE; + ItemInfo.fState = MFS_ENABLED; + ItemInfo.fType = MFT_STRING; + ItemInfo.dwTypeData = szTemp; + ItemInfo.cch = lstrlen(ItemInfo.dwTypeData); + SetMenuItemInfo(hMenu, RECENT_POSITION + nCount, TRUE, &ItemInfo); + } + } + } + DrawMenuBar(hWndMain); +} + +int GetSystemType() +{ + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + int result = -1; + + /* Try calling GetVersionEx using the OSVERSIONINFOEX structure, + which is supported on Windows NT versions 5.0 and later. + If that fails, try using the OSVERSIONINFO structure, + which is supported on earlier versions of Windows and Windows NT */ + + ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + + if (! (bOsVersionInfoEx = GetVersionEx ( (OSVERSIONINFO *) &osvi) ) ) { + /* If OSVERSIONINFOEX doesn't work, try OSVERSIONINFO. */ + osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); + if (! GetVersionEx ( (OSVERSIONINFO *) &osvi) ) { + fprintf(stderr, "GetVersion() failed \n"); + MessageBox(NULL, "GetVersion() failed.", NULL, MB_APPLMODAL | MB_ICONHAND | MB_OK); + return -1; + } + } + + switch (osvi.dwPlatformId) { + case VER_PLATFORM_WIN32_NT: + if (osvi.dwMajorVersion == 3) + result = WINNT3; + else if (osvi.dwMajorVersion == 4) + result = WINNT4; + else + result = WINNT5; + break; + case VER_PLATFORM_WIN32_WINDOWS: + if ((osvi.dwMajorVersion > 4) || + ((osvi.dwMajorVersion == 4) && (osvi.dwMinorVersion > 0))) + result = WIN98; + else + result = WIN95; + break; + case VER_PLATFORM_WIN32s: + result = WIN31; + break; + } +#if 0 + fprintf (stderr, "version %d.%d (Build %d)\n", + osvi.dwMajorVersion, + osvi.dwMinorVersion, + osvi.dwBuildNumber & 0xFFFF); + if (bOsVersionInfoEx) + fprintf (stderr, "Service Pack %d.%d\n", + osvi.wServicePackMajor, + osvi.wServicePackMinor); +#endif + return result; +} + +void CloseHandleAndClear(HANDLE *h) +{ + if (h && *h != INVALID_HANDLE_VALUE) { + if (CloseHandle(*h) == FALSE) { + Win32Error("CloseHandle"); + } + *h = INVALID_HANDLE_VALUE; + } +} diff --git a/Build/source/texk/windvi/windvi.h b/Build/source/texk/windvi/windvi.h new file mode 100644 index 00000000000..5e56ba42437 --- /dev/null +++ b/Build/source/texk/windvi/windvi.h @@ -0,0 +1,1457 @@ +/*========================================================================*\ + +Copyright (c) 1990-1997 Paul Vojta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +PAUL VOJTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +NOTE: + xdvi is based on prior work, as noted in the modification history + in xdvi.c. + +\*========================================================================*/ + +/* + * This file gathers all xdvi.h definitions useful for Win32. + * Written by Fabrice Popineau, Supelec from the original xdvi.h . + * This could be merged again at some point, but xdvi.h is already + * fullfiled. + */ + +#ifndef WINDVI_H +#define WINDVI_H + +#define TTF 0 +#define T1 0 + +/******************************** + * The C environment * + *******************************/ + +#include "c-auto.h" + +#ifndef WORDS_BIGENDIAN +#define WORDS_BIGENDIAN 1 +#endif + +#ifdef WIN32 +#include <win32lib.h> +#include <gs32lib.h> +#define WIN31 0 +#define WIN95 WIN31+1 +#define WIN98 WIN95+1 +#define WINNT3 WIN98+1 +#define WINNT4 WINNT3+1 +#define WINNT5 WINNT4+1 + +extern int iSystemType; + +/* Makes it easier to determine appropriate code paths: */ +#if defined (WIN32) +#define IS_WIN32 TRUE +#else +#define IS_WIN32 FALSE +#endif +#define IS_NT (iSystemType >= WINNT3) +#define IS_WIN32S (iSystemType == WIN31) +#define IS_WIN95 (iSystemType == WIN95) +#define IS_WIN98 (iSystemType == WIN98) +#endif /* WIN32 */ + +#if STDC_HEADERS +# include <stddef.h> +# include <stdlib.h> + /* the following works around the wchar_t problem */ +# ifndef WIN32 +# include <X11/X.h> +# if HAVE_X11_XOSDEFS_H +# include <X11/Xosdefs.h> +# endif +# ifdef X_NOT_STDC_ENV +# undef X_NOT_STDC_ENV +# undef X_WCHAR +# include <X11/Xlib.h> +# define X_NOT_STDC_ENV +# endif +# endif /* !WIN32 */ +#endif /* STDC_HEADERS */ + +/* Avoid name clashes with kpathsea. */ +#define xfopen xdvi_xfopen + +/* For wchar_t et al., that the X files might want. */ +#include <kpathsea/systypes.h> +#include <kpathsea/c-memstr.h> +#include <kpathsea/c-fopen.h> +#include <kpathsea/c-pathmx.h> +#include <kpathsea/tex-file.h> + +#ifndef WIN32 +#include <X11/Xlib.h> /* include Xfuncs.h, if available */ +#include <X11/Xutil.h> /* needed for XDestroyImage */ +#include <X11/Xos.h> +#undef wchar_t + +#if XlibSpecificationRelease >= 5 +#include <X11/Xfuncs.h> +#endif +#endif + +#ifdef WIN32 +#define TOOLKIT 1 +#define XtNumber(arr) (sizeof(arr)/sizeof(arr[0])) +typedef void * XtPointer; +typedef unsigned long Pixel; +typedef char Boolean; +typedef unsigned int Dimension; +#undef MOTIF +#undef BUTTONS +#undef CFG2RES + +#else /* !WIN32 */ +#ifndef NOTOOL + +#include <X11/Intrinsic.h> +#if (defined(VMS) && (XtSpecificationRelease <= 4)) || defined(lint) +#include <X11/IntrinsicP.h> +#endif +#define TOOLKIT 1 + +#else /* NOTOOL */ + +#define XtNumber(arr) (sizeof(arr)/sizeof(arr[0])) +typedef unsigned long Pixel; +typedef char Boolean; +typedef unsigned int Dimension; +#undef TOOLKIT +#undef MOTIF +#undef BUTTONS +#undef CFG2RES + +#endif /* NOTOOL */ +#endif /* !WIN32 */ + +#if defined(CFG2RES) && !defined(SELFAUTO) +#define SELFAUTO 1 +#endif + +#if defined(SELFAUTO) && !defined(DEFAULT_CONFIG_PATH) +#define DEFAULT_CONFIG_PATH "$SELFAUTODIR:$SELFAUTOPARENT" +#endif + +#undef CFGFILE /* no cheating */ + +#if defined(DEFAULT_CONFIG_PATH) +#define CFGFILE 1 +#endif + +typedef char Bool3; /* Yes/No/Maybe */ + +#define True 1 +#define False 0 +#define Maybe 2 + +#define INVALID_WIDTH 017777777777 + +#ifdef VMS +#include <string.h> +#define index strchr +#define rindex strrchr +#define bzero(a, b) (void) memset ((void *) (a), 0, (size_t) (b)) +#define bcopy(a, b, c) (void) memmove ((void *) (b), (void *) (a), (size_t) (c)) +#endif + +#ifdef WIN32 +#include <sys/types.h> +typedef long off_t; +#include <io.h> +#endif +#include <stdio.h> +#include <setjmp.h> + +#if HAVE_UNISTD_H +#include <unistd.h> +#endif + +#if HAVE_DIRENT_H +# include <dirent.h> +# define NAMLEN(dirent) strlen((dirent)->d_name) +#else +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# if HAVE_SYS_NDIR_H +# include <sys/ndir.h> +# endif +# if HAVE_SYS_DIR_H +# include <sys/dir.h> +# endif +# if HAVE_NDIR_H +# include <ndir.h> +# endif +#endif + +#ifndef NeedFunctionPrototypes +#if __STDC__ +#define NeedFunctionPrototypes 1 +#else /* STDC */ +#define NeedFunctionPrototypes 0 +#endif /* STDC */ +#endif /* NeedFunctionPrototypes */ + +#if NeedFunctionPrototypes +#define ARGS(x) x +#else +#define ARGS(x) () +#endif + +#ifndef NeedWidePrototypes +#define NeedWidePrototypes NeedFunctionPrototypes +#endif + +#include <kpathsea/c-vararg.h> + +#ifndef _XFUNCPROTOBEGIN +#define _XFUNCPROTOBEGIN +#define _XFUNCPROTOEND +#endif + +#ifndef _Xconst +#if __STDC__ +#define _Xconst const +#else /* STDC */ +#define _Xconst +#endif /* STDC */ +#endif /* _Xconst */ + +#ifdef WIN32 +#undef _Xconst +#define _Xconst +#endif + +#ifndef VOLATILE +#if __STDC__ || (defined(__stdc__) && defined(__convex__)) +#define VOLATILE volatile +#else +#define VOLATILE /* nothing */ +#endif +#endif + +#ifndef NORETURN +#ifdef __GNUC__ +#define NORETURN volatile +#else +#define NORETURN /* nothing */ +#endif +#endif + +#ifndef OPEN_MODE +#define OPEN_MODE FOPEN_RBIN_MODE +#endif /* OPEN_MODE */ + +#ifndef VMS +#define OPEN_MODE_ARGS _Xconst char * +#else +#define OPEN_MODE_ARGS _Xconst char *, _Xconst char * +#endif + +#define Printf (void) printf +#define Puts (void) puts +#define Fprintf (void) fprintf +#define Sprintf (void) sprintf +#define Fseek (void) fseek +#define Fread (void) fread +#define Fputs (void) fputs +#define Putc (void) putc +#define Putchar (void) putchar +#define Fclose (void) fclose +#define Fflush (void) fflush +#define Strcat (void) strcat +#define Strcpy (void) strcpy +#define Exit(n) (void) CleanExit(n) + +#define GC HDC +#define Cursor HCURSOR +#define Window HWND +#define Widget HWND +#define caddr_t void* + +#define XtNumber(arr) (sizeof(arr)/sizeof(arr[0])) +typedef COLORREF Pixel; +typedef RGBQUAD XColor; +typedef char Boolean; +typedef unsigned int Dimension; +typedef short Position; +typedef char Bool3; /* Yes/No/Maybe */ +typedef struct _ximage { + int width; + int height; + unsigned int depth; + unsigned int *endian_permuted; + unsigned int bytes_per_line; + unsigned char *data; } XImage; + +typedef struct BITMAPINFO_256 { + BITMAPINFOHEADER bmiHeader; + RGBQUAD bmiColors[256]; +} BITMAPINFO_256; + +#define DISP NULL +#define SCRN NULL +#define XYBitmap 0 +#define ZPixmap 0 + +/* Macro to determine to round off the given value to the closest byte */ +#define WIDTHBYTES(i) ((i+31)/32*4) + +#define WhitePixelOfScreen(SCRN) PALETTERGB(255,255,255) +#define BlackPixelOfScreen(SCRN) PALETTERGB(0,0,0) + +/* Bit Gravity */ + +#define ForgetGravity 0 +#define NorthWestGravity 1 +#define NorthGravity 2 +#define NorthEastGravity 3 +#define WestGravity 4 +#define CenterGravity 5 +#define EastGravity 6 +#define SouthWestGravity 7 +#define SouthGravity 8 +#define SouthEastGravity 9 +#define StaticGravity 10 + +#define NoValue 0x0000 +#define XValue 0x0001 +#define YValue 0x0002 +#define WidthValue 0x0004 +#define HeightValue 0x0008 +#define AllValues 0x000F +#define XNegative 0x0010 +#define YNegative 0x0020 + +#define USPosition (1L << 0) /* user specified x, y */ +#define USSize (1L << 1) /* user specified width, height */ + +#define PPosition (1L << 2) /* program specified position */ +#define PSize (1L << 3) /* program specified size */ +#define PMinSize (1L << 4) /* program specified minimum size */ +#define PMaxSize (1L << 5) /* program specified maximum size */ +#define PResizeInc (1L << 6) /* program specified resize increments */ +#define PAspect (1L << 7) /* program specified min and max aspect ratios */ +#define PBaseSize (1L << 8) /* program specified base for incrementing */ +#define PWinGravity (1L << 9) /* program specified window gravity */ + +extern int XParseGeometry (char *s, int *x, int *y, + unsigned int *w, unsigned int *h); + + +#ifdef HTEX +char *urlocalize ARGS((char *filename)); +int lastwwwopen; +#endif + +/******************************** + * Types and data * + *******************************/ + +#ifndef EXTERN +#define EXTERN extern +#define INIT(x) +#endif + +#define MAXDIM 32767 + +typedef unsigned char ubyte; + +#if NeedWidePrototypes +typedef unsigned int wide_ubyte; +typedef int wide_bool; +#define WIDENINT (int) +#else +typedef ubyte wide_ubyte; +typedef Boolean wide_bool; +#define WIDENINT +#endif + +#if defined(MAKETEXPK) && !defined(MKTEXPK) +#define MKTEXPK 1 +#endif + +/* + * pixel_conv is currently used only for converting absolute positions + * to pixel values; although normally it should be + * ((int) ((x) / shrink_factor + (1 << 15) >> 16)), + * the rounding is achieved instead by moving the constant 1 << 15 to + * PAGE_OFFSET in dvi_draw.c. + */ +#define pixel_conv(x) ((int) ((x) / shrink_factor >> 16)) +#define pixel_round(x) ((int) ROUNDUP(x, shrink_factor << 16)) +#define spell_conv0(n, f) ((long) (n * f)) +#define spell_conv(n) spell_conv0(n, dimconv) + +#define BMUNIT unsigned BMTYPE +#define BMBITS (8 * BMBYTES) + +#define ADD(a, b) ((BMUNIT *) (((char *) a) + b)) +#define SUB(a, b) ((BMUNIT *) (((char *) a) - b)) + +extern BMUNIT bit_masks[BMBITS + 1]; + +struct frame { + /* dvi_h and dvi_v is the horizontal and vertical baseline position + it is the responsebility of the set_char procedure to update + them. */ + struct framedata { + long dvi_h, dvi_v, w, x, y, z; + int pxl_v; + } data; + struct frame *next, *prev; +}; + +#ifndef TEXXET +typedef long (*set_char_proc) ARGS((wide_ubyte)); +#else +typedef void (*set_char_proc) ARGS((wide_ubyte, wide_ubyte)); +#endif + +struct drawinf { /* this information is saved when using virtual fonts */ + struct framedata data; + struct font *fontp; + set_char_proc set_char_p; + int tn_table_len; + struct font **tn_table; + struct tn *tn_head; + ubyte *pos, *end; + struct font *virtual; +#ifdef TEXXET + int dir; +#endif +}; + +EXTERN struct drawinf currinf; + +/* entries below with the characters 'dvi' in them are actually stored in + scaled pixel units */ + +#define DVI_H currinf.data.dvi_h +#define PXL_H pixel_conv(currinf.data.dvi_h) +#define DVI_V currinf.data.dvi_v +#define PXL_V currinf.data.pxl_v +#define WW currinf.data.w +#define XX currinf.data.x +#define YY currinf.data.y +#define ZZ currinf.data.z +#define ROUNDUP(x,y) (((x)+(y)-1)/(y)) + +EXTERN int current_page; +EXTERN int total_pages; +EXTERN int pageno_correct INIT(1); +EXTERN long magnification; +EXTERN double dimconv; +EXTERN double tpic_conv; +EXTERN int n_files_left INIT(24); /* for LRU closing of fonts */ +EXTERN time_t dvi_time; /* last mod. time for dvi file */ +EXTERN unsigned int page_w, page_h; + +#if defined(GS_PATH) && !defined(PS_GS) +#define PS_GS +#endif + +#if defined(PS_DPS) || defined(PS_NEWS) || defined(PS_GS) +#define PS 1 +#else +#define PS 0 +#endif + +#if PS +EXTERN int scanned_page; /* last page prescanned */ +EXTERN int scanned_page_bak; /* actual value of the above */ +EXTERN int scanned_page_reset; /* number to reset the above to */ +#endif + +/* + * Table of page offsets in DVI file, indexed by page number - 1. + * Initialized in prepare_pages(). + */ +EXTERN long *page_offset; + +/* + * Mechanism for reducing repeated warning about specials, lost characters, etc. + */ +EXTERN Boolean warn_spec_now; + +/* + * added Stefan Ulrich + */ +EXTERN Boolean delay_src INIT(False); + +/* + * If we're in the middle of a PSFIG special. + */ +EXTERN Boolean psfig_begun INIT(False); + +/* BEGIN CHUNK xdvi.h 1 */ +#ifdef SRC_SPECIALS +EXTERN Boolean src_specials_are_evaluated INIT(False); +EXTERN Boolean src_EditorCmd_filename_first; +EXTERN int src_tickShape; +EXTERN int src_tick_height, src_tick_width; /* size of the src tick glyphs */ +#define SPECIAL_SHAPE_MAX_NUM 4 /* number of different shapes (starting from 0) + for drawing src specials. Hardcoding these here is a bad idea ... */ +EXTERN Cursor save_cursor; +#define SRC_WARNINGS_SILENT 0 +#define SRC_WARNINGS_MEDIUM 1 +#define SRC_WARNINGS_VERBOSE 2 +#endif +/* END CHUNK xdvi.h 1 */ + +/* + * Bitmap structure for raster ops. + */ +struct bitmap { + unsigned short w, h; /* width and height in pixels */ + short bytes_wide; /* scan-line width in bytes */ + unsigned int endian_permuted; + char *bits; /* pointer to the bits */ +}; + +/* + * Per-character information. + * There is one of these for each character in a font (raster fonts only). + * All fields are filled in at font definition time, + * except for the bitmap, which is "faulted in" + * when the character is first referenced. + */ +struct glyph { + long addr; /* address of bitmap in font file */ + long dvi_adv; /* DVI units to move reference point */ + short x, y; /* x and y offset in pixels */ + struct bitmap bitmap; /* bitmap for character */ + short x2, y2; /* x and y offset in pixels (shrunken bitmap) */ +#ifdef GREY + XImage *image2; + char *pixmap2; + char *pixmap2_t; +#endif + struct bitmap bitmap2; /* shrunken bitmap for character */ +}; + +/* + * Per character information for virtual fonts + */ +struct macro { + ubyte *pos; /* address of first byte of macro */ + ubyte *end; /* address of last+1 byte */ + long dvi_adv; /* DVI units to move reference point */ + Boolean free_me; /* if free(pos) should be called when */ + /* freeing space */ +}; + +/* + * The layout of a font information block. + * There is one of these for every loaded font or magnification thereof. + * Duplicates are eliminated: this is necessary because of possible recursion + * in virtual fonts. + * + * Also note the strange units. The design size is in 1/2^20 point + * units (also called micro-points), and the individual character widths + * are in the TFM file in 1/2^20 ems units, i.e., relative to the design size. + * + * We then change the sizes to SPELL units (unshrunk pixel / 2^16). + */ + +#define NOMAGSTP (-29999) + +typedef void (*read_char_proc) ARGS((register struct font *, wide_ubyte)); + +struct font { + struct font *next; /* link to next font info block */ + char *fontname; /* name of font */ + float fsize; /* size information (dots per inch) */ + int magstepval; /* magstep number * two, or NOMAGSTP */ + FILE *file; /* open font file or NULL */ + char *filename; /* name of font file */ + long checksum; /* checksum */ + unsigned short timestamp; /* for LRU management of fonts */ + ubyte flags; /* flags byte (see values below) */ +#ifdef Omega + wide_ubyte maxchar; /* largest character code */ +#else + ubyte maxchar; /* largest character code */ +#endif + double dimconv; /* size conversion factor */ + set_char_proc set_char_p; /* proc used to set char */ + /* these fields are used by (loaded) raster fonts */ + read_char_proc read_char; /* function to read bitmap */ + struct glyph *glyph; + /* these fields are used by (loaded) virtual fonts */ + struct font **vf_table; /* list of fonts used by this vf */ + struct tn *vf_chain; /* ditto, if TeXnumber >= VFTABLELEN */ + struct font *first_font; /* first font defined */ + struct macro *macro; + /* I suppose the above could be put into a union, but we */ + /* wouldn't save all that much space. */ +#ifdef T1 + /* These were added for t1 use */ + int t1id; + long scale; +#endif +/* BEGIN CHUNK xdvi.h 2 */ +#ifdef SRC_SPECIALS + float pt_size; /* font size in pt, needed for specials evaluation */ +#endif +/* END CHUNK xdvi.h 2 */ +}; + +#define FONT_IN_USE 1 /* used for housekeeping */ +#define FONT_LOADED 2 /* if font file has been read */ +#define FONT_VIRTUAL 4 /* if font is virtual */ + +#define TNTABLELEN 30 /* length of TeXnumber array (dvi file) */ +#define VFTABLELEN 5 /* length of TeXnumber array (virtual fonts) */ + +struct tn { + struct tn *next; /* link to next TeXnumber info block */ + int TeXnumber; /* font number (in DVI file) */ + struct font *fontp; /* pointer to the rest of the info */ +}; + +EXTERN struct font *tn_table[TNTABLELEN]; +EXTERN struct font *font_head INIT(NULL); +EXTERN struct tn *tn_head INIT(NULL); +#ifdef Omega +EXTERN wide_ubyte maxchar; +#else +EXTERN ubyte maxchar; +#endif +EXTERN unsigned short current_timestamp INIT(0); + +/* + * Command line flags. + */ + +extern struct _resource { +#if CFGFILE && TOOLKIT + _Xconst char *progname; +#endif +#if TOOLKIT + int shrinkfactor; +#endif + int _density; +#ifdef GREY + float _gamma; +#endif + int _pixels_per_inch; + Boolean _delay_rulers; + int _tick_length; + char *_tick_units; + _Xconst char *sidemargin; + _Xconst char *topmargin; + _Xconst char *xoffset; + _Xconst char *yoffset; + _Xconst char *paper; + _Xconst char *_alt_font; + Boolean makepk; + _Xconst char *mfmode; + Boolean _list_fonts; + Boolean reverse; + Boolean _warn_spec; + Boolean _hush_chars; + Boolean _hush_chk; + Boolean safer; +#if defined(VMS) || defined(WIN32) || !defined(TOOLKIT) + _Xconst char *fore_color; + _Xconst char *back_color; +#endif + Pixel _fore_Pixel; + Pixel _back_Pixel; +#ifdef TOOLKIT + Pixel _brdr_Pixel; + Pixel _hl_Pixel; + Pixel _cr_Pixel; +#endif + _Xconst char *icon_geometry; + Boolean keep_flag; + Boolean copy; + Boolean thorough; +#if PS + /* default is to use DPS, then NEWS, then GhostScript; + * we will figure out later on which one we will use */ + Boolean _postscript; + Boolean prescan; + Boolean allow_shell; +#ifdef PS_DPS + Boolean useDPS; +#endif +#ifdef PS_NEWS + Boolean useNeWS; +#endif +#ifdef PS_GS + Boolean useGS; + Boolean gs_safer; + Boolean gs_alpha; + _Xconst char *gs_path; + _Xconst char *gs_palette; +#endif +#endif /* PS */ + _Xconst char *debug_arg; + Boolean version_flag; +#ifdef BUTTONS + Boolean expert; + int shrinkbutton[4]; +#endif + _Xconst char *mg_arg[5]; +#ifdef GREY + Boolean _use_grey; + Bool3 install; +#endif +#ifdef GRID + int _grid_mode; + char *grid1_color, *grid2_color, *grid3_color; +#ifdef TOOLKIT + Pixel _grid1_Pixel, _grid2_Pixel, _grid3_Pixel; +#endif /* TOOLKIT */ +#endif /* GRID */ +#ifdef HTEX + Boolean _underline_link; + char *_browser; + char *_URLbase; + char *_scroll_pages; +#endif /* HTEX */ +/* BEGIN CHUNK xdvi.h 3 */ +#ifdef SRC_SPECIALS + int _src_specialFormat; + int _src_jumpButton; + int _src_tickShape; + char *_src_tickSize; + int _src_cursor_shape; + char *_src_editorCommand; + int _src_warn_verbosity; + Boolean _src_tickVisibility; + Boolean _src_evalMode; +#endif +/* END CHUNK xdvi.h 3 */ +#ifdef WIN32 + Boolean single_flag; + int numColors; + Boolean scan_flag; + Boolean log_flag; + Boolean in_memory; + Boolean use_xform; + Boolean book_mode; +#endif +} resource; + +/* As a convenience, we define the field names without leading underscores + * to point to the field of the above record. Here are the global ones; + * the local ones are defined in each module. */ + +/* BEGIN CHUNK xdvi.h 4 */ +#ifdef SRC_SPECIALS +#define src_cursor_shape resource._src_cursor_shape +#define src_editorCommand resource._src_editorCommand +#define src_warn_verbosity resource._src_warn_verbosity +#define src_tickShape resource._src_tickShape +#define src_tickVisibility resource._src_tickVisibility +#define src_evalMode resource._src_evalMode +#endif +/* END CHUNK xdvi.h 4 */ +#define density resource._density +#define pixels_per_inch resource._pixels_per_inch +#define alt_font resource._alt_font +#define list_fonts resource._list_fonts +#define warn_spec resource._warn_spec +#define hush_chars resource._hush_chars +#define hush_chk resource._hush_chk +#ifdef GREY +#define use_grey resource._use_grey +#endif +#ifdef GRID +#define grid_mode resource._grid_mode +#endif /* GRID */ +#ifdef HTEX +#define underline_link resource._underline_link +#define browser resource._browser +#define URLbase resource._URLbase +#define scroll_pages resource._scroll_pages +#define KPSE_DEBUG_HYPER 6 +#endif + +#ifndef TOOLKIT +EXTERN Pixel brdr_Pixel; +#ifdef GRID +EXTERN Pixel grid1_Pixel; +EXTERN Pixel grid2_Pixel; +EXTERN Pixel grid3_Pixel; +#endif /* GRID */ +#endif + + + +#ifdef GREY +EXTERN Pixel plane_masks[4]; +EXTERN XColor fore_color_data, back_color_data; +#endif + +extern struct mg_size_rec { + int w; + int h; +} + mg_size[5]; + +EXTERN int debug INIT(0); + +#define DBG_BITMAP 1 +#define DBG_DVI 2 +#define DBG_PK 4 +#define DBG_BATCH 8 +#define DBG_EVENT 16 +#define DBG_OPEN 32 +#define DBG_PS 64 +#define DBG_STAT 128 +#define DBG_HASH 256 +#define DBG_PATHS 512 +#define DBG_EXPAND 1024 +#define DBG_SEARCH 2048 +#ifdef HTEX +#define DBG_HYPER 4096 +#define DBG_ANCHOR 8192 +#endif +/* BEGIN CHUNK xdvi.h 5 */ +#ifdef SRC_SPECIALS +#define DBG_SRC_SPECIALS 16384 +#endif +/* END CHUNK xdvi.h 5 */ +#define DBG_ALL (~DBG_BATCH) + + +EXTERN int offset_x, offset_y; +EXTERN unsigned int unshrunk_paper_w, unshrunk_paper_h; +EXTERN unsigned int unshrunk_page_w, unshrunk_page_h; +EXTERN unsigned int unshrunk_dvifile_page_w, unshrunk_dvifile_page_h; +#ifdef GRID +EXTERN unsigned int unshrunk_paper_unit; +#endif /* GRID */ + +EXTERN char *temporary_dir INIT(NULL); +#ifdef HTEX +EXTERN int HTeXnext_extern; /* Bring up next file in new xdvi window */ +EXTERN char *anchor_name INIT(NULL); +EXTERN Boolean URL_aware INIT(False); +EXTERN Boolean highlight INIT(False); +extern int HTeXAnestlevel; /* Hypertext nesting level */ +extern int HTeXreflevel; /* flag for whether we are inside an href */ +#endif + +EXTERN char *dvi_name INIT(NULL); +EXTERN FILE *dvi_file; /* user's file */ +EXTERN unsigned long dvipos; +EXTERN enum {CLEARED, SAVED, RESTORED} dvistate; +EXTERN _Xconst char *prog; +EXTERN int bak_shrink; /* last shrink factor != 1 */ +EXTERN Dimension window_w, window_h; +EXTERN XImage *image; +EXTERN int backing_store; +EXTERN int home_x, home_y; + +#ifndef WIN32 +EXTERN Display *DISP; +EXTERN Screen *SCRN; +#ifdef GREY +EXTERN int screen_number; +EXTERN Visual *our_visual; +EXTERN unsigned int our_depth; +EXTERN Colormap our_colormap; +EXTERN GC copyGC; +#else +#define our_depth (unsigned int) DefaultDepthOfScreen(SCRN) +#define our_visual DefaultVisualOfScreen(SCRN) +#define our_colormap DefaultColormapOfScreen(SCRN) +#define copyGC DefaultGCOfScreen(SCRN) +#endif +#else /* WIN32 */ +EXTERN char *sOutputName INIT(NULL); +EXTERN char ***sCmdArg INIT(NULL); +#endif /* !WIN32 */ +EXTERN GC ruleGC; +EXTERN GC foreGC, highGC; +EXTERN GC foreGC2; +#ifdef GRID +EXTERN GC grid1GC, grid2GC, grid3GC; +#endif /* GRID */ +EXTERN Boolean copy; +EXTERN Boolean allowDrawingChars; + +EXTERN Cursor redraw_cursor, ready_cursor; + +#ifdef GREY +EXTERN COLORREF palette[17]; +EXTERN RGBQUAD pal_rgb[17]; +EXTERN RGBQUAD pal_bw[17]; +EXTERN RGBQUAD pal_mask[17]; +EXTERN unsigned long *pixeltbl; +EXTERN Pixel *pixeltbl_t; +#endif /* GREY */ + +EXTERN Boolean canit INIT(False); +EXTERN jmp_buf canit_env; +EXTERN VOLATILE short event_counter INIT(0); + +struct WindowRec { + Window win; + int shrinkfactor; + int base_x, base_y; + unsigned int width, height; + int min_x, max_x, min_y, max_y; /* for pending expose events */ +}; + +extern struct WindowRec mane, alt, currwin; +EXTERN int min_x, max_x, min_y, max_y; + +#define shrink_factor currwin.shrinkfactor + +#if defined(TOOLKIT) && !defined(WIN32) +EXTERN Widget top_level, vport_widget, draw_widget, clip_widget; +#ifdef HTEX +EXTERN Widget pane_widget, anchor_search, anchor_info; +#endif +#ifdef MOTIF +EXTERN Widget shrink_button[4]; +EXTERN Widget x_bar, y_bar; /* horizontal and vert. scroll bars */ +#endif /* MOTIF */ +#ifdef BUTTONS +#ifndef MOTIF +#define XTRA_WID 79 +#else +#define XTRA_WID 120 +#endif +EXTERN Widget form_widget; +#endif +#else /* !TOOLKIT || WIN32 */ +EXTERN Window top_level; +#ifdef WIN32 +EXTERN Widget anchor_search INIT(NULL); +EXTERN Widget anchor_info INIT(NULL); +#endif +#define BAR_WID 12 /* width of darkened area */ +#define BAR_THICK 15 /* gross amount removed */ +#endif /* TOOLKIT */ + +EXTERN jmp_buf dvi_env; /* mechanism to relay dvi file errors */ +EXTERN _Xconst char *dvi_oops_msg; /* error message */ + +EXTERN char *ffline INIT(NULL); /* an array used by filefind to store */ + /* the file name being formed. */ + /* It expands as needed. */ + /* Also used elsewhere. */ +EXTERN int ffline_len INIT(0); /* current length of ffline[] */ + +#ifdef SELFAUTO +EXTERN _Xconst char *argv0; /* argv[0] */ +#endif + +#ifdef CFG2RES +struct cfg2res { + _Xconst char *cfgname; /* name in config file */ + _Xconst char *resname; /* name of resource */ + Boolean numeric; /* if numeric */ +}; +#endif + +#if PS + +extern struct psprocs { + void (*toggle) ARGS((void)); + void (*destroy) ARGS((void)); + void (*interrupt) ARGS((void)); + void (*endpage) ARGS((void)); + void (*drawbegin) ARGS((int, int, _Xconst char *)); + void (*drawraw) ARGS((_Xconst char *)); + void (*drawfile) ARGS((_Xconst char *, FILE *, _Xconst char *)); + void (*drawend) ARGS((_Xconst char *)); + void (*beginheader) ARGS((void)); + void (*endheader) ARGS((void)); + void (*newdoc) ARGS((void)); +} psp, no_ps_procs; + +#endif /* PS */ + +EXTERN BITMAPINFO_256 bmi1, bmi4, bmi8, bmi24; +EXTERN int nbDIBS INIT(0); +EXTERN HBITMAP oldmaneDIB INIT(NULL); +EXTERN HBITMAP oldmagDIB INIT(NULL); +EXTERN HBITMAP oldimageDIB INIT(NULL); + +/* The default colors for the win32 color map */ +typedef struct colormap_t +{ + char *name; + COLORREF colorref; +} colormap_t; + +extern colormap_t win32_color_map[]; +extern int win32_color_map_size; + +/******************************** + * Procedures * + *******************************/ + +_XFUNCPROTOBEGIN +#ifdef BUTTONS +extern void create_buttons ARGS((XtArgVal)); +#endif +#ifdef GREY +extern void init_plane_masks ARGS((void)); +extern Boolean init_pix ARGS((COLORREF, COLORREF)); +#endif +extern void init_colors ARGS((void)); +extern Boolean reconfig ARGS((void)); +#if defined(TOOLKIT) && !defined(WIN32) +extern void handle_key ARGS((Widget, XtPointer, XEvent *, Boolean *)); +extern void handle_resize ARGS((Widget, XtPointer, XEvent *, Boolean *)); +extern void handle_button ARGS((Widget, XtPointer, XEvent *, Boolean *)); +extern void handle_motion ARGS((Widget, XtPointer, XEvent *, Boolean *)); +extern void handle_release ARGS((Widget, XtPointer, XEvent *, Boolean *)); +extern void handle_exp ARGS((Widget, XtPointer, XEvent *, Boolean *)); +#endif +#ifdef MOTIF +extern void file_pulldown_callback ARGS((Widget, XtPointer, XtPointer)); +extern void navigate_pulldown_callback ARGS((Widget, XtPointer, XtPointer)); +extern void scale_pulldown_callback ARGS((Widget, XtPointer, XtPointer)); +extern void set_shrink_factor ARGS((int)); +#endif +extern void showmessage ARGS((_Xconst char *)); +#if PS +extern void ps_read_events ARGS((wide_bool, wide_bool)); +#define read_events(wait) ps_read_events(wait, True) +#else +extern void read_events ARGS((wide_bool)); +#endif +extern void redraw_page ARGS((void)); +extern void do_pages ARGS((void)); +extern void reset_fonts ARGS((void)); +extern void realloc_font ARGS((struct font *, wide_ubyte)); +extern void realloc_virtual_font ARGS((struct font *, wide_ubyte)); +extern Boolean load_font ARGS((struct font *)); +extern struct font *define_font ARGS((FILE *, wide_ubyte, + struct font *, struct font **, unsigned int, + struct tn **)); +extern void init_page ARGS((void)); +extern void set_directory_dvifile ARGS((void)); +extern void open_dvi_file ARGS((void)); +extern Boolean check_dvi_file ARGS((void)); +extern void put_border ARGS((int, int, unsigned int, unsigned int, GC)); +#ifdef GRID +#ifdef WIN32 +extern void put_grid ARGS((struct WindowRec *, unsigned int, GC, GC, GC)); +#else +extern void put_grid ARGS((int, int, unsigned int, unsigned int, unsigned int, GC, GC, GC)); +#endif +#endif /* GRID */ +#ifndef TEXXET +extern long set_char ARGS((wide_ubyte)); +extern long load_n_set_char ARGS((wide_ubyte)); +extern long set_vf_char ARGS((wide_ubyte)); +#if TTF +extern long set_ttf_char P1H(wide_ubyte); +#endif +#if T1 +extern long set_t1_char P1H(wide_ubyte); +#endif +#else +extern void set_char ARGS((wide_ubyte, wide_ubyte)); +extern void load_n_set_char ARGS((wide_ubyte, wide_ubyte)); +extern void set_vf_char ARGS((wide_ubyte, wide_ubyte)); +#if TTF +extern void set_ttf_char P2H(wide_ubyte, wide_ubyte); +#endif +#if T1 +extern void set_t1_char P2H(wide_ubyte, wide_ubyte); +#endif +#endif +extern int tfmload P3H(char *, long *, long *); +#if TTF +extern void read_TTF_char P2H(struct font *, ubyte); +extern int find_TTF_font P1H(char *); +#endif +#if T1 +extern void read_T1_char P2H(struct font *, ubyte); +extern int find_T1_font P1H(char *); +extern void init_t1 P1H(void); +#endif +extern int getpsinfo P1H(char *); +extern void draw_page P1H(void); +#if CFGFILE +#ifndef CFG2RES +extern void readconfig ARGS((void)); +#else +extern void readconfig ARGS((_Xconst struct cfg2res *, + _Xconst struct cfg2res *, XtResource *, XtResource *)); +#endif /* CFG2RES */ +#endif /* CFGFILE */ +extern void init_font_open ARGS((void)); +#if T1 +extern FILE *font_open P7H(char *, char **, double, int *, int, + char **,int *); +#else +extern FILE *font_open P6H(char *, char **, double, int *, int, + char **); +#endif +#if PS +extern void ps_newdoc ARGS((void)); +extern void ps_destroy ARGS((void)); +#endif +extern void applicationDoSpecial ARGS((char *, int)); +#if PS +extern void scan_special ARGS((char *)); +#endif +extern NORETURN void oops ARGS((_Xconst char *message, ...)); +#ifndef KPATHSEA +extern void *xmalloc ARGS((unsigned)); +extern void *xrealloc ARGS((void *, unsigned)); +extern char *xstrdup ARGS((_Xconst char *, int)); +extern char *xmemdump ARGS((_Xconst char *, int)); +#endif +extern void expandline ARGS((int)); +extern void alloc_bitmap ARGS((struct bitmap *)); +#ifndef KPATHSEA +extern void xputenv ARGS((const char *, const char *)); +#endif +#ifndef WIN32 +extern int memicmp ARGS((_Xconst char *, _Xconst char *, size_t)); +#endif +extern FILE *xfopen ARGS((_Xconst char *, OPEN_MODE_ARGS)); +#ifdef HTEX +extern FILE *xfopen_local ARGS((_Xconst char *, OPEN_MODE_ARGS)); +#else +#define xfopen_local xfopen +#endif +#ifndef WIN32 +extern int xpipe ARGS((int *)); +extern DIR *xdvi_xopendir ARGS((_Xconst char *)); +extern _Xconst struct passwd *ff_getpw ARGS((_Xconst char **, _Xconst char *)); +#endif +extern unsigned long num ARGS((FILE *, int)); +extern long snum ARGS((FILE *, int)); +extern void read_PK_index ARGS((struct font *, wide_bool)); +extern void read_GF_index ARGS((struct font *, wide_bool)); +#ifdef Omega +extern unsigned long read_VF_index ARGS((struct font *, wide_bool)); +#else +extern void read_VF_index ARGS((struct font *, wide_bool)); +#endif + +#if PS +extern void drawbegin_none ARGS((int, int, _Xconst char *)); +extern void beginheader_none ARGS(()); +extern void draw_bbox ARGS((void)); +extern void NullProc ARGS((void)); +#ifdef PS_DPS +extern Boolean initDPS ARGS((void)); +#endif +#ifdef PS_NEWS +extern Boolean initNeWS ARGS((void)); +#endif +#ifdef PS_GS +extern Boolean initGS ARGS((void)); +#endif +#ifdef WIN32 +#include "gsdll.h" +#endif +#endif /* PS */ +#ifdef HTEX +extern int open_www_file ARGS((void)); +extern void cleanup_and_exit ARGS((int)); +extern void htex_can_it ARGS((void)); +extern void search_callback ARGS((Widget, XtPointer, XtPointer)); +extern KPSEDLL string xgetcwd ARGS((void)); +extern void detach_anchor ARGS((void)); +extern FILE *xfopen_local ARGS((_Xconst char *, OPEN_MODE_ARGS)); +extern char *MyStrAllocCopy ARGS((char **, char *)); +extern int pointerlocate ARGS((int *, int *)); +extern void htex_recordbits ARGS((int, int, int, int)); +extern void htex_initpage ARGS((void)); +extern void htex_donepage ARGS((int, int)); +extern void htex_parsepages ARGS((void)); +extern void htex_parse_page ARGS((int)); +extern void htex_scanpage ARGS((int)); +extern void htex_scanpage ARGS((int)); +extern void htex_dospecial ARGS((long, int)); +extern void htex_reinit ARGS((void)); +extern void htex_do_loc ARGS((char *)); +extern void add_search ARGS((char *, int)); +extern int htex_handleref ARGS((int, int, int)); +extern void htex_displayanchor ARGS((int, int, int)); +extern void htex_goback ARGS((void)); +extern int checkHyperTeX ARGS((char *, int)); +extern void htex_handletag ARGS((char *, int)); +extern void htex_anchor ARGS((int, char *, int)); +extern void htex_dohref ARGS((char *)); +extern void htex_drawboxes ARGS((void)); +extern void htex_to_page ARGS((int)); +extern void htex_to_anchor ARGS((int, int)); +extern int htex_is_url ARGS((const char *)); +extern void htex_do_url ARGS((char *)); +extern void paint_anchor ARGS((char *)); +extern int fetch_relative_url ARGS((char *, const char *, char *)); +extern void wait_for_urls ARGS((void)); +#endif + +/* BEGIN CHUNK xdvi.h 7 */ +#ifdef SRC_SPECIALS +/* functions in src_special.c */ +extern void src_find_special ARGS((int, Position, Position)); +extern void src_delete_all_specials ARGS((void)); +extern void src_warn_outdated ARGS((void)); +extern void src_eval_special ARGS((char *, Position, Position)); +extern void src_check_editorCommand ARGS((void)); +extern void src_cleanup ARGS((void)); +// extern void src_do_special ARGS((float)); +extern float src_look_forward ARGS((double)); +#endif +/* END CHUNK xdvi.h 7 */ + +_XFUNCPROTOEND + +#define one(fp) ((unsigned char) getc(fp)) +#define sone(fp) ((long) one(fp)) +#define two(fp) num (fp, 2) +#define stwo(fp) snum(fp, 2) +#define four(fp) num (fp, 4) +#define sfour(fp) snum(fp, 4) + +#ifdef HTEX +/* From xhdvi/url.h */ +/* Some URL stuff: */ +typedef struct { + char *url; /* Full address of the URL we have locally */ + char *file; /* Local file name it is stored as */ +} FiletoURLconv; + +#define FILELISTCHUNK 20 +EXTERN FiletoURLconv *filelist INIT(NULL); +EXTERN int nURLs INIT(0); + +#define exit(n) cleanup_and_exit(n) +#endif /* HTEX */ + +#define delay_rulers resource._delay_rulers +#define tick_units resource._tick_units +#define tick_length resource._tick_length +#define fore_Pixel resource._fore_Pixel +#define back_Pixel resource._back_Pixel +#if defined(TOOLKIT) +struct _resource resource; +#define brdr_Pixel resource._brdr_Pixel +#define hl_Pixel resource._hl_Pixel +#define cr_Pixel resource._cr_Pixel +#ifdef GRID +#define grid1_Pixel resource._grid1_Pixel +#define grid2_Pixel resource._grid2_Pixel +#define grid3_Pixel resource._grid3_Pixel +#endif /* GRID */ +#else /* TOOLKIT */ +static Pixel hl_Pixel, cr_Pixel; +#ifdef GRID +static Pixel grid1_Pixel, grid2_Pixel, grid3_Pixel; +#endif /* GRID */ +#endif /* TOOLKIT */ + +#ifdef GREY +#define gamma resource._gamma +#endif + +#include "patchlevel.h" +#ifdef Omega +static _Xconst char *version = "(Omega) oxdvik version 20a"; +#else +static _Xconst char *version = "xdvik version 20a"; +#endif + +EXTERN char *display; +EXTERN char *geometry; +EXTERN char *margins; +EXTERN char *offsets; +EXTERN Boolean hush; + +extern Boolean iconic; +extern Dimension bwidth; + +EXTERN char *curr_page; + +/* Win32 specific variables */ + +EXTERN HDC maneDC, maneDrawDC, maneDrawMemDC; +EXTERN HDC imageDC; +EXTERN HPEN forePen INIT(0); +EXTERN HPEN foreTPicPen INIT(0); +EXTERN HPEN backTPicPen INIT(0);; +EXTERN HBRUSH foreBrush INIT(0); +EXTERN HBRUSH backBrush INIT(0); +EXTERN HBRUSH foreTPicBrush INIT(0); +EXTERN HCURSOR hCursWait, hCursArrow, hCursCross, hCursSrc; + +EXTERN int maneHorzRes; +EXTERN int maneVertRes; +EXTERN int maneLogPixelsX; +EXTERN int maneLogPixelsY; +EXTERN int maneBitsPixel; +EXTERN int maneSizePalette; +EXTERN int maneColorRes; +EXTERN int maneRasterCaps; +EXTERN int numColors; /* num colors actually used */ + +/* Utility functions */ +typedef void (* PF_BSWAP)(void *, unsigned count); + +int check_386(); +void bswap_asm(void *p, unsigned count); +void bswap_c(void *p, unsigned count); +EXTERN PF_BSWAP bswap; + +/* + Color functions + */ + +#define COLOR_STACK_DEPTH 256 + +typedef struct _CRefStack { + COLORREF *s; + int max; + int i; +} CRefStack, *lpCRefStack; + +EXTERN lpCRefStack color_stack; +EXTERN BOOL bColorPage; /* If there are no colors on the page, don't bother */ +lpCRefStack InitCRefStack(int); +BOOL CRefIsEmpty(lpCRefStack); +void CRefPush(lpCRefStack, COLORREF); +COLORREF CRefPop(lpCRefStack); +COLORREF CRefTop(lpCRefStack); +lpCRefStack CRefSave(lpCRefStack); +void CRefRestore(lpCRefStack, lpCRefStack); +void CRefResetInit(lpCRefStack, COLORREF); + +/* + Various variables +*/ +extern Boolean psToDisplay; +extern BOOL bMagDisp, bSetHome; +extern BOOL isPrinting, isPrintingDvips; +extern BOOL bDrawKeep; +extern BOOL bSkipFirstClick; + +extern unsigned char *gs_device; + +extern COLORREF ColorInvert(COLORREF); +extern RGBQUAD Color2Quad(COLORREF); +extern void initialize_palette(void); +extern void setup_palette(RGBQUAD *, int); +extern void init_colors(void); +extern COLORREF string_to_colorref(char *); +extern void SetForeColor(COLORREF); +extern void SetBackColor(COLORREF); +extern void initcolor(); + +/* + Transformation matrix + */ + +extern XFORM xfrmTransf, xfrmUnit, xfrmTemp; +EXTERN BOOL bMatrixUnit INIT(TRUE); + +/* + * X11 replacements + */ +extern void XDrawLine(void *, HWND hwnd, HDC hdc, + int x1, int y1, int x2, int y2); +extern void XDrawPoint(void *, HWND hwnd, HDC hdc, + int x1, int y1); +extern void XFillRectangle(void *display, Window w, GC gc, + int, int, unsigned int, unsigned int); +#if 0 +extern HWND XtInitialize(char* shell_name, char* app_class, + XrmOptionDescRec* options, Cardinal nul_options, + int *argc, char* argv[]); +extern void XtGetApplicationResources(HWND hwnd, XtPointer base, + XtResourceList resources, + Cardinal num_resources, + ArgList args, Cardinal num_args); +#endif +extern void ParseCmdLine(char *); +extern void XPutImage(void *, HWND hwnd, HDC hdc, XImage *img, + int src_x, int src_y, + int dest_x, int dest_y, + unsigned int width, unsigned int height); +extern void XClearWindow(void *, HWND ); +extern void XFlush(void *); +extern void home(Boolean scrl); +extern void set_icon_and_title (char *dvi_name, char **icon_ret, + char **title_ret, int set_std); +extern FILE *XsraSelFile(Widget toplevel, char *prompt, char *ok, + char *cancel, + char *failed, char *init_path, char *mode, + int (*show_entry)(), char **name_return); +extern Boolean set_paper_type(void); +extern FILE* select_filename(int, int); +/* extern string_to_pixel(); */ +extern void parse_options(int, char**); +extern int atopix(_Xconst char *); +extern int atopixunit(_Xconst char *); +extern char *pixtoa(int); +extern NORETURN void usage(); +extern void FillDIB(struct glyph *g, struct bitmap *bm); +extern HBITMAP CreateDIB(HDC hdc, int x, int y, int bitCount, BITMAPINFO_256 *bmi, LPVOID *ppvBits); +extern void XClearArea(void *disp, HWND win, int x, int y, int width, + int height, int b); +void draw_rulers(unsigned int width, unsigned int height, HDC ourGC); +extern void bswap_asm(void *p, unsigned count); +extern void bswap_c(void *p, unsigned count); +extern void XPutPixel(XImage *img, int x, int y, COLORREF pixel); + +extern XImage* XCreateImage(void* d, HDC, unsigned int depth, + int format, int offset, char* data, + unsigned int width, unsigned int height, + int bitmap_pad, int bytes_per_line); +extern COLORREF x_to_win32_color (const char * colorname); +extern void CleanUp(void); +extern void CleanExit(int code); +extern BOOL DibBlt (HDC hdc, INT x0, INT y0, INT dx, INT dy, + HANDLE hdib, INT x1, INT y1, LONG rop); +extern void XDestroyImage(XImage *img); +extern void pixel_to_unit(); +extern Pixel string_to_pixel(const char **strp); +extern void init_colors(); +extern const char * XGetDefault(void*, char*, char*); +extern void SaveOptions(); +extern void FreeOptions(); +extern void CloseCurrentFile(); +extern void OpenCurrentFile(char *); +extern void SuspendCurrentFile(); +extern void ResumeCurrentFile(); +extern void NormalizeDviName(); +extern RGBQUAD Color2Quad(COLORREF c); +extern void show_help(); +extern void make_temporary_dir(char **); +extern void scan_colors(char *); +#ifdef HTEX +extern void htex_cleanup(int arg); +#endif +extern void remove_temporary_dir(void); +extern void emspecial(char *, int x, int y); +extern void CloseHandleAndClear(HANDLE *h); +#endif /* WINUTIL_H */ diff --git a/Build/source/texk/windvi/windvi.ico b/Build/source/texk/windvi/windvi.ico Binary files differnew file mode 100644 index 00000000000..ae2fd4ff961 --- /dev/null +++ b/Build/source/texk/windvi/windvi.ico diff --git a/Build/source/texk/windvi/windvi.rc b/Build/source/texk/windvi/windvi.rc new file mode 100644 index 00000000000..d2b2f822dd0 --- /dev/null +++ b/Build/source/texk/windvi/windvi.rc @@ -0,0 +1,538 @@ +//Microsoft Developer Studio generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winver.h" +#include "wingui.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 + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_APPICON ICON DISCARDABLE "windvi.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDR_TOOLBAR1 BITMAP DISCARDABLE "toolbar1.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// Toolbar +// + +IDR_TOOLBAR1 TOOLBAR DISCARDABLE 18, 17 +BEGIN + BUTTON ID_BUTTON40028 + BUTTON ID_BUTTON40029 + BUTTON ID_BUTTON40030 + BUTTON ID_BUTTON40031 + BUTTON ID_BUTTON40032 + BUTTON ID_BUTTON40033 + BUTTON ID_BUTTON40034 + BUTTON ID_BUTTON40035 + BUTTON ID_BUTTON40036 + BUTTON ID_BUTTON40037 + BUTTON ID_BUTTON40038 + BUTTON IDM_REDRAWPAGE + BUTTON IDM_TOGGLEPS + BUTTON IDM_GOTOPAGE + BUTTON IDM_NAVIGATEBACK + BUTTON IDM_BOOKMODE + BUTTON IDM_SRCSPECIALS +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +ABOUTBOX DIALOG DISCARDABLE 22, 17, 167, 64 +STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU +CAPTION "About WinDvi" +FONT 8, "System" +BEGIN + DEFPUSHBUTTON "OK",IDOK,132,2,32,14,WS_GROUP + ICON IDI_APPICON,-1,3,2,20,20 + LTEXT "ProductName",IDD_VERFIRST,30,2,50,8 + LTEXT "FileDescription",IDD_VERDESC,30,12,82,8 + LTEXT "FileVersion",IDD_VERVERSION,91,2,30,8 + LTEXT "LegalCopyright",IDD_VERCOPY,30,28,137,17 + LTEXT "LegalTrademarks",IDD_VERLAST,30,45,136,16 + CONTROL "",501,"Static",SS_BLACKRECT,28,24,138,1 +END + +DLGGOTOPAGE DIALOG DISCARDABLE 0, 0, 118, 54 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Goto Page" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_PAGE_NUMBER,7,23,28,14,ES_AUTOHSCROLL | ES_NUMBER + CONTROL "Spin1",IDC_SPIN_PAGE_NUMBER,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS | UDS_NOTHOUSANDS,35,23,11,14 + DEFPUSHBUTTON "OK",IDOK,71,7,40,14 + PUSHBUTTON "Cancel",IDCANCEL,71,24,40,14 +END + +DLGVIEWLOG DIALOG DISCARDABLE 0, 0, 414, 253 +STYLE DS_LOCALEDIT | DS_MODALFRAME | WS_POPUP | WS_CAPTION +CAPTION "Log File" +FONT 8, "MS Sans Serif" +BEGIN + DEFPUSHBUTTON "Dismiss",IDOK,7,232,400,14 + EDITTEXT IDC_LOG_EDIT,7,7,400,221,ES_MULTILINE | ES_AUTOVSCROLL | + ES_READONLY | ES_WANTRETURN | WS_VSCROLL +END + +ABORTPRINTDLG DIALOG DISCARDABLE 33, 32, 214, 119 +STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Printing" +FONT 8, "MS Sans Serif" +BEGIN + CTEXT "Now Printing: ",IDD_TEXT,0,15,214,8,NOT WS_GROUP + CTEXT "",IDD_FILE,0,25,214,8,NOT WS_GROUP + DEFPUSHBUTTON "Cancel",IDD_CANCEL,83,96,45,15 + CONTROL "Progress1",IDC_PRINT_PROGRESS_PAGE,"msctls_progress32", + WS_BORDER,63,38,80,14 + CONTROL "Progress2",IDC_PRINT_PROGRESS_BAND,"msctls_progress32", + WS_BORDER,63,67,80,14 + LTEXT "Document",IDC_STATIC,17,41,34,8 + LTEXT "Page",IDC_STATIC,17,70,18,8 +END + +DLGCONFIGVIEW DIALOG DISCARDABLE 0, 0, 334, 191 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "View Configuration" +FONT 8, "MS Sans Serif" +BEGIN + CONTROL "Antialiasing",IDC_CHECKALIASING,"Button", + BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,7,7,66,12 + CONTROL "In Memory",IDC_CHECKINMEMORY,"Button",BS_AUTOCHECKBOX | + BS_LEFTTEXT | WS_TABSTOP,7,21,66,12 + CONTROL "Postscript",IDC_CHECKPOSTSCRIPT,"Button", + BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,7,35,66,12 + CONTROL "PS Antialiasing",IDC_CHECKGSALPHA,"Button", + BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,7,49,66,12 + CONTROL "Reverse Video",IDC_CHECKREVIDEO,"Button", + BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,7,63,66,12 + CONTROL "Transformations",IDC_CHECKXFORM,"Button", + BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,7,77,66,12 + EDITTEXT IDC_EDITDENSITY,215,7,51,12,ES_AUTOHSCROLL + EDITTEXT IDC_EDITGAMMA,215,26,51,12,ES_AUTOHSCROLL + COMBOBOX IDC_COMBO_FORE_COLOR,207,45,59,30,CBS_DROPDOWN | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBO_BACK_COLOR,207,64,59,30,CBS_DROPDOWN | + CBS_SORT | WS_VSCROLL | WS_TABSTOP + EDITTEXT IDC_EDITMGS3,218,108,40,14,ES_AUTOHSCROLL + EDITTEXT IDC_EDITMGS2,218,128,40,14,ES_AUTOHSCROLL + EDITTEXT IDC_EDITMGS1,218,148,40,14,ES_AUTOHSCROLL + LTEXT "Density",IDC_STATIC,147,7,58,12,SS_CENTERIMAGE + LTEXT "Gamma",IDC_STATIC,147,26,58,12,SS_CENTERIMAGE + LTEXT "Small",IDC_STATIC,13,148,18,14,SS_CENTERIMAGE + LTEXT "Medium",IDC_STATIC,13,128,26,14,SS_CENTERIMAGE + LTEXT "Large",IDC_STATIC,13,108,19,14,SS_CENTERIMAGE + GROUPBOX "Grid Colors",IDC_STATIC,7,94,120,74 + LTEXT "Small",IDC_STATIC,153,148,18,14,SS_CENTERIMAGE + LTEXT "Medium",IDC_STATIC,153,128,26,14,SS_CENTERIMAGE + LTEXT "Large",IDC_STATIC,153,108,53,14,SS_CENTERIMAGE + GROUPBOX "Magnifyer sizes",IDC_STATIC,145,94,120,74 + LTEXT "Fore Color",IDC_STATIC,147,45,58,12,SS_CENTERIMAGE + LTEXT "Back Color",IDC_STATIC,147,64,58,12,SS_CENTERIMAGE +END + +DLGCONFIGDVI DIALOG DISCARDABLE 0, 0, 320, 130 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "DVI File Configuration" +FONT 8, "MS Sans Serif" +BEGIN + EDITTEXT IDC_EDITBDPI,67,7,40,12,ES_AUTOHSCROLL | ES_NUMBER + EDITTEXT IDC_EDITALTFONT,67,25,40,12,ES_AUTOHSCROLL + COMBOBOX IDC_COMBOMFMODE,190,7,123,59,CBS_DROPDOWNLIST | + CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBOPAPER,221,25,92,56,CBS_DROPDOWN | CBS_SORT | + WS_VSCROLL | WS_TABSTOP + CONTROL "Make pk",IDC_CHECKMAKEPK,"Button",BS_AUTOCHECKBOX | + BS_LEFTTEXT | WS_TABSTOP,7,58,66,10 + CONTROL "Allow Shell",IDC_CHECKALLOWSHELL,"Button", + BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,7,73,66,10 + CONTROL "Auto scan",IDC_CHECKSCAN,"Button",BS_AUTOCHECKBOX | + BS_LEFTTEXT | WS_TABSTOP,7,89,66,10 + CONTROL "Auto log",IDC_CHECKLOG,"Button",BS_AUTOCHECKBOX | + BS_LEFTTEXT | WS_TABSTOP,7,121,66,10 + CONTROL "Single Instance",IDC_CHECKSINGLE,"Button", + BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,7,105,66,10 + CONTROL "Hush specials",IDC_CHECKHUSHSPECIALS,"Button", + BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,146,58,66,10 + CONTROL "Hush chars",IDC_CHECKHUSHCHARS,"Button",BS_AUTOCHECKBOX | + BS_LEFTTEXT | WS_TABSTOP,146,73,66,10 + CONTROL "Hush checksums",IDC_CHECKHUSHCHECKSUMS,"Button", + BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,146,89,66,10 + CONTROL "List fonts",IDC_CHECKLISTFONTS,"Button",BS_AUTOCHECKBOX | + BS_LEFTTEXT | WS_TABSTOP,146,105,66,10 + LTEXT "Paper type",IDC_STATIC,126,25,45,12,SS_CENTERIMAGE + LTEXT "Pixels per inches",IDC_STATIC,7,7,54,12,SS_CENTERIMAGE + LTEXT "MF mode",IDC_STATIC,126,7,45,12,SS_CENTERIMAGE + LTEXT "Alternate font",IDC_STATIC,7,25,54,12,SS_CENTERIMAGE +END + +DLGCONFIG DIALOG DISCARDABLE 0, 0, 300, 230 +STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU +CAPTION "Windvi Configuration" +FONT 8, "MS Sans Serif" +BEGIN +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +WINDVI MENU DISCARDABLE +BEGIN + POPUP "&File" + BEGIN + MENUITEM "&Open...", IDM_FILEOPEN + MENUITEM "&Close", IDM_FILECLOSE + MENUITEM SEPARATOR + MENUITEM "&Print", IDM_FILEPRINT + MENUITEM "Print through &Dvips", IDM_FILEPRINTDVIPS, GRAYED + MENUITEM "Page Se&tup...", IDM_FILEPAGESU, GRAYED + MENUITEM "P&rint Setup...", IDM_FILEPRINTSU, GRAYED + MENUITEM SEPARATOR + MENUITEM SEPARATOR + MENUITEM "E&xit", IDM_EXIT + END + POPUP "&Move" + BEGIN + MENUITEM "&Next Page\tEnter", IDM_NEXTPAGE + MENUITEM "&Previous Page\tBack", IDM_PREVIOUSPAGE + MENUITEM "Page +5", IDM_NEXT5 + MENUITEM "Page-5", IDM_PREVIOUS5 + MENUITEM "Page +10", IDM_NEXT10 + MENUITEM "Page -10", IDM_PREVIOUS10 + MENUITEM "First Page\tCtrl+Home", IDM_FIRSTPAGE + MENUITEM "Last Page\tCtrl+End", IDM_LASTPAGE + MENUITEM "Goto Page", IDM_GOTOPAGE + MENUITEM "URL &Back", IDM_URLBACK + END + POPUP "&View" + BEGIN + MENUITEM "Zoom In\t+", IDM_ZOOMIN + MENUITEM "Zoom Out\t-", IDM_ZOOMOUT + MENUITEM SEPARATOR + MENUITEM "&Keep Position", IDM_KEEPPOS + MENUITEM "Redraw Page\tCtrl+L", IDM_REDRAWPAGE + MENUITEM SEPARATOR + MENUITEM "Toggle &Grid", IDM_TOGGLEGRID + MENUITEM "Toggle PS", IDM_TOGGLEPS + MENUITEM SEPARATOR + MENUITEM "&Options", ID_OPTIONS_WINDVI + END + POPUP "&Help" + BEGIN + MENUITEM "&Topics", IDM_HELPTOPICS, HELP + MENUITEM SEPARATOR + MENUITEM "View Log File", IDM_VIEW_LOG + MENUITEM SEPARATOR + MENUITEM "&About...", IDM_ABOUT + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO DISCARDABLE +BEGIN + "DLGGOTOPAGE", DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 111 + TOPMARGIN, 7 + BOTTOMMARGIN, 47 + END + + "DLGVIEWLOG", DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 407 + TOPMARGIN, 7 + BOTTOMMARGIN, 246 + END + + "DLGCONFIGVIEW", DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 327 + TOPMARGIN, 7 + BOTTOMMARGIN, 184 + END + + "DLGCONFIGDVI", DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 313 + TOPMARGIN, 7 + BOTTOMMARGIN, 123 + END + + DLGCONFIG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 293 + TOPMARGIN, 7 + BOTTOMMARGIN, 223 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE DISCARDABLE +BEGIN + IDS_APPNAME "Windvi" + IDS_DESCRIPTION "Dvi file viewer" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SYSMENU "Move, size, or close application window" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SCRESTORE "Restores the window to normal size" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SCMOVE "Changes the position of the window" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SCSIZE "Changes the size of the window" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SCMINIMIZE "Minimizes the window to an icon" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SCMAXIMIZE "Enlarges the window to full size" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SCCLOSE "Closes the window" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_SCTASKLIST "Switches to another application through the Windows Task Manager" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_FILEMENU "Open or print documents" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDM_ABOUT "Displays information about this application" + IDM_EXIT "Quits this application" + IDM_FILECLOSE "Closes the active document" + IDM_FILEOPEN "Opens an existing document" + IDM_FILEPAGESU "Changes the page setup" + IDM_FILEPRINT "Prints the active document" + IDM_FILEPRINTSU "Changes the printer selection or configuration" + IDM_FIRSTPAGE "Goto first page" + IDM_GOTOPAGE "Goto page" + IDM_LASTPAGE "Goto last page" + IDM_NEXT10 "Move forward 10 pages" + IDM_NEXT5 "Move forward 5 pages" + IDM_NEXTPAGE "Next Page" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDM_FILE_RECENT "Most Recent Used Files" + IDM_FILE_RECENT1 "Most Recent Used Files" + IDM_FILE_RECENT2 "Most Recent Used Files" + IDM_FILE_RECENT3 "Most Recent Used Files" + IDM_FILE_RECENT4 "Most Recent Used Files" + IDM_FILE_RECENT5 "Most Recent Used Files" + IDM_FILE_RECENT6 "Most Recent Used Files" + IDM_FILE_RECENT7 "Most Recent Used Files" + IDM_FILE_RECENT8 "Most Recent Used Files" + IDM_FILE_RECENT9 "Most Recent Used Files" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDM_PREVIOUS10 "Move backward 10 pages" + IDM_PREVIOUS5 "Move backward 5 pages" + IDM_PREVIOUSPAGE "Previous Page" + IDM_TOGGLEPS "Toggle Postscript" + IDM_ZOOMIN "Zoom In" + IDM_ZOOMOUT "Zoom Out" + IDS_HELPMENU "Get help" + IDS_MOVEMENU "Move in the document" + IDS_VIEWMENU "Change the view params" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDM_BOOKMODE "Two pages mode" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDM_TOGGLEGRID "Toggle Grid" + IDM_REDRAWPAGE "Redraw current page" + IDM_VIEW_LOG "View Current Log File" +END + +STRINGTABLE DISCARDABLE +BEGIN + IDS_NO_HELP "Unable to activate help" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// French (France) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) +#ifdef _WIN32 +LANGUAGE LANG_FRENCH, SUBLANG_FRENCH +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_BMP BITMAP DISCARDABLE "toolbar1.bmp" + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 0,67,3,0 + PRODUCTVERSION 0,4,0,0 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0xbL +#else + FILEFLAGS 0xaL +#endif + FILEOS 0x10004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904e4" + BEGIN + VALUE "CompanyName", "Fabrice POPINEAU\0" + VALUE "FileDescription", "DVI file viewer\0" + VALUE "FileVersion", "0.67.3\0" + VALUE "InternalName", "windvi\0" + VALUE "LegalCopyright", "Copyright © 1998-2001 Fabrice POPINEAU\r\nReport bugs to <Fabrice.Popineau@supelec.fr>\0" + VALUE "LegalTrademarks", "Based on XDvi by Paul Vojta and\r\nMicrosoft © code from the Win32 SDK\0" + VALUE "OriginalFilename", "windvi.exe\0" + VALUE "ProductName", "SUPELEC fpTeX/Windvi\0" + VALUE "ProductVersion", "0.7\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200, 0x409, 1200, 0x409, 1252 + END +END + +#endif // !_MAC + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE DISCARDABLE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE DISCARDABLE +BEGIN + "#include ""winver.h""\r\n" + "#include ""wingui.h""\r\n" + "\0" +END + +3 TEXTINCLUDE DISCARDABLE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + +#endif // French (France) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/Build/source/texk/windvi/winevt.c b/Build/source/texk/windvi/winevt.c new file mode 100644 index 00000000000..77b9ef0ba43 --- /dev/null +++ b/Build/source/texk/windvi/winevt.c @@ -0,0 +1,1235 @@ +/* + * Copyright (c) 1994 Paul Vojta. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * NOTE: + * xdvi is based on prior work as noted in the modification history, below. + */ + +/* + * DVI previewer for X. + * + * Eric Cooper, CMU, September 1985. + * + * Code derived from dvi-imagen.c. + * + * Modification history: + * 1/1986 Modified for X.10 --Bob Scheifler, MIT LCS. + * 7/1988 Modified for X.11 --Mark Eichin, MIT + * 12/1988 Added 'R' option, toolkit, magnifying glass + * --Paul Vojta, UC Berkeley. + * 2/1989 Added tpic support --Jeffrey Lee, U of Toronto + * 4/1989 Modified for System V --Donald Richardson, Clarkson Univ. + * 3/1990 Added VMS support --Scott Allendorf, U of Iowa + * 7/1990 Added reflection mode --Michael Pak, Hebrew U of Jerusalem + * 1/1992 Added greyscale code --Till Brychcy, Techn. Univ. Muenchen + * and Lee Hetherington, MIT + * 7/1992 Added extra menu buttons--Nelson H. F. Beebe <beebe@math.utah.edu> + * 4/1994 Added DPS support, bounding box + * --Ricardo Telichevesky + * and Luis Miguel Silveira, MIT RLE. + * 2/1995 Added rulers support --Nelson H. F. Beebe <beebe@math.utah.edu> + * + * Compilation options: + * SYSV compile for System V + * VMS compile for VMS + * NOTOOL compile without toolkit + * BUTTONS compile with buttons on the side of the window (needs toolkit) + * MSBITFIRST store bitmaps internally with most significant bit first + * BMSHORT store bitmaps in shorts instead of bytes + * BMLONG store bitmaps in longs instead of bytes + * ALTFONT default for -altfont option + * A4 use European size paper + * TEXXET support reflection dvi codes (right-to-left typesetting) + * GREY use grey levels to shrink fonts + * PS_DPS use display postscript to render pictures/bounding boxes + * PS_NEWS use the NeWS server to render pictures/bounding boxes + * PS_GS use Ghostscript to render pictures/bounding boxes + * GS_PATH path to call the Ghostscript interpreter by + */ + +#if 0 +static char copyright[] = +"@(#) Copyright (c) 1994 Paul Vojta. All rights reserved.\n"; +#endif + +#define EXTERN +#define INIT(x) =x + +#include <windows.h> +#include <commdlg.h> +#include <direct.h> +#include "wingui.h" +#include "xdvi-config.h" + +#include "dvi.h" + +#define get_xy() +static Position window_x, window_y; +#define clip_w mane.width +#define clip_h mane.height + +struct mg_size_rec mg_size[5] = {{200, 150}, {400, 250}, {700, 500}, + {1000, 800}, {1200, 1200}}; + +struct WindowRec mane = {(Window) 0, 1, 0, 0, 0, 0, MAXDIM, 0, MAXDIM, 0}; +struct WindowRec alt = {(Window) 0, 1, 0, 0, 0, 0, MAXDIM, 0, MAXDIM, 0}; +/* currwin is temporary storage except for within redraw() */ +struct WindowRec currwin = {(Window) 0, 3, 0, 0, 0, 0, MAXDIM, 0, MAXDIM, 0}; + + +/* + * Mechanism to keep track of the magnifier window. The problems are, + * (a) if the button is released while the window is being drawn, this + * could cause an X error if we continue drawing in it after it is + * destroyed, and + * (b) creating and destroying the window too quickly confuses the window + * manager, which is avoided by waiting for an expose event before + * destroying it. + */ +static short alt_stat; /* 1 = wait for expose, */ +/* -1 = destroy upon expose */ +static Boolean alt_canit; /* stop drawing this window */ + +/* + * Data for buffered events. + */ + +static VOLATILE short event_freq = 70; + +static void can_exposures(), keystroke(); + + +/* We split this help string into smaller pieces, because some C +implementations have been known to croak on large strings. */ + +static char* help_string[] = +{ + "", + "----------------------------Help and Exiting----------------------------", + "", + "h or H or ? or Help", + " Displays this help text.", + "", + "q or Control-C or Control-D or Cancel or Stop or Control-Z (VAX VMS)", + " Quits the program.", + "", + "------------------------------Page Motion-------------------------------", + "", + "n or f or Space or Return or LineFeed or PgDn", + " Moves to the next page (or to the nth next page if a", + " number is given).", + "", + "p or b or Control-H or BackSpace or DELete or PgUp", + " Moves to the previous page (or back n pages).", + "", + "u or Up-arrow", + " Moves up two thirds of a window-full.", + "", + "d or Down-arrow", + " Moves down two thirds of a window-full.", + "", + "l or Left-arrow", + " Moves left two thirds of a window-full.", + "", + "r or Right-arrow", + " Moves right two thirds of a window-full.", + "", + "g or j or End", + " Moves to the page with the given number. Initially,", + " the first page is assumed to be page number 1, but this", + " can be changed with the `P' keystroke, below. If no", + " page number is given, then it goes to the last page.", + "", + "< Move to first page in document.", + "> Move to last page in document.", + "", + "-----------------------------Other Commands-----------------------------", + "", + "Control-A or Again", + " Repeat last command (including its argument).", + "", + "Control-L or Clear", + " Redisplays the current page.", + "", + "Control-P", + " Prints bitmap unit, bit order, and byte order.", + "", + "^ or Home", + " Move to the ``home'' position of the page. This is", + " normally the upper left-hand corner of the page,", + " depending on the margins as described in the -margins", + " option, above.", + "", + "c Moves the page so that the point currently beneath the", + " cursor is moved to the middle of the window. It also", + " (gasp!) warps the cursor to the same place.", + "", + "G This key toggles the use of greyscale anti-aliasing for", + " displaying shrunken bitmaps. In addition, the key", + " sequences `0G' and `1G' clear and set this flag,", + " respectively. See also the -nogrey option.", + "", + "k Normally when xdvi switches pages, it moves to the home", + " position as well. The `k' keystroke toggles a `keep-", + " position' flag which, when set, will keep the same", + " position when moving between pages. Also `0k' and `1k'", + " clear and set this flag, respectively. See also the", + " -keep option.", + "", + "M Sets the margins so that the point currently under the", + " cursor is the upper left-hand corner of the text in the", + " page. Note that this command itself does not move the", + " image at all. For details on how the margins are used,", + " see the -margins option.", + "", + "P ``This is page number n.'' This can be used to make", + " the `g' keystroke refer to actual page numbers instead", + " of absolute page numbers.", + "", + "R Forces the dvi file to be reread. This allows you to", + " preview many versions of the same file while running", + " xdvi only once.", + "", + "s Changes the shrink factor to the given number. If no", + " number is given, the smallest factor that makes the", + " entire page fit in the window will be used. (Margins", + " are ignored in this computation.)", + "", + "S Sets the density factor to be used when shrinking", + " bitmaps. This should be a number between 0 and 100;", + " higher numbers produce lighter characters.", + "", + "t Toggles to the next unit in a sorted list of TeX dimension", + " units for the popup magnifier ruler.", + "", + "x Toggles expert mode (in which the buttons do not appear).", + " Also `0x' and `1x' clear and enable this mode,", + " respectively. See also the -expert option.", + "", + "V Toggles Ghostscript anti-aliasing. Also `0V' and `1V' clear", + " and enables this mode, respectively. See also the the -gsalpha", + " option.", + "", +#ifdef SELFILE + "Control-F Find another DVI file.", + "", +#endif +#ifdef HTEX + "B Go back to the previous anchor.", + "F Follow hyperlink forward.", + "", +#endif + "------------------------------------------------------------------------", +}; + +static char *TmpDir=NULL; + +void +show_help() +{ + int k; + + for (k = 0; k < (sizeof(help_string)/sizeof(help_string[0])); ++k) + (void)puts(help_string[k]); +} + +/* + * Ruler routines + */ + +static int +tick_scale(k) + int k; +{ + if (k == 0) + return 3; + else if ((k % 1000) == 0) + return 7; + else if ((k % 500) == 0) + return 6; + else if ((k % 100) == 0) + return 5; + else if ((k % 50) == 0) + return 4; + else if ((k % 10) == 0) + return 3; + else if ((k % 5) == 0) + return 2; + else + return 1; +} + + +void +draw_rulers(width, height, ourGC) + unsigned int width, height; + GC ourGC; +{ +#ifdef WIN32 + int k; /* tick counter */ + double old_pixels_per_tick; + double pixels_per_tick; + int scale; + int tick_offset; /* offset along axes */ + int x; /* coordinates of top-left popup */ + int y; /* window corner */ + double xx; /* coordinates of tick */ + double yy; /* coordinates of tick */ + static char *last_tick_units = ""; /* memory of last tick units */ + + if (tick_length <= 0) /* user doesn't want tick marks */ + return; + + x = 0; /* the pop-up window always has origin (0,0) */ + y = 0; + + /* We need to clear the existing window to remove old rulers. I think + that this could be avoided if draw_rulers() could be invoked earlier. + The expose argument in XClearArea() must be True to force redrawing + of the text inside the popup window. Also, it would be better to draw + the rulers before painting the text, so that rulers would not + overwrite the text, but I haven't figured out yet how to arrange + that. */ + +#if 1 + XClearArea(DISP, alt.win, x, y, width, height, True); +#endif + /* The global resource._pixels_per_inch tells us how to find the ruler + scale. For example, 300dpi corresponds to these TeX units: + + 1 TeX point (pt) = 4.151 pixels + 1 big point (bp) = 4.167 pixels + 1 pica (pc) = 49.813 pixels + 1 cicero (cc) = 53.501 pixels + 1 didot point (dd) = 4.442 pixels + 1 millimeter (mm) = 11.811 pixels + 1 centimeter (cm) = 118.110 pixels + 1 inch (in) = 300.000 pixels + 1 scaled point (sp) = 0.00006334 pixels + + The user can select the units via a resource (e.g. XDvi*tickUnits: bp), + or a command-line option (e.g. -xrm '*tickUnits: cm'). The length of + the ticks can be controlled by a resource (e.g. XDvi*tickLength: 10), or + a command-line option (e.g. -xrm '*tickLength: 10000'). If the tick + length exceeds the popup window size, then a graph-paper grid is drawn + over the whole window. Zero, or negative, tick length completely + suppresses rulers. */ + + pixels_per_tick = (double)resource._pixels_per_inch; + if (strcmp(tick_units,"pt") == 0) + pixels_per_tick /= 72.27; + else if (strcmp(tick_units,"bp") == 0) + pixels_per_tick /= 72.0; + else if (strcmp(tick_units,"in") == 0) + /* NO-OP */; + else if (strcmp(tick_units,"cm") == 0) + pixels_per_tick /= 2.54; + else if (strcmp(tick_units,"mm") == 0) + pixels_per_tick /= 25.4; + else if (strcmp(tick_units,"dd") == 0) + pixels_per_tick *= (1238.0 / 1157.0) / 72.27; + else if (strcmp(tick_units,"cc") == 0) + pixels_per_tick *= 12.0 * (1238.0 / 1157.0) / 72.27; + else if (strcmp(tick_units,"pc") == 0) + pixels_per_tick *= 12.0 /72.27; + else if (strcmp(tick_units,"sp") == 0) + pixels_per_tick /= (65536.0 * 72.27); + else + { + Printf("Unrecognized tickUnits [%s]: defaulting to TeX points [pt]\n", + tick_units); + tick_units = "pt"; + pixels_per_tick /= 72.27; + } + + /* To permit accurate measurement in the popup window, we can reasonably + place tick marks about 3 to 10 pixels apart, so we scale the computed + pixels_per_tick by a power of ten to bring it into that range. */ + + old_pixels_per_tick = pixels_per_tick; /* remember the original scale */ + while (pixels_per_tick < 3.0) + pixels_per_tick *= 10.0; + while (pixels_per_tick > 30.0) + pixels_per_tick /= 10.0; + if (strcmp(last_tick_units, tick_units) != 0) + { /* tell user what the ruler scale is, but only when it changes */ + if (old_pixels_per_tick != pixels_per_tick) + Printf("Ruler tick interval adjusted to represent %.2f%s\n", + pixels_per_tick/old_pixels_per_tick, tick_units); + else if (debug & DBG_EVENT) + Printf("Ruler tick interval represents 1%s\n", tick_units); + } + + /* In order to make the ruler as accurate as possible, given the coarse + screen resolution, we compute tick positions in floating-point + arithmetic, then round to nearest integer values. */ + + for (k = 0, xx = 0.0; xx < (double)width; k++, xx += pixels_per_tick) + { /* draw vertical ticks on top and bottom */ + tick_offset = (int)(0.5 + xx); /* round to nearest pixel */ + scale = tick_scale(k); + XDrawLine(DISP, alt.win, ourGC, + x + tick_offset, y, + x + tick_offset, y + scale*tick_length); + XDrawLine(DISP, alt.win, ourGC, + x + tick_offset, y + height, + x + tick_offset, y + height - scale*tick_length); + } + + for (k = 0, yy = 0.0; yy < (double)height; k++, yy += pixels_per_tick) + { /* draw horizontal ticks on left and right */ + tick_offset = (int)(0.5 + yy); /* round to nearest pixel */ + scale = tick_scale(k); + XDrawLine(DISP, alt.win, ourGC, + x, y + tick_offset, + x + scale*tick_length, y + tick_offset); + XDrawLine(DISP, alt.win, ourGC, + x + width, y + tick_offset, + x + width - scale*tick_length, y + tick_offset); + } + + last_tick_units = tick_units; + +#if 0 + XFlush(DISP); /* bring window up-to-date */ +#endif +#endif +} + + /* The global resource._pixels_per_inch tells us how to find the ruler + scale. For example, 300dpi corresponds to these TeX units: + + 1 TeX point (pt) = 4.151 pixels + 1 big point (bp) = 4.167 pixels + 1 pica (pc) = 49.813 pixels + 1 cicero (cc) = 53.501 pixels + 1 didot point (dd) = 4.442 pixels + 1 millimeter (mm) = 11.811 pixels + 1 centimeter (cm) = 118.110 pixels + 1 inch (in) = 300.000 pixels + 1 scaled point (sp) = 0.00006334 pixels + + The user can select the units via a resource (e.g. XDvi*tickUnits: bp), + or a command-line option (e.g. -xrm '*tickUnits: cm'). The length of + the ticks can be controlled by a resource (e.g. XDvi*tickLength: 10), or + a command-line option (e.g. -xrm '*tickLength: 10000'). If the tick + length exceeds the popup window size, then a graph-paper grid is drawn + over the whole window. Zero, or negative, tick length completely + suppresses rulers. */ +const_string pos_format; +double p2u_factor; + +void pixel_to_unit() +{ + double pixels_per_tick = (double)resource._pixels_per_inch; + + if (strcmp(tick_units,"pt") == 0) { + p2u_factor = 72.27 / pixels_per_tick; + pos_format = "%10.3fpt x %10.3fpt"; + } + else if (strcmp(tick_units,"bp") == 0) { + p2u_factor = 72.0 / pixels_per_tick; + pos_format = "%10.3fbp x %10.3fbp"; + } + else if (strcmp(tick_units,"in") == 0) { + p2u_factor = 1.0 / pixels_per_tick; + pos_format = "%10.3fin x %10.3fin"; + } + else if (strcmp(tick_units,"cm") == 0) { + p2u_factor = 2.54 / pixels_per_tick; + pos_format = "%10.3lfcm x %10.3lfcm"; + } + else if (strcmp(tick_units,"mm") == 0) { + p2u_factor = 25.4 / pixels_per_tick; + pos_format = "%10.3lfmm x %10.3lfmm"; + } + else if (strcmp(tick_units,"dd") == 0) { + p2u_factor = 1.0 / pixels_per_tick / ((1238.0 / 1157.0) / 72.27); + pos_format = "%10.3lfdd x %10.3lfdd"; + } + else if (strcmp(tick_units,"cc") == 0) { + p2u_factor = 1.0 / pixels_per_tick / (12.0 * (1238.0 / 1157.0) / 72.27); + pos_format = "%10.3lfcc x %10.3lfcc"; + } + else if (strcmp(tick_units,"pc") == 0) { + p2u_factor = 1.0 / pixels_per_tick / (12.0 /72.27); + pos_format = "%10.3lfpc x %10.3lfpc"; + } + else if (strcmp(tick_units,"sp") == 0) { + p2u_factor = 1.0 / pixels_per_tick * (65536.0 * 72.27); + pos_format = "%10.3lfsp x %10.3lfsp"; + } + else + { + Printf("Unrecognized tickUnits [%s]: defaulting to TeX points [pt]\n", + tick_units); + tick_units = "pt"; + p2u_factor = 72.27 / pixels_per_tick; + pos_format = "%10.3fpt x %10.3fpt"; + } +} + + + +#ifndef WIN32 +/* + * Event-handling routines + */ + +static void +expose(windowrec, x, y, w, h) + register struct WindowRec *windowrec; + int x, y; + unsigned int w, h; +{ + if (windowrec->min_x > x) windowrec->min_x = x; + if (windowrec->max_x < x + w) + windowrec->max_x = x + w; + if (windowrec->min_y > y) windowrec->min_y = y; + if (windowrec->max_y < y + h) + windowrec->max_y = y + h; +} + +static void +clearexpose(windowrec, x, y, w, h) + struct WindowRec *windowrec; + int x, y; + unsigned int w, h; +{ + XClearArea(DISP, windowrec->win, x, y, w, h, False); + expose(windowrec, x, y, w, h); +} + +static void +scrollwindow(windowrec, x0, y0) + register struct WindowRec *windowrec; + int x0, y0; +{ + int x, y; + int x2 = 0, y2 = 0; + int ww, hh; + + x = x0 - windowrec->base_x; + y = y0 - windowrec->base_y; + ww = windowrec->width - x; + hh = windowrec->height - y; + windowrec->base_x = x0; + windowrec->base_y = y0; + if (currwin.win == windowrec->win) { + currwin.base_x = x0; + currwin.base_y = y0; + } + windowrec->min_x -= x; + if (windowrec->min_x < 0) windowrec->min_x = 0; + windowrec->max_x -= x; + if (windowrec->max_x > windowrec->width) + windowrec->max_x = windowrec->width; + windowrec->min_y -= y; + if (windowrec->min_y < 0) windowrec->min_y = 0; + windowrec->max_y -= y; + if (windowrec->max_y > windowrec->height) + windowrec->max_y = windowrec->height; + if (x < 0) { + x2 = -x; + x = 0; + ww = windowrec->width - x2; + } + if (y < 0) { + y2 = -y; + y = 0; + hh = windowrec->height - y2; + } + if (ww <= 0 || hh <= 0) { + XClearWindow(DISP, windowrec->win); + windowrec->min_x = windowrec->min_y = 0; + windowrec->max_x = windowrec->width; + windowrec->max_y = windowrec->height; + } + else { + XCopyArea(DISP, windowrec->win, windowrec->win, + DefaultGCOfScreen(SCRN), x, y, + (unsigned int) ww, (unsigned int) hh, x2, y2); + if (x > 0) + clearexpose(windowrec, ww, 0, + (unsigned int) x, windowrec->height); + if (x2 > 0) + clearexpose(windowrec, 0, 0, + (unsigned int) x2, windowrec->height); + if (y > 0) + clearexpose(windowrec, 0, hh, + windowrec->width, (unsigned int) y); + if (y2 > 0) + clearexpose(windowrec, 0, 0, + windowrec->width, (unsigned int) y2); + } +} +#endif + + + +_Xconst char *paper_types[] = { + "us", "8.5in x 11in", + "usr", "11in x 8.5in", + "legal", "8.5in x 14in", + "foolscap", "13.5in x 17.0in", /* ??? */ + + /* ISO `A' formats, Portrait */ + "a1", "59.4cm x 84.0cm", + "a2", "42.0cm x 59.4cm", + "a3", "29.7cm x 42.0cm", + "a4", "21.0cm x 29.7cm", + "a5", "14.85cm x 21.0cm", + "a6", "10.5cm x 14.85cm", + "a7", "7.42cm x 10.5cm", + + /* ISO `A' formats, Landscape */ + "a1r", "84.0cm x 59.4cm", + "a2r", "59.4cm x 42.0cm", + "a3r", "42.0cm x 29.7cm", + "a4r", "29.7cm x 21.0cm", + "a5r", "21.0cm x 14.85cm", + "a6r", "14.85cm x 10.5cm", + "a7r", "10.5cm x 7.42cm", + + /* ISO `B' formats, Portrait */ + "b1", "70.6cm x 100.0cm", + "b2", "50.0cm x 70.6cm", + "b3", "35.3cm x 50.0cm", + "b4", "25.0cm x 35.3cm", + "b5", "17.6cm x 25.0cm", + "b6", "13.5cm x 17.6cm", + "b7", "8.8cm x 13.5cm", + + /* ISO `B' formats, Landscape */ + "b1r", "100.0cm x 70.6cm", + "b2r", "70.6cm x 50.0cm", + "b3r", "50.0cm x 35.3cm", + "b4r", "35.3cm x 25.0cm", + "b5r", "25.0cm x 17.6cm", + "b6r", "17.6cm x 13.5cm", + "b7r", "13.5cm x 8.8cm", + + /* ISO `C' formats, Portrait */ + "c1", "64.8cm x 91.6cm", + "c2", "45.8cm x 64.8cm", + "c3", "32.4cm x 45.8cm", + "c4", "22.9cm x 32.4cm", + "c5", "16.2cm x 22.9cm", + "c6", "11.46cm x 16.2cm", + "c7", "8.1cm x 11.46cm", + + /* ISO `C' formats, Landscape */ + "c1r", "91.6cm x 64.8cm", + "c2r", "64.8cm x 45.8cm", + "c3r", "45.8cm x 32.4cm", + "c4r", "32.4cm x 22.9cm", + "c5r", "22.9cm x 16.2cm", + "c6r", "16.2cm x 11.46cm", + "c7r", "11.46cm x 8.1cm", +}; + +int paper_types_number = sizeof(paper_types)/sizeof(char *); + +Boolean +set_paper_type() { + _Xconst char *arg, *arg1; + char temp[64]; + _Xconst char **p; + char *q; + + /* fprintf(stderr, "Setting paper type to %s\n", resource.paper); */ + if (!resource.paper) { +#ifdef A4 + resource.paper = strdup("a4"); +#else + resource.paper = strdup("us"); +#endif + } + if (strlen(resource.paper) > sizeof(temp) - 1) return False; + arg = resource.paper; + q = temp; + for (;;) { /* convert to lower case */ + char c = *arg++; + if (c >= 'A' && c <= 'Z') c ^= ('a' ^ 'A'); + *q++ = c; + if (c == '\0') break; + } + arg = temp; + /* perform substitutions */ + for (p = paper_types; p < paper_types + XtNumber(paper_types); p += 2) + if (strcmp(temp, *p) == 0) { + arg = p[1]; + break; + } + + arg1 = strchr(arg, 'x'); + if (arg1 == NULL) return False; + unshrunk_paper_w = atopix(arg); + unshrunk_paper_h = atopix(arg1 + 1); +#ifdef GRID + unshrunk_paper_unit = atopixunit(arg); +#endif /* GRID */ + + unshrunk_page_w = unshrunk_dvifile_page_w; + unshrunk_page_h = unshrunk_dvifile_page_h; + if (unshrunk_page_h < unshrunk_paper_h) + unshrunk_page_h = unshrunk_paper_h; + if (unshrunk_page_w < unshrunk_paper_w) + unshrunk_page_w = unshrunk_paper_w; + init_page(); + +#if 0 + fprintf(stderr, "paper (%d x %d)\n", unshrunk_paper_w, unshrunk_paper_h); + fprintf(stderr, "dvi unshrunk page (%d x %d)\n", unshrunk_page_w, unshrunk_page_h); + fprintf(stderr, "dvi shrunk page (%d x %d)\n", page_w, page_h); +#endif + + if (! isPrinting && hWndDraw) + SendMessage(hWndDraw, WM_ERASEBKGND, (WPARAM)GetDC(currwin.win), 0); + + return (unshrunk_paper_w != 0 && unshrunk_paper_h != 0); +} + +/* Set the icon name and title name standard properties on `top_level' + (which we don't pass in because it is a different type for TOOLKIT + !and TOOLKIT). We use the basename of the DVI file (without the + .dvi), so different xdvi invocations can be distinguished, yet + do not use up too much real estate. */ + +void +set_icon_and_title (dvi_name, icon_ret, title_ret, set_std) + char *dvi_name; + char **icon_ret; + char **title_ret; + int set_std; +{ + /* Use basename of DVI file for name in icon and title. */ + unsigned baselen; + char *icon_name, *title_name; + + icon_name = strrchr(dvi_name, '/'); + if (icon_name != NULL) ++icon_name; else icon_name = dvi_name; + baselen = strlen(icon_name); + if (baselen >= sizeof(".dvi") + && strcmp(icon_name + baselen - sizeof(".dvi") + 1, ".dvi") + == 0) { /* remove the .dvi */ + char *p; + + baselen -= sizeof(".dvi") - 1; + p = xmalloc(baselen + 1); + (void) strncpy(p, icon_name, (int) baselen); + p[baselen] = '\0'; + icon_name = p; + } +#ifdef Omega + title_name = xmalloc(baselen + sizeof("(Omega) OWindvi: ")); + Strcpy(title_name, "(Omega) OWindvi: "); +#else + title_name = xmalloc(baselen + sizeof("Windvi: ")); + Strcpy(title_name, "Windvi: "); +#endif + Strcat(title_name, icon_name); + + if (icon_ret) *icon_ret = icon_name; + if (title_ret) *title_ret = title_name; + if (set_std) { +#ifdef WIN32 + SetWindowText(hWndMain, title_name); +#else + Window top_window = +#ifdef TOOLKIT + XtWindow (top_level); +#else + top_level; +#endif + + XSetStandardProperties(DISP, top_window, title_name, icon_name, + (Pixmap) 0, NULL, 0, NULL); +#endif + } +} + +void +showmessage(message) + _Xconst char *message; +{ + UpdateStatusBar(message, 0, 0); + /* XDrawImageString(DISP, mane.win, foreGC, + 5 - window_x, 5 + X11HEIGHT - window_y, message, strlen(message)) */ +} + + +void +home(Boolean scrl) +{ + if (resource.keep_flag) { + /* Send messages to go to (0,0) */ + SendMessage(mane.win, WM_HSCROLL, + MAKEWPARAM(SB_THUMBPOSITION, (home_x/mane.shrinkfactor)), 0); + SendMessage(mane.win, WM_VSCROLL, + MAKEWPARAM(SB_THUMBPOSITION, (home_y/mane.shrinkfactor)), 0); + } + else { + SendMessage(mane.win, WM_HSCROLL, + MAKEWPARAM(SB_THUMBPOSITION, 0), 0); + SendMessage(mane.win, WM_VSCROLL, + MAKEWPARAM(SB_THUMBPOSITION, 0), 0); + } +} + +void +#if PS +ps_read_events(wait, allow_can) + wide_bool wait; + wide_bool allow_can; +#else + read_events(wait) + wide_bool wait; +#define allow_can True +#endif +{ + +} + +void +redraw(windowrec) + struct WindowRec *windowrec; +{ + bDrawKeep = FALSE; + + /* restore color state at the beginning of the new page */ + init_colors(); + + currwin = *windowrec; + min_x = currwin.min_x + currwin.base_x; + min_y = currwin.min_y + currwin.base_y; + max_x = currwin.max_x + currwin.base_x; + max_y = currwin.max_y + currwin.base_y; +#ifndef WIN32 + can_exposures(windowrec); +#endif + if (debug & DBG_EVENT) + Printf("Redraw %d x %d at (%d, %d) (base=%d,%d)\n", max_x - min_x, + max_y - min_y, min_x, min_y, currwin.base_x, currwin.base_y); +#ifdef WIN32 + /* FIXME : change cursor */ + if (!bMagDisp) + SetCursor(hCursWait); +#else + if (!busycurs) { + XDefineCursor(DISP, mane.win, redraw_cursor); + XFlush(DISP); + busycurs = True; + } +#endif + if (setjmp(dvi_env)) { + XClearWindow(DISP, mane.win); + showmessage(dvi_oops_msg); + if (dvi_file) { + Fclose(dvi_file); + dvi_file = NULL; + } + } + else { +#ifdef BOOKMODE + if (resource.book_mode) { + int old_min_x = min_x, + old_max_x = max_x; + if (min_x <= page_w) { + if (max_x > page_w) { + max_x = currwin.max_x = page_w; + } + draw_page(); + max_x = currwin.max_x = old_max_x; + } + if (max_x > page_w) { + if (min_x <= page_w) { + min_x = currwin.min_x = 0; + } + max_x = currwin.max_x = max_x - page_w; + current_page += 1; + draw_page(); + max_x = currwin.max_x = old_max_x; + min_x = currwin.min_x = old_min_x; + } + warn_spec_now = True; + } + else { + draw_page(); + warn_spec_now = True; + } +#else + draw_page(); + warn_spec_now = True; +#endif + } + if (!bMagDisp) + SetCursor(hCursArrow); +} + +void +redraw_page() +{ +#ifdef WIN32 + RECT maneRect; + GdiFlush(); + GetClientRect(mane.win, &maneRect); + + if (mane.win == hWndDraw && GetClientRect(hWndDraw, &maneRect)) { + int xorg = (int)(page_w - maneRect.right)/2; + int yorg = (int)(page_h - maneRect.bottom)/2; + xorg = min(0, xorg); + yorg = min(0, yorg); +#if 0 + fprintf(stderr, "New org %ld %ld page %d %d rect %d %d\n", + xorg, yorg, page_w, page_h, maneRect.right, maneRect.bottom); +#endif + if (SetWindowOrgEx(maneDC, xorg, yorg, NULL) == 0) { + Win32Error("MsgDrawPaint/SetWindowOrgEx(x,y)"); + } + } + else { + Win32Error("MsgDrawPaint/GetClientRect(hwnd)"); + } + + if (debug & DBG_EVENT) Fputs("Redraw page: ", stdout); + +#if 0 + if (resource.in_memory) { + mane.base_x = 0; + mane.base_y = 0; + mane.min_x = mane.min_y = 0; + mane.max_x = page_w; + mane.max_y = page_h; + allowDrawingChars = True; + maneRect.top = maneRect.left = 0; + maneRect.right = page_w+1; + maneRect.bottom = page_h+1; +#if 0 + if (!FillRect(foreGC, &maneRect, backBrush)) + Win32Error("Redraw Page background"); +#endif + redraw(&mane); + } +#endif + + if (resource.keep_flag) home(False); + + bDrawKeep = FALSE; + InvalidateRect(mane.win, &maneRect, TRUE); + +#else /* ! WIN32 */ + if (debug & DBG_EVENT) Fputs("Redraw page: ", stdout); + XClearWindow(DISP, mane.win); + if (backing_store != NotUseful) { + mane.min_x = mane.min_y = 0; + mane.max_x = page_w; + mane.max_y = page_h; + } + else { + get_xy(); + mane.min_x = -window_x; + mane.max_x = -window_x + clip_w; + mane.min_y = -window_y; + mane.max_y = -window_y + clip_h; + } + redraw(&mane); +#endif /* ! WIN32 */ +} + +Boolean +reconfig() +{ + RECT maneRect; + int x_thick = 0, y_thick = 0; + + /* FIXME : this should change the size of the drawing surface */ + /* XdviResizeWidget(draw_widget, page_w, page_h); + get_geom(); */ + + if (resource.in_memory) { + /* FIXME: + - if the bitmap can't be generated, return en error, and switch back + to the previous shrink_factor + - at s=1, no antialiasing should occur + */ + if (maneDrawMemDC == NULL) + if ((maneDrawMemDC = CreateCompatibleDC(maneDC)) == NULL) + Win32Error("CreateCompatibleDC maneDrawMemDC"); + foreGC = ruleGC = highGC = maneDrawDC = maneDrawMemDC; + + grid1GC = grid2GC = grid3GC = maneDrawDC; + foreGC2 = NULL; /* not used under Win32 */ + +#ifdef TRANSFORM + if (IS_WIN98 || IS_NT) + SetGraphicsMode(maneDrawDC, GM_ADVANCED); +#endif + + if (oldmaneDIB) { + /* There is an old maneDIB, put it back in the DC + and delete the current one */ + if ((maneDIB = SelectObject(foreGC, oldmaneDIB)) == NULL) + Win32Error("reconfig/SelectObject"); + if (DeleteObject(maneDIB) == FALSE) + Win32Error("DeleteObject/maneDIB"); + } + + if ((maneDIB = CreateDIB(maneDC, page_w, page_h, numColors, NULL, NULL)) == NULL) + return False; + if ((oldmaneDIB = SelectObject(foreGC, maneDIB)) == NULL) + Win32Error("reconfig/SelectObject"); + +#if 0 + if (PatBlt(foreGC, 0, 0, page_w, page_h, PATCOPY) == 0) + Win32Error("Reconfig background"); +#else + maneRect.top = maneRect.left = 0; + maneRect.right = page_w; + maneRect.bottom = page_h; +#if 0 + fprintf(stderr, "reconfig() is erasing background\n"); +#endif + if (!FillRect(foreGC, &maneRect, backBrush)) + Win32Error("Reconfig background"); +#endif + } + else { + foreGC = ruleGC = highGC = maneDrawDC = GetDC(hWndDraw); + grid1GC = grid2GC = grid3GC = foreGC; + magMemDC = foreGC2 = NULL; /* not used under Win32 */ + } + +#ifdef HTEX + if (anchor_info) { + /* XMoveResizeWindow(DPY anchor_info, + y_thick - 1, x_thick - BAR_THICK - 1, + clip_w/2, BAR_THICK - 1); */ + if (SetWindowPos(anchor_info, HWND_TOPMOST, + y_thick - 1, x_thick - BAR_THICK - 1, + clip_w/2, BAR_THICK - 1, + SWP_NOACTIVATE | SWP_NOSIZE /* | SWP_SHOWWINDOW */ + | SWP_NOOWNERZORDER | SWP_NOZORDER) == 0) + Win32Error("SetWindowPos"); + paint_anchor(NULL); + /* XMoveResizeWindow(DPY anchor_search, + y_thick + clip_w/2 - 1, x_thick - BAR_THICK - 1, + clip_w/2, BAR_THICK - 1); */ + if (SetWindowPos(anchor_search, HWND_TOPMOST, + y_thick + clip_w/2 - 1, x_thick - BAR_THICK - 1, + clip_w/2, BAR_THICK - 1, + SWP_NOACTIVATE | SWP_NOSIZE /* | SWP_SHOWWINDOW */ + | SWP_NOOWNERZORDER | SWP_NOZORDER) == 0) + Win32Error("SetWindowPos"); + } else { + /* anchor_info = XCreateSimpleWindow(DISP, top_level, y_thick - 1, + x_thick - BAR_THICK -1, + (unsigned int) clip_w/2, BAR_THICK - 1, 1, + brdr_Pixel, back_Pixel); */ + anchor_info = CreateWindow("EDIT", + NULL, + WS_BORDER | WS_POPUP | WS_DISABLED, + /* | WS_CLIPSIBLINGS, */ + y_thick - 1, x_thick - BAR_THICK -1, + (unsigned int) clip_w/2, BAR_THICK - 1, + hWndDraw, + NULL, + hInst, + NULL); + if (anchor_info == NULL) { + Win32Error("CreateWindow/Magnify"); + return FALSE; + } + /* XSelectInput(DISP, anchor_info, ExposureMask); + anchor_search = XCreateSimpleWindow(DISP, top_level, + y_thick + clip_w/2 - 1, + x_thick - BAR_THICK -1, + (unsigned int) clip_w/2, BAR_THICK - 1, 1, + brdr_Pixel, back_Pixel); */ + anchor_search = CreateWindow("EDIT", + NULL, + WS_BORDER | WS_POPUP | WS_DISABLED, + /* | WS_CLIPSIBLINGS, */ + y_thick + clip_w/2 - 1, x_thick - BAR_THICK -1, + (unsigned int) clip_w/2, BAR_THICK - 1, + hWndDraw, + NULL, + hInst, + NULL); + if (anchor_search == NULL) { + Win32Error("CreateWindow/Magnify"); + return FALSE; + } + ShowWindow(anchor_info, SW_SHOW); + ShowWindow(anchor_search, SW_SHOW); +#if 0 + XSelectInput(DISP, anchor_search, ExposureMask|KeyPressMask); + XMapWindow(DPY anchor_info); + XMapWindow(DPY anchor_search); +#endif + } +#endif + /* Now, the scrollbars */ + SetScrollBars(mane.win); + return True; +} + +int +atopix(arg) + _Xconst char *arg; +{ + int len = strlen(arg); + _Xconst char *arg_end = arg; + char tmp[11]; + double factor; + + /* Skip whithe spaces */ + while (arg_end && *arg_end && isspace(*arg_end)) arg_end++; + + while ((*arg_end >= '0' && *arg_end <= '9') || *arg_end == '.') + if (arg_end >= arg + XtNumber(tmp) - 1) return 0; + else ++arg_end; + bcopy(arg, tmp, arg_end - arg); + tmp[arg_end - arg] = '\0'; + +#if A4 + factor = 1.0 / 2.54; /* cm */ +#else + factor = 1.0; /* inches */ +#endif + if (len > 2) + switch (arg[len - 2] << 8 | arg[len - 1]) { + case 'i' << 8 | 'n': factor = 1.0; break; + case 'c' << 8 | 'm': factor = 1.0 / 2.54; break; + case 'm' << 8 | 'm': factor = 1.0 / 25.4; break; + case 'p' << 8 | 't': factor = 1.0 / 72.27; break; + case 'p' << 8 | 'c': factor = 12.0 / 72.27; break; + case 'b' << 8 | 'p': factor = 1.0 / 72.0; break; + case 'd' << 8 | 'd': factor = 1238.0 / 1157.0 / 72.27; break; + case 'c' << 8 | 'c': factor = 12 * 1238.0 / 1157.0 / 72.27; + break; + case 's' << 8 | 'p': factor = 1.0 / 72.27 / 65536; break; + } + + return factor * atof(tmp) * pixels_per_inch + 0.5; +} + +string +pixtoa(int arg) +{ + char buf[64]; + sprintf(buf, "%.2fcm", (arg * 2.54) / pixels_per_inch); + return strdup(buf); +} + +#ifdef GRID +/* extract the unit used in paper size specification */ +/* the information is used to decide the initial grid separation */ +int +atopixunit(arg) + _Xconst char *arg; +{ + int len = strlen(arg); + + return (int)((len > 2 && arg[len - 2] == 'c' && arg[len - 1] == 'm' ? + 1.0 / 2.54 : 1.0) * pixels_per_inch + 0.5); +} +#endif /* GRID */ + +void remove_temporary_dir(void) + +{ + int err; + + if (TmpDir!=NULL) { + err=rmdir(TmpDir); + if (err!=0 && errno!=ENOENT) { + char *buffer=malloc(160); + if (buffer==NULL) oops("Please buy more RAM"); + sprintf(buffer,"xdvik: Warning: Could not remove temporary directory %s", + TmpDir); + perror(buffer); + } + } +} + +/* Create a temporary directory where we can write files from this program */ +void +make_temporary_dir(tmpdir) +char **tmpdir; +{ + int ret, idval; + char * tmp; + + *tmpdir = tempnam(NULL,"xdvi"); + + if (*tmpdir == NULL) + oops("Out of memory. Exiting."); + +#ifdef HTEX + if (debug & DBG_HYPER) + fprintf(stderr,"Making temporary directory %s\n",*tmpdir); +#endif + +#ifdef WIN32 + ret = mkdir(*tmpdir); +#else + ret = mkdir(*tmpdir, 0700); +#endif + + /* The use of atexit and one variable to store the directory name + makes this procedure a oneoff. Enforce it */ + if (TmpDir!=NULL) + oops("make_temporary_dir called twice!\n"); + + TmpDir=strdup(*tmpdir); +#ifndef WIN32 + atexit(remove_temporary_dir); +#endif + if (ret != 0) + /* Didn't work, PANIC! */ + oops("Could not create temporary directory. Exiting."); + +} + +#ifdef HTEX +/* The anchor window stuff: */ + +void paint_anchor(text) +char *text; +{ +#ifdef WIN32 + extern Widget anchor_info; +#if 0 + if (text != NULL) + SetWindowText(anchor_info, text); +#endif +#else + ClearArea(anchor_info, 1, 1, clip_w/2, BAR_THICK); + if (text != NULL) XDrawString(DISP, anchor_info, foreGC, + 1 , BAR_WID, text, strlen(text)); +#endif +} + +#endif diff --git a/Build/source/texk/windvi/wingoto.c b/Build/source/texk/windvi/wingoto.c new file mode 100644 index 00000000000..cf4f60d2384 --- /dev/null +++ b/Build/source/texk/windvi/wingoto.c @@ -0,0 +1,115 @@ +#include "wingui.h" +#include "xdvi-config.h" + +/***************************************************************************** + GotoPage Box + ****************************************************************************/ +LRESULT CALLBACK DlgGotoPage(HWND, UINT, WPARAM, LPARAM); +LRESULT MsgGotoPageInit(HWND, UINT, WPARAM, LPARAM); +LRESULT MsgGotoPageCommand(HWND, UINT, WPARAM, LPARAM); +LRESULT CmdGotoPageOK(HWND, WORD, WORD, HWND); +LRESULT CmdGotoPageCancel(HWND, WORD, WORD, HWND); +LRESULT CmdGotoPageSPUp(HWND, WORD, WORD, HWND); +LRESULT CmdGotoPageSPDown(HWND, WORD, WORD, HWND); + +/* GotoPage dialog message table definition. */ +MSD rgmsdGotoPage[] = +{ + {WM_COMMAND, MsgGotoPageCommand}, + {WM_INITDIALOG, MsgGotoPageInit} +}; + +MSDI msdiGotoPage = +{ + sizeof(rgmsdGotoPage) / sizeof(MSD), + rgmsdGotoPage, + edwpNone +}; + +/* GotoPage dialog command table definition. */ +CMD rgcmdGotoPage[] = +{ + {IDOK, CmdGotoPageOK}, + {IDCANCEL, CmdGotoPageCancel} +}; + +CMDI cmdiGotoPage = +{ + sizeof(rgcmdGotoPage) / sizeof(CMD), + rgcmdGotoPage, + edwpNone +}; + +/* + Goto page dialog box + */ + +/* + Processes WM_COMMAND sent to the GotoPage box. + */ + +LRESULT MsgGotoPageCommand(HWND hwnd, + UINT uMessage, + WPARAM wparam, + LPARAM lparam) +{ + return DispCommand(&cmdiGotoPage, hwnd, wparam, lparam); +} + +LRESULT MsgGotoPageInit(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + /* Center the dialog over the application window */ + CenterWindow(hdlg, GetWindow(hdlg, GW_OWNER)); + + /* Put the current page number into the edit */ + SendDlgItemMessage(hdlg, IDC_SPIN_PAGE_NUMBER, UDM_SETPOS, + 0, (LPARAM) MAKELONG((short) current_page + 1, 0)); + /* Put the page range into the spinner */ + SendDlgItemMessage(hdlg, IDC_SPIN_PAGE_NUMBER, UDM_SETRANGE, + 0, (LPARAM) MAKELONG((short) total_pages, 1)); + /* set the selection */ + SendDlgItemMessage(hdlg, IDC_PAGE_NUMBER, EM_SETSEL, + 0, -1); + SetFocus(GetDlgItem(hdlg, IDC_PAGE_NUMBER)); + return 0; +} + +/* + OK has been clicked on, free the box and related resources. + */ + +LRESULT CmdGotoPageOK(HWND hdlg, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + char szBuf[80]; + int new_page; + /* Get the current page number */ + *((LPDWORD)szBuf) = sizeof(szBuf); + SendDlgItemMessage(hdlg, IDC_PAGE_NUMBER, EM_GETLINE, + 0, (LPARAM)szBuf); + new_page = atoi(szBuf) - 1; + wsprintf(szBuf, "Goto page %d", new_page+1); + UpdateStatusBar(szBuf, 0, 0); + ChangePage(new_page - current_page); + EndDialog(hdlg, TRUE); /* Exit the dialog */ + return 0; +} + +/* + Cancel has been clicked on, free the box and related resources. + */ + +LRESULT CmdGotoPageCancel(HWND hdlg, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + EndDialog(hdlg, TRUE); /* Exit the dialog */ + return 0; +} + +/* + Process messages for the GotoPage box. + */ + +LRESULT CALLBACK DlgGotoPage(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + return DispMessage(&msdiGotoPage, hdlg, uMessage, wparam, lparam); +} + diff --git a/Build/source/texk/windvi/wingui.h b/Build/source/texk/windvi/wingui.h new file mode 100644 index 00000000000..c317950e586 --- /dev/null +++ b/Build/source/texk/windvi/wingui.h @@ -0,0 +1,276 @@ +#define HAVE_BOOLEAN 1 + +#include <windows.h> +#include <windowsx.h> +#include <commctrl.h> +#include <shellapi.h> +#include <tchar.h> + +typedef long HRESULT; + +#define APPNAME WINDVI +#define SZAPPNAME "Windvi" +#define SZDESCRIPTION "Dvi viewer for Win32" +#define SZABOUT "About Windvi" +#define SZVERSION "4.0" + +/* + Resources + */ +#include "resource.h" + +/**************************************************************************** + Global Variables + ***************************************************************************/ + +extern HINSTANCE hInst; /* Current instance */ +extern char szAppName[100]; /* Name of the app */ +extern char szTitle[100]; /* The title bar text */ +extern HWND hWndMain, hWndDraw, hWndMagnify; +extern HWND hWndToolbar, hWndStatusBar; +extern HWND hViewLog; +extern HDC maneDC, maneDrawDC; /* DC for the screen window */ +extern HDC magDC, magMemDC; /* DC for the magnifying glass */ +extern HBITMAP maneDIB, magDIB; +extern HMENU hMenuMain; /* Main Menu */ +extern char *szLogFileName; /* Temporary log file for kpathsea */ +extern HANDLE hCrtIn, hCrtOut, hCrtErr; /* Standard handles */ +extern HANDLE hLogIn; +extern HANDLE hViewLogThread, hLogLoopThread; +extern int tbHeight, sbHeight, maneHeight, maneWidth; +extern RECT maneRect; +/* Scrollbars' variables */ +extern SCROLLINFO si; +extern int xMinScroll; +extern int xMaxScroll; +extern int xCurrentScroll; +extern int yMinScroll; +extern int yMaxScroll; +extern int yCurrentScroll; +extern BOOL fScroll; +extern BOOL fSize; +extern BOOL bLogShown; + +/* Mouse Position */ +extern int xMousePos; +extern int yMousePos; + + +void SetupEnv(); +BOOL InitInstance(HINSTANCE hInstance, int nCmdShow); +BOOL CreateDraw(HWND hwndParent); +BOOL CreateMagnify(HWND hwndParent); +BOOL CreateViewLog(HWND hwndParent); +extern void InitGlobalsDraw(); + +/* Used by the WM_COPYDATA mechanism */ +struct data_exchange { + char cwd[256]; + char dviname[256]; + int currentpage; + int shrinkfactor; +}; + + +/*------------------------------------------------------------------------- + Functions for handling main window messages. The message-dispatching + mechanism expects all message-handling functions to have the following + prototype: + + LRESULT FunctionName(HWND, UINT, WPARAM, LPARAM); + + **TODO** Add message-handling function prototypes here. Be sure to + add the function names to the main window message table in + windvi.c. +*/ + +LRESULT MsgCommand (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgCreate (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgDestroy (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgSize (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgMove (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgHScroll (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgVScroll (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgTimer (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgMousemove (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgMenuSelect(HWND, UINT, WPARAM, LPARAM); +LRESULT MsgNotify (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgPaint (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgChar (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgKeyDown (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgActivate (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgDropFiles (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgCopyData (HWND, UINT, WPARAM, LPARAM); + +LRESULT MsgDrawCommand (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgDrawCreate (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgDrawSize (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgDrawHScroll (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgDrawVScroll (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgDrawMousemove (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgDrawPaint (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgDrawEraseBkgnd(HWND, UINT, WPARAM, LPARAM); +LRESULT MsgDrawNCPaint (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgDrawEnterMagL (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgDrawEnterMagM (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgDrawEnterMagR (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgDrawQuitMagL (HWND, UINT, WPARAM, LPARAM); + +LRESULT MsgMagnifyCommand (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgMagnifyCreate (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgMagnifySize (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgMagnifyHScroll (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgMagnifyVScroll (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgMagnifyMousemove (HWND, UINT, WPARAM, LPARAM); +LRESULT MsgMagnifyEraseBkgnd(HWND, UINT, WPARAM, LPARAM); +LRESULT MsgMagnifyPaint (HWND, UINT, WPARAM, LPARAM); + +/*------------------------------------------------------------------------- + Functions for handling main window commands--ie. functions for + processing WM_COMMAND messages based on the wParam value. + The message-dispatching mechanism expects all command-handling + functions to have the following prototype: + + LRESULT FunctionName(HWND, WORD, WORD, HWND); + + **TODO** Add message-handling function prototypes here. Be sure to + add the function names to the main window command table in + windvi.c. +*/ + +LRESULT CmdExit (HWND, WORD, WORD, HWND); +LRESULT CmdFilePrint (HWND, WORD, WORD, HWND); +LRESULT CmdFilePrSetup (HWND, WORD, WORD, HWND); +LRESULT CmdAbout (HWND, WORD, WORD, HWND); +LRESULT CmdStub (HWND, WORD, WORD, HWND); +LRESULT CmdOpen (HWND, WORD, WORD, HWND); +LRESULT CmdOpenRecentFile (HWND, WORD, WORD, HWND); +LRESULT CmdClose (HWND, WORD, WORD, HWND); +LRESULT CmdZoomIn (HWND, WORD, WORD, HWND); +LRESULT CmdZoomOut (HWND, WORD, WORD, HWND); +LRESULT CmdToggleGrid (HWND, WORD, WORD, HWND); +LRESULT CmdTogglePS (HWND, WORD, WORD, HWND); +LRESULT CmdPreviousPage (HWND, WORD, WORD, HWND); +LRESULT CmdNextPage (HWND, WORD, WORD, HWND); +LRESULT CmdPreviousPage (HWND, WORD, WORD, HWND); +LRESULT CmdNext5 (HWND, WORD, WORD, HWND); +LRESULT CmdPrevious5 (HWND, WORD, WORD, HWND); +LRESULT CmdNext10 (HWND, WORD, WORD, HWND); +LRESULT CmdPrevious10 (HWND, WORD, WORD, HWND); +LRESULT CmdGotoPage (HWND, WORD, WORD, HWND); +LRESULT CmdSrcSpecials (HWND, WORD, WORD, HWND); +LRESULT CmdUrlBack (HWND, WORD, WORD, HWND); +LRESULT CmdViewLog (HWND, WORD, WORD, HWND); +LRESULT CmdRedrawPage (HWND, WORD, WORD, HWND); +LRESULT CmdKeepPosition (HWND, WORD, WORD, HWND); +LRESULT CmdLastPage (HWND, WORD, WORD, HWND); +LRESULT CmdFirstPage (HWND, WORD, WORD, HWND); +LRESULT CmdHelpTopics (HWND, WORD, WORD, HWND); +LRESULT CmdHelpContents (HWND, WORD, WORD, HWND); +LRESULT CmdHelpSearch (HWND, WORD, WORD, HWND); +LRESULT CmdHelpHelp (HWND, WORD, WORD, HWND); +LRESULT CmdWindviConfig (HWND, WORD, WORD, HWND); +LRESULT CmdTexConfig (HWND, WORD, WORD, HWND); + +BOOL InitApplication(HINSTANCE); +BOOL CenterWindow(HWND, HWND); + +/* + Main callback function. + */ + +LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); + +LRESULT CALLBACK DrawProc(HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK MagnifyProc(HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK DlgGotoPage(HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK DlgViewLog(HWND, UINT, WPARAM, LPARAM); + +/* + Message and command dispatch infrastructure. The following type + definitions and functions are used by the message and command dispatching + mechanism and do not need to be changed. + */ + + /* Function pointer prototype for message handling functions. */ +typedef LRESULT (*PFNMSG)(HWND,UINT,WPARAM,LPARAM); + + /* Function pointer prototype for command handling functions. */ +typedef LRESULT (*PFNCMD)(HWND,WORD,WORD,HWND); + + /* Enumerated type used to determine which default window procedure */ + /* should be called by the message- and command-dispatching mechanism */ + /* if a message or command is not handled explicitly. */ +typedef enum +{ + edwpNone, /* Do not call any default procedure. */ + edwpWindow, /* Call DefWindowProc. */ + edwpDialog, /* Call DefDlgProc (This should be used only for */ + /* custom dialogs - standard dialog use edwpNone). */ + edwpMDIChild, /* Call DefMDIChildProc. */ + edwpMDIFrame /* Call DefFrameProc. */ +} EDWP; /* Enumeration for Default Window Procedures */ + + /* This structure maps messages to message handling functions. */ +typedef struct _MSD +{ + UINT uMessage; + PFNMSG pfnmsg; +} MSD; /* MeSsage Dispatch structure */ + + /* This structure contains all of the information that a window */ + /* procedure passes to DispMessage in order to define the message */ + /* dispatching behavior for the window. */ +typedef struct _MSDI +{ + int cmsd; /* Number of message dispatch structs in rgmsd */ + MSD *rgmsd; /* Table of message dispatch structures */ + EDWP edwp; /* Type of default window handler needed. */ +} MSDI, FAR *LPMSDI; /* MeSsage Dipatch Information */ + + /* This structure maps command IDs to command handling functions. */ +typedef struct _CMD +{ + WORD wCommand; + PFNCMD pfncmd; +} CMD; /* CoMmand Dispatch structure */ + + /* This structure contains all of the information that a command */ + /* message procedure passes to DispCommand in order to define the */ + /* command dispatching behavior for the window. */ +typedef struct _CMDI +{ + int ccmd; /* Number of command dispatch structs in rgcmd */ + CMD *rgcmd; /* Table of command dispatch structures */ + EDWP edwp; /* Type of default window handler needed. */ +} CMDI, FAR *LPCMDI; /* CoMmand Dispatch Information */ + + /* Message and command dispatching functions. They look up messages */ + /* and commands in the dispatch tables and call the appropriate handler */ + /* function. */ +LRESULT DispMessage(LPMSDI, HWND, UINT, WPARAM, LPARAM); +LRESULT DispCommand(LPCMDI, HWND, WPARAM, LPARAM); + + /* Message dispatch information for the main window */ +MSDI msdiMain; + /* Command dispatch information for the main window */ +CMDI cmdiMain; + +/* Function protoptype for Creating Toolbar */ +BOOL CreateTBar(HWND); + +/* Function prototypes for status bar creation */ +BOOL CreateSBar(HWND); +void InitializeStatusBar(HWND); +void UpdateStatusBar(LPSTR, WORD, WORD); + + +/* Various */ +void ChangePage(int); +void ReadHelp(HWND, LPTSTR); +void SizeClientWindow(HWND); +int ChooseShrink(); +void ChangeZoom(int); +DWORD WINAPI ViewLogSentinel(LPVOID); +void SetScrollBars(HWND); +void DispVersion(); diff --git a/Build/source/texk/windvi/winhtex.c b/Build/source/texk/windvi/winhtex.c new file mode 100644 index 00000000000..e3dc3477dca --- /dev/null +++ b/Build/source/texk/windvi/winhtex.c @@ -0,0 +1,230 @@ +/* + winhtex.c : implementation file + Time-stamp: "99/07/23 17:33:42 popineau" + + Copyright (C) 1999 + Fabrice Popineau <Fabrice.Popineau@supelec.fr> + + This file is part of Windvi. + + Windvi 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. + + Windvi 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 Windvi; if not, write to the Free Software Foundation, 59 + Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "wingui.h" +#include "xdvi-config.h" +#include <wininet.h> + +#include <kpathsea/c-proto.h> + +static HINTERNET hInternetSession = NULL; + +static BOOL init_htex_features() +{ + /* __asm int 3; */ + if (!hInternetSession) { + hInternetSession = InternetOpen(_T("Windvi"), + INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0); + if (!hInternetSession) { + fprintf(stderr, "Unable to open an Internet Session !n"); + } + } + return hInternetSession != NULL; +} + +/* + Windows can get rid of all the libwww stuff, because + there is no need much than opening remote files, which + can be done through the ShellExecute() call. + Anyway, to be still compatible with the code written here, + some of the libwww functions have been rewritten. +*/ + +#include "winhtex.h" +#include <kpathsea/c-pathch.h> + +/* +** Search the URL and determine whether it is a relative or absolute URL. +** We check to see if there is a ":" before any "/", "?", and "#". If this +** is the case then we say it is absolute. Otherwise it is relative. +*/ +BOOL HTURL_isAbsolute (const char * url) +{ + /* Given the context, we can't let windvi believe that + c:/foo.dvi is an absolute url ... */ + if (NAME_BEGINS_WITH_DEVICE(url)) + return NO; + + if (url) { + const char * ptr = url; + while (*ptr) { + if (*ptr == ':') return YES; + if (*ptr == '/' || *ptr == '?' || *ptr == '#') break; + ptr ++; + } + } + return NO; +} + +int +invokeviewer(char *filename) +{ + int ret; + ret = ShellExecute(NULL, "open", dvi_name, NULL, NULL, SW_SHOWNORMAL); + if (ret <= 0) + return 0; + else + return 1; +} + +char * HTParse (const char *aName, const char *relatedName, int wanted) +{ + int ret; + char *result, *abs, *rel; + DWORD len; + BOOL bAgain = FALSE; + +#if 0 + if (aName && *aName) { + abs = xmalloc(strlen(aName) + 2); + strcpy(abs, aName); + strcat(abs, "/"); + } + else { + /* FIXME: what does mean a null base url ? */ + abs = xstrdup(""); + } +#else + abs = xstrdup(aName ? aName : ""); +#endif + rel = (relatedName ? relatedName : ""); + + len = strlen(abs) + strlen(rel) + 45; + result = xmalloc(len*sizeof(char)); + +#if 0 + fprintf(stderr, "HTParse called with aName = %s and relatedName = %s\n", + aName, relatedName); +#endif + do { + if (*rel) { + ret = InternetCombineUrl(abs, rel, result, &len, ICU_BROWSER_MODE); + } + else { + ret = InternetCanonicalizeUrl(abs, result, &len, ICU_BROWSER_MODE); + } + bAgain = FALSE; + if (!ret) { + switch (GetLastError()) { + case ERROR_INSUFFICIENT_BUFFER: +#if 0 + fprintf(stderr, "InternetCombineUrl: buffer was not long enough (needed %d)\n", len+1); +#endif + result = xrealloc(result, len+1); + bAgain = TRUE; + break; + case ERROR_BAD_PATHNAME: + fprintf(stderr, "InternetCombineUrl failed, one of the path names is bad:\n\t%s\n\t%s\n", + aName, relatedName); + break; + case ERROR_INTERNET_INVALID_URL: + fprintf(stderr, "InternetCombineUrl failed, url %s is malformed.\n", aName); + break; + case ERROR_INVALID_PARAMETER: + fprintf(stderr, "InternetCombineUrl failed with `invalid parameter'.\n"); + break; + default: + break; + } + } + } while (bAgain); + + /* abs has always been malloc'ed */ + if (abs) + free(abs); + + if (!ret) { + /* FIXME: Try this poor thing ! */ + sprintf(result, "%s/%s", aName, relatedName); + } + +#if 0 + fprintf(stderr, "HTParse: result is %s\n", result); +#endif + return result; +} + +int +www_fetch(char *url, char *savefile) +{ + HINTERNET hUrlDump; + extern HINTERNET hInternetSession; + DWORD dwSize=TRUE; + LPSTR lpszData; + LPSTR lpszOutPut; + LPSTR lpszHolding; + int nCounter=1; + int nBufferSize; + DWORD BigSize=8000; + FILE *fSave; + + if ((fSave = fopen(savefile, "wb")) == NULL) { + perror("www_fetch"); + return 0; + } + + hUrlDump = InternetOpenUrl(hInternetSession, url, NULL, 0, + INTERNET_FLAG_RAW_DATA, 0); + if (!hUrlDump) { + Win32Error("www_fetch/InternetOpenUrl"); + fclose(fSave); + return 0; + } + + do { + + /* Read the data */ + if(InternetReadFile(hUrlDump,(LPVOID)lpszData,BigSize,&dwSize) == FALSE) { + Win32Error("www_fetch/InternetReadFile"); + break; + } + else { + fwrite(lpszData, sizeof(char), dwSize , fSave); + if (dwSize == 0) { + break; + } + } + } + while (TRUE); + + /* Close the HINTERNET handle */ + InternetCloseHandle(hUrlDump); + + /* Set the cursor back to an arrow */ + SetCursor(LoadCursor(NULL,IDC_ARROW)); + + /* Return */ + return TRUE; +} + +void +htex_cleanup(int arg) +{ + /* Delete all the temp files we created */ + for (;nURLs>0; nURLs--) { + /* fprintf(stderr,"htex: Unlinking %s\n",filelist[nURLs-1].file); */ + unlink(filelist[nURLs-1].file); + } + if (hInternetSession) + InternetCloseHandle(hInternetSession); +} diff --git a/Build/source/texk/windvi/winhtex.h b/Build/source/texk/windvi/winhtex.h new file mode 100644 index 00000000000..37b29ec84bd --- /dev/null +++ b/Build/source/texk/windvi/winhtex.h @@ -0,0 +1,38 @@ +/* + winhtex.h : prototype file + Time-stamp: "99/07/22 20:24:32 popineau" + + Copyright (C) 1999 + Fabrice Popineau <Fabrice.Popineau@supelec.fr> + + This file is part of Windvi. + + Windvi 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. + + Windvi 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 Windvi; if not, write to the Free Software Foundation, 59 + Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef _WINHTEX_H_ +#define _WINHTEX_H_ + +#define NO 0 +#define YES 1 + +#define PARSE_ALL 1 + +extern BOOL HTURL_isAbsolute(const char *url); +extern int invokviewer(char *filename); +extern char * HTParse (const char *aName, const char *relatedName, int wanted); +extern void htex_cleanup(int arg); +extern int www_fetch(char *url, char *savefile); +#endif + diff --git a/Build/source/texk/windvi/winimg.c b/Build/source/texk/windvi/winimg.c new file mode 100644 index 00000000000..8ed6b0139c7 --- /dev/null +++ b/Build/source/texk/windvi/winimg.c @@ -0,0 +1,563 @@ +/* + winimg.c : implementation file + Time-stamp: "00/04/06 23:50:06 Fabrice Popineau" + + Copyright (C) 1999 + Fabrice Popineau <Fabrice.Popineau@supelec.fr> + + This file is part of Windvi. + + Windvi 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. + + Windvi 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 Windvi; if not, write to the Free Software Foundation, 59 + Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "wingui.h" +#include "xdvi-config.h" + +struct emunit { + char *unit; + float factor; +}; +struct emunit emtable[] = { + {"pt",72.27}, + {"pc",72.27/12}, + {"in",1.0}, + {"bp",72.0}, + {"cm",2.54}, + {"mm",25.4}, + {"dd",72.27/(1238.0/1157)}, + {"cc",72.27/12/(1238.0/1157)}, + {"sp",72.27*65536}, + {0,0.0} +}; + +#define SKIP_SPACE(p) { while(isspace(*p)) { p++; } } +#define SKIP_SPACE_AND_COMMA(p) { while(isspace(*p) || *p == ',') { p++; } } + +char emstr[MAXPATHLEN]; +float emwidth, emheight; + +typedef struct _myBitmap { + HANDLE hFile; + HANDLE hMapFile; + LPVOID pMapFile; + LPBITMAPINFO pbmi; + /* PBYTE ppvBits; */ + HPALETTE hPal; + BOOL bCoreHeader; +} myBitmap, *pmyBitmap; + +/******************************Public*Routine******************************\ + * + * bSelectDIBPal + * + * Effects: Creates a logical palette from the DIB and select it into the DC + * and realize the palette. Saving the hPal in the pInfo->hPal + * + * Warnings: Based on Windows NT DIB support. If PM support 16,24,32 bpp + * we need to modify this routine. + * + \**************************************************************************/ +BOOL bSelectDIBPal(HDC hDC, pmyBitmap theBitmap) +{ + LOGPALETTE *plogPal; + UINT uiSizPal; + INT i, iNumClr; + WORD wBitCount; + LPBITMAPINFO pbmi = theBitmap->pbmi; + + if (theBitmap->bCoreHeader) { + wBitCount = ((LPBITMAPCOREINFO)pbmi)->bmciHeader.bcBitCount; + } + else { + wBitCount = pbmi->bmiHeader.biBitCount; + } + + switch (wBitCount) { + case 16: + case 24: + case 32: + /* Does PM supports these? */ + return FALSE; + default: + iNumClr = (1 << wBitCount); + break; + } + uiSizPal = sizeof(WORD)*2 + sizeof(PALETTEENTRY)*iNumClr; + if ((plogPal = (LOGPALETTE *) LocalAlloc(LMEM_FIXED,uiSizPal)) == NULL) { + theBitmap->hPal = NULL; + return FALSE; + } + plogPal->palVersion = 0x300; + plogPal->palNumEntries = (WORD) iNumClr; + if (theBitmap->bCoreHeader) { + for (i=0; i<iNumClr; i++) { + plogPal->palPalEntry[i].peRed = ((LPBITMAPCOREINFO)pbmi)->bmciColors[i].rgbtRed; + plogPal->palPalEntry[i].peGreen = ((LPBITMAPCOREINFO)pbmi)->bmciColors[i].rgbtGreen; + plogPal->palPalEntry[i].peBlue = ((LPBITMAPCOREINFO)pbmi)->bmciColors[i].rgbtBlue; + plogPal->palPalEntry[i].peFlags = PC_RESERVED; + } + } + else { + for (i=0; i<iNumClr; i++) { + plogPal->palPalEntry[i].peRed = pbmi->bmiColors[i].rgbRed; + plogPal->palPalEntry[i].peGreen = pbmi->bmiColors[i].rgbGreen; + plogPal->palPalEntry[i].peBlue = pbmi->bmiColors[i].rgbBlue; + plogPal->palPalEntry[i].peFlags = PC_RESERVED; + } + } + theBitmap->hPal = CreatePalette((LPLOGPALETTE)plogPal); + if ((theBitmap->hPal) == NULL) { + return FALSE; + } +#if 0 + /* FIXME : if we play with the palette her, then we must + use it too when displaying glyphs. */ + if ((GetDeviceCaps(hDC, RASTERCAPS)) & RC_PALETTE) { + SelectPalette(hDC, theBitmap->hPal, FALSE); + RealizePalette(hDC); + } +#endif + GlobalFree(plogPal); + return TRUE; +} + +/******************************Public*Routine******************************\ + * + * LoadBitmapFile * * Effects: Loads the bitmap from file and put into pInfo->hBmpSaved + * + * Warnings: pszFileName contains the full path + * +\**************************************************************************/ +pmyBitmap LoadBitmapFile(const char *filename) +{ + BOOL bSuccess; + HANDLE hFile, hMapFile; + LPVOID pMapFile; + LPBITMAPINFOHEADER pbmh; + LPBITMAPINFO pbmi; + PBYTE pjTmp; + ULONG sizBMI; + INT iNumClr; + BOOL bCoreHeader; + pmyBitmap theBitmap = NULL; + /* + PFILEINFO pFileInfo; + */ + + bSuccess = TRUE; + if ((hFile = CreateFile(filename, + GENERIC_READ, + FILE_SHARE_READ, + NULL, + OPEN_EXISTING, + FILE_ATTRIBUTE_READONLY, + NULL)) == (HANDLE)-1) { + OutputDebugString("Fail in file open"); + bSuccess = FALSE; + goto ErrExit1; + } + /* Create a map file of the opened file. */ + if ((hMapFile = CreateFileMapping(hFile, + NULL, + PAGE_READONLY, + 0, + 0, + NULL)) == (HANDLE)-1) { + Win32Error("Fail in creating map file"); + bSuccess = FALSE; + goto ErrExit2; + } + /* Map a view of the whole file */ + if ((pMapFile = MapViewOfFile(hMapFile, FILE_MAP_READ, 0, 0, 0)) == NULL) { + Win32Error("Fail in mapping view of the Map File object"); + bSuccess = FALSE; + goto ErrExit3; + } + /* Saving the DIB file handle, etc in pInfo... + freeing existing objects, if any. */ + +#if 0 + bFreeRleFile(pInfo); + pFileInfo = &(pInfo->RleData.rgFileInfo[0]); + pFileInfo->hFile = hFile; + pFileInfo->hMapFile = hMapFile; + pFileInfo->lpvMapView = pMapFile; +#endif + /* First check that it is a bitmap file. */ + if (*((PWORD)pMapFile) != 0x4d42) { + /* 'BM' */ + fprintf(stderr, "windvi: Error, %s is not a DIB!\n", filename); + bSuccess = FALSE; + goto ErrExit3; + } + + /* The file header doesn't end on DWORD boundary... */ + pbmh = (LPBITMAPINFOHEADER)((PBYTE)pMapFile + sizeof(BITMAPFILEHEADER)); + { + BITMAPCOREHEADER bmch, *pbmch; + BITMAPINFOHEADER bmih, *pbmih; + PBYTE pjTmp; + ULONG ulSiz; + pbmch = &bmch; + pbmih = &bmih; + pjTmp = (PBYTE)pbmh; + ulSiz = sizeof(BITMAPCOREHEADER); + while (ulSiz--) { + *(((PBYTE)pbmch)++) = *(((PBYTE)pjTmp)++); + } + pjTmp = (PBYTE)pbmh; + ulSiz = sizeof(BITMAPINFOHEADER); + while (ulSiz--) { + *(((PBYTE)pbmih)++) = *(((PBYTE)pjTmp)++); + } + /* Use the size to determine if it is a BitmapCoreHeader or + BitmapInfoHeader. + Does PM supports 16 and 32 bpp? How? */ + if (bmch.bcSize == sizeof(BITMAPCOREHEADER)) { + WORD wBitCount; + wBitCount = bmch.bcBitCount; + iNumClr = ((wBitCount == 24) ? 0 : (1 << wBitCount)); + sizBMI = sizeof(BITMAPCOREHEADER)+sizeof(RGBTRIPLE)*iNumClr; + bCoreHeader = TRUE; + } + else { + /* BITMAPINFOHEADER */ + WORD wBitCount; + wBitCount = bmih.biBitCount; + switch (wBitCount) { + case 16: + case 32: + sizBMI = sizeof(BITMAPINFOHEADER)+sizeof(DWORD)*3; + break; + case 24: + sizBMI = sizeof(BITMAPINFOHEADER); + break; + default: + iNumClr = (1 << wBitCount); + sizBMI = sizeof(BITMAPINFOHEADER)+sizeof(RGBQUAD)*iNumClr; + break; + } + bCoreHeader = FALSE; + } + } + if ((pbmi = (LPBITMAPINFO) malloc(sizBMI)) == NULL) { + bSuccess = FALSE; + goto ErrExit3; + } + /* Make sure we pass in a DWORD aligned BitmapInfo to CreateDIBitmap + Otherwise, exception on the MIPS platform + CR!!! Equivalent to memcpy */ + pjTmp = (PBYTE)pbmi; + while(sizBMI--) { + *(((PBYTE)pjTmp)++) = *(((PBYTE)pbmh)++); + } + + /* assuming CreateDIBitmap() is doing a byte fetch... */ + pMapFile = (PBYTE)pMapFile + ((BITMAPFILEHEADER *)pMapFile)->bfOffBits; + +#if 0 + /* Select the palette into the DC first before CreateDIBitmap() */ + bSelectDIBPal(maneDC, pInfo, pbmi, bCoreHdr); + if ((hddb = CreateDIBitmap(maneDC, + (LPBITMAPINFOHEADER)pbmi, + CBM_INIT, + pMapFile, + pbmi, + DIB_RGB_COLORS)) == NULL) { + Win32Error("Fail in creating DIB bitmap from file!"); + bSuccess = FALSE; + goto ErrExit4; + } +#endif +#if 0 + /* Saving the DIB...free memory when the windows is closed. */ + pInfo->RleData.rgpjFrame[0] = pMapFile; + pInfo->RleData.rgpbmi[0] = pbmi; + pInfo->RleData.pbmi = (PBITMAPINFO) &(pInfo->RleData.rgpbmi[0]); + pInfo->RleData.ulFrames = 1; + pInfo->RleData.ulFiles = 1; + /* set flag to use original DIB as source for blting so HT can be done */ + pInfo->bUseDIB = TRUE; + pInfo->bCoreHdr = bCoreHdr; +#endif + theBitmap = malloc(sizeof(myBitmap)); + theBitmap->hFile = hFile; + theBitmap->hMapFile = hMapFile; + theBitmap->pMapFile = pMapFile; + theBitmap->pbmi = pbmi; + theBitmap->bCoreHeader = bCoreHeader; + + return (theBitmap); + ErrExit4: + LocalFree(pbmi); + ErrExit3: + CloseHandleAndClear(&hMapFile); + ErrExit2: + CloseHandleAndClear(&hFile); + ErrExit1: + return (0); +} + +void +DisplayBmpFile(const char *filename, int xpos, int ypos, int width, int height) +{ + pmyBitmap theBitmap; + RECT r; + + if (xpos < max_x && xpos + (int) width >= min_x && + ypos < max_y && ypos + (int) height >= min_y) { +#if 0 + MoveToEx(foreGC, xpos, ypos, NULL); + LineTo(foreGC, xpos + width, ypos); + LineTo(foreGC, xpos + width, ypos + height); + LineTo(foreGC, xpos, ypos + height); + LineTo(foreGC, xpos, ypos); +#else + r.left = xpos; + r.top = ypos; + r.right = xpos + width; + r.bottom = ypos + height; + if (theBitmap = LoadBitmapFile(filename)) { + bSelectDIBPal(maneDC, theBitmap); + StretchDIBits(maneDC, + xpos - currwin.base_x, ypos - currwin.base_y, width, height, + 0, 0, + theBitmap->pbmi->bmiHeader.biWidth, + theBitmap->pbmi->bmiHeader.biHeight, + theBitmap->pMapFile, + theBitmap->pbmi, + DIB_RGB_COLORS, + SRCCOPY); + free(theBitmap->pbmi); + CloseHandleAndClear(&(theBitmap->hMapFile)); + CloseHandleAndClear(&(theBitmap->hFile)); + DeleteObject(theBitmap->hPal); + free(theBitmap); + } +#endif + } +} + +/* Load an enhanced MetaFile. Borrowed from the mfedit sample. */ +HENHMETAFILE LoadEnhMetaFile (const char * filename) +{ + HENHMETAFILE hEmf = 0; + + const DWORD META32_SIGNATURE = 0x464D4520; /* ' EMF' */ + const DWORD ALDUS_ID = 0x9AC6CDD7; + const size_t APMSIZE = 22; + + HANDLE hMapFile; + LPVOID pMapFile; + HANDLE hFile = CreateFile (filename, + GENERIC_READ, + FILE_SHARE_READ, + 0, + OPEN_EXISTING, + FILE_ATTRIBUTE_READONLY, + 0); + if (hFile == INVALID_HANDLE_VALUE) { + return (0); + } + + hMapFile = CreateFileMapping (hFile, 0, PAGE_READONLY, 0, 0, "YAPEMF"); + if (hMapFile == 0) { + goto ErrorExit1; + } + + pMapFile = MapViewOfFile (hMapFile, FILE_MAP_READ, 0, 0, 0); + if (pMapFile == 0) { + goto ErrorExit2; + } + + { + LPENHMETAHEADER pEmh = (LPENHMETAHEADER) pMapFile; + if (pEmh->dSignature == META32_SIGNATURE) { + hEmf = GetEnhMetaFile (filename); + goto HLM_EXIT; + } + + if (*((LPDWORD) pEmh) == ALDUS_ID) { + DWORD uiSize = * ((LPDWORD) ((PBYTE) pMapFile + APMSIZE + 6)); + hEmf = SetWinMetaFileBits (uiSize * 2, (PBYTE) pMapFile + APMSIZE, 0, 0); + if (hEmf == 0) { + } + goto HLM_EXIT; + } + } + + { + UINT uiSize; + HMETAFILE hMf = GetMetaFile (filename); + if (hMf == 0) { + goto ErrorExit3; + } + + uiSize = GetMetaFileBitsEx (hMf, 0, 0); + if (uiSize == 0) { + DeleteMetaFile (hMf); + goto ErrorExit3; + } + + { + void * pvData = malloc (uiSize); + if (pvData == 0) { + goto ErrorExit4; + } + + uiSize = GetMetaFileBitsEx (hMf, uiSize, pvData); + if (uiSize == 0) { + goto ErrorExit5; + } + + hEmf = SetWinMetaFileBits (uiSize, (const PBYTE) pvData, 0, 0); + + ErrorExit5: + free (pvData); + } + + ErrorExit4: + DeleteMetaFile (hMf); + } + + HLM_EXIT: + ErrorExit3: + UnmapViewOfFile (pMapFile); + + ErrorExit2: + CloseHandleAndClear (&hMapFile); + + ErrorExit1: + CloseHandleAndClear (&hFile); + + return (hEmf); +} + +void +DisplayMetaFile(const char *filename, int xpos, int ypos, int width, int height) +{ + HENHMETAFILE hEmf; + RECT r; + + if (xpos < max_x && xpos + (int) width >= min_x && + ypos < max_y && ypos + (int) height >= min_y) { + +#if 0 + MoveToEx(foreGC, xpos, ypos, NULL); + LineTo(foreGC, xpos + width, ypos); + LineTo(foreGC, xpos + width, ypos + height); + LineTo(foreGC, xpos, ypos + height); + LineTo(foreGC, xpos, ypos); +#endif + r.left = xpos - currwin.base_x; + r.top = ypos - currwin.base_y; + r.right = xpos + width - currwin.base_x; + r.bottom = ypos + height - currwin.base_y; + + if (hEmf = LoadEnhMetaFile(filename)) { + ENHMETAHEADER header; + int true_width, true_height; + GetEnhMetaFileHeader (hEmf, sizeof (header), &header); + true_width = ROUNDUP(header.rclBounds.right - header.rclBounds.left, shrink_factor); + true_height = ROUNDUP (header.rclBounds.bottom - header.rclBounds.top, shrink_factor); +#if 0 + fprintf(stderr, "Actual dimensions of the emf file : %d x %d\n", + header.rclBounds.right - header.rclBounds.left, + header.rclBounds.bottom - header.rclBounds.top); +#endif + PlayEnhMetaFile(foreGC, hEmf, &r); + DeleteEnhMetaFile(hEmf); + } + } +} + +/* convert width into dpi units */ +float emunits (float width, char * unit) +{ + struct emunit *p; + + for (p=emtable; p->unit; p++) { + if (strcmp(p->unit,unit)==0) { + return( width * pixels_per_inch / p->factor ); + } + } + return (-1.0); /* invalid unit */ +} + +void emgraph(char *name, int xpos, int ypos, int width, int height) +{ + int len = strlen(name); + +#if 0 + fprintf(stderr, "emspecial: file %s, width = %f, height = %f\n", + emstr, emwidth, emheight); +#endif + + if (strnicmp(name+len-4, ".bmp", 4) == 0) { + DisplayBmpFile(name, xpos, ypos, width, height); + } + else if (strnicmp(name+len-4, ".wmf", 4) == 0 + || strnicmp(name+len-4, ".emf", 4) == 0) { + DisplayMetaFile(name, xpos, ypos, width, height); + } + else { + fprintf(stderr, "emgraph: %s, unknown file type\n", name); + } +} + +void emspecial(char *cp, int xpos, int ypos) +{ + int i, nskip; + char emunit[4]; + + SKIP_SPACE(cp); + if (strnicmp(cp, "graph", 5) == 0) { + cp += 5; + SKIP_SPACE(cp); + + /* FIXME : what about files with a space in their name ??? */ + for (i=0; *cp && !isspace(*cp) && !(*cp==',') ; cp++) + emstr[i++] = *cp; /* copy filename */ + emstr[i] = '\0'; + + /* now get optional width and height */ + emwidth = emheight = -1.0; /* no dimension is <= 0 */ + SKIP_SPACE_AND_COMMA(cp); + + if (*cp) { + sscanf(cp, "%f%2s", &emwidth, emunit); /* read width */ + emwidth = emunits(emwidth,emunit); /* convert to pixels */ + + for (; *cp && (*cp=='.'||isdigit(*cp)||isalpha(*cp)); cp++) + ; /* skip width dimension */ + + SKIP_SPACE_AND_COMMA(cp); + + if (*cp) { + sscanf(cp, "%f%2s", &emheight, emunit); /* read height */ + emheight = emunits(emheight,emunit) /* vactualdpi/actualdpi */; + } + } + if (emstr[0]) { + emgraph(emstr,xpos, ypos, (int)floor(emwidth/shrink_factor), (int)floor(emheight/shrink_factor)); + } + else { + (void)fprintf(stderr, "em:graph: no file given\n") ; + } + } + else { + fprintf(stderr, "emspecial not handled: %s\n", cp); + } +} + diff --git a/Build/source/texk/windvi/winlog.c b/Build/source/texk/windvi/winlog.c new file mode 100644 index 00000000000..f1f9be5c5e4 --- /dev/null +++ b/Build/source/texk/windvi/winlog.c @@ -0,0 +1,294 @@ +#include "wingui.h" +#include "xdvi-config.h" + +/***************************************************************************** + View Log File Box + ****************************************************************************/ +LRESULT CALLBACK DlgViewLog(HWND, UINT, WPARAM, LPARAM); +LRESULT MsgViewLogInit(HWND, UINT, WPARAM, LPARAM); +LRESULT MsgViewLogCommand(HWND, UINT, WPARAM, LPARAM); +LRESULT CmdViewLogOK(HWND, WORD, WORD, HWND); +/* LRESULT CmdViewLogCancel(HWND, WORD, WORD, HWND); */ + +/* ViewLog dialog message table definition. */ +MSD rgmsdViewLog[] = +{ + {WM_COMMAND, MsgViewLogCommand}, + {WM_INITDIALOG, MsgViewLogInit} +}; + +MSDI msdiViewLog = +{ + sizeof(rgmsdViewLog) / sizeof(MSD), + rgmsdViewLog, + edwpNone +}; + +/* ViewLog dialog command table definition. */ +CMD rgcmdViewLog[] = +{ + {IDOK, CmdViewLogOK} + /* {IDCANCEL, CmdViewLogCancel} */ +}; + +CMDI cmdiViewLog = +{ + sizeof(rgcmdViewLog) / sizeof(CMD), + rgcmdViewLog, + edwpNone +}; + +/* Global Variables */ +HANDLE hLogEdit; +HANDLE hLogEvent; +char *szText; +BOOL abortRequest; /* Used to wait the user has acknowledged + the log view. */ +BOOL somethingToRead; +/***************************************************************************** + View Log File Box + ****************************************************************************/ +LRESULT CALLBACK DlgViewLog(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + return DispMessage(&msdiViewLog, hdlg, uMessage, wparam, lparam); +} + +BOOL CreateViewLog(HWND hwndParent) +{ + abortRequest = FALSE; + somethingToRead = FALSE; + hViewLog = CreateDialog(hInst, + "DlgViewLog", + hwndParent, + (DLGPROC) DlgViewLog); + + if (hViewLog == NULL) { + Win32Error("ViewLog/CreateDialog"); + return FALSE; + } + + hLogEdit = GetDlgItem(hViewLog, IDC_LOG_EDIT); + + SendDlgItemMessage(hViewLog, IDC_LOG_EDIT, + EM_LIMITTEXT, (WPARAM)0, 0); + + ShowWindow(hViewLog, SW_HIDE); + bLogShown = False; + return TRUE; +} + +LRESULT MsgViewLogInit(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + return 0; +} + + +LRESULT MsgViewLogCommand(HWND hwnd, UINT uMessage, WPARAM wparam, LPARAM lparam) +{ + return DispCommand(&cmdiViewLog, hwnd, wparam, lparam); +} + +LRESULT CmdViewLogOK(HWND hdlg, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + somethingToRead = FALSE; /* The user has read */ +#if 0 + if (abortRequest) { + DestroyWindow(hViewLog); + hViewLog = NULL; + } + else { +#endif + ShowWindow(hViewLog, SW_HIDE); + bLogShown = False; + if (hWndMain) SetForegroundWindow(hWndMain); +#if 0 + } +#endif + return 0; +} + +#if 0 +LRESULT CmdViewLogCancel(HWND hdlg, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + /* If there is nothing to read, destroy the window immediately */ + if (somethingToRead) { + abortRequest = TRUE; + ShowWindow(hViewLog, SW_SHOW); + bLogShown=TRUE; + } + else { + DestroyWindow(hViewLog); + hViewLog = NULL; + } + + return 0; +} +#endif + +/* + Log Loop function + */ + +DWORD WINAPI LogLoop(LPVOID lpParam) +{ + MSG msg; + int rc; + + if (CreateViewLog(hWndMain) == FALSE) { + return 1; + } + + if (SetEvent(hLogEvent) == 0) { + return 1; + } + + while (TRUE) { + rc = GetMessage(&msg, hViewLog, 0, 0); + switch (rc) { + case -1: + break; + case 0: + goto end1; + default: + TranslateMessage(&msg); + DispatchMessage(&msg); + break; + } + } + end1: + if (hViewLog) DestroyWindow(hViewLog); + hViewLog = NULL; + +#if 0 + MessageBox(NULL, "Exit ViewLog thread", NULL, MB_APPLMODAL | MB_ICONHAND | MB_OK); +#endif + ExitThread(0); + /* unreachable */ + return 0; +} + +/* + Sentinel function. It runs in its own thread and sends messages + to the dialog box. +*/ + +DWORD WINAPI ViewLogSentinel(LPVOID lpParam) +{ + char data[64]; + char line[128]; + int nbRead, count, text_count; + BOOL bResult; + DWORD idLoopThread; + SECURITY_ATTRIBUTES sa = { sizeof(SECURITY_ATTRIBUTES), NULL, TRUE }; + + count = 0; /* count chars in line */ + ZeroMemory(line, sizeof(line)); +#if 0 + if ((szText = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 1)) == NULL) { + MessageBox(NULL, "HeapAlloc failed", "ViewLog", + MB_OK|MB_ICONERROR ); + return 1; + } +#endif + text_count = 1; + + if ((hLogEvent = CreateEvent(&sa, /* security attributes */ + FALSE, /* Automatic reset */ + FALSE, /* Initial state is reset */ + "WinLogEvent")) == NULL) { + Win32Error("ViewLogSentinel/WinLogEvent"); + return 0; + } + + if ((hLogLoopThread = CreateThread(&sa, /* security attributes */ + 0, /* default stack size */ + LogLoop, /* start address of thread */ + 0, /* parameter */ + 0, /* creation flags */ + &idLoopThread /* thread id */ + )) == NULL) { + Win32Error("ViewLogSentinel/LogLoopThread"); + return 0; + } + + if (WaitForSingleObject(hLogEvent, 4000) != WAIT_OBJECT_0) { + Win32Error("Log Window not created !"); + return 0; + } + + CloseHandleAndClear(&hLogEvent); + + do { + nbRead = 0; + bResult = ReadFile(hLogIn, data, 1, &nbRead, NULL /* &gOverLapped */); + if (!bResult || !nbRead) { + /* EOF on hCrtOut */ + goto exit_loop; + } + + if (!bResult) { + /* deal with the error code */ + switch (GetLastError()) { + case ERROR_BROKEN_PIPE: + /* program exiting */ +#if 1 + MessageBox(NULL, "Broken Pipe", NULL, MB_APPLMODAL | MB_ICONHAND | MB_OK); +#endif + goto exit_loop; + default: + Win32Error("ViewLogSentinel/ReadFile"); + } + } + + /* first, accumulate into line[] +s until 80 chars or eol */ + + if (data[0] == '\n') { + line[count++] = '\r'; + line[count++] = '\n'; + } + else + line[count++] = data[0]; + + if (data[0] == '\n' || count >= 80) { + if (hViewLog) { + /* remove any selection */ + SendDlgItemMessage(hViewLog, IDC_LOG_EDIT, EM_SETSEL, + -1, 0); + SendDlgItemMessage(hViewLog, IDC_LOG_EDIT, EM_REPLACESEL, + FALSE, (LPARAM)line); + if (! bLogShown) { + /* FIXME : really needed ? */ + GdiFlush(); + somethingToRead = TRUE; + if (resource.log_flag) { + ShowWindow(hViewLog, SW_SHOW); + /* SetFocus(hViewLog); */ + SetForegroundWindow(hViewLog); + /* There might be some fight to get the focus. */ + SetForegroundWindow(hWndMain); + if (bMagDisp) { + SetForegroundWindow(hWndMagnify); + } + bLogShown = TRUE; + } + } + UpdateWindow(hViewLog); + } + ZeroMemory(line, sizeof(line)); + count = 0; + } + + } while(1); + +exit_loop: + if (PostMessage(hViewLog, WM_QUIT, 0, 0) == 0) + Win32Error("ViewLogSentinel/PostMessage/WM_QUIT"); + if (WaitForSingleObject(hLogLoopThread, INFINITE) == WAIT_FAILED) { + // MessageBox( NULL, "LogLoop thread does not want to shut down...", "", MB_OK|MB_ICONINFORMATION ); + Win32Error("ViewLogSentinel/WaitForSingleObject/hLogLoopThread"); + } + CloseHandleAndClear(&hLogLoopThread); + + return 0; +} diff --git a/Build/source/texk/windvi/winopt.c b/Build/source/texk/windvi/winopt.c new file mode 100644 index 00000000000..28702a27537 --- /dev/null +++ b/Build/source/texk/windvi/winopt.c @@ -0,0 +1,1502 @@ +#include "wingui.h" +#include "xdvi-config.h" +#include "version.h" +#include "c-openmx.h" +#include <kpathsea/proginit.h> +#include <kpathsea/tex-hush.h> +#include <kpathsea/tex-make.h> +#include <kpathsea/line.h> +#ifndef ALTFONT +#define ALTFONT "cmr10" +#endif + +#if defined(PS_GS) && !defined(GS_PATH) +#define GS_PATH "gsdll32.dll" +#endif + +#ifdef WIN32 +#define DEFAULT_PAPER NULL +#else +#ifndef A4 +#define DEFAULT_PAPER "us" +#else +#define DEFAULT_PAPER "a4" +#endif +#endif + +#ifndef BDPI +#define BDPI 600 +#endif + +#ifndef MFMODE +#define MFMODE NULL +#endif +#ifndef SHRINK +#define SHRINK "6" +#endif + +#define option xdviw32_option + +/* + * Data for options processing + */ + +static _Xconst char silent[] = " "; /* flag value for usage() */ + +static _Xconst char subst[] = "x"; /* another flag value */ + +static _Xconst char *subst_val[] = {"-mgs[n] <size>"}; + +static _Xconst char *brdr_color; +static _Xconst char *high_color; +static _Xconst char *curs_color; + +/* BEGIN CHUNK xdvi.c 1 */ +#ifdef SRC_SPECIALS +#define src_tickSize resource._src_tickSize +#define src_specialFormat resource._src_specialFormat +#define src_jumpButton resource._src_jumpButton +#endif +/* END CHUNK xdvi.c 1 */ + +Boolean iconic = False; +Dimension bwidth = 2; + +/* + * Command line flags. + */ + +int argc; +char **argv; +#define SEPARATORS " \t" +#define MAX_ARG 20 + +static _Xconst char *usagestr[] = { + /* shrinkFactor */ "shrink", +#ifndef VMS + /* S */ "density", + /* density */ silent, +#else + /* density */ "density", +#endif +#ifdef GREY + /* gamma */ "g", +#endif +#ifdef GRID + /* grid1 */ "color", + /* grid2 */ "color", + /* grid3 */ "color", +#endif /* GRID */ + /* p */ "pixels", + /* margins */ "dimen", + /* sidemargin */ "dimen", + /* topmargin */ "dimen", + /* offsets */ "dimen", + /* xoffset */ "dimen", + /* yoffset */ "dimen", + /* paper */ "papertype", + /* altfont */ "font", + /* mfmode */ "mode-def", + /* rv */ "^-l", "-rv", +#ifdef BUTTONS + /* shrinkbutton1 */ subst, + /* shrinkbutton2 */ silent, + /* shrinkbutton3 */ silent, + /* shrinkbutton4 */ silent, +#endif + /* mgs */ subst, + /* msg1 */ silent, + /* msg2 */ silent, + /* msg3 */ silent, + /* msg4 */ silent, + /* msg5 */ silent, + /* bw */ "^-safer", "-bw <width>", + /* fg */ "color", + /* foreground */ silent, + /* bg */ "color", + /* background */ silent, + /* hl */ "color", + /* bd */ "^-hl", "-bd <color>", + /* cr */ "color", +#ifndef VMS + /* display */ "^-cr", "-display <host:display>", +#else + /* display */ "^-cr", "-display <host::display>", +#endif + /* geometry */ "^-cr", "-geometry <geometry>", + /* icongeometry */ "geometry", + /* iconic */ "^-icongeometry", "-iconic", +#ifdef BUTTONS + /* font */ "^-icongeometry", "-font <font>", +#endif +#ifdef PS_GS + /* interpreter */ "path", + /* gspalette */ "monochrome|grayscale|color", +#endif + /* debug */ "bitmask", +#ifdef HTEX + /* browser */ "WWWbrowser", + /* URLbase */ "base URL", +#endif +/* BEGIN CHUNK xdvi.c 4 */ +#ifdef SRC_SPECIALS + /* src_SpecialFormat */ "[0,1,2]", + /* src_JumpButtons */ "button", + /* src_TickShape */ "[0,1,2,3]", + /* src_TickSize */ "geometry", + /* src_Cursor */ "shape", + /* src_EditorCommand */ "commandstring", + /* src_verbosity */ "[0,1,2]", + /* _src_tickVisibility */ silent, + /* _src_evalMode */ silent, +#endif +#ifdef WIN32 + /* single */ "single instance", + /* colours */ "number of colours", + /* auto scan */ "auto scan", + /* in memory */ "in memory redraw", + /* transformations */ "use transformations from postscript", + /* two pages mode */ "two pages mode", +#endif +/* [dummy] */ "z" +}; + +#define ADDR(x) (caddr_t) &resource.x + +static struct option { + _Xconst char *name; + _Xconst char *resource; + _Xconst char *mark; + enum {FalseArg, TrueArg, StickyArg, SepArg} + argclass; + enum {BooleanArg, Bool3Arg, StringArg, NumberArg, FloatArg} + argtype; + int classcount; + _Xconst char *usagestr; + caddr_t address; + Boolean save_it; +} options[] = { + {"+", NULL, NULL, StickyArg, StringArg, 1, + NULL, (caddr_t) &curr_page, False}, + {"-s", "shrinkFactor", NULL, SepArg, NumberArg, 1, + "shrink", ADDR(shrinkfactor), True}, +#ifndef VMS + {"-S", NULL, NULL, SepArg, NumberArg, 2, + "density", ADDR(_density), True}, + {"-density", "densityPercent", NULL, SepArg, NumberArg, 1, + silent, ADDR(_density), True}, +#else + {"-density", "densityPercent", NULL, SepArg, NumberArg, 1, + "density", ADDR(_density), True}, +#endif +#ifdef GREY + {"-nogrey", NULL, NULL, FalseArg, BooleanArg, 2, + NULL, ADDR(_use_grey), True}, + {"+nogrey", "grey", NULL, TrueArg, BooleanArg, 1, + NULL, ADDR(_use_grey), True}, + {"-gamma", "gamma", NULL, SepArg, FloatArg, 1, + "g", ADDR(_gamma), True}, + {"-install", NULL, NULL, TrueArg, Bool3Arg, 2, + NULL, ADDR(install), False}, + {"-noinstall", "install", NULL, FalseArg, Bool3Arg, 1, + NULL, ADDR(install), False}, +#endif +#ifdef GRID + {"-grid1", "grid1Color", NULL, SepArg, StringArg, 1, + "color", ADDR(grid1_color), True}, + {"-grid2", "grid2Color", NULL, SepArg, StringArg, 1, + "color", ADDR(grid2_color), True}, + {"-grid3", "grid3Color", NULL, SepArg, StringArg, 1, + "color", ADDR(grid3_color), True}, +#endif /* GRID */ + {"-p", "pixelsPerInch", NULL, SepArg, NumberArg, 1, + "pixels", ADDR(_pixels_per_inch), True}, + {"-margins", "Margin", NULL, SepArg, StringArg, 3, + "dimen", (caddr_t) &margins, True}, + {"-sidemargin", "sideMargin", NULL, SepArg, StringArg, 1, + "dimen", ADDR(sidemargin), True}, + {"-topmargin", "topMargin", NULL, SepArg, StringArg, 1, + "dimen", ADDR(topmargin), True}, + {"-offsets", "Offset", NULL, SepArg, StringArg, 3, + "dimen", (caddr_t) &offsets, True}, + {"-xoffset", "xOffset", NULL, SepArg, StringArg, 1, + "dimen", ADDR(xoffset), True}, + {"-yoffset", "yOffset", NULL, SepArg, StringArg, 1, + "dimen", ADDR(yoffset), True}, + {"-paper", "paper", NULL, SepArg, StringArg, 1, + "papertype", ADDR(paper), True}, + {"-altfont", "altFont", NULL, SepArg, StringArg, 1, + "font", ADDR(_alt_font), True}, + {"-nomakepk", NULL, NULL, FalseArg, BooleanArg, 2, + NULL, ADDR(makepk), True}, + {"+nomakepk", "makePk", NULL, TrueArg, BooleanArg, 1, + NULL, ADDR(makepk), True}, + {"-mfmode", "mfMode", NULL, SepArg, StringArg, 1, + "mode-def", ADDR(mfmode), True}, + {"-l", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(_list_fonts), True}, + {"+l", "listFonts", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(_list_fonts), True}, + {"-rv", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(reverse), True}, + {"+rv", "reverseVideo", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(reverse), True}, + {"-mgs", NULL, NULL, SepArg, StringArg, 2, + subst, ADDR(mg_arg[0]), True}, + {"-mgs1", "magnifierSize1", NULL,SepArg, StringArg, 1, + silent, ADDR(mg_arg[0]), True}, + {"-mgs2", "magnifierSize2", NULL,SepArg, StringArg, 1, + silent, ADDR(mg_arg[1]), True}, + {"-mgs3", "magnifierSize3", NULL,SepArg, StringArg, 1, + silent, ADDR(mg_arg[2]), True}, + {"-mgs4", "magnifierSize4", NULL,SepArg, StringArg, 1, + silent, ADDR(mg_arg[3]), True}, + {"-mgs5", "magnifierSize5", NULL,SepArg, StringArg, 1, + silent, ADDR(mg_arg[4]), True}, + {"-warnspecials", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(_warn_spec), True}, + {"+warnspecials", "warnSpecials", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(_warn_spec), True}, + {"-hush", NULL, NULL, TrueArg, BooleanArg, 6, + NULL, (caddr_t) &hush, True}, + {"+hush", "Hush", NULL, FalseArg, BooleanArg, 5, + NULL, (caddr_t) &hush, True}, + {"-hushchars", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(_hush_chars), True}, + {"+hushchars", "hushLostChars", NULL,FalseArg, BooleanArg, 1, + NULL, ADDR(_hush_chars), True}, + {"-hushchecksums", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(_hush_chk), True}, + {"+hushchecksums","hushChecksums", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(_hush_chk), True}, + {"-safer", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(safer), True}, + {"+safer", "safer", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(safer), True}, + {"-bw", NULL, NULL, SepArg, NumberArg, 2, + "width", (caddr_t) &bwidth}, + {"-borderwidth", "borderWidth", NULL, SepArg, NumberArg, 1, + silent, (caddr_t) &bwidth, True}, + {"-fg", NULL, NULL, SepArg, StringArg, 2, + "color", ADDR(fore_color), True}, + {"-foreground", "foreground", NULL, SepArg, StringArg, 1, + silent, ADDR(fore_color), True}, + {"-bg", NULL, NULL, SepArg, StringArg, 2, + "color", ADDR(back_color), True}, + {"-background", "background", NULL, SepArg, StringArg, 1, + silent, ADDR(back_color), True}, +#ifndef VMS + {"-display", NULL, NULL, SepArg, StringArg, 1, + "host:display", (caddr_t) &display, False}, +#else + {"-display", NULL, NULL, SepArg, StringArg, 1, + "host::display", (caddr_t) &display, False}, +#endif + {"-geometry", "geometry", NULL, SepArg, StringArg, 1, + "geometry", (caddr_t) &geometry, True}, + {"-icongeometry","iconGeometry", NULL,StickyArg, StringArg, 1, + "geometry", ADDR(icon_geometry), False}, + {"-iconic", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, (caddr_t) &iconic, False}, + {"+iconic", "iconic", NULL, FalseArg, BooleanArg, 1, + NULL, (caddr_t) &iconic, False}, + {"-keep", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(keep_flag), True}, + {"+keep", "keepPosition", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(keep_flag), True}, + {"-copy", NULL, NULL, TrueArg, Bool3Arg, 2, + NULL, ADDR(copy), False}, + {"+copy", "copy", NULL, FalseArg, Bool3Arg, 1, + NULL, ADDR(copy), False}, + {"-thorough", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(thorough), False}, + {"+thorough", "thorough", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(thorough), False}, +#if PS + {"-nopostscript", NULL, NULL, FalseArg, BooleanArg, 2, + NULL, ADDR(_postscript), True}, + {"+nopostscript", "postscript", NULL,TrueArg, BooleanArg, 1, + NULL, ADDR(_postscript), True}, + {"-noscan", NULL, NULL, FalseArg, BooleanArg, 2, + NULL, ADDR(prescan), True}, + {"+noscan", "prescan", NULL, TrueArg, BooleanArg, 1, + NULL, ADDR(prescan), True}, + {"-allowshell", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(allow_shell), True}, + {"+allowshell", "allowShell", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(allow_shell), True}, +#ifdef PS_DPS + {"-nodps", NULL, NULL, FalseArg, BooleanArg, 2, + NULL, ADDR(useDPS), True}, + {"+nodps", "dps", NULL, TrueArg, BooleanArg, 1, + NULL, ADDR(useDPS), True}, +#endif +#ifdef PS_NEWS + {"-nonews", NULL, NULL, FalseArg, BooleanArg, 2, + NULL, ADDR(useNeWS), True}, + {"+nonews", "news", NULL, TrueArg, BooleanArg, 1, + NULL, ADDR(useNeWS), True}, +#endif +#ifdef PS_GS + {"-noghostscript",NULL, NULL, FalseArg, BooleanArg, 2, + NULL, ADDR(useGS), True}, + {"+noghostscript","ghostscript", NULL, TrueArg, BooleanArg, 1, + NULL, ADDR(useGS), True}, + {"-nogssafer", NULL, NULL, FalseArg, BooleanArg, 2, + NULL, ADDR(gs_safer), True}, + {"+nogssafer", "gsSafer", NULL, TrueArg, BooleanArg, 1, + NULL, ADDR(gs_safer), True}, + {"-nogsalpha", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(gs_alpha), True}, + {"+nogsalpha", "gsAlpha", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(gs_alpha), True}, + {"-interpreter", "interpreter", NULL, SepArg, StringArg, 1, + "path", ADDR(gs_path), True}, + {"-gspalette", "palette", NULL, SepArg, StringArg, 1, + "monochrome|grayscale|color", ADDR(gs_palette), True}, +#endif +#endif /* PS */ + {"-debug", "debugLevel", NULL, SepArg, StringArg, 1, + "bitmask", ADDR(debug_arg), False}, + {"-version", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(version_flag), False}, + {"+version", "version", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(version_flag), False}, +#ifdef HTEX + {"-underlink", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(_underline_link), True}, + {"+underlink", "underLink", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(_underline_link), True}, + {"-browser", "wwwBrowser", NULL, SepArg, StringArg, 1, + NULL, ADDR(_browser), True}, + {"-base", "urlBase", NULL, SepArg, StringArg, 1, + NULL, ADDR(_URLbase), True}, +#endif +/* BEGIN CHUNK xdvi.c 5 */ +#ifdef SRC_SPECIALS + {"-srcSpecialFormat", "srcSpecialFormat", NULL, SepArg, NumberArg, 1, + "[0,1,2]", (caddr_t)&src_specialFormat, True}, + {"-srcJumpButton", "srcJumpButton", NULL, SepArg, NumberArg, 1, + "button", (caddr_t)&src_jumpButton, True}, + {"-srcTickShape", "srcTickShape", NULL, SepArg, NumberArg, 1, + "[0,1,2,3]", (caddr_t)&src_tickShape, True}, + {"-srcTickSize", "srcTickSize", NULL, SepArg, StringArg, 1, + "geometry", ADDR(_src_tickSize), True}, + {"-srcCursor", "srcCursor", NULL, SepArg, NumberArg, 1, + "shape", (caddr_t)&src_cursor_shape, True}, + {"-srcEditorCommand", "srcEditorCommand", NULL, SepArg, StringArg, 1, + "commandstring", (caddr_t)&src_editorCommand, True}, + {"-srcVerbosity", "srcVerbosity", NULL, SepArg, NumberArg, 1, + "[0,1,2]", (caddr_t)&src_warn_verbosity, True}, + {"-srcVisibility", "srcVisibility", NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(_src_tickVisibility), True}, + {"+srcVisibility", "srcVisibility", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(_src_tickVisibility), True}, + {"-srcMode", "srcMode", NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(_src_evalMode), True}, + {"+srcMode", "srcMode", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(_src_evalMode), True}, +#endif +#ifdef WIN32 + /* Run only one instance */ + {"-single", NULL, NULL, TrueArg, BooleanArg, 3, + NULL, ADDR(single_flag), True}, + {"-1", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(single_flag), True}, + {"+single", "singleInstance", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(single_flag), True}, + /* Depth of the main bitmap */ + {"-depth", "depthText", NULL, SepArg, NumberArg, 1, + "1|2|4|8|16|24", ADDR(numColors), False}, + /* Support of color */ + + /* Auto scan of dvi files */ + {"-autoscan", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(scan_flag), True}, + {"+autoscan", "autoScan", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(scan_flag), True}, + {"-autolog", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(log_flag), True}, + {"+autolog", "autoLog", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(log_flag), True}, + {"-inmemory", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(in_memory), True}, + {"+inmemory", "inMemory", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(in_memory), True}, + {"-xform", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(use_xform), True}, + {"+xform", "useXform", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(use_xform), True}, + {"-book", NULL, NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(book_mode), True}, + {"+book", "bookMode", NULL, FalseArg, BooleanArg, 1, + NULL, ADDR(book_mode), True}, +#endif +}; + + +struct _resource resource = { +#if CFGFILE && TOOLKIT + /* progname */ "windvi", +#endif +#if TOOLKIT + /* shrinkfactor */ 3, +#endif + /* density */ 40, +#ifdef GREY + /* gamma */ 1.0, +#endif + /* pixels_per_inch */ BDPI, + /* _delay_rulers */ True, + /* _tick_length */ 4, + /* _tick_units */ "pt", + /* sidemargin */ NULL, + /* topmargin */ NULL, + /* xoffset */ NULL, + /* yoffset */ NULL, + /* paper */ DEFAULT_PAPER, + /* alt_font */ ALTFONT, + /* makepk */ MAKE_TEX_PK_BY_DEFAULT, + /* mfmode */ MFMODE, + /* _list_fonts */ False, + /* reverse */ False, + /* _warn_spec */ False, + /* _hush_chars */ False, + /* _hush_chk */ False, + /* safer */ False, +#if defined(VMS) || defined(WIN32) || !defined(TOOLKIT) + /* fore_color */ NULL, + /* back_color */ NULL, +#endif + /* _fore_Pixel */ (Pixel) 0, + /* _back_Pixel */ (Pixel) 0, +#ifdef TOOLKIT + /* _brdr_Pixel */ (Pixel) 0, + /* _hl_Pixel */ (Pixel) 0, + /* _cr_Pixel */ (Pixel) 0, +#endif + /* icon_geometry */ NULL, + /* keep_flag */ False, + /* copy */ False, + /* thorough */ False, +#if PS + /* default is to use DPS, then NEWS, then GhostScript; + * we will figure out later on which one we will use */ + /* postscript */ True, + /* prescan */ True, + /* allow_shell */ False, +#ifdef PS_DPS + /* useDPS */ True, +#endif +#ifdef PS_NEWS + /* useNeWS */ True, +#endif +#ifdef PS_GS + /* useGS */ True, + /* gs_safer */ True, + /* gs_alpha */ False, + /* gs_path */ GS_PATH, + /* gs_palette */ "Color", +#endif +#endif /* PS */ + /* debug_arg */ NULL, + /* version_flag */ False, +#ifdef BUTTONS + /* expert */ False, + /* shrinkbutton[4] */ {100, 50, 33, 35}, +#endif + /* mg_arg */ {NULL, NULL, NULL, NULL, NULL}, +#ifdef GREY + /* use_grey */ True, + /* install */ Maybe, +#endif +#ifdef GRID + /* grid_mode */ 0, + /* grid1_color */ NULL, + /* grid2_color */ NULL, + /* grid3_color */ NULL, +#ifdef TOOLKIT + /* _grid1_Pixel */ (Pixel) 0, + /* _grid2_Pixel */ (Pixel) 0, + /* _grid3_Pixel */ (Pixel) 0, +#endif /* TOOLKIT */ +#endif /* GRID */ +#ifdef HTEX + /* _underline_link */ True, + /* _browser */ (char *) NULL, + /* _URLbase */ (char *) NULL, + /* _scroll_pages */ (char *) NULL, +#endif +/* BEGIN CHUNK xdvi.c 6 */ +#ifdef SRC_SPECIALS + /* _src_specialFormat */ 2, + /* _src_jumpButton */ 1, + /* _src_tickShape */ 1, + /* _src_tickSize */ "40x70", + /* _src_cursor_shape */ 90, + /* _src_editorCommand */ "emacsclient --no-wait \"+%u\" \"%s\"", + /* _src_warn_verbosity */ 2, + /* _src_tickVisibility */ False, + /* _src_evalMode */ False, +#endif +#ifdef WIN32 + /* single_flag */ False, + /* num_colors */ 8, + /* scan_flag */ True, + /* log_flag */ False, + /* in_memory */ False, + /* use_xform */ False, + /* book_mode */ False +#endif +}; + +void RestoreOptions(); + +/* + * Process the option table. This is not guaranteed for all possible + * option tables, but at least it works for this one. + */ + +void +parse_options(argc, argv) + int argc; + char **argv; +{ + char **arg; + char **argvend = argv + argc; + const char *optstring; + caddr_t addr; + struct option *opt, *lastopt, *candidate; + int len1, len2, matchlen; + + /* + * Step 0. Restore options from the last run. + */ + for (opt = options; opt < options + XtNumber(options); ++opt) { + opt->mark = opt->resource; + } + + RestoreOptions(); + + /* + * Step 1. Process command line options. + */ + for (arg = argv + 1; arg < argvend; ++arg) { + len1 = strlen(*arg); + candidate = NULL; + matchlen = 0; + for (opt = options; opt < options + XtNumber(options); ++opt) { + len2 = strlen(opt->name); + if (opt->argclass == StickyArg) { + if (matchlen <= len2 && !strncmp(*arg, opt->name, len2)) { + candidate = opt; + matchlen = len2; + } + } + else if (len1 <= len2 && matchlen <= len1 && + !strncmp(*arg, opt->name, len1)) { + if (len1 == len2) { + candidate = opt; + break; + } + if (matchlen < len1) candidate = opt; + else if (candidate && candidate->argclass != StickyArg) + candidate = NULL; + matchlen = len1; + } + } + if (candidate == NULL) { + if (**arg == '-' || dvi_name) usage(); + else { + /* need to make sure that dvi_name can be freed safely */ + dvi_name = xmalloc((unsigned) strlen(*arg)+1); + Strcpy(dvi_name, *arg); + continue; + } + } + /* flag it for subsequent processing */ + candidate->mark = (char *) candidate; + /* store the value */ + addr = candidate->address; + switch (candidate->argclass) { + case FalseArg: *((Boolean *) addr) = False; continue; + case TrueArg: *((Boolean *) addr) = True; continue; + case StickyArg: optstring = *arg + strlen(candidate->name); + break; + case SepArg: + ++arg; + if (arg >= argvend) usage(); + optstring = *arg; + break; + } + switch (candidate->argtype) { + case StringArg: *((char **) addr) = (char *)optstring; break; + case NumberArg: *((int *) addr) = atoi(optstring); break; + case FloatArg: *((float *) addr) = atof(optstring); break; + default: ; + } + } + /* + * Step 2. Propagate classes for command line arguments. Backwards. + */ + for (opt = options + XtNumber(options) - 1; opt >= options; --opt) + if (opt->mark == (char *) opt) { + addr = opt->address; + lastopt = opt + opt->classcount; + for (candidate = opt; candidate < lastopt; ++candidate) { + /* FIXME : resource or mark ? */ + if (candidate->mark != NULL) { + switch (opt->argtype) { + case BooleanArg: + case Bool3Arg: /* same type as Boolean */ + *((Boolean *) candidate->address) = + *((Boolean *) addr); + break; + case StringArg: + *((char **) candidate->address) = + *((char **) addr); + break; + case NumberArg: + *((int *) candidate->address) = *((int *) addr); + break; + case FloatArg: + *((float *) candidate->address) = + *((float *) addr); + break; + } + candidate->mark = NULL; + } + } + } + +#if 0 + if ((DISP = XOpenDisplay(display)) == NULL) + oops("Can't open display"); + SCRN = DefaultScreenOfDisplay(DISP); +#endif + + /* + * Step 3. Handle resources (including classes). + */ + for (opt = options; opt < options + XtNumber(options); ++opt) + if (opt->mark && + ((optstring = XGetDefault(DISP, prog, opt->resource)) || + (optstring = XGetDefault(DISP, "XDvi", opt->resource)))) + { + lastopt = opt + opt->classcount; + for (candidate = opt; candidate < lastopt; ++candidate) + if (candidate->mark != NULL) switch (opt->argtype) { + case Bool3Arg: + if ( memicmp(optstring, "maybe", 6) == 0) + { + * (Bool3 *) candidate->address = Maybe; + break; + } + /* otherwise, fall through; the underlying */ + /* types of Bool3 and Boolean are the same. */ + case BooleanArg: + * (Boolean *) candidate->address = + ( memicmp(optstring, "true", 5) == 0 + || memicmp(optstring, "yes", 4) == 0 + || memicmp(optstring, "on", 3) == 0 + || memicmp(optstring, "1", 2) == 0); + break; + case StringArg: + * (char **) candidate->address = xstrdup((char *)optstring); + break; + case NumberArg: + * (int *) candidate->address = atoi(optstring); + break; + case FloatArg: + * (float *) candidate->address = + atof(optstring); + } + } +} + +/* Analysis of arguments */ +void ParseCmdLine(LPSTR lpCmdLine) +{ + int i; + +#ifdef _TRACE + fprintf(stderr, "Command Line : %s\n", lpCmdLine); +#endif + +#if _DEBUG + fprintf(stderr, "lpCmdLine = %s\n", lpCmdLine); +#endif + sCmdArg = parse_cmdline(lpCmdLine, NULL, &sOutputName, NULL); + + argv = &sCmdArg[0][0]; + for(argc = 0; argv[argc] != NULL; argc++); + +#if 0 + { + int i; + for (i = 0; i < argc; i++) { + fprintf(stderr, "argv[%d] = %s\n", i, argv[i]); + } + } +#endif + /* + * Step 1: Process command-line options and resources. + */ + + /* This has to be a special case, for now. */ + + if (argc == 2 && (strcmp(argv[1], "-version") == 0 || + strcmp(argv[1], "--version") == 0 || + strcmp(argv[1], "+version") == 0 + )) + { +#ifdef WIN32 + Printf("windvi(k) version %s\n", TVERSION); + Printf("Copyright (C) 1990-1998 Paul Vojta.\n\ +Copyright (C) 1997-1999 Fabrice Popineau for the Win32 part.\n\ +There is NO warranty. You may redistribute this software\n\ +under the terms of the GNU General Public License\n\ +and the standard X consortium copyright notice.\n\ +For more information about these matters, see the files\n\ +named COPYING and windvi.c.\n\ +Primary author of Xdvi: Paul Vojta; -k maintainer: janl@math.uio.no.\n\ +Win32 maintainer: Fabrice.Popineau@supelec.fr\n"); +#else + Printf("xdvi(k) version %s\n", TVERSION); + Printf("Copyright (C) 1990-1998 Paul Vojta.\n\ +There is NO warranty. You may redistribute this software\n\ +under the terms of the GNU General Public License\n\ +and the standard X consortium copyright notice.\n\ +For more information about these matters, see the files\n\ +named COPYING and xdvi.c.\n\ +Primary author of Xdvi: Paul Vojta; -k maintainer: janl@math.uio.no.\n"); +#endif + /* Waiting acknowledge from user */ + while (bLogShown == TRUE); + /* and exiting */ + /* PostMessage(hViewLog, WM_QUIT, 0, 0); */ + CleanExit(0); + } + + if (argc == 2 && ((strcmp (argv[1], "-help") == 0) + || (strcmp (argv[1], "+help") == 0) + || (strcmp (argv[1], "--help") == 0) + )) + { + extern KPSEDLL char *kpse_bug_address; +#ifdef WIN32 + Printf("windvi(k) version %s\n", TVERSION); + Printf("Preview a DVI file under the Win32 window system. %s\n", + kpse_bug_address); +#else + Printf("xdvi(k) version %s\n", TVERSION); + Printf("Preview a DVI file under the X window system. %s\n", + kpse_bug_address); +#endif + usage (); /* Unfortunately this exits with status 1. */ + } + +#ifndef WIN32 +#ifndef VMS + prog = strrchr(*argv, '/'); +#else + prog = strrchr(*argv, ']'); +#endif + if (prog != NULL) ++prog; else prog = *argv; + +#ifdef VMS + if (strchr(prog, '.') != NULL) *strchr(prog, '.') = '\0'; +#endif +#endif /* WIN32 */ + + /* We can't initialize this at compile time, because it might be + the result of a function call under POSIX. */ + n_files_left = OPEN_MAX; + + kpse_set_program_name (argv[0] = "windvi", "windvi"); + kpse_set_program_enabled (kpse_any_glyph_format, + MAKE_TEX_PK_BY_DEFAULT, kpse_src_compile); + +#ifdef WIN32 + prog = kpse_program_name; +#endif + +#ifdef SELFAUTO + argv0 = argv[0]; +#endif + + parse_options(argc, argv); + + if (resource.mfmode != NULL) { + char *p; + + p = strrchr(resource.mfmode, ':'); + if (p != NULL) { + unsigned int len; + char *p1; + + ++p; + len = p - resource.mfmode; + p1 = xmalloc(len); + bcopy(resource.mfmode, p1, len - 1); + p1[len - 1] = '\0'; + resource.mfmode = p1; + pixels_per_inch = atoi(p); + } + } + + if (shrink_factor < 0 || density <= 0 || pixels_per_inch <= 0 +#if !defined(SELFILE) && !defined(WIN32) + || dvi_name == NULL +#endif + ) usage(); + + if (shrink_factor > 1) { + bak_shrink = resource.shrinkfactor; + mane.shrinkfactor = resource.shrinkfactor; /* otherwise it's 1 */ + } +#if 0 + /* We do not allow -s 1 at startup. */ + if (resource.shrinkfactor == 1) + resource.shrinkfactor = 2; +#endif + + if (resource.debug_arg != NULL) { + debug = isdigit(*resource.debug_arg) ? atoi(resource.debug_arg) + : DBG_ALL; + if (debug & DBG_OPEN) KPSE_DEBUG_SET (KPSE_DEBUG_FOPEN); + if (debug & DBG_STAT) KPSE_DEBUG_SET (KPSE_DEBUG_STAT); + if (debug & DBG_HASH) KPSE_DEBUG_SET (KPSE_DEBUG_HASH); + if (debug & DBG_PATHS) KPSE_DEBUG_SET (KPSE_DEBUG_PATHS); + if (debug & DBG_EXPAND) KPSE_DEBUG_SET (KPSE_DEBUG_EXPAND); + if (debug & DBG_SEARCH) KPSE_DEBUG_SET (KPSE_DEBUG_SEARCH); + } + + if (resource.sidemargin) home_x = atopix(resource.sidemargin); + if (resource.topmargin) home_y = atopix(resource.topmargin); + offset_x = resource.xoffset ? atopix(resource.xoffset) + : pixels_per_inch; + offset_y = resource.yoffset ? atopix(resource.yoffset) + : pixels_per_inch; + if (!set_paper_type()) + oops("Don't recognize paper type %s", resource.paper); + + for (i = 0; i < 5; ++i) + if (resource.mg_arg[i] != NULL) { + char *s; + + mg_size[i].w = mg_size[i].h = atoi(resource.mg_arg[i]); + s = strchr(resource.mg_arg[i], 'x'); + if (s != NULL) { + mg_size[i].h = atoi(s + 1); + if (mg_size[i].h <= 0) mg_size[i].w = 0; + } + } +#if PS + if (resource.safer) { + resource.allow_shell = False; +#ifdef PS_GS + resource.gs_safer = True; +#endif + } +#endif /* PS */ +#ifdef PS_GS + { + _Xconst char *CGMcgm = "CGMcgm"; + _Xconst char *cgmp; + + cgmp = strchr(CGMcgm, resource.gs_palette[0]); + if (cgmp == NULL) + oops("Invalid value %s for gs palette option", + resource.gs_palette); + if (cgmp >= CGMcgm + 3) { + static char gsp[] = "x"; + + gsp[0] = *(cgmp - 3); + resource.gs_palette = gsp; + } + } +#endif + + +#ifdef GRID + if (resource.grid1_color) + grid1_Pixel = string_to_colorref(resource.grid1_color); + if (resource.grid2_color) + grid2_Pixel = string_to_colorref(resource.grid2_color); + if (resource.grid3_color) + grid3_Pixel = string_to_colorref(resource.grid3_color); +#endif /* GRID */ + +#if 0 + /* There was a -s option */ + + /* We do not allow -s 1 at startup. */ + if (resource.shrinkfactor == 1) + resource.shrinkfactor = 2; + + if (resource.shrinkfactor > 1) + shrink_factor = resource.shrinkfactor; +#endif + + +#ifdef ALTFONT + resource._alt_font = xstrdup(ALTFONT); +#else + resource._alt_font = xstrdup("cmr10"); +#endif + + if (resource.version_flag) + Printf("windvi version %s\n", TVERSION); + + kpse_init_prog (uppercasify (kpse_program_name), + pixels_per_inch, resource.mfmode, alt_font); + + kpse_set_program_enabled (kpse_any_glyph_format, + resource.makepk, kpse_src_compile); + + /* janl 16/11/98: I have changed this. The above line used to + say the settings in resource.makepk was supplied on the + commandline, resulting in it overriding _all other_ + settings, derived from the environment or texmf.cnf, no + matter what the value. The value in resource.makepk could + be the compile-time default... + + Personaly I like the environment/texmf.cnf to override + resources and thus changed the 'level' of this setting to + kpse_src_compile so the environment/texmf.cnf will override + the values derived by Xt. + + Previous comment here: + + ``Let true values as an X resource/command line override false + values in texmf.cnf/envvar.'' */ + + hush_chk = hush_chk || kpse_tex_hush ("checksum"); + hush_chars = hush_chars || kpse_tex_hush ("lostchars"); + warn_spec = warn_spec || kpse_tex_hush ("special"); + kpse_make_tex_discard_errors = hush_chars; + + + /* Can't use {Black,White}PixelOfScreen() any more */ + if (!resource.fore_color) + resource.fore_color = + xstrdup(resource.reverse ? "white" : "black"); + if (!resource.back_color) + resource.back_color = + xstrdup(resource.reverse ? "black" : "white"); + + fore_Pixel = (resource.fore_color + ? string_to_colorref(resource.fore_color) + : (resource.reverse ? WhitePixelOfScreen(SCRN) + : BlackPixelOfScreen(SCRN))); + back_Pixel = (resource.back_color + ? string_to_colorref(resource.back_color) + : (resource.reverse ? BlackPixelOfScreen(SCRN) + : WhitePixelOfScreen(SCRN))); + /* FIXME : create brushes and pens for these ones, use accordingly ! */ + brdr_Pixel = (brdr_color ? string_to_colorref(brdr_color) : fore_Pixel); + hl_Pixel = (high_color ? string_to_colorref(high_color) : fore_Pixel); + cr_Pixel = (curs_color ? string_to_colorref(curs_color) : fore_Pixel); + +#ifdef GRID + if (resource.grid1_color) + grid1_Pixel = string_to_colorref(resource.grid1_color); + if (resource.grid2_color) + grid2_Pixel = string_to_colorref(resource.grid2_color); + if (resource.grid3_color) + grid3_Pixel = string_to_colorref(resource.grid3_color); +#endif /* GRID */ + +#ifdef GREY + if (resource._gamma == 0.0) resource._gamma = 1.0; +#endif + +} + +NORETURN void +usage() { +#if defined(TOOLKIT) && !defined(WIN32) + XrmOptionDescRec *opt; + _Xconst char **usageptr = usagestr; +#else + struct option *opt; +#endif + _Xconst char **sv = subst_val; + _Xconst char *str1; + _Xconst char *str2; + int col = 23; + int n; + +#ifdef Omega + Fputs("Usage: owindvi [+[<page>]]", stderr); +#else + Fputs("Usage: windvi [+[<page>]]", stderr); +#endif + +#if 1 + for (opt = options; opt < options + XtNumber(options); ++opt) { +#if defined(TOOLKIT) && !defined(WIN32) + str1 = opt->option; + if (*str1 != '-') continue; + str2 = NULL; + if (opt->argKind != XrmoptionNoArg) { + str2 = *usageptr++; + if (str2 == silent) continue; + if (str2 == subst) { + str1 = *sv++; + str2 = NULL; + } + } + for (;;) { + n = strlen(str1) + 3; + if (str2 != NULL) n += strlen(str2) + 3; + if (col + n < 80) Putc(' ', stderr); + else { + Fputs("\n\t", stderr); + col = 8 - 1; + } + if (str2 == NULL) + Fprintf(stderr, "[%s]", str1); + else + Fprintf(stderr, "[%s <%s>]", str1, str2); + col += n; + if (**usageptr != '^' + || strcmp(*usageptr + 1, opt->option) != 0) break; + ++usageptr; + str1 = *usageptr++; + str2 = NULL; + } +#else /* not TOOLKIT or WIN32 */ + str1 = opt->name; + str2 = opt->usagestr; + if (*str1 != '-' || str2 == silent) continue; + if (str2 == subst) { + str1 = *sv++; + str2 = NULL; + } + n = strlen(str1) + 3; + if (str2 != NULL) n += strlen(str2) + 3; + if (col + n < 80) Putc(' ', stderr); + else { + Fputs("\n\t", stderr); + col = 8 - 1; + } + if (str2 == NULL) + Fprintf(stderr, "[%s]", str1); + else + Fprintf(stderr, "[%s <%s>]", str1, str2); + col += n; +#endif /* not TOOLKIT */ + } + if (col + 9 < 80) Putc(' ', stderr); + else Fputs("\n\t", stderr); +#endif +#ifdef SELFILE + Fputs("[dvi_file]\n", stderr); +#else + Fputs("dvi_file\n", stderr); +#endif + /* Waiting acknowledge from user */ + while (bLogShown == TRUE); + /* and exiting */ + CleanExit(1); +} +/* + Saving options. In which file ? + Saving can be done either in $(HOME)/windvi.cnf + or in $(sysdir)/windvi.cnf + Reading will be done first in $(TEXMFCNF)/windvi.cnf + next in $(HOME)/windvi.cnf and in $(sysdir)/windvi.cnf if nothing found + in $(HOME). + */ + +/* + Implement INI files. + INI files are list of sections. + Each section consist of a list of pairs (key, val). + */ + +typedef struct ini_section { + char *key; + char *val; + struct ini_section *n; +} ini_section; + +typedef struct ini_file { + char *s_name; + ini_section *s; + struct ini_file *n; +} ini_file; + +/* + Retrieve a ret pointer to an existing ini section, + or add it and return the new pointer. + */ +ini_file *GetIniSection(ini_file *pif, char *name, + ini_file **ret, boolean create) +{ + ini_file *p, *q; + + for(p = pif, q = NULL; p != NULL; q = p, p = p->n) { + if (stricmp(p->s_name, name) == 0) { + *ret = p; + return pif; + } + } + if (create) { + p = (ini_file *)xmalloc(sizeof(ini_file)); + p->s_name = strdup(name); + p->n = NULL; + p->s = NULL; + if (q != NULL) { + /* Some q exists, so hang p to q->n and return p */ + q->n = p; + } + else { + /* Not yet any section was built. */ + pif = p; + } + *ret = p; + return pif; + } + else { + *ret = NULL; + return pif; + } +} + +/* + Set the value of 'key' to 'val' in section 'name' of 'pif'. + */ +ini_file *SetIniValue(ini_file *pif, char *name, char *key, char*val) +{ + ini_file *f; + ini_section *p, *q; + + /* With create flag, f can't be null */ + pif = GetIniSection(pif, name, &f, True); + + for (q = NULL, p = f->s; p != NULL; q = p, p = p->n) { + if (stricmp(p->key, key) == 0) { + /* set current value and return */ + if (p->val) free(p->val); + p->val = strdup(val); + return pif; + } + } + p = (ini_section *)xmalloc(sizeof(ini_section)); + p->key = strdup(key); + p->val = strdup(val); + p->n = NULL; + if (q != NULL) + q->n = p; + else + f->s = p; + return pif; +} + +/* + Retrieve the value of 'key' in section 'name' of 'pif'. + */ +char *GetIniValue(ini_file *pif, char *name, char *key) +{ + ini_file *f; + ini_section *p; + + /* will not modify pif */ + pif = GetIniSection(pif, name, &f, False); + + if (!f) + return NULL; + + for (p = f->s; p != NULL; p = p->n) { + if (stricmp(p->key, key) == 0) { + return p->val; + } + } + return NULL; +} + +/* + The windvi.cnf INI file. Needs a phantom node. + */ + +ini_file *windvi_cnf; + +/* + Write an ini_file to file given. + */ +Boolean WriteOptions(FILE *f, ini_file *ini) +{ + /* First, save the implicit options structure. + */ + + struct option *opt; + caddr_t addr; + ini_file *p; + ini_section *q; + int i; + extern iLastUsedFilesNum; + extern char **lpLastUsedFiles; + + fprintf(f, "[Display]\n"); + for (opt = options; opt < options + XtNumber(options); ++opt) { + if (opt->save_it && opt->resource) { + fprintf(f, "%s=", opt->resource); + addr = opt->address; + switch (opt->argtype) { + case BooleanArg: + switch (*((Boolean *)addr)) { + case False: + fprintf(f, "false\n"); + break; + case True: + fprintf(f, "true\n"); + break; + } + break; + case Bool3Arg: + switch (*((Bool3 *)addr)) { + case False: + fprintf(f, "false\n"); + break; + case Maybe: + fprintf(f, "maybe\n"); + break; + case True: + fprintf(f, "true\n"); + break; + } + break; + case StringArg: + fprintf(f, "%s\n", (*((char **)addr) ? *((char **)addr) : "")); + break; + case NumberArg: + fprintf(f, "%d\n", *((int *)addr)); + break; + case FloatArg: + fprintf(f, "%f\n", *((float *)addr)); + break; + } + } + } + /* Last used files */ + fprintf(f, "[Last Used Files]\n"); + fprintf(f, "numFiles=%d\n", iLastUsedFilesNum); + for (i = 0; i < iLastUsedFilesNum; i++) { + fprintf(f, "lastFile%d=%s\n", i, lpLastUsedFiles[i]); +#if 0 + fprintf(stderr, "SaveOptions : plLastUsedFiles[%d] = %s\n", i, + lpLastUsedFiles[i]); +#endif + } + /* Save the rest of the ini_file */ + for(p = ini; p != NULL; p = p->n) { + /* Do not write the Display section again. */ + if (stricmp(p->s_name, "Display") && stricmp(p->s_name, "Last Used Files")) { + fprintf(f, "[%s]\n", p->s_name); + for(q = p->s; q != NULL; q = q->n) { + fprintf(f, "%s=%s\n", q->key, q->val); + } + } + } + + return True; +} + +void SaveOptions() +{ + FILE *outf = NULL; + char *homedir = NULL; + char *save_name = NULL; + + /* FIXME : change this for: + - save in %HOME% if defined + - else try TEXMFLOCAL/texmf/windvi.cnf (if writable) + - else try TEXMFMAIN/texmf/windvi.cnf (if writable) + - else do not save options and warn user + */ + if (homedir = getenv("HOME")) { + if (IS_DIR_SEP(homedir[strlen(homedir) - 1])) { + save_name = concat(homedir, "windvi.cnf"); + } + else { + save_name = concat(homedir, "/windvi.cnf"); + } + + if ((outf = fopen(save_name, "w")) == NULL) { + char buf[_MAX_PATH]; + sprintf(buf, "%s not writable !", save_name); + MessageBox(hWndMain, buf, NULL, + MB_APPLMODAL | MB_ICONERROR | MB_OK); + return; + } + } + else { + save_name = concat (kpse_path_expand("$TEXMFLOCAL/web2c"), "/windvi.cnf"); + if (save_name == NULL || (outf = fopen(save_name, "w")) == NULL) { + free(save_name); + save_name = kpse_find_file("windvi.cnf", kpse_cnf_format, True); + if (save_name == NULL || (outf = fopen(save_name, "w")) == NULL) { + MessageBox(hWndMain, "No place in $TEXMFCNF to save options.", NULL, + MB_APPLMODAL | MB_ICONERROR | MB_OK); + return; + } + } + } + if (save_name) + free(save_name); + if (outf) { + WriteOptions(outf, windvi_cnf); + } + else { + MessageBox(hWndMain, "No place to save options.", NULL, + MB_APPLMODAL | MB_ICONERROR | MB_OK); + return; + } + fclose(outf); +} + +ini_file *ReadOptions(FILE *f, ini_file *ini) +{ + char *line; + char *p; + ini_file *pif; + + pif = NULL; + + while ((line = read_line(f)) != NULL) { +#if 0 + fprintf(stderr, "ReadOptions : %s\n", line); +#endif + /* Wait for a section */ + if ((*line == '[') && (p = strchr(line, ']'))) { + *p = '\0'; +#if 0 + fprintf(stderr, "ReadOptions : new section %s\n", line+1); +#endif + ini = GetIniSection(ini, line + 1, &pif, True); + } + else { + /* there is a current pif, scan the line for = */ + if (!(p = strchr(line, '='))) { + /* invalid line, discard it */ + } + else { + *p = '\0'; + ini = SetIniValue(ini, pif->s_name, line, p+1); + } + } + free(line); + } + return ini; +} + +void RestoreOptions() +{ + FILE *inf; + char *save_name, *homedir; + + /* First, look for a site config file. */ + save_name = kpse_find_file("windvi.cnf", kpse_cnf_format, True); + if (save_name && *save_name) { + if ((inf = fopen(save_name, "r")) != NULL) { + windvi_cnf = ReadOptions(inf, windvi_cnf); + fclose(inf); + } + else { + MessageBox(hWndMain, "Fail reading site configuration file.", NULL, + MB_APPLMODAL | MB_ICONERROR | MB_OK); + } + free(save_name); + } + /* Second, overwrite options values by a private + config file. */ + if ((homedir = getenv("HOME")) || (homedir = "c:/")) { + if (IS_DIR_SEP(homedir + strlen(homedir) - 1)) { + save_name = concat(homedir, "windvi.cnf"); + } + else { + save_name = concat(homedir, "/windvi.cnf"); + } + if ((inf = fopen(save_name, "r")) != NULL) { + windvi_cnf = ReadOptions(inf, windvi_cnf); + fclose(inf); + } + free(save_name); + } + /* In case no .cnf file, create dummy entries */ + if (windvi_cnf == NULL) { + ini_file *pif; + windvi_cnf = GetIniSection(windvi_cnf, "Display", &pif, True); + windvi_cnf = GetIniSection(windvi_cnf, "Last Used Files", &pif, True); + windvi_cnf = SetIniValue(windvi_cnf, pif->s_name, "numFiles", "0"); + } + + /* Report the last used files in the queue */ + { + int i; + extern iLastUsedFilesNum; + extern char **lpLastUsedFiles; + char *num_files = GetIniValue(windvi_cnf, "Last Used Files", "numFiles"); + if (num_files) { + char buf[sizeof("lastFile")+5]; + iLastUsedFilesNum = atoi(num_files); + lpLastUsedFiles = (char **)xmalloc(iLastUsedFilesNum*sizeof(char*)); + for (i = 0; i < iLastUsedFilesNum; i++) { + char *p; + sprintf(buf, "lastFile%d", i); + if (p = GetIniValue(windvi_cnf, "Last Used Files", buf)) { + lpLastUsedFiles[i] = xstrdup(p); + } + else + lpLastUsedFiles[i] = xstrdup(""); +#if 0 + fprintf(stderr, "RestoreOptions : plLastUsedFiles[%d] = %s\n", i, lpLastUsedFiles[i]); +#endif + } + } + else { + /* Allocate 4 Used Files by default */ + iLastUsedFilesNum = 4; + lpLastUsedFiles = (char **)xmalloc(iLastUsedFilesNum*sizeof(char*)); + for (i = 0; i < iLastUsedFilesNum; i++) + lpLastUsedFiles[i] = xstrdup(""); + } + } +} + +void free_ini_section(ini_section *s) +{ + if (s) { + if (s->key) free(s->key); + if (s->val) free(s->val); + free_ini_section(s->n); + free(s); + } +} + +void free_ini_file(ini_file *f) +{ + if (f) { + if (f->s_name) free(f->s_name); + free_ini_section(f->s); + free_ini_file(f->n); + free(f); + } +} + +void FreeOptions() +{ + free_ini_file(windvi_cnf); +} + +const char *XGetDefault(void *v, char *prog, char *key) +{ + char *ret; + ret = GetIniValue(windvi_cnf, "Display", key); + /* We do not allow "" */ + if (ret && !*ret) return NULL; + return ret; +} diff --git a/Build/source/texk/windvi/winprint.c b/Build/source/texk/windvi/winprint.c new file mode 100644 index 00000000000..88426999de1 --- /dev/null +++ b/Build/source/texk/windvi/winprint.c @@ -0,0 +1,1779 @@ +/* + winprint.c : implementation file + Time-stamp: "01/01/12 10:50:56 popineau" + + Copyright (C) 1999 + Fabrice Popineau <Fabrice.Popineau@supelec.fr> + + This file is part of Windvi. + + Windvi 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. + + Windvi 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 Windvi; if not, write to the Free Software Foundation, 59 + Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* + Supports 'print setup' and 'print' functions. + + Not so easy to implement color printing. + Some remarks : + - it seems no possible to use rasterops + to do tramsparent blt + - a part from doing banding which might be + very expensive + - maybe we could build a list of affected rectangles + (rules and specials) + - and redraw the needed parts using the appropriate mode + + */ + +#include "wingui.h" +#include "xdvi-config.h" +#include <commdlg.h> +#include "gsdll.h" + +#define DEBUG_PRINT 0 + +HWND hDlgPrint = 0, hWndParent = 0; +CHAR *msgFormat = "file %s (page %d in [%d - %d])"; +CHAR msgBuffer[256]; +BOOL isPrinting = FALSE, isPrintingDvips = FALSE; +int iFirstPage, iLastPage; +HDC hMemBandDC; +HBITMAP oldprintDIB, printDIB; +void *lpMemBandData; +struct BITMAPINFO_256 bmiMemBand; +BOOL bPrintError = FALSE; +BOOL bUserAbort = FALSE; + +/* + + Variables to save display configuration + + */ + +HDC save_maneDC; +int save_page, save_shrink; +struct WindowRec save_mane; +Pixel save_fore, save_back; +Boolean save_grey; +POINT saveScroll; +BOOL savedPS; +int save_maneRC; +int saveBitsPixel; +int save_u_paper_w, save_u_paper_h; +int save_offset_x, save_offset_y; + +/* + Printercapabilities + */ + +unsigned int iPrintBitsPixel, iPrintSizePal, iPrintColorRes, iPrintRasterCaps; +unsigned int iPrintOffsetX, iPrintOffsetY; +unsigned int nBandHeight, current_band, nBandNumbers; +unsigned int nBandMBSize = 2; + +/* + extern definitions + */ +extern void redraw(struct WindowRec *); +extern BOOL IsOpenedDviFile(); +extern void ReopenDviFile(); +extern void prescan(); + +BOOL CALLBACK AbortProc(HDC hdc, int nCode) +{ + MSG msg; + + /* Retrieve and remove messages from the thread's message queue. */ + while (!bUserAbort && PeekMessage(&msg, (HWND) NULL, 0, 0, PM_REMOVE)) { + /* Process any messages for the Cancel dialog box. */ + if (!hDlgPrint || !IsDialogMessage(hDlgPrint, &msg)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + + /* Return the global isPrinting flag (which is set to FALSE if the + user presses the Cancel button). */ + return !bUserAbort; + + UNREFERENCED_PARAMETER(hdc); + UNREFERENCED_PARAMETER(nCode); +} + +LRESULT CALLBACK PrintDlgProc(HWND hwndDlg, UINT message, + WPARAM wParam, LPARAM lParam) +{ + switch (message) { + + case WM_INITDIALOG: /* message: initialize dialog box */ + /* Initialize the static text control. */ + SetDlgItemText(hwndDlg, IDD_FILE, xbasename(dvi_name)); + + /* Initialize the progress bars. */ + SendDlgItemMessage(hwndDlg, IDC_PRINT_PROGRESS_PAGE, + PBM_SETRANGE, (WPARAM) 0, MAKELPARAM(1, total_pages)); + SendDlgItemMessage(hwndDlg, IDC_PRINT_PROGRESS_PAGE, + PBM_SETPOS, (WPARAM) 1, (LPARAM) 0); + SendDlgItemMessage(hwndDlg, IDC_PRINT_PROGRESS_PAGE, + PBM_SETBARCOLOR, + (WPARAM) 0, (LPARAM) (COLORREF) MYRGB(0, 255, 40)); + + SendDlgItemMessage(hwndDlg, IDC_PRINT_PROGRESS_BAND, + PBM_SETRANGE, (WPARAM) 0, MAKELPARAM(1, 100)); + SendDlgItemMessage(hwndDlg, IDC_PRINT_PROGRESS_BAND, + PBM_SETPOS, (WPARAM) 1, (LPARAM) 0); + SendDlgItemMessage(hwndDlg, IDC_PRINT_PROGRESS_PAGE, + PBM_SETBARCOLOR, + (WPARAM) 0, (LPARAM) (COLORREF) MYRGB(0, 40, 255)); + + SetFocus(GetDlgItem(hwndDlg, IDD_CANCEL)); + return 0; /* Because it is setting focus */ + + case WM_COMMAND: /* message: received a command */ + /* User pressed "Cancel" button--stop print job. */ + bUserAbort = TRUE; + EnableWindow(hWndParent, TRUE); + DestroyWindow(hwndDlg); + hDlgPrint = 0; + return 1; + } + + return 0; + UNREFERENCED_PARAMETER(lParam); + UNREFERENCED_PARAMETER(wParam); + UNREFERENCED_PARAMETER(message); +} + +/**************************************************************************** + * * + * FUNCTION : InitPrinting(HDC hDC, HWND hWnd, HANDLE hInst, LPSTR msg) * + * * + * PURPOSE : Makes preliminary driver calls to set up print job. * + * * + * RETURNS : TRUE - if successful. * + * FALSE - otherwise. * + * * + ****************************************************************************/ +BOOL InitPrinting(HDC hDC, HWND hWnd, HANDLE hInst, LPSTR msg) +{ + DOCINFO DocInfo; + + bPrintError = FALSE; /* no errors yet */ + bUserAbort = FALSE; /* user hasn't aborted */ + + hWndParent = hWnd; /* save for Enable at Term time */ + + hDlgPrint = CreateDialog (hInst, "ABORTPRINTDLG", hWndParent, + (DLGPROC)PrintDlgProc); + + if (!hDlgPrint) + return FALSE; + + EnableWindow (hWndParent, FALSE); /* disable parent */ + + /* + Use new printing APIs...Petrus Wong 12-May-1993 + */ + if (SetAbortProc(hDC, (ABORTPROC)AbortProc) <= 0) { + bPrintError = TRUE; + return FALSE; + } + + ZeroMemory(&DocInfo, sizeof(DocInfo)); + DocInfo.cbSize = sizeof(DOCINFO); + DocInfo.lpszDocName = (LPTSTR) msg; + DocInfo.lpszOutput = NULL; + + if (StartDoc(hDC, &DocInfo) <= 0) { + bPrintError = TRUE; + return FALSE; + } + bPrintError = FALSE; + + /* might want to call the abort proc here to allow the user to + * abort just before printing begins */ + return TRUE; +} + +/**************************************************************************** + * * + * FUNCTION : TermPrinting(HDC hDC) * + * * + * PURPOSE : Terminates print job. * + * * + ****************************************************************************/ +VOID TermPrinting(HDC hDC) +{ + /* + Use new printing APIs...Petrus Wong 12-May-1993 + */ + if (!bPrintError) + EndDoc(hDC); + + if (bUserAbort) + AbortDoc(hDC); + else { + EnableWindow(hWndParent, TRUE); + DestroyWindow(hDlgPrint); + hDlgPrint = 0; + } + +} + +LRESULT CmdFilePrSetup (HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + PAGESETUPDLG pgsdlg; + return 0; +} + +/*********************************************************************** + * + * GetPrinterDC() + * + * Uses PrinDlg common dialog for printer selection and creates a dc. + * Returns NULL on error. + * + ***********************************************************************/ + +HDC GetPrinterDC(HWND hWnd) +{ + PRINTDLG pd; + char gszDevice[256]; + char gszOutput[256]; + + ZeroMemory(&pd, sizeof(pd)); + + pd.lStructSize = sizeof(PRINTDLG); + pd.hwndOwner = hWnd; + pd.Flags = PD_ALLPAGES | PD_RETURNDC /* | PD_PRINTSETUP */; + pd.nFromPage = 1; + pd.nToPage = total_pages; + pd.nMinPage = 1; + pd.nMaxPage = total_pages; + pd.nCopies = 1; + + iFirstPage = 0; + iLastPage = total_pages - 1; + + if (PrintDlg(&pd) == TRUE) { + DEVNAMES *pDevNames; + DEVMODE *pDevMode; + + pDevNames = GlobalLock(pd.hDevNames); + pDevMode = GlobalLock(pd.hDevMode); + + lstrcpy((LPSTR)gszDevice, + (LPSTR)((char *)pDevNames+pDevNames->wDeviceOffset)); + + if(!lstrcmpi((LPSTR)((char *)pDevNames+pDevNames->wDeviceOffset), + (LPSTR)((char *)pDevNames+pDevNames->wOutputOffset))) + lstrcpy((LPSTR)gszOutput, "net:"); + else + lstrcpy((LPSTR)gszOutput, + (LPSTR)((char *)pDevNames+pDevNames->wOutputOffset)); + + +#if DEBUG_PRINT + if (pDevMode = pd.hDevMode) { + fprintf(stderr, "devmode: name = %s, colors = %s\n", + pDevMode->dmDeviceName, + pDevMode->dmColor == DMCOLOR_COLOR ? "color" : "mono"); + } + fprintf(stderr, "gszDevice = %s\ngszOutput = %s\n", + gszDevice, gszOutput); +#endif + + iFirstPage = pd.nFromPage - 1; + iLastPage = pd.nToPage - 1; + + GlobalUnlock(pd.hDevNames); + GlobalUnlock(pd.hDevMode); + + return pd.hDC; + } + else { + CommDlgExtendedError(); + iFirstPage = iLastPage = 0; + return NULL; + } +} + +BOOL SetupPageForPrinting(HDC hDC) { + + int cxPage, cyPage, cxInch, cyInch; + + /* Should we bother about the number of colors the printer + will support ? + Answer : YES !!! + */ + + iPrintRasterCaps = GetDeviceCaps(hDC, RASTERCAPS); + + /* Examine the raster capabilities of the device identified by hDC + to verify that it supports the BitBlt function. */ + + if (!(iPrintRasterCaps & RC_STRETCHDIB)) { + DeleteDC(hDC); + MessageBox(hWndParent, + "Printer cannot display bitmaps.", + "Device Error", + MB_OK); + return FALSE; + } + + if (!(iPrintRasterCaps & RC_BITMAP64)) { + DeleteDC(hDC); + MessageBox(hWndParent, + "Printer cannot cope with bitmaps > 64k.", + "Device Error", + MB_OK); + return FALSE; + } + + /* FIXME: there is a problem if Bits per Pixel is 1 ! + Check with the dib palette. + */ + iPrintBitsPixel = GetDeviceCaps(hDC, BITSPIXEL); + iPrintSizePal = GetDeviceCaps(hDC, SIZEPALETTE); + iPrintColorRes = GetDeviceCaps(hDC, COLORRES); + iPrintOffsetX = GetDeviceCaps(hDC, PHYSICALOFFSETX); + iPrintOffsetY = GetDeviceCaps(hDC, PHYSICALOFFSETY); + /* There is a mess there with device not reporting colors ! */ + iPrintBitsPixel = 24; + + cxPage = GetDeviceCaps(hDC, HORZRES); /* Width of printr page - pixels */ + cyPage = GetDeviceCaps(hDC, VERTRES); /* Height of printr page - pixels */ + cxInch = GetDeviceCaps(hDC, LOGPIXELSX);/* Printer pixels per inch - X */ + cyInch = GetDeviceCaps(hDC, LOGPIXELSY);/* Printer pixels per inch - Y */ + + SetStretchBltMode(hDC, COLORONCOLOR); + + save_mane = mane; + save_shrink = shrink_factor; + save_fore = fore_Pixel; + save_back = back_Pixel; + save_grey = use_grey; + saveScroll.x = xCurrentScroll; + saveScroll.y = yCurrentScroll; + save_page = current_page; + save_maneDC = maneDC; + savedPS = resource._postscript; + save_maneRC = maneRasterCaps; + saveBitsPixel = maneBitsPixel; + save_u_paper_w = unshrunk_paper_w; + save_u_paper_h = unshrunk_paper_h; + save_offset_x = offset_x; + save_offset_y = offset_y; + offset_x -= iPrintOffsetX; + offset_y -= iPrintOffsetY; + xCurrentScroll = yCurrentScroll = 0; + shrink_factor = 1; + use_grey = False; + maneRasterCaps = iPrintRasterCaps; + maneBitsPixel = iPrintBitsPixel; + + unshrunk_paper_w = cxPage; + unshrunk_paper_h = cyPage; + unshrunk_page_w = unshrunk_dvifile_page_w; + unshrunk_page_h = unshrunk_dvifile_page_h; + if (unshrunk_page_h < unshrunk_paper_h) + unshrunk_page_h = unshrunk_paper_h; + if (unshrunk_page_w < unshrunk_paper_w) + unshrunk_page_w = unshrunk_paper_w; + + mane.shrinkfactor = 1; + mane.base_x = 0; + mane.base_y = 0; + mane.min_x = 0; + mane.min_y = 0; + mane.max_x = unshrunk_paper_w; + mane.max_y = unshrunk_paper_h; + mane.width = mane.max_x - mane.min_x; + mane.height = mane.max_y - mane.min_y; + + init_page(); + +#if DEBUG_PRINT + fprintf(stderr, "printer page (%d x %d), cx = %d, cy = %d\n", + cxPage, cyPage, cxInch, cyInch); + fprintf(stderr, "bits/pixel = %d, colorres = %d, size pal = %d\n", + iPrintBitsPixel, iPrintColorRes, iPrintSizePal); + fprintf(stderr, "dvi paper (%d x %d)\n", unshrunk_paper_w, unshrunk_paper_h); + fprintf(stderr, "dvi unshrunk page (%d x %d)\n", + unshrunk_page_w, unshrunk_page_h); + fprintf(stderr, "dvi shrunk page (%d x %d)\n", page_w, page_h); + fprintf(stderr, "offset printer (%d , %d)\n", iPrintOffsetX, iPrintOffsetY); +#endif + +#if 0 + /* FIXME: change mode and dpi */ + resource._pixels_per_inch = cxInch; + resource.mfmode = ?; +#endif + + if (!IsOpenedDviFile()) + ReopenDviFile(); + + scanned_page_bak = scanned_page = -1; + + initcolor(); + reset_fonts(); +#ifdef XFORM + reset_xform_stack(); +#endif + + return TRUE; +} + +BOOL RestorePageForDisplay() +{ + fprintf(stderr, "Restoring for display...\n"); + + mane = save_mane; + shrink_factor = save_shrink; + current_page = save_page; + use_grey = save_grey; + xCurrentScroll = saveScroll.x; + yCurrentScroll = saveScroll.y; + fore_Pixel = save_fore; + back_Pixel = save_back; + + offset_x = save_offset_x; + offset_y = save_offset_y; + + unshrunk_paper_w = save_u_paper_w; + unshrunk_paper_h = save_u_paper_h; + unshrunk_page_w = unshrunk_dvifile_page_w; + unshrunk_page_h = unshrunk_dvifile_page_h; + if (unshrunk_page_h < unshrunk_paper_h) + unshrunk_page_h = unshrunk_paper_h; + if (unshrunk_page_w < unshrunk_paper_w) + unshrunk_page_w = unshrunk_paper_w; + init_page(); + + /* + User might abort before config has been changed + */ + maneBitsPixel = saveBitsPixel; + maneRasterCaps = save_maneRC; + + foreGC = ruleGC = highGC = maneDC = save_maneDC; + + scanned_page = scanned_page_reset = -1; +#ifdef XFORM + reset_xform_stack(); +#endif + + initcolor(); + reset_fonts(); + + resource._postscript = savedPS; + + + return TRUE; +} + +void PrepareForBanding(HDC hDC) +{ + + RGBQUAD QuadWhite = { 255, 255, 255, 0}; + RGBQUAD QuadBlack = { 0, 0, 0, 0}; + + /* Create a memory DC that is compatible with the printer DC */ + hMemBandDC = CreateCompatibleDC(hDC); + + SetStretchBltMode(hMemBandDC, COLORONCOLOR); + +#ifdef TRANSFORM + if (IS_WIN98 || IS_NT) + SetGraphicsMode(hMemBandDC, GM_ADVANCED); +#endif + + /* + Do banding. We can't afford more than say 6Mb at a time. + Calculate the number of rows at the current dpi. + Print as many bands as needed. + */ + + nBandNumbers = ROUNDUP(unshrunk_paper_w * unshrunk_paper_h * iPrintBitsPixel, + nBandMBSize * 1024 * 1024 * 8) + 1; + nBandHeight = ROUNDUP(unshrunk_paper_h, nBandNumbers); + + SendDlgItemMessage(hDlgPrint, IDC_PRINT_PROGRESS_BAND, + PBM_SETRANGE, + (WPARAM) 0, (LPARAM) MAKELPARAM(1, nBandNumbers)); + SendDlgItemMessage(hDlgPrint, IDC_PRINT_PROGRESS_BAND, + PBM_SETPOS, + (WPARAM) 1, (LPARAM) 0); + + mane.base_y = 0; + mane.max_y = nBandHeight; + mane.height = mane.max_y - mane.min_y; + +#if DEBUG_PRINT + fprintf(stderr, "Band numbers = %d, Band height = %d, page_h = %d\n", + nBandNumbers, nBandHeight, unshrunk_paper_h); +#endif + + /* Create a DIB for printing into it. We might need maneDIB to do redraw + while printing */ + printDIB = CreateDIB(hMemBandDC, unshrunk_paper_w + 1, nBandHeight + 1, + iPrintBitsPixel, + &bmiMemBand, &lpMemBandData); + + /* FIXME : there is a problem with monochrome printing. */ + if (iPrintBitsPixel == 1) { + bmiMemBand.bmiColors[1] = QuadWhite; + bmiMemBand.bmiColors[0] = QuadBlack; + } + + /* Put the DIB into the memory DC */ + oldprintDIB = SelectObject(hMemBandDC, printDIB); + + if (resource._postscript) { + ps_destroy(); + initGS(); + } + +} + +static BOOL bBandInit = FALSE; + +void FreeBandingRc() +{ + SelectObject(hMemBandDC, oldprintDIB); + DeleteObject(printDIB); + + DeleteObject(hMemBandDC); + + if (resource._postscript) { + ps_destroy(); + initGS(); + } + bBandInit = FALSE; +} + +void DrawPage(HDC hPrinterDC, int page) +{ + if (!IsOpenedDviFile()) + ReopenDviFile(); + + current_page = page; + + bColorPage = psToDisplay = FALSE; + +#if 1 + /* FIXME: really needed ? */ + init_colors(); +#endif + +#ifdef TRANSFORM + /* FIXME : there should be a global stack in case + such transformations would span over several pages. */ + if (resource.use_xform) + reset_xfrm_stack(); +#endif + + if (!bBandInit) { + bBandInit = TRUE; + PrepareForBanding(hPrinterDC); + } + + if (scanned_page < current_page) + prescan(); + +#if DEBUG_PRINT + fprintf(stderr, "page %d, bColorPage = %d psToDisplay = %d\n", + page, bColorPage, psToDisplay); +#endif + + if (bColorPage || psToDisplay) { + + /* Specials, do banding */ + maneDC = foreGC = ruleGC = highGC = hMemBandDC; + + for (current_band = 0; current_band < nBandNumbers; current_band++) { +#if DEBUG_PRINT + fprintf(stderr, "Printing page %d band %d\n", + page, current_band); +#endif + mane.base_y = current_band*nBandHeight; + mane.max_y = min(nBandHeight, unshrunk_paper_h - current_band * nBandHeight) + 1; + mane.height = mane.max_y - mane.min_y; + + if (resource._postscript && psToDisplay && gs_device) { + extern void + init_ps_page(int llx, int lly, int urx, int ury, int height); + extern void gs_io(char *); + gs_io("H initgraphics\n"); + init_ps_page(0,0, + mane.max_x - mane.min_x, + mane.max_y - mane.min_y, + mane.base_y + mane.max_y); + gs_io("\nstop\n%%xdvimark\n"); + } + + /* FIXME : paint background color */ + if (get_back_color(current_page) != MYRGB(255,255,255)) + fprintf(stderr, "this page is white, but should be %-8x\n", + get_back_color(current_page)); + + /* FIXME: check about the + 1 on each dimension ! */ + if (PatBlt(foreGC, 0, 0, unshrunk_paper_w + 1, nBandHeight + 1, + WHITENESS) == 0) + Win32Error("Redraw Page background"); + + /* First pass for specials */ + allowDrawingChars = FALSE; + redraw(&mane); + +#if DEBUG_PRINT + fprintf(stderr, "PS state: resource._postscript = %d, psToDisplay = %d, gs_device = %d\n", + resource._postscript, psToDisplay, gs_device); +#endif + + if (resource._postscript && psToDisplay && gs_device) { + /* if gs is active, try to make it paint its picture */ + BITMAPINFO_256 bmih; + LPBYTE ppbyte; + (*pgsdll_lock_device)(gs_device, 1); + /* Get a pointer to the bitmap in gs interpreter */ + (*pgsdll_get_bitmap_row)(gs_device, &(bmih.bmiHeader), bmih.bmiColors, &ppbyte, 0); +#if DEBUG_PRINT + fprintf(stderr, + "bmih : %d x %d x %d at %x (colors : used %d at %x)\n", + bmih.bmiHeader.biWidth, + bmih.bmiHeader.biHeight, + bmih.bmiHeader.biBitCount, + ppbyte, + bmih.bmiHeader.biClrUsed, + bmih.bmiColors); +#endif + if (StretchDIBits(foreGC, + mane.min_x, + mane.min_y, + mane.max_x - mane.min_x, + mane.max_y - mane.min_y, + 0, + 0, + mane.max_x - mane.min_x, + mane.max_y - mane.min_y, + ppbyte, (LPBITMAPINFO)&bmih, + (bmih.bmiHeader.biClrUsed ? DIB_PAL_COLORS : DIB_RGB_COLORS), + SRCCOPY) == GDI_ERROR) + Win32Error("Print/GS/StretchDIBits"); + (*pgsdll_lock_device)(gs_device, 0); + } + + /* Second pass for glyphs */ + allowDrawingChars = TRUE; + redraw(&mane); +#if 0 + fprintf(stderr, "before bitblt ..."); +#endif + +#if DEBUG_PRINT + fprintf(stderr, "Printing band to (%d, %d) - (%d x %d)\n", + mane.base_x + mane.min_x, + mane.base_y + mane.min_y, + mane.max_x - mane.min_x, + mane.max_y - mane.min_y); + +#endif + +#if 0 + SelectObject(hMemBandDC, oldPrintDIB); +#endif + if (StretchDIBits(hPrinterDC, + mane.base_x + mane.min_x, + mane.base_y + mane.min_y, + mane.max_x - mane.min_x, + mane.max_y - mane.min_y, + 0, 0, + mane.max_x - mane.min_x, + mane.max_y - mane.min_y, + lpMemBandData, (LPBITMAPINFO)&bmiMemBand, + (bmiMemBand.bmiHeader.biClrUsed ? DIB_PAL_COLORS : DIB_RGB_COLORS), + SRCCOPY) == GDI_ERROR) + Win32Error("WinPrint/StretchDIBits()"); + + if (hDlgPrint) + SendDlgItemMessage(hDlgPrint, IDC_PRINT_PROGRESS_BAND, + PBM_SETPOS, (WPARAM) current_band, (LPARAM) 0); + + } + } + else { + /* No color or PS specials on this page, + draw directly onto the hPrinterDC */ + mane.base_x = 0; mane.base_y = 0; + mane.min_x = 0; mane.max_x = unshrunk_paper_w; + mane.min_y = 0; mane.max_y = unshrunk_paper_h; + maneDC = foreGC = ruleGC = highGC = hPrinterDC; + allowDrawingChars = TRUE; + redraw(&mane); + } + + if (hDlgPrint) + SendDlgItemMessage(hDlgPrint, IDC_PRINT_PROGRESS_PAGE, + PBM_SETPOS, (WPARAM) page, (LPARAM) 0); + +} + +LRESULT CmdFilePrint (HWND hwnd, WORD wCommand, WORD wNotify, HWND hwndCtrl) +{ + HDC hPrinterDC; + int page; + + if (!(hPrinterDC = GetPrinterDC(hwnd))) + return 0; + +#if 0 + __asm int 3; +#endif + + /* Set the flag used by the AbortPrintJob dialog procedure. */ + + if (InitPrinting(hPrinterDC, hwnd, hInst, dvi_name)) { + + /* Reset pre-scanning */ + scanned_page = scanned_page_reset = -1; + + SendDlgItemMessage(hDlgPrint, IDC_PRINT_PROGRESS_PAGE, + PBM_SETRANGE, + (WPARAM) 0, (LPARAM) MAKELPARAM(iFirstPage, iLastPage)); + SendDlgItemMessage(hDlgPrint, IDC_PRINT_PROGRESS_PAGE, + PBM_SETSTEP, + (WPARAM) 1, (LPARAM) 0); + + isPrinting = TRUE; + if (!SetupPageForPrinting(hPrinterDC)) + goto Abort; + + + for (page = iFirstPage; page <= iLastPage; page++) { + + if (StartPage(hPrinterDC) <= 0) { + Win32Error("CmdFilePrint/StartPage"); + break; + } + + if (bUserAbort) { + break; + } + else { + DrawPage(hPrinterDC, page); + } + + if (EndPage(hPrinterDC) <= 0) { + Win32Error("CmdFilePrint/StartPage"); + break; + } + + } + + Abort: + RestorePageForDisplay(); + if (bBandInit) + FreeBandingRc(); + isPrinting = FALSE; + + TermPrinting(hPrinterDC); + } + + DeleteDC(hPrinterDC); + return 0; +} + +#if 0 + +BOOL GuessPostScriptPrinter() +{ + bFound = FALSE; + for (each device in [Devices] section of win.ini) { + /* extract the necessary fields from the ini line */ + szDriverName = driver name extracted from ini line + szModelName = left side of ini line (the key) + szPort = port name extracted from ini line. + + hIC = CreateIC(szDriverName, szModelName, szPort, NULL); + if (hIC) { + /* see if driver supports GETTECHNOLOGY escape */ + wEscape = GETTECHNOLOGY; + if (Escape(hIC, QUERYESCSUPPORT, sizeof(WORD), &wEscape, NULL)) + { + Escape(hIC, GETTECHNOLOGY, 0, NULL, + + &szTechnology); + + /* Check that the string starts with PostScript + * by doing a case-insensitive search. Allow + * for the possibility that the string could be + * longer, like "PostScript level 2" or some other + * extension. + */ + if (beginning of string is "PostScript") + bFound = TRUE; + } + DeleteDC(hIC); + } + + /* if the driver has been found break out */ + if (bFound) + break; + } + + if (bFound) { + PostScript driver is szDriverName, model is szModelName, port is + szPort. + + } +} +NOTE: In the event that GETTECHNOLOGY is not supported by some printer drivers, another method need to be used to determine if the printer is a PostScript printer. One possible method is to use QUERYESCSUPPORT on escapes that are only implemented by PostScript printers. For example: + +EPSPRINTING +SETLINEJOIN +SETMITERLIMIT +SET_POLY_MODE + + +Similarly, you can determine a PCL printer by calling QUERYESCSUPPORT on the following escape: + +DRAWPATTERNRECT + +============================================================================================================ + +This will print a file on a PS printer for example. + +/* FILE: spool.c */ + +#include <windows.h> +#include <print.h> +#include <commdlg.h> +#include <string.h> + +// Function prototypes +BOOL FAR PASCAL PrintFile(LPSTR, HDC, HGLOBAL, HGLOBAL); +VOID SendFile(HDC, LPSTR); +HDC GetPrinterDC(HGLOBAL, HGLOBAL); +BOOL CALLBACK __export PrintAbortProc(HDC, int); + + // Play with this number +#define BUFSIZE 2048 + +// Convenient structure for use with PASSTHROUGH escape +typedef struct +{ + WORD wSize; + BYTE bData[2]; // placeholder +} PASSTHROUGHSTRUCT, FAR *LPPTS; + + +BOOL bAbort; // Global printing abort flag + + + //************************************************************* + // + // PrintFile() + // + // Purpose: + // Reads a file and copies it to a printer using the + // PASSTHROUGH escape. + // + // Parameters: + // LPSTR szFile - Pointer to path/filename to print + // HDC hPrnDC - Handle to printer DC or NULL + // HGLOBAL hDevNames - Handle to DEVNAMES struct or NULL + // HGLOBAL hDevMode - Handle to DEVMODE struct or NULL + // + // Return: + // Returns nonzero for success or zero for failure. + // + // Comments: + // hDevNames and hDevMode are only used if hPrnDC is NULL. + // If both hPrnDC and hDevNames are NULL, the default + // printer is used. + // + // History: Date Author Comment + // 6/03/93 JMS Created + // + //************************************************************* + +BOOL FAR PASCAL PrintFile ( LPSTR szFile, + HDC hPrnDC, + HGLOBAL hDevNames, + HGLOBAL hDevMode ) +{ + int iEsc; + BOOL bLocalDC = TRUE; // Assume we must create a DC (hPrnDC == NULL) + + bAbort = FALSE; // Haven't aborted yet + + + // Make sure we have a printer DC + + if (!hPrnDC) + hPrnDC = GetPrinterDC(hDevNames, hDevMode); + else + bLocalDC = FALSE; // Use passed in hPrnDC + + if (!hPrnDC) + return FALSE; + + + // PASSTHROUGH is required. If driver doesn't support it, bail out. + + iEsc = PASSTHROUGH; + if (!Escape(hPrnDC, QUERYESCSUPPORT, sizeof(int), (LPSTR)&iEsc, NULL)) + { + bAbort = TRUE; + goto MSFCleanUp; + } + + // If we created the DC, install an abort procedure. We don't have + // a Cancel dialog box, but the abort proc enables multitasking. + // (Use __export and compile with -GA or -GD so we don't need + // a MakeProcInstance.) + + if (bLocalDC) + Escape (hPrnDC, SETABORTPROC, 0, (LPSTR) PrintAbortProc, NULL); + + // Call EPSPRINTING if it is supported (that is, if we're on a + // PostScript printer) to suppress downloading the pscript header. + + iEsc = EPSPRINTING; + if (Escape(hPrnDC, QUERYESCSUPPORT, sizeof(int), (LPSTR)&iEsc, NULL)) + { + iEsc = 1; // 1 == enable PASSTHROUGH (disable pscript header) + Escape(hPrnDC, EPSPRINTING, sizeof(int), (LPSTR)&iEsc, NULL); + } + + SendFile(hPrnDC, szFile); // Send file to printer (could do multiple + // files) + + MSFCleanUp: // Done + + if (bLocalDC) // Only delete DC if we created it + DeleteDC(hPrnDC); + + return !bAbort; + +} /* PrintFile() */ + + +VOID SendFile(HDC hPrnDC, LPSTR szFile) +{ + static LPPTS lpPTS=NULL; // Pointer to PASSTHROUGHSTRUCT + OFSTRUCT ofs; + HFILE hFile; + + hFile = OpenFile((LPSTR) szFile, &ofs, OF_READ); + if (hFile == HFILE_ERROR) + { + bAbort = TRUE; // Can't open file! + return; + } + + if (!lpPTS && + !(lpPTS = (LPPTS)GlobalLock(GlobalAlloc(GPTR, sizeof(WORD) + + BUFSIZE)))) + { + bAbort = TRUE; // Can't allocate memory for buffer! + return; + } + + Escape (hPrnDC, STARTDOC, 0, "", NULL); + + // Loop through the file, reading a chunk at a time and passing + // it to the printer. QueryAbort calls the abort procedure, which + // processes messages so we don't tie up the whole system. + // We could skip the QueryAbort, in which case we wouldn't need + // to set an abort proc at all. + + do { + if ((lpPTS->wSize=_lread(hFile, lpPTS->bData, BUFSIZE)) == + HFILE_ERROR) + { + bAbort = TRUE; // error reading file + break; + } + + Escape(hPrnDC, PASSTHROUGH, NULL, (LPSTR)lpPTS, NULL); + } + while ((lpPTS->wSize == BUFSIZE) && QueryAbort(hPrnDC, 0)); + + if (!bAbort) + Escape(hPrnDC, ENDDOC, NULL, NULL, NULL); + + _lclose(hFile); + +} /* SendFile() */ + +HDC GetPrinterDC(HGLOBAL hDevNames, HGLOBAL hDevMode) +{ + HDC hdc; + char szPrinter[64]; + LPSTR szDevice=NULL, szDriver=NULL, szOutput=NULL; + LPDEVMODE lpdm; + + if (hDevNames) + { + LPDEVNAMES lpdn = (LPDEVNAMES) GlobalLock(hDevNames); + + szDriver = (LPSTR) lpdn + lpdn->wDriverOffset; + szDevice = (LPSTR) lpdn + lpdn->wDeviceOffset; + szOutput = (LPSTR) lpdn + lpdn->wOutputOffset; + + if (hDevMode) + lpdm = (LPDEVMODE) GlobalLock(hDevMode); + } + else + { // Get default printer info + GetProfileString ("windows", "device", "", szPrinter, 64); + + if (!((szDevice = strtok (szPrinter, "," )) && + (szDriver = strtok (NULL, ", ")) && + (szOutput = strtok (NULL, ", ")))) + return NULL; // No default printer + + lpdm = NULL; // Don't use DEVMODE with default printer + } + + hdc = CreateDC(szDriver, szDevice, szOutput, lpdm); + + if (hDevMode && lpdm) + GlobalUnlock(hDevMode); + if (hDevNames) + GlobalUnlock(hDevNames); + + return hdc; + +} /* GetPrinterDC() */ + + +BOOL CALLBACK __export PrintAbortProc(HDC hdc, int code) +{ + MSG msg; + + while (!bAbort && PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + return (!bAbort); + +} /* PrintAbortProc() */ + +/*** EOF: spool.c ***/ +============================================================================================================= +To identify the printer as a PostScript printer, use this code: + + +int gPrCode = 0; // Set according to platform. + +if( Win32s ) // Using the Win16 driver. +{ + gPrCode = PASSTHROUGH; + if((Escape(printerIC, GETTECHNOLOGY, NULL, NULL, (LPSTR)szTech) && + !lstrcmp(szTech, "PostScript")) && + Escape(printerIC, QUERYESCSUPPORT, sizeof(int), + (LPSTR)gPrCode, NULL ) + { + // The printer is PostScript. + ... + } + } + else // Using Win32 driver under Windows NT. + { + gPrCode = POSTSCRIPT_PASSTHROUGH; // Fails with Win16 driver + if( Escape(printerIC, QUERYESCSUPPORT, sizeof(int), (LPSTR)gPrCode, + NULL)) + { + // The printer is PostScript. + ... + } + } + + + Printing + To send PostScript data to the printer on either platform, use this code: + + +// Assuming a buffer, szPSBuf, of max size MAX_PSBUF containing +// nPSData bytes of PostScript data. + + char szBuf[MAX_PSBUF+sizeof(short)]; + + // Store length in buffer. + *((short *)szBuf) = nPSData; + + // Store data in buffer. + memcpy( (char *)szBuf + sizeof(short), szPSBuf, nPSData ); + + // Note that gPrCode (set when identifying the printer) depends on + // the platform. + Escape( printerDC, gPrCode, (int) nPSData, szBuf, NULL ); + + + However, your output may appear scaled or translated incorrectly or data may be transformed off the page under Win32s. + The origin and scale for Windows printer drivers is not the PostScript default (bottom left/72 dpi) but is instead at the upper left and at the device scale(300 dpi). Therefore, before sending data to the printer, you may need to send a couple of PostScript commands to scale or translate the matrix. For example, for scaling, send the following escape to scale the PostScript transform to 72 dpi: + + + xres = GetDeviceCaps(printerDC, LOGPIXELSX); + yres = GetDeviceCaps(printerDC, LOGPIXELSY); + +// Two leading spaces for the following operation. + wsprintf(szBuf, " %d 72 div %d 72 div scale\n", xres, yres); + + // Put actual size into buffer + *((short *)szBuf) = strlen(szBuf)-2; + Escape( printerDC, gPrCode, strlen(szBuf)-2, szBuf, NULL ); + + + +#endif + +#if 0 + /* ******************************************************************** */ + /* */ + /* print.c */ + /* */ + /* Source file for Device-Independent Bitmap (DIB) API. Provides */ + /* the following functions: */ + /* */ + /* PrintWindow() - Prints all or part of a window */ + /* PrintScreen() - Prints the entire screen */ + /* PrintDIB() - Prints the specified DIB */ + /* */ + /* Written by Microsoft Product Support Services, Developer Support. */ + /* Copyright 1991-1998 Microsoft Corporation. All rights reserved. */ + /* ******************************************************************** */ + +#define STRICT /* enable strict type checking */ + +#include <windows.h> +#include <string.h> +#include "dibdll.h" /* Header for printing dialog & DLL instance handle */ +#include "dibapi.h" /* Header for DIB functions */ +#include "dibutil.h" /* Auxiliary functions */ + + + extern HANDLE ghDLLInst; /* Global handle to DLL's instance */ + +/*************************************************************** + * Typedefs + **************************************************************/ + +/* Structure used for Banding */ + + typedef struct + { + BOOL bGraphics; + BOOL bText; + RECT GraphicsRect; + } BANDINFOSTRUCT; + + + /**************************************************************** + * Variables + ***************************************************************/ + + HWND hDlgAbort; /* Handle to Abort Dialog */ + char szPrintDlg[] = "PRINTING"; /* Name of Print dialog from .RC */ + BOOL bAbort = FALSE; /* Abort a print operation? */ + char gszDevice[50]; /* Keeps track out device (e.g. "HP LaserJet") */ + char gszOutput[50]; /* Output device (e.g. "LPT1:") */ + + /*************************************************************** + * Function prototypes for functions local to this module + **************************************************************/ + + BOOL CALLBACK PrintAbortProc(HDC, int); + int CALLBACK PrintAbortDlg(HWND, UINT, WPARAM, LPARAM); + WORD PrintBand(HDC, LPRECT, LPRECT, BOOL, BOOL, LPBITMAPINFOHEADER, LPSTR); + HDC GetPrinterDC(void); + void CalculatePrintRect(HDC, LPRECT, WORD, DWORD, DWORD); + + + /********************************************************************** + * + * PrintDIB() + * + * Description: + * + * This routine prints the specified DIB. The actual printing is done + * in the PrintBand() routine (see below), this procedure drives the + * printing operation. PrintDIB() has the code to handle both banding + * and non-banding printers. A banding printer can be distinguished by + * the GetDeviceCaps() API (see the code below). On banding devices, + * must repeatedly call the NEXTBAND escape to get the next banding + * rectangle to print into. If the device supports the BANDINFO escape, + * it should be used to determine whether the band "wants" text or + * graphics (or both). On non-banding devices, we can ignore all this + * and call PrintBand() on the entire page. + * + * Parameters: + * + * HDIB hDib - Handle to dib to be printed + * + * WORD fPrintOpt - tells which print option to use (PW_BESTFIT, + * PW_STRETCHTOPAGE, OR PW_SCALE) + * + * WORD wXScale, wYScale - X and Y scaling factors (integers) for + * printed output if the PW_SCALE option is used. + * + * LPSTR szJobName - Name that you would like to give to this print job (this + * name shows up in the Print Manager as well as the + * "Now Printing..." dialog box). + * + * Return Value: (see errors.h for description) + * + * One of: ERR_INVALIDHANDLE + * ERR_LOCK + * ERR_SETABORTPROC + * ERR_STARTDOC + * ERR_NEWFRAME + * ERR_ENDDOC + * ERR_GETDC + * ERR_STRETCHDIBITS + * + ********************************************************************/ + + WORD PrintDIB(HDIB hDib, WORD fPrintOpt, WORD wXScale, WORD wYScale, + LPSTR szJobName) + { + HDC hPrnDC; /* DC to the printer */ + RECT rect; /* Rect structure used for banding */ + LPSTR lpBits; /* pointer to the DIB bits */ + LPBITMAPINFOHEADER lpDIBHdr; /* Pointer to DIB header */ + int nBandCount = 0; /* used for print dialog box to count bands */ + WORD wErrorCode = 0; /* Error code to return */ + RECT rPrintRect; /* specifies the area on the printer */ + /* (in printer coordinates) which we */ + /* want the DIB to go to */ + char szBuffer[70]; /* Buffer to hold message for "Printing" dlg box */ + char szJobNameTrunc[35]; /* szJobName truncated to 31 */ + /* characters, since STARTDOC can't */ + /* accept a string longer than 31 */ + DOCINFO DocInfo; /* structure for StartDoc */ + int nTemp; /* used to check banding capability */ + CHAR lpBuffer[128]; /* Buffer for strings retrieved from resources */ + + + /* Paramter validation */ + + if (!hDib) + return ERR_INVALIDHANDLE; + + /* Get pointer to DIB header */ + + lpDIBHdr = (LPBITMAPINFOHEADER)GlobalLock(hDib); + if (!lpDIBHdr) /* Check that we have a valid pointer */ + return ERR_LOCK; + lpBits = FindDIBBits((LPSTR)lpDIBHdr); /* Find pointer to DIB bits */ + + if (hPrnDC = GetPrinterDC()) + { + SetStretchBltMode(hPrnDC, COLORONCOLOR); + + /* Determine rPrintRect (printer area to print to) from the */ + /* fPrintOpt. Fill in rPrintRect.left and .top from wXScale and */ + /* wYScale just in case we use PW_SCALE (see the function */ + /* CalculatePrintRect). */ + + rPrintRect.left = wXScale; + rPrintRect.top = wYScale; + CalculatePrintRect(hPrnDC, &rPrintRect, fPrintOpt, lpDIBHdr->biWidth, + lpDIBHdr->biHeight); + + /* Initialize the abort procedure. */ + + hDlgAbort = CreateDialog(ghDLLInst, szPrintDlg, GetFocus(), + (DLGPROC)PrintAbortDlg); + + /* ISet the text inside the dialog to the name of our print job */ + + lstrcpy(szJobNameTrunc, szJobName); + szJobNameTrunc[31] = '\0'; /* Truncate string to 31 chars */ + LoadString(ghDLLInst, IDS_PRINTMSG, lpBuffer, sizeof(lpBuffer)); + wsprintf(szBuffer, lpBuffer, (LPSTR)szJobNameTrunc); + SetDlgItemText(hDlgAbort, IDC_PRINTTEXT1, (LPSTR)szBuffer); + + /* Set global variable bAbort to FALSE. This will get set to TRUE */ + /* in our PrintAbortDlg() procedure if the user selects the */ + /* CANCEL button in our dialog box */ + + bAbort = FALSE; + + /* set up the Abort Procedure */ + + if (SetAbortProc(hPrnDC, (ABORTPROC)PrintAbortProc) < 0) + return ERR_SETABORTPROC; + + /* start print job */ + + ZeroMemory(&DocInfo, sizeof(DOCINFO)); + DocInfo.cbSize = sizeof(DOCINFO); + DocInfo.lpszDocName = (LPTSTR)szJobNameTrunc; + DocInfo.lpszOutput = NULL; + + if (StartDoc(hPrnDC, &DocInfo) <= 0) + { + /* Oops, something happened, let's clean up here and return */ + + DestroyWindow(hDlgAbort); /* Remove abort dialog box */ + DeleteDC(hPrnDC); + GlobalUnlock(hDib); + return ERR_STARTDOC; + } + + /* Note: the following banding code applies to Windows 3.1. With the new */ + /* printing architecture of Win32, send out both the graphics and */ + /* text in one band (like a non-banding device). This code is used */ + /* for Win32s since Win32s depends on Windows 3.1 printing architecture. */ + /* */ + /* Check if need to do banding. If we do, loop through */ + /* each band in the page, calling NEXTBAND and BANDINFO */ + /* (if supported) calling PrintBand() on the band. Else, */ + /* call PrintBand() with the entire page as our clipping */ + /* rectangle! */ + + /* If Wincap32 is running on Win32s, then use banding */ + + nTemp = NEXTBAND; + if (Escape(hPrnDC, QUERYESCSUPPORT, sizeof(int), (LPSTR)&nTemp, NULL) && + (GetVersion() & 0x80000000) && (LOWORD(GetVersion()) == 3)) + { + BOOL bBandInfoDevice; + BANDINFOSTRUCT biBandInfo; /* Used for banding */ + + /* Fill in initial values for our BandInfo Structure to */ + /* tell driver we can want to do graphics and text, and */ + /* also which area we want the graphics to go in. */ + + biBandInfo.bGraphics = TRUE; + biBandInfo.bText = TRUE; + biBandInfo.GraphicsRect = rPrintRect; + + /* Check if device supports the BANDINFO escape. */ + + nTemp = BANDINFO; + bBandInfoDevice = Escape(hPrnDC, QUERYESCSUPPORT, sizeof(int), + (LPSTR)&nTemp, NULL); + + /* Do each band -- Call Escape() with NEXTBAND, then the */ + /* rect structure returned is the area where we are to */ + /* print in. This loop exits when the rect area is empty. */ + + while (Escape(hPrnDC, NEXTBAND, 0, NULL, (LPSTR)&rect) && ! + IsRectEmpty(&rect)) + { + char szTmpBuf[100]; + + + /* Do the BANDINFO, if needed. */ + + if (bBandInfoDevice) + Escape(hPrnDC, BANDINFO, sizeof(BANDINFOSTRUCT), (LPSTR)& + biBandInfo, (LPSTR)&biBandInfo); + LoadString(ghDLLInst, IDS_BANDNMBR, lpBuffer, sizeof(lpBuffer)); + wsprintf(szTmpBuf, lpBuffer, ++nBandCount); + SetDlgItemText(hDlgAbort, IDC_PERCENTAGE, (LPSTR)szTmpBuf); + + /* Call PrintBand() to do actual output into band. */ + /* Pass in our band-info flags to tell what sort */ + /* of data to output into the band. Note that on */ + /* non-banding devices, we pass in the default bandinfo */ + /* stuff set above (i.e. bText=TRUE, bGraphics=TRUE). */ + + wErrorCode = PrintBand(hPrnDC, &rPrintRect, &rect, + biBandInfo.bText, biBandInfo.bGraphics, lpDIBHdr, + lpBits); + } + } + else + { + /* Print the whole page -- non-banding device. */ + + if (StartPage(hPrnDC) <= 0) + return ERR_STARTPAGE; + + rect = rPrintRect; + LoadString(ghDLLInst, IDS_SENDINGBAND, lpBuffer, sizeof(lpBuffer)); + SetDlgItemText(hDlgAbort, IDC_PERCENTAGE, lpBuffer); + wErrorCode = PrintBand(hPrnDC, &rPrintRect, &rect, TRUE, TRUE, + lpDIBHdr, lpBits); + + /* Non-banding devices need a NEWFRAME */ + + if (EndPage(hPrnDC) <= 0) + return ERR_ENDPAGE; + } + + + /* End the print operation. Only send the ENDDOC if */ + /* we didn't abort or error. */ + + if (!bAbort) + { + /* We errored out on ENDDOC, but don't return here - we still */ + /* need to close the dialog box, free proc instances, etc. */ + + if (EndDoc(hPrnDC) <= 0) + wErrorCode = ERR_ENDDOC; + + DestroyWindow(hDlgAbort); + } + + /* All done, clean up. */ + + DeleteDC(hPrnDC); + } + else + wErrorCode = ERR_GETDC; /* Couldn't get Printer DC! */ + + GlobalUnlock(hDib); + return wErrorCode; + } + + + + + /* ******************************************************************* */ + /* Auxiliary Functions */ + /* -- Local to this module only */ + /* ******************************************************************* */ + + + /********************************************************************* + * + * CalculatePrintRect() + * + * Given fPrintOpt and a size of the DIB, return the area on the + * printer where the image should go (in printer coordinates). If + * fPrintOpt is PW_SCALE, then lpPrintRect.left and .top should + * contain WORDs which specify the scaling factor for the X and + * Y directions, respecively. + * + ********************************************************************/ + + void CalculatePrintRect(HDC hDC, LPRECT lpPrintRect, WORD fPrintOpt, + DWORD cxDIB, DWORD cyDIB) + { + int cxPage, cyPage, cxInch, cyInch; + + if (!hDC) + return; + + /* Get some info from printer driver */ + + cxPage = GetDeviceCaps(hDC, HORZRES); /* Width of printr page - pixels */ + cyPage = GetDeviceCaps(hDC, VERTRES); /* Height of printr page - pixels */ + cxInch = GetDeviceCaps(hDC, LOGPIXELSX);/* Printer pixels per inch - X */ + cyInch = GetDeviceCaps(hDC, LOGPIXELSY);/* Printer pixels per inch - Y */ + + switch (fPrintOpt) + { + + /* Best Fit case -- create a rectangle which preserves */ + /* the DIB's aspect ratio, and fills the page horizontally. */ + + /* The formula in the "->bottom" field below calculates the Y */ + /* position of the printed bitmap, based on the size of the */ + /* bitmap, the width of the page, and the relative size of */ + /* a printed pixel (cyInch / cxInch). */ + + case PW_BESTFIT: + lpPrintRect->top = 0; + lpPrintRect->left = 0; + lpPrintRect->bottom = (int)(((double)cyDIB * cxPage * cyInch) / + ((double)cxDIB * cxInch)); + lpPrintRect->right = cxPage; + break; + + /* Scaling option -- lpPrintRect's top/left contain */ + /* multipliers to multiply the DIB's height/width by. */ + + case PW_SCALE: + { + int cxMult, cyMult; + + cxMult = lpPrintRect->left; + cyMult = lpPrintRect->top; + lpPrintRect->top = 0; + lpPrintRect->left = 0; + lpPrintRect->bottom = (int)(cyDIB * cyMult); + lpPrintRect->right = (int)(cxDIB * cxMult); + break; + } + + /* Stretch To Page case -- create a rectangle */ + /* which covers the entire printing page (note that this */ + /* is also the default). */ + + case PW_STRETCHTOPAGE: + + default: + lpPrintRect->top = 0; + lpPrintRect->left = 0; + lpPrintRect->bottom = cyPage; + lpPrintRect->right = cxPage; + break; + } + } + + + /********************************************************************* + * + * PrintBand() + * + * This routine does ALL output to the printer. It is called from + * the PrintDIB() routine. It is called for both banding and non- + * banding printing devices. lpRectClip contains the rectangular + * area we should do our output into (i.e. we should clip our output + * to this area). The flags fDoText and fDoGraphics should be set + * appropriately (if we want any text output to the rectangle, set + * fDoText to true). Normally these flags are returned on banding + * devices which support the BANDINFO escape. + * + ********************************************************************/ + + WORD PrintBand(HDC hDC, LPRECT lpRectOut, LPRECT lpRectClip, BOOL fDoText, + BOOL fDoGraphics, LPBITMAPINFOHEADER lpDIBHdr, LPSTR lpDIBBits) + { + RECT rect; /* Temporary rectangle */ + double dblXScaling, /* X and Y scaling factors */ + dblYScaling; + WORD wReturn = 0; /* Return code */ + + if (fDoGraphics) + { + dblXScaling = ((double)lpRectOut->right - lpRectOut->left) / (double) + lpDIBHdr->biWidth; + dblYScaling = ((double)lpRectOut->bottom - lpRectOut->top) / (double) + lpDIBHdr->biHeight; + + /* Now we set up a temporary rectangle -- this rectangle */ + /* holds the coordinates on the paper where our bitmap */ + /* WILL be output. We can intersect this rectangle with */ + /* the lpClipRect to see what we NEED to output to this */ + /* band. Then, we determine the coordinates in the DIB */ + /* to which this rectangle corresponds (using dbl?Scaling). */ + + IntersectRect(&rect, lpRectOut, lpRectClip); + if (!IsRectEmpty(&rect)) + { + RECT rectIn; + + rectIn.left = (int)((rect.left - lpRectOut->left) / dblXScaling + + 0.5 + ); + rectIn.top = (int)((rect.top - lpRectOut->top) / dblYScaling + 0.5); + rectIn.right = (int)(rectIn.left + (rect.right - rect.left) / + dblXScaling + 0.5); + rectIn.bottom = (int)(rectIn.top + (rect.bottom - rect.top) / + dblYScaling + 0.5); + if (!StretchDIBits(hDC, rect.left, rect.top, + rect.right - rect.left, rect.bottom - rect.top, + rectIn.left, (int)(lpDIBHdr->biHeight) - + rectIn.top - (rectIn.bottom - rectIn.top), + rectIn.right - rectIn.left, rectIn.bottom - rectIn.top, + lpDIBBits, (LPBITMAPINFO)lpDIBHdr, DIB_RGB_COLORS, + SRCCOPY)) + wReturn = ERR_STRETCHDIBITS; /* StretchDIBits() failed! */ + } + } + + return wReturn; + } + + + /*********************************************************************** + * + * GetPrinterDC() + * + * Uses PrinDlg common dialog for printer selection and creates a dc. + * Returns NULL on error. + * + ***********************************************************************/ + + HDC GetPrinterDC() { + + PRINTDLG pd; + + ZeroMemory(&pd, sizeof(pd)); + + pd.lStructSize = sizeof(PRINTDLG); + pd.Flags = PD_RETURNDC; + + if (PrintDlg(&pd) == TRUE) + { + DEVNAMES *pDevNames = GlobalLock(pd.hDevNames); + + lstrcpy((LPSTR)gszDevice, + (LPSTR)((char *)pDevNames+pDevNames->wDeviceOffset)); + + if(!lstrcmpi((LPSTR)((char *)pDevNames+pDevNames->wDeviceOffset), + (LPSTR)((char *)pDevNames+pDevNames->wOutputOffset))) + lstrcpy((LPSTR)gszOutput, "net:"); + else + lstrcpy((LPSTR)gszOutput, + (LPSTR)((char *)pDevNames+pDevNames->wOutputOffset)); + + GlobalUnlock(pd.hDevNames); + return pd.hDC; + } + + else + return NULL; + } + + + /********************************************************************** + * PrintAbortProc() + * + * Abort procedure - contains the message loop while printing is + * in progress. By using a PeekMessage() loop, multitasking + * can occur during printing. + * + **********************************************************************/ + + BOOL CALLBACK PrintAbortProc(HDC hDC, int code) + { + MSG msg; + + while (!bAbort && PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) + if (!IsDialogMessage(hDlgAbort, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + return !bAbort; + } + + /*********************************************************************** + * + * PrintAbortDlg() + * + * + * This is the Dialog Procedure which will handle the "Now Printing" + * dialog box. When the user presses the "Cancel" button, the + * global variable bAbort is set to TRUE, which causes the + * PrintAbortProc to exit, which in turn causes the printing + * operation to terminate. + * + ***********************************************************************/ + + int CALLBACK PrintAbortDlg(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + { + switch (msg) + { + case WM_INITDIALOG: + { + char szBuffer[100]; + + /* Fill in the text which specifies where this bitmap */ + /* is going ("on HP LaserJet on LPT1", for example) */ + LoadString(ghDLLInst, IDS_ABORTSTRING, msgBuffer, sizeof(msgBuffer)); + wsprintf(szBuffer, msgBuffer, (LPSTR)gszDevice, + (LPSTR)gszOutput); + SetDlgItemText(hWnd, IDC_PRINTTEXT2, (LPSTR)szBuffer); + SetFocus(GetDlgItem(hWnd, IDCANCEL)); + return TRUE; /* Return TRUE because we called SetFocus() */ + } + + case WM_COMMAND: + bAbort = TRUE; + DestroyWindow(hWnd); + return TRUE; + break; + } + + return FALSE; + } + +#endif + +#define NEW_DIB_FORMAT(lpbih) (lpbih->biSize != sizeof(BITMAPCOREHEADER)) + + /****************************************************************************** + * * + * FUNCTION : DIBNumColors(LPVOID lpv) * + * * + * PURPOSE : Determines the number of colors in the DIB by looking at * + * the BitCount and ClrUsed fields in the info block. * + * * + * RETURNS : The number of colors in the DIB. With DIBS with more than * + * 8-bits-per-pixel that have a color table table included, * + * then the return value will be the number of colors in the * + * color table rather than the number of colors in the DIB. * + * * + * * + *****************************************************************************/ + WORD DIBNumColors (LPVOID lpv) + { + INT bits; + LPBITMAPINFOHEADER lpbih = (LPBITMAPINFOHEADER)lpv; + LPBITMAPCOREHEADER lpbch = (LPBITMAPCOREHEADER)lpv; + + /* With the BITMAPINFO format headers, the size of the palette + * is in biClrUsed, whereas in the BITMAPCORE - style headers, it + * is dependent on the bits per pixel ( = 2 raised to the power of + * bits/pixel). + */ + if (NEW_DIB_FORMAT(lpbih)) { + if (lpbih->biClrUsed != 0) + return (WORD)lpbih->biClrUsed; + bits = lpbih->biBitCount; + } + else + bits = lpbch->bcBitCount; + + if (bits > 8) + return 0; /* Since biClrUsed is 0, we dont have a an optimal palette */ + else + return (1 << bits); + } + + /****************************************************************************** + * * + * FUNCTION : ColorTableSize(LPVOID lpv) * + * * + * PURPOSE : Calculates the palette size in bytes. If the info. block * + * is of the BITMAPCOREHEADER type, the number of colors is * + * multiplied by 3 to give the palette size, otherwise the * + * number of colors is multiplied by 4. * + * * + * RETURNS : Color table size in number of bytes. * + * * + *****************************************************************************/ + WORD ColorTableSize (LPVOID lpv) + { + LPBITMAPINFOHEADER lpbih = (LPBITMAPINFOHEADER)lpv; + + if (NEW_DIB_FORMAT(lpbih)) + { + if (((LPBITMAPINFOHEADER)(lpbih))->biCompression == BI_BITFIELDS) + /* Remember that 16/32bpp dibs can still have a color table */ + return (sizeof(DWORD) * 3) + (DIBNumColors (lpbih) * sizeof (RGBQUAD)); + else + return (DIBNumColors (lpbih) * sizeof (RGBQUAD)); + } + else + return (DIBNumColors (lpbih) * sizeof (RGBTRIPLE)); + } + + diff --git a/Build/source/texk/windvi/wintransf.c b/Build/source/texk/windvi/wintransf.c new file mode 100644 index 00000000000..ea90c10521b --- /dev/null +++ b/Build/source/texk/windvi/wintransf.c @@ -0,0 +1,201 @@ +/* + wintransf.c : implementation file + Time-stamp: "03/05/21 23:50:21 popineau" + + Copyright (C) 1999 + Fabrice Popineau <Fabrice.Popineau@supelec.fr> + + This file is part of Windvi. + + Windvi 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. + + Windvi 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 Windvi; if not, write to the Free Software Foundation, 59 + Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "wingui.h" +#include "xdvi-config.h" + +#define DEBUG_TRANSF 0 + +#define XFRM_INITIAL 100 + +XFORM xfrmTransf = {1.0, 0.0, 0.0, 1.0, 0.0, 0.0}; +XFORM xfrmUnit = {1.0, 0.0, 0.0, 1.0, 0.0, 0.0}; + +typedef struct _xfrm_stack { + long dviptr; + XFORM xfrm; +} xfrm_stack; + +xfrm_stack *xfrmStack; +int top_xfrm; +int xfrmStack_len; + +BOOL bTransfInUse = FALSE; +XFORM xfrm_unit = { 1.0, 0.0, 0.0, 1.0, 0.0,0.0 }; +XFORM current_transf; + +void init_xfrm_stack() +{ + top_xfrm = 0; + xfrmStack_len = XFRM_INITIAL; + xfrmStack = xmalloc(sizeof(xfrm_stack)*XFRM_INITIAL); + current_transf = xfrm_unit; +} + +void reset_xfrm_stack() +{ + XFORM xfrm; + top_xfrm = 0; +#if DEBUG_TRANSF + fprintf(stderr, "Resetting transformation stack.\n"); +#endif + if (ModifyWorldTransform(foreGC, &xfrm, MWT_IDENTITY) == 0) + Win32Error("reset_xfrm_stack/ModifyWorldTransform"); + bTransfInUse = FALSE; + current_transf = xfrm_unit; +} + +void xfrm_dump_stack() +{ + int i; + for (i = 0; i < top_xfrm; i++) { + fprintf(stderr, "xfrmStack[%d] = [%f %f %f %f %f %f] pos = %ld\n", i, + xfrmStack[i].xfrm.eM11, xfrmStack[i].xfrm.eM12, + xfrmStack[i].xfrm.eM21, xfrmStack[i].xfrm.eM22, + xfrmStack[i].xfrm.eDx, xfrmStack[i].xfrm.eDy, + xfrmStack[i].dviptr); + } +} + +void xfrm_record(XFORM *x) +{ +#if 0 + __asm int 3; +#endif + int i; + + if (!resource.use_xform || !x) return; + + for (i = 0; i < top_xfrm; i++) { + if (xfrmStack[i].dviptr == currinf.pos) { + /* Already in there, return */ + /* FIXME : should we do any check for the *same* transf ? */ + return; + } + else if(xfrmStack[i].dviptr > currinf.pos) { + /* insert it at this position and move up everything else */ + break; + } + } + if (top_xfrm+1 > xfrmStack_len) { + xfrmStack_len *= 2; + xfrmStack = xrealloc(xfrmStack, sizeof(xfrm_stack)*xfrmStack_len); + } + if (i == top_xfrm) { + xfrmStack[top_xfrm].dviptr = currinf.pos; + xfrmStack[top_xfrm].xfrm = *x; + top_xfrm++; + } + else { + memmove(xfrmStack+(i+1), xfrmStack+i, (top_xfrm - i)*sizeof(xfrm_stack)); + xfrmStack[i].dviptr = currinf.pos; + xfrmStack[i].xfrm = *x; + top_xfrm++; + } +#if DEBUG_TRANSF + fprintf(stderr, "inserting (pos = %ld) xfrmStack[%d] = [%f %f %f %f %f %f]\n", + currinf.pos, i, + xfrmStack[i].xfrm.eM11, xfrmStack[i].xfrm.eM12, + xfrmStack[i].xfrm.eM21, xfrmStack[i].xfrm.eM22, + xfrmStack[i].xfrm.eDx, xfrmStack[i].xfrm.eDy); + xfrm_dump_stack(); +#endif +} + +void xfrm_apply() +{ + int i = -1; + long pos = currinf.pos; + POINT mane_points[3]; + XFORM xfrm = xfrm_unit; +#if 0 + __asm int 3; + fprintf(stderr, "Entering xfrm_apply\n"); +#endif + if (!resource.use_xform) return; + +#if DEBUG_TRANSF + fprintf(stderr, "xfrm_apply: pos = %ld\n", pos); + xfrm_dump_stack(); +#endif + for (i = 0; i < top_xfrm; i++) { + if (pos == xfrmStack[i].dviptr) { + xfrm = xfrmStack[i].xfrm; + break; + } + } + if (i < top_xfrm) { + if (foreGC == magMemDC || foreGC == magDC) { + extern int magWidth, magHeight; +#if 1 + /* FIXME : I'm afraid it can be solved only by applying + transformations in XPutImage ! + */ + +#if 0 + xfrm.eDx += ((xfrm.eM11 -1)*(currwin.base_x + magWidth) + xfrm.eM21*(currwin.base_y + magHeight))/mane.shrinkfactor; + xfrm.eDy += (xfrm.eM12*(currwin.base_x + magWidth) + (xfrm.eM22-1)*(currwin.base_y + magHeight))/mane.shrinkfactor; +#endif + xfrm.eDx += (xfrm.eM11 -1)*(currwin.base_x) + xfrm.eM21*(currwin.base_y); + xfrm.eDy += xfrm.eM12*(currwin.base_x) + (xfrm.eM22-1)*(currwin.base_y); + + bTransfInUse = (fabs(xfrm.eM11 - 1.0) + + fabs(xfrm.eM12) + + fabs(xfrm.eM21) + + fabs(xfrm.eM22 - 1.0) + + fabs(xfrm.eDx) + + fabs(xfrm.eDy)) > .0001 ; +#else + bTransfInUse = FALSE; +#endif + } + else { + bTransfInUse = (fabs(xfrm.eM11 - 1.0) + + fabs(xfrm.eM12) + + fabs(xfrm.eM21) + + fabs(xfrm.eM22 - 1.0) + + fabs(xfrm.eDx) + + fabs(xfrm.eDy)) > .0001 ; + } + if (!bTransfInUse) { + if (ModifyWorldTransform(foreGC, &xfrm, MWT_IDENTITY) == 0) + Win32Error("xfrm_apply/ModifyWorldTransform"); + current_transf = xfrm_unit; + } + else { +#if 0 + fprintf(stderr, "Applying transf [%f %f %f %f %f %f] to foreGC\n", + xfrm.eM11, xfrm.eM12, + xfrm.eM21, xfrm.eM22, + xfrm.eDx, xfrm.eDy); + fprintf(stderr, "currwin orig: (%d %d)\n", currwin.base_x, currwin.base_y); +#endif +#if 0 + if (SetWorldTransform(foreGC, &(xfrm)) == 0) + Win32Error("xfrm_apply/SetWorldTransform"); +#else + current_transf = xfrm; +#endif + } + } +} diff --git a/Build/source/texk/windvi/winver.c b/Build/source/texk/windvi/winver.c new file mode 100644 index 00000000000..9547a9ecb78 --- /dev/null +++ b/Build/source/texk/windvi/winver.c @@ -0,0 +1,46 @@ +#include "wingui.h" +#include "xdvi-config.h" + +/* + Displays a dialog box with version information +*/ +void DispVersion() +{ + char szFullPath[256]; + DWORD dwVerHnd; + DWORD dwVerInfoSize; + char szBuf[256]; + extern HWND hWndMain; + extern HINSTANCE hInst; + GetModuleFileName(hInst, szFullPath, sizeof(szFullPath)); + dwVerInfoSize = GetFileVersionInfoSize(szFullPath, &dwVerHnd); + if (dwVerInfoSize) { + /* If we were able to get the information, process it: */ + HANDLE hMem; + LPVOID lpvMem; + char szGetName[256]; + int cchRoot; + BOOL fRet; + UINT cchVer = 0; + LPSTR lszVer = NULL; + + hMem = GlobalAlloc(GMEM_MOVEABLE, dwVerInfoSize); + lpvMem = GlobalLock(hMem); + GetFileVersionInfo(szFullPath, dwVerHnd, dwVerInfoSize, lpvMem); + lstrcpy(szGetName, "\\StringFileInfo\\040904E4\\ProductVersion"); + cchRoot = lstrlen(szGetName); + fRet = VerQueryValue(lpvMem, szGetName, &lszVer, &cchVer); + if (fRet && cchVer && lszVer) { + wsprintf(szBuf, "(o)windvi %s", lszVer); + } + else { + wsprintf(szBuf, "Failed to get product version number."); + } + } + else { + wsprintf(szBuf, "Failed to get version information."); + } + MessageBox(NULL, szBuf, + "Version Information", MB_APPLMODAL | MB_ICONHAND | MB_OK); + CleanExit(0); +} diff --git a/Build/source/texk/windvi/winxutl.c b/Build/source/texk/windvi/winxutl.c new file mode 100644 index 00000000000..99b54f92e7f --- /dev/null +++ b/Build/source/texk/windvi/winxutl.c @@ -0,0 +1,1159 @@ +#include <windows.h> +#include <commdlg.h> +#include "wingui.h" +#include "xdvi-config.h" + +#include "winxutl.h" + +#define _TRACE 0 + +RGBQUAD QuadWhite = { 255, 255, 255, 0}; +RGBQUAD QuadBlack = { 0, 0, 0, 0}; + +colormap_t win32_color_map[] = +{ + {"snow" , MYRGB (255,250,250)}, + {"ghost white" , MYRGB (248,248,255)}, + {"GhostWhite" , MYRGB (248,248,255)}, + {"white smoke" , MYRGB (245,245,245)}, + {"WhiteSmoke" , MYRGB (245,245,245)}, + {"gainsboro" , MYRGB (220,220,220)}, + {"floral white" , MYRGB (255,250,240)}, + {"FloralWhite" , MYRGB (255,250,240)}, + {"old lace" , MYRGB (253,245,230)}, + {"OldLace" , MYRGB (253,245,230)}, + {"linen" , MYRGB (250,240,230)}, + {"antique white" , MYRGB (250,235,215)}, + {"AntiqueWhite" , MYRGB (250,235,215)}, + {"papaya whip" , MYRGB (255,239,213)}, + {"PapayaWhip" , MYRGB (255,239,213)}, + {"blanched almond" , MYRGB (255,235,205)}, + {"BlanchedAlmond" , MYRGB (255,235,205)}, + {"bisque" , MYRGB (255,228,196)}, + {"peach puff" , MYRGB (255,218,185)}, + {"PeachPuff" , MYRGB (255,218,185)}, + {"navajo white" , MYRGB (255,222,173)}, + {"NavajoWhite" , MYRGB (255,222,173)}, + {"moccasin" , MYRGB (255,228,181)}, + {"cornsilk" , MYRGB (255,248,220)}, + {"ivory" , MYRGB (255,255,240)}, + {"lemon chiffon" , MYRGB (255,250,205)}, + {"LemonChiffon" , MYRGB (255,250,205)}, + {"seashell" , MYRGB (255,245,238)}, + {"honeydew" , MYRGB (240,255,240)}, + {"mint cream" , MYRGB (245,255,250)}, + {"MintCream" , MYRGB (245,255,250)}, + {"azure" , MYRGB (240,255,255)}, + {"alice blue" , MYRGB (240,248,255)}, + {"AliceBlue" , MYRGB (240,248,255)}, + {"lavender" , MYRGB (230,230,250)}, + {"lavender blush" , MYRGB (255,240,245)}, + {"LavenderBlush" , MYRGB (255,240,245)}, + {"misty rose" , MYRGB (255,228,225)}, + {"MistyRose" , MYRGB (255,228,225)}, + {"white" , MYRGB (255,255,255)}, + {"black" , MYRGB ( 0, 0, 0)}, + {"dark slate gray" , MYRGB ( 47, 79, 79)}, + {"DarkSlateGray" , MYRGB ( 47, 79, 79)}, + {"dark slate grey" , MYRGB ( 47, 79, 79)}, + {"DarkSlateGrey" , MYRGB ( 47, 79, 79)}, + {"dim gray" , MYRGB (105,105,105)}, + {"DimGray" , MYRGB (105,105,105)}, + {"dim grey" , MYRGB (105,105,105)}, + {"DimGrey" , MYRGB (105,105,105)}, + {"slate gray" , MYRGB (112,128,144)}, + {"SlateGray" , MYRGB (112,128,144)}, + {"slate grey" , MYRGB (112,128,144)}, + {"SlateGrey" , MYRGB (112,128,144)}, + {"light slate gray" , MYRGB (119,136,153)}, + {"LightSlateGray" , MYRGB (119,136,153)}, + {"light slate grey" , MYRGB (119,136,153)}, + {"LightSlateGrey" , MYRGB (119,136,153)}, + {"gray" , MYRGB (190,190,190)}, + {"grey" , MYRGB (190,190,190)}, + {"light grey" , MYRGB (211,211,211)}, + {"LightGrey" , MYRGB (211,211,211)}, + {"light gray" , MYRGB (211,211,211)}, + {"LightGray" , MYRGB (211,211,211)}, + {"midnight blue" , MYRGB ( 25, 25,112)}, + {"MidnightBlue" , MYRGB ( 25, 25,112)}, + {"navy" , MYRGB ( 0, 0,128)}, + {"navy blue" , MYRGB ( 0, 0,128)}, + {"NavyBlue" , MYRGB ( 0, 0,128)}, + {"cornflower blue" , MYRGB (100,149,237)}, + {"CornflowerBlue" , MYRGB (100,149,237)}, + {"dark slate blue" , MYRGB ( 72, 61,139)}, + {"DarkSlateBlue" , MYRGB ( 72, 61,139)}, + {"slate blue" , MYRGB (106, 90,205)}, + {"SlateBlue" , MYRGB (106, 90,205)}, + {"medium slate blue" , MYRGB (123,104,238)}, + {"MediumSlateBlue" , MYRGB (123,104,238)}, + {"light slate blue" , MYRGB (132,112,255)}, + {"LightSlateBlue" , MYRGB (132,112,255)}, + {"medium blue" , MYRGB ( 0, 0,205)}, + {"MediumBlue" , MYRGB ( 0, 0,205)}, + {"royal blue" , MYRGB ( 65,105,225)}, + {"RoyalBlue" , MYRGB ( 65,105,225)}, + {"blue" , MYRGB ( 0, 0,255)}, + {"dodger blue" , MYRGB ( 30,144,255)}, + {"DodgerBlue" , MYRGB ( 30,144,255)}, + {"deep sky blue" , MYRGB ( 0,191,255)}, + {"DeepSkyBlue" , MYRGB ( 0,191,255)}, + {"sky blue" , MYRGB (135,206,235)}, + {"SkyBlue" , MYRGB (135,206,235)}, + {"light sky blue" , MYRGB (135,206,250)}, + {"LightSkyBlue" , MYRGB (135,206,250)}, + {"steel blue" , MYRGB ( 70,130,180)}, + {"SteelBlue" , MYRGB ( 70,130,180)}, + {"light steel blue" , MYRGB (176,196,222)}, + {"LightSteelBlue" , MYRGB (176,196,222)}, + {"light blue" , MYRGB (173,216,230)}, + {"LightBlue" , MYRGB (173,216,230)}, + {"powder blue" , MYRGB (176,224,230)}, + {"PowderBlue" , MYRGB (176,224,230)}, + {"pale turquoise" , MYRGB (175,238,238)}, + {"PaleTurquoise" , MYRGB (175,238,238)}, + {"dark turquoise" , MYRGB ( 0,206,209)}, + {"DarkTurquoise" , MYRGB ( 0,206,209)}, + {"medium turquoise" , MYRGB ( 72,209,204)}, + {"MediumTurquoise" , MYRGB ( 72,209,204)}, + {"turquoise" , MYRGB ( 64,224,208)}, + {"cyan" , MYRGB ( 0,255,255)}, + {"light cyan" , MYRGB (224,255,255)}, + {"LightCyan" , MYRGB (224,255,255)}, + {"cadet blue" , MYRGB ( 95,158,160)}, + {"CadetBlue" , MYRGB ( 95,158,160)}, + {"medium aquamarine" , MYRGB (102,205,170)}, + {"MediumAquamarine" , MYRGB (102,205,170)}, + {"aquamarine" , MYRGB (127,255,212)}, + {"dark green" , MYRGB ( 0,100, 0)}, + {"DarkGreen" , MYRGB ( 0,100, 0)}, + {"dark olive green" , MYRGB ( 85,107, 47)}, + {"DarkOliveGreen" , MYRGB ( 85,107, 47)}, + {"dark sea green" , MYRGB (143,188,143)}, + {"DarkSeaGreen" , MYRGB (143,188,143)}, + {"sea green" , MYRGB ( 46,139, 87)}, + {"SeaGreen" , MYRGB ( 46,139, 87)}, + {"medium sea green" , MYRGB ( 60,179,113)}, + {"MediumSeaGreen" , MYRGB ( 60,179,113)}, + {"light sea green" , MYRGB ( 32,178,170)}, + {"LightSeaGreen" , MYRGB ( 32,178,170)}, + {"pale green" , MYRGB (152,251,152)}, + {"PaleGreen" , MYRGB (152,251,152)}, + {"spring green" , MYRGB ( 0,255,127)}, + {"SpringGreen" , MYRGB ( 0,255,127)}, + {"lawn green" , MYRGB (124,252, 0)}, + {"LawnGreen" , MYRGB (124,252, 0)}, + {"green" , MYRGB ( 0,255, 0)}, + {"chartreuse" , MYRGB (127,255, 0)}, + {"medium spring green" , MYRGB ( 0,250,154)}, + {"MediumSpringGreen" , MYRGB ( 0,250,154)}, + {"green yellow" , MYRGB (173,255, 47)}, + {"GreenYellow" , MYRGB (173,255, 47)}, + {"lime green" , MYRGB ( 50,205, 50)}, + {"LimeGreen" , MYRGB ( 50,205, 50)}, + {"yellow green" , MYRGB (154,205, 50)}, + {"YellowGreen" , MYRGB (154,205, 50)}, + {"forest green" , MYRGB ( 34,139, 34)}, + {"ForestGreen" , MYRGB ( 34,139, 34)}, + {"olive drab" , MYRGB (107,142, 35)}, + {"OliveDrab" , MYRGB (107,142, 35)}, + {"dark khaki" , MYRGB (189,183,107)}, + {"DarkKhaki" , MYRGB (189,183,107)}, + {"khaki" , MYRGB (240,230,140)}, + {"pale goldenrod" , MYRGB (238,232,170)}, + {"PaleGoldenrod" , MYRGB (238,232,170)}, + {"light goldenrod yellow" , MYRGB (250,250,210)}, + {"LightGoldenrodYellow" , MYRGB (250,250,210)}, + {"light yellow" , MYRGB (255,255,224)}, + {"LightYellow" , MYRGB (255,255,224)}, + {"yellow" , MYRGB (255,255, 0)}, + {"gold" , MYRGB (255,215, 0)}, + {"light goldenrod" , MYRGB (238,221,130)}, + {"LightGoldenrod" , MYRGB (238,221,130)}, + {"goldenrod" , MYRGB (218,165, 32)}, + {"dark goldenrod" , MYRGB (184,134, 11)}, + {"DarkGoldenrod" , MYRGB (184,134, 11)}, + {"rosy brown" , MYRGB (188,143,143)}, + {"RosyBrown" , MYRGB (188,143,143)}, + {"indian red" , MYRGB (205, 92, 92)}, + {"IndianRed" , MYRGB (205, 92, 92)}, + {"saddle brown" , MYRGB (139, 69, 19)}, + {"SaddleBrown" , MYRGB (139, 69, 19)}, + {"sienna" , MYRGB (160, 82, 45)}, + {"peru" , MYRGB (205,133, 63)}, + {"burlywood" , MYRGB (222,184,135)}, + {"beige" , MYRGB (245,245,220)}, + {"wheat" , MYRGB (245,222,179)}, + {"sandy brown" , MYRGB (244,164, 96)}, + {"SandyBrown" , MYRGB (244,164, 96)}, + {"tan" , MYRGB (210,180,140)}, + {"chocolate" , MYRGB (210,105, 30)}, + {"firebrick" , MYRGB (178,34, 34)}, + {"brown" , MYRGB (165,42, 42)}, + {"dark salmon" , MYRGB (233,150,122)}, + {"DarkSalmon" , MYRGB (233,150,122)}, + {"salmon" , MYRGB (250,128,114)}, + {"light salmon" , MYRGB (255,160,122)}, + {"LightSalmon" , MYRGB (255,160,122)}, + {"orange" , MYRGB (255,165, 0)}, + {"dark orange" , MYRGB (255,140, 0)}, + {"DarkOrange" , MYRGB (255,140, 0)}, + {"coral" , MYRGB (255,127, 80)}, + {"light coral" , MYRGB (240,128,128)}, + {"LightCoral" , MYRGB (240,128,128)}, + {"tomato" , MYRGB (255, 99, 71)}, + {"orange red" , MYRGB (255, 69, 0)}, + {"OrangeRed" , MYRGB (255, 69, 0)}, + {"red" , MYRGB (255, 0, 0)}, + {"hot pink" , MYRGB (255,105,180)}, + {"HotPink" , MYRGB (255,105,180)}, + {"deep pink" , MYRGB (255, 20,147)}, + {"DeepPink" , MYRGB (255, 20,147)}, + {"pink" , MYRGB (255,192,203)}, + {"light pink" , MYRGB (255,182,193)}, + {"LightPink" , MYRGB (255,182,193)}, + {"pale violet red" , MYRGB (219,112,147)}, + {"PaleVioletRed" , MYRGB (219,112,147)}, + {"maroon" , MYRGB (176, 48, 96)}, + {"medium violet red" , MYRGB (199, 21,133)}, + {"MediumVioletRed" , MYRGB (199, 21,133)}, + {"violet red" , MYRGB (208, 32,144)}, + {"VioletRed" , MYRGB (208, 32,144)}, + {"magenta" , MYRGB (255, 0,255)}, + {"violet" , MYRGB (238,130,238)}, + {"plum" , MYRGB (221,160,221)}, + {"orchid" , MYRGB (218,112,214)}, + {"medium orchid" , MYRGB (186, 85,211)}, + {"MediumOrchid" , MYRGB (186, 85,211)}, + {"dark orchid" , MYRGB (153, 50,204)}, + {"DarkOrchid" , MYRGB (153, 50,204)}, + {"dark violet" , MYRGB (148, 0,211)}, + {"DarkViolet" , MYRGB (148, 0,211)}, + {"blue violet" , MYRGB (138, 43,226)}, + {"BlueViolet" , MYRGB (138, 43,226)}, + {"purple" , MYRGB (160, 32,240)}, + {"medium purple" , MYRGB (147,112,219)}, + {"MediumPurple" , MYRGB (147,112,219)}, + {"thistle" , MYRGB (216,191,216)}, + {"gray0" , MYRGB ( 0, 0, 0)}, + {"grey0" , MYRGB ( 0, 0, 0)}, + {"dark grey" , MYRGB (169,169,169)}, + {"DarkGrey" , MYRGB (169,169,169)}, + {"dark gray" , MYRGB (169,169,169)}, + {"DarkGray" , MYRGB (169,169,169)}, + {"dark blue" , MYRGB ( 0, 0,139)}, + {"DarkBlue" , MYRGB ( 0, 0,139)}, + {"dark cyan" , MYRGB ( 0,139,139)}, + {"DarkCyan" , MYRGB ( 0,139,139)}, + {"dark magenta" , MYRGB (139, 0,139)}, + {"DarkMagenta" , MYRGB (139, 0,139)}, + {"dark red" , MYRGB (139, 0, 0)}, + {"DarkRed" , MYRGB (139, 0, 0)}, + {"light green" , MYRGB (144,238,144)}, + {"LightGreen" , MYRGB (144,238,144)} +}; + +int win32_color_map_size = sizeof(win32_color_map)/sizeof(colormap_t); + +int check_386() +{ + OSVERSIONINFO os; + SYSTEM_INFO si; + int is_nt = 0; + os.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + if (GetVersionEx(&os) == 0) + Win32Error("GetVersionEx"); + is_nt = (os.dwPlatformId == VER_PLATFORM_WIN32_NT); + GetSystemInfo(&si); + if (is_nt) + return si.wProcessorLevel <= 3; + else + return si.dwProcessorType == PROCESSOR_INTEL_386; +} + +/* + swap count bytes starting at address p + */ + +void bswap_asm(void *p, unsigned count) +{ + __asm { + mov edx, DWORD PTR p; + mov ecx, count; + /* shl ecx, 2; */ + $L1: + mov eax, DWORD PTR [edx]; + bswap eax; + mov DWORD PTR [edx], eax; + inc edx; + inc edx; + inc edx; + inc edx; + loopnz $L1; + } +} + +void bswap_c(void *p, unsigned count) +{ + unsigned char *q; + unsigned char temp; + for (q = p; + q < (unsigned char *)p + 4*count; + q += 4) { + temp = *(q); *(q) = *(q+3); *(q+3) = temp; + temp = *(q+1); *(q+1) = *(q+2); *(q+2) = temp; + } +} + +FILE * +XsraSelFile(Widget toplevel, char *prompt, char *ok, char *cancel, + char *failed, char *init_path, char *mode, + int (*show_entry)(), char **name_return) +{ + OPENFILENAME ofn; /* common dialog box structure */ + char szFile[260]; /* buffer for filename */ + FILE *fret = NULL; + char currentDir[260]; + + *name_return = NULL; + GetCurrentDirectory(sizeof(currentDir), currentDir); + + szFile[0] = '\0'; + /* Initialize OPENFILENAME */ + ZeroMemory(&ofn, sizeof(OPENFILENAME)); + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = toplevel; + ofn.lpstrFile = szFile; + ofn.nMaxFile = sizeof(szFile); + ofn.lpstrFilter = "Dvi Files\0*.dvi\0All Files\0*.*\0\0"; + ofn.nFilterIndex = 1; + ofn.lpstrFileTitle = NULL; + ofn.nMaxFileTitle = 0; + ofn.lpstrInitialDir = NULL; /* FIXME : we should use init_path */ + ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; + + /* Display the Open dialog box. */ + + if (GetOpenFileName(&ofn)==TRUE) { + *name_return = xstrdup(szFile); + fret = fopen(*name_return, mode); + } + else { + SetCurrentDirectory(currentDir); + if (CommDlgExtendedError() != 0) + MessageBox(toplevel, failed, NULL, MB_OK|MB_ICONERROR||MB_APPLMODAL); + } + return fret; +} + +COLORREF string_to_colorref(char *p) +{ + COLORREF c; + float cyan, magenta, yellow, black, red, green, blue, gray; + + while ( *p <= ' ' ) p++ ; + if (memicmp(p, "cmyk", 4) == 0) { + sscanf(p+4, "%f %f %f %f", &cyan, &magenta, &yellow, &black); + cyan += black; + magenta += black; + yellow += black; + + red = (float)fabs(magenta-yellow); + blue = (float)fabs(magenta - cyan); + green = (float)fabs(yellow - cyan); + + c = MYRGB((unsigned)(red*255), (unsigned)(green*255), (unsigned)(blue*255)); + } + else if (memicmp(p, "gray", 4) == 0) { + sscanf(p+4, "%f", &gray); + c = MYRGB((unsigned)(255*gray), (unsigned)(255*gray), (unsigned)(255*gray)); + } + else if (memicmp(p, "rgb", 3) == 0) { + sscanf(p+3, "%f %f %f", &red, &green, &blue); + c = MYRGB((unsigned)(red*255), (unsigned)(green*255), (unsigned)(blue*255)); + } + else + c = x_to_win32_color(p); + + return c; +} + +#ifdef TRANSFORM +HRGN hClipRgn = NULL; +#endif + +/* + FP: 22/07/99 + Time to clean up this routine. + Should handle clipping automatically. + Should handle transformations. + Grey scaling for colors is handled by complex rop code. +*/ + +/* trial version : uses SetDIBits(), no temp DIB */ +void XPutImage(void *scrn, HWND w, HDC hdc, XImage *img, + int src_x, int src_y, + int dest_x, int dest_y, + unsigned int width, unsigned int height) +{ + RGBQUAD c1,c2; + COLORREF fc, bc; +#ifdef TRANSFORM + POINT lppt[4]; + HRGN hNewClipRgn = NULL; + XFORM xfrm, xfrm_temp; + extern BOOL bTransfInUse; +#endif + + if (!allowDrawingChars) { +#if 0 + fprintf(stderr, "Not allowing chars drawing\n"); +#endif + return; + } + +#if 0 + fprintf(stderr, "Back color is %-8x, mode is %s\n", + GetBkColor(hdc), + (GetBkMode(hdc) == OPAQUE ? "opaque" : + (GetBkMode(hdc) == TRANSPARENT ? "transparent" : "failed"))); +#endif + +#if _TRACE + if (isPrinting) { + fprintf(stderr, "fore = %x\n", fore_Pixel); + fprintf(stderr, "src_x = %d, src_y = %d, dest_x = %d, dest_y = %d\n", + src_x, src_y, dest_x, dest_y); + } +#endif + + if (!img->width || !img->height) { + /* Nothing to do ! */ + return; + } + +#ifdef WIN32 + if (img->endian_permuted !=NULL && *(img->endian_permuted) == 0) { + bswap((BMUNIT*)img->data, + (img->bytes_per_line * height)/BMBYTES); + *(img->endian_permuted) = 1; + } +#endif + +#if TRANSFORM + if (resource.use_xform && bTransfInUse) { + RECT rTemp; + BOOL bClipped1, bClipped2; + extern XFORM current_transf; + rTemp.left = dest_x; + rTemp.top = dest_y; + rTemp.right = dest_x + width; + rTemp.bottom = dest_y + height; + if (SetWorldTransform(hdc, ¤t_transf) == 0) + Win32Error("XPutImage/SetWorldTransform/current"); + + lppt[0].x = dest_x; + lppt[0].y = dest_y; + lppt[1].x = dest_x + width; + lppt[1].y = dest_y; + lppt[2].x = dest_x + width; + lppt[2].y = dest_y + height; + lppt[3].x = dest_x; + lppt[3].y = dest_y + height; + LPtoDP(hdc, lppt, 4); + if ((hNewClipRgn = CreatePolygonRgn(lppt, 4, ALTERNATE)) == NULL) { + Win32Error("XPutImage/CreatePolygonRgn"); + } + if (SelectClipRgn(hdc, hNewClipRgn) == ERROR) { + Win32Error("XPutImage/SelectClipRgn"); + } + bClipped2 = RectVisible(hdc, &rTemp); + if (!bClipped2) + goto nothing; + } + else +#endif + { + RECT rTemp; + rTemp.left = dest_x; + rTemp.top = dest_y; + rTemp.right = dest_x + width; + rTemp.bottom = dest_y + height; + if (!RectVisible(hdc, &rTemp)) + goto nothing; + } + +#if _TRACE + fprintf(stderr, "XPutImage at (%d %d) of (%d, %d, w=%d x h=%d)\n", + dest_x, dest_y, src_x, src_y, width, height); +#endif + switch (img->depth) { + case 1: + bmi1.bmiHeader.biWidth = img->width; + bmi1.bmiHeader.biHeight = (img->height == 1 ? img->height : -img->height); + bmi1.bmiHeader.biSizeImage = + WIDTHBYTES((DWORD)img->width * img->depth) + * (img->height > 0 ? img->height : -img->height); +#if _TRACE + fprintf(stderr, "XPutImage at (%d %d) of (%d, %d, w=%d x h=%d)\n", + dest_x, dest_y, src_x, src_y, width, height); + fprintf(stderr, "bmiColors: 0 = %x, 1 = %x\n", + bmi1.bmiColors[0], bmi1.bmiColors[1]); +#endif + + c1 = bmi1.bmiColors[0]; + c2 = bmi1.bmiColors[1]; + + if (isPrinting && !(bColorPage || psToDisplay)) { + HBRUSH oldBrush; + + bmi1.bmiColors[0] = QuadWhite; + bmi1.bmiColors[1] = QuadBlack; + + oldBrush = SelectObject(hdc, foreBrush); + + if (StretchDIBits(hdc, dest_x, dest_y, width, height, + src_x, src_y, width, height, + img->data, (LPBITMAPINFO)&bmi1, + DIB_RGB_COLORS, SRCAND /* 0x00B8074A 0x00E61CE8 */ ) == GDI_ERROR) + Win32Error("XPutImage/SetDIBits"); + bmi1.bmiColors[0] = c1; + bmi1.bmiColors[1] = c2; + + SelectObject(hdc, oldBrush); + } +#if 1 + else { + HBRUSH oldBrush; + init_pix( MYRGB(255,255,255), MYRGB(0,0,0)); + oldBrush = SelectObject(hdc, foreBrush); + if (StretchDIBits(hdc, dest_x, dest_y, width, height, + src_x, src_y, width, height, + img->data, (LPBITMAPINFO)&bmi1, DIB_RGB_COLORS, 0x00B8074A ) == GDI_ERROR) + Win32Error("XPutImage/SetDIBits"); + SelectObject(hdc, oldBrush); + } +#else + else { + /* this is the 2 passes solution, but does not seem to work ok + on the printer dc */ + bmi1.bmiColors[0] = QuadWhite; + bmi1.bmiColors[1] = QuadBlack; + + if (StretchDIBits(hdc, dest_x, dest_y, width, height, + src_x, src_y, width, height, + img->data, (LPBITMAPINFO)&bmi1, DIB_RGB_COLORS, SRCAND ) == GDI_ERROR) + Win32Error("XPutImage/SetDIBits"); + + bmi1.bmiColors[0] = QuadBlack; + bmi1.bmiColors[1] = Color2Quad(fore_Pixel); + + if (StretchDIBits(hdc, dest_x, dest_y, width, height, + src_x, src_y, width, height, + img->data, (LPBITMAPINFO)&bmi1, DIB_RGB_COLORS, SRCPAINT ) == GDI_ERROR) + Win32Error("XPutImage/SetDIBits"); + bmi1.bmiColors[0] = c1; + bmi1.bmiColors[1] = Color2Quad(fore_Pixel); + } +#endif + break; + + case 4: { + POINT pt; + RECT rcClip, rcGlyph, rcDest; + + bmi4.bmiHeader.biWidth = img->width; + bmi4.bmiHeader.biHeight = (img->height == 1 ? img->height : -img->height); + bmi4.bmiHeader.biSizeImage = + WIDTHBYTES((DWORD)img->width * img->depth) + * (img->height > 0 ? img->height : -img->height); + +#if 0 + fprintf(stderr, "XPutImage @ (%d %d) w %d h %d fore %-8x back %-8x\n", + dest_x, dest_y, width, height, fore_Pixel, back_Pixel); +#endif + +#if 0 + fprintf(stderr, "This is%s a color page!\n", bColorPage ? "" : " not"); +#endif + /* If this is a monochrome page, no antialiasing */ + if (!bColorPage) { + /* Don't bother with color antialiasing in this case ! */ + fc = fore_Pixel; + bc = back_Pixel; + init_pix(bc, fc); +#if 0 + { + int pixel; + for (pixel = 0; pixel < 16; pixel++) + fprintf(stderr, "color %d = %-8x %-8x %-8x\n", pixel, + pal_rgb[pixel], pal_bw[pixel], pal_mask[pixel]); + } +#endif + if (StretchDIBits(hdc, dest_x, dest_y, width, height, + src_x, src_y, width, height, + img->data, (LPBITMAPINFO)&bmi4, DIB_RGB_COLORS, SRCAND ) == GDI_ERROR) { + Win32Error("XPutImage/SetDIBits"); + } + } + else { + { + HBRUSH oldBrush; + init_pix( MYRGB(255,255,255), MYRGB(0,0,0)); + oldBrush = SelectObject(hdc, foreBrush); + if (StretchDIBits(hdc, dest_x, dest_y, width, height, + src_x, src_y, width, height, + img->data, (LPBITMAPINFO)&bmi4, DIB_RGB_COLORS, 0x00B8074A ) == GDI_ERROR) + Win32Error("XPutImage/SetDIBits"); + SelectObject(hdc, oldBrush); + } + + } + } + + break; + + case 8: + bmi8.bmiHeader.biWidth = img->width; + bmi8.bmiHeader.biHeight = (img->height == 1 ? img->height : -img->height); + bmi8.bmiHeader.biSizeImage = + WIDTHBYTES((DWORD)img->width * img->depth) + * (img->height > 0 ? img->height : -img->height); + + if (StretchDIBits(hdc, dest_x, dest_y, width, height, + src_x, src_y, width, height, + img->data, (LPBITMAPINFO)&bmi8, DIB_RGB_COLORS, SRCPAINT ) == GDI_ERROR) + Win32Error("XPutImage/SetDIBits"); + break; + + default: + fprintf(stderr, "XPutImage: image depth is %d, non implemented.\n", + img->depth); + } + nothing: +#if TRANSFORM + if (resource.use_xform && bTransfInUse) { + SelectClipRgn(hdc, NULL); + if (hNewClipRgn) DeleteObject(hNewClipRgn); + ModifyWorldTransform(hdc, &xfrm_temp, MWT_IDENTITY); + } +#endif +} + +/* Trial version : assumes 16 colors DIBS, computes the nibble to be + changed */ +void XPutPixel(XImage *img, int x, int y, COLORREF c) +{ + unsigned pixel; + unsigned char *pos; + if (x < 0 || x > img->width || y < 0 || y > img->height) { + fprintf(stderr, + "XPutPixel error : x = %d y = %d width = %d height = %d\n", + x, y, img->width, img->height); + } else { + switch (img->depth) { + case 4: +#if 0 + for (pixel = 0; pixel < 16; pixel++) + fprintf(stderr, "color %d = %-8x\n", pixel, palette[pixel]); + fprintf(stderr, "looked for %-8x\n", c); +#endif + for (pixel = 0; (palette[pixel] != c) && (pixel < 16); pixel++); + if (pixel == 16) + Win32Error("XPutPixel/Color not found"); +#if 0 + else + fprintf(stderr, "Found pixel = %d color = %-8x\n", pixel, palette[pixel]); +#endif + pos = (unsigned char *)img->data + y * img->bytes_per_line + x / 2; +#if 0 + fprintf(stderr, "img w = %d h = %d b/l = %d data = %x\nx = %d y = %d pos = %x\n", img->width , img->height, img->bytes_per_line, img->data, x, y, pos); +#endif + if (x % 2 == 0) { + /* msb */ + *pos = (*pos & 0x0F) | ((pixel & 0x0F) << 4); + } + else { + /* lsb */ + *pos = (*pos & 0xF0) | (pixel & 0x0F); + } + break; + default: + Win32Error("XPutPixel/not a 16 colors DIB"); + } + } +} + +XImage* XCreateImage(void* d, HDC hdc, unsigned int depth, + int format, int offset, char* data, + unsigned int width, unsigned int height, + int bitmap_pad, int bytes_per_line) +{ + XImage *img; + img = (XImage *)xmalloc(sizeof(XImage)); + img->width = width; + img->height = height; + img->depth = depth; + if (! bytes_per_line) { + img->bytes_per_line = + WIDTHBYTES((DWORD)img->width * img->depth) ; + } + else + img->bytes_per_line = bytes_per_line; + img->data = NULL; + return img; +} + +void XClearWindow(void *disp, HWND win) +{ + if (! isPrinting) { + if (debug & DBG_EVENT) { + fprintf(stderr, "Clearing window %-8x\n", win); + } + SendMessage(win, WM_ERASEBKGND, (WPARAM)GetDC(win), 0); + UpdateWindow(win); + } +} + +void XClearArea(void *disp, HWND win, int x, int y, int width, int height, + int b) +{ + HDC maneGC = GetDC(win); + RECT r; + + r.left = x; r.top = y; + r.right = x + width; + r.bottom = y + height; + + /* Blank the bitmap */ +#if 0 + if (!PatBlt(maneGC, x, y, x+width, y+height, PATCOPY)) + Win32Error("XClearArea: PatBlt"); +#else + r.right++; + r.bottom++; + if (!FillRect(maneGC, &r, backBrush)) + Win32Error("XClearArea: PatBlt"); +#endif + ReleaseDC(win, maneGC); +} + +void XFlush(void *disp) +{ + GdiFlush(); +} + +void XDestroyImage(XImage *img) +{ + /* An XImage is a DIB basically */ + if (img) { + if (img->data) free(img->data); + free (img); + } +} + +void XDrawLine(void *d, HWND hwnd, HDC hdc, int x1, int y1, int x2, int y2) +{ + static int xprev = 0, yprev = 0; + if (xprev != x1 || yprev != y1) { +#if 0 + fprintf(stderr, "Moving to (%d, %d)\n", x1, y1); +#endif + MoveToEx(hdc, x1, y1, NULL); + } +#if 0 + fprintf(stderr, "Drawing to (%d, %d)\n", x2, y2); +#endif + LineTo(hdc, x2, y2); + xprev = x2; + yprev = y2; +} + +void XDrawPoint(void *w, HWND hwnd, HDC hdc, int x1, int y1) +{ +#if 0 + fprintf(stderr, "Drawing point at (%d %d)\n", x1, y1); +#endif + if (MoveToEx(hdc, x1, y1, NULL) == 0) { + Win32Error("XDrawPoint/MoveToEx failed!"); + } + if (LineTo(hdc, x1, y1) == 0) { + Win32Error("XDrawPoint/LineTo failed!"); + } +} + +void XFillRectangle(void *d, HWND w, HDC hdc, int x, int y, + unsigned int width, unsigned int height) +{ + RECT r; + /* Rectangle(hdc, x, y, x+width, y+height); */ + r.left = x; r.top = y; + r.right = x + width; + r.bottom = y + height; +#if 0 + fprintf(stderr, "FillRect (%d %d) - (%d %d) hdc %x color %-8x\n", + r.left, r.top, r.right, r.bottom, hdc, fore_Pixel); +#endif + FillRect(hdc, &r, foreBrush); +} + + +HBITMAP CreateDIB(HDC hdc, int x, int y, int bitCount, + BITMAPINFO_256 *header, void **data) +{ + int i; + HBITMAP hbm; + BITMAPINFO_256 bmi; + LPBITMAPINFO lpbmi; + + LPVOID ppvBits; + + lpbmi = (LPBITMAPINFO)(header ? header : &bmi); + + lpbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); + lpbmi->bmiHeader.biPlanes = 1; + lpbmi->bmiHeader.biBitCount = bitCount; + lpbmi->bmiHeader.biCompression = BI_RGB; + lpbmi->bmiHeader.biWidth = x; + lpbmi->bmiHeader.biHeight = y; + lpbmi->bmiHeader.biSizeImage = + WIDTHBYTES((DWORD)x * bitCount) * (y > 0 ? y : -y); + if (lpbmi->bmiHeader.biCompression != BI_RGB) + lpbmi->bmiHeader.biSizeImage = (lpbmi->bmiHeader.biSizeImage * 3) / 2; + lpbmi->bmiHeader.biXPelsPerMeter = 0; + lpbmi->bmiHeader.biYPelsPerMeter = 0; + lpbmi->bmiHeader.biClrUsed = 0; + lpbmi->bmiHeader.biClrImportant = 0; + + /* SelectPalette(hdc,hpal,FALSE); */ + if (bitCount == 1) { + lpbmi->bmiColors[1] = Color2Quad(back_Pixel); + lpbmi->bmiColors[0] = Color2Quad(fore_Pixel); + } +#ifdef GREY + else if (bitCount <= 8) { + for (i = 0; i < (1 << bitCount); i++) { + lpbmi->bmiColors[i] = Color2Quad(palette[i]); + } + } +#endif + + hbm = CreateDIBSection(hdc, lpbmi, DIB_RGB_COLORS, &ppvBits, NULL, 0); + /* fprintf(stderr, "Nb DIBS = %d\n", ++nbDIBS); */ + if (hbm == NULL) + Win32Error("CreateDIB/CreateDIBSection"); + if (data) + *data = ppvBits; + return hbm; +} + +/* These ones are taken from NTEmacs */ + +/* + * XParseGeometry parses strings of the form + * "=<width>x<height>{+-}<xoffset>{+-}<yoffset>", where + * width, height, xoffset, and yoffset are unsigned integers. + * Example: "=80x24+300-49" + * The equal sign is optional. + * It returns a bitmask that indicates which of the four values + * were actually found in the string. For each value found, + * the corresponding argument is updated; for each value + * not found, the corresponding argument is left unchanged. + */ + +static int +read_integer (char *s, char **NextString) +{ + register int Result = 0; + int Sign = 1; + + if (*s == '+') + s++; + else if (*s == '-') + { + s++; + Sign = -1; + } + for (; (*s >= '0') && (*s <= '9'); s++) + { + Result = (Result * 10) + (*s - '0'); + } + *NextString = s; + if (Sign >= 0) + return (Result); + else + return (-Result); +} + +int +XParseGeometry (char *s, int *x, int *y, + unsigned int *width, unsigned int *height) +{ + int mask = NoValue; + register char *strind; + unsigned int tempWidth, tempHeight; + int tempX, tempY; + char *nextCharacter; + + if ((s == NULL) || (*s == '\0')) return (mask); + if (*s == '=') + s++; /* ignore possible '=' at beg of geometry spec */ + + strind = (char *)s; + if (*strind != '+' && *strind != '-' && *strind != 'x') + { + tempWidth = read_integer (strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + mask |= WidthValue; + } + + if (*strind == 'x' || *strind == 'X') + { + strind++; + tempHeight = read_integer (strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + mask |= HeightValue; + } + + if ((*strind == '+') || (*strind == '-')) + { + if (*strind == '-') + { + strind++; + tempX = -read_integer (strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + mask |= XNegative; + + } + else + { + strind++; + tempX = read_integer (strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + } + mask |= XValue; + if ((*strind == '+') || (*strind == '-')) + { + if (*strind == '-') + { + strind++; + tempY = -read_integer (strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + mask |= YNegative; + + } + else + { + strind++; + tempY = read_integer (strind, &nextCharacter); + if (strind == nextCharacter) + return (0); + strind = nextCharacter; + } + mask |= YValue; + } + } + + /* If strind isn't at the end of the string the it's an invalid + geometry specification. */ + + if (*strind != '\0') return (0); + + if (mask & XValue) + *x = tempX; + if (mask & YValue) + *y = tempY; + if (mask & WidthValue) + *width = tempWidth; + if (mask & HeightValue) + *height = tempHeight; + return (mask); +} + +COLORREF +x_to_win32_color (const char *colorname) +{ + colormap_t *tail; + int i; + COLORREF ret; + + if (colorname[0] == '#') + { + /* Could be an old-style RGB Device specification. */ + char *color; + int size; + color = colorname + 1; + + size = strlen(color); + if (size == 3 || size == 6 || size == 9 || size == 12) + { + UINT colorval; + int i, pos; + pos = 0; + size /= 3; + colorval = 0; + + for (i = 0; i < 3; i++) + { + char *end; + char t; + unsigned long value; + + /* The check for 'x' in the following conditional takes into + account the fact that strtol allows a "0x" in front of + our numbers, and we don't. */ + if (!isxdigit(color[0]) || color[1] == 'x') + break; + t = color[size]; + color[size] = '\0'; + value = strtoul(color, &end, 16); + color[size] = t; + if (errno == ERANGE || end - color != size) + break; + switch (size) + { + case 1: + value = value * 0x10; + break; + case 2: + break; + case 3: + value /= 0x10; + break; + case 4: + value /= 0x100; + break; + } + colorval |= (value << pos); + pos += 0x8; + if (i == 2) + { + return MYADJUSTRGB(colorval); + } + color = end; + } + } + } + else if (strnicmp(colorname, "rgb:", 4) == 0) + { + char *color; + UINT colorval; + int i, pos; + pos = 0; + + colorval = 0; + color = colorname + 4; + for (i = 0; i < 3; i++) + { + char *end; + unsigned long value; + + /* The check for 'x' in the following conditional takes into + account the fact that strtol allows a "0x" in front of + our numbers, and we don't. */ + if (!isxdigit(color[0]) || color[1] == 'x') + break; + value = strtoul(color, &end, 16); + if (errno == ERANGE) + break; + switch (end - color) + { + case 1: + value = value * 0x10 + value; + break; + case 2: + break; + case 3: + value /= 0x10; + break; + case 4: + value /= 0x100; + break; + default: + value = ULONG_MAX; + } + if (value == ULONG_MAX) + break; + colorval |= (value << pos); + pos += 0x8; + if (i == 2) + { + if (*end != '\0') + break; + return MYADJUSTRGB(colorval); + } + if (*end != '/') + break; + color = end + 1; + } + } + else if (strnicmp(colorname, "rgbi:", 5) == 0) + { + /* This is an RGB Intensity specification. */ + char *color; + UINT colorval; + int i, pos; + pos = 0; + + colorval = 0; + color = colorname + 5; + for (i = 0; i < 3; i++) + { + char *end; + double value; + UINT val; + + value = strtod(color, &end); + if (errno == ERANGE) + break; + if (value < 0.0 || value > 1.0) + break; + val = (UINT)(0x100 * value); + /* We used 0x100 instead of 0xFF to give an continuous + range between 0.0 and 1.0 inclusive. The next statement + fixes the 1.0 case. */ + if (val == 0x100) + val = 0xFF; + colorval |= (val << pos); + pos += 0x8; + if (i == 2) + { + if (*end != '\0') + break; + return MYADJUSTRGB(colorval); + } + if (*end != '/') + break; + color = end + 1; + } + } + /* I am not going to attempt to handle any of the CIE color schemes + or TekHVC, since I don't know the algorithms for conversion to + RGB. */ + + for (tail = win32_color_map, i = 0; + i < sizeof(win32_color_map)/sizeof(colormap_t); + tail++, i++) + { + char *tem = tail->name; + + if (lstrcmpi (tem, colorname) == 0) + { + ret = tail->colorref; + break; + } + } + return ret; +} + diff --git a/Build/source/texk/windvi/winxutl.h b/Build/source/texk/windvi/winxutl.h new file mode 100644 index 00000000000..83f39a8f1a8 --- /dev/null +++ b/Build/source/texk/windvi/winxutl.h @@ -0,0 +1,258 @@ +unsigned int rop3code[256] = { + /* 00 */ 0x00000042, /* 0 BLACKNESS */ + /* 01 */ 0x00010289, /* DPSoon */ + /* 02 */ 0x00020C89, /* DPSona */ + /* 03 */ 0x000300AA, /* PSon */ + /* 04 */ 0x00040C88, /* SDPona */ + /* 05 */ 0x000500A9, /* DPon */ + /* 06 */ 0x00060865, /* PDSxnon */ + /* 07 */ 0x000702C5, /* PDSaon */ + /* 08 */ 0x00080F08, /* SDPnaa */ + /* 09 */ 0x00090245, /* PDSxon */ + /* 0A */ 0x000A0329, /* DPna */ + /* 0B */ 0x000B0B2A, /* PSDnaon */ + /* 0C */ 0x000C0324, /* SPna */ + /* 0D */ 0x000D0B25, /* PDSnaon */ + /* 0E */ 0x000E08A5, /* PDSonon */ + /* 0F */ 0x000F0001, /* Pn */ + /* 10 */ 0x00100C85, /* PDSona */ + /* 11 */ 0x001100A6, /* DSon NOTSRCERASE */ + /* 12 */ 0x00120868, /* SDPxnon */ + /* 13 */ 0x001302C8, /* SDPaon */ + /* 14 */ 0x00140869, /* DPSxnon */ + /* 15 */ 0x001502C9, /* DPSaon */ + /* 16 */ 0x00165CCA, /* PSDPSanaxx */ + /* 17 */ 0x00171D54, /* SSPxDSxaxn */ + /* 18 */ 0x00180D59, /* SPxPDxa */ + /* 19 */ 0x00191CC8, /* SDPSanaxn */ + /* 1A */ 0x001A06C5, /* PDSPaox */ + /* 1B */ 0x001B0768, /* SDPSxaxn */ + /* 1C */ 0x001C06CA, /* PSDPaox */ + /* 1D */ 0x001D0766, /* DSPDxaxn */ + /* 1E */ 0x001E01A5, /* PDSox */ + /* 1F */ 0x001F0385, /* PDSoan */ + /* 20 */ 0x00200F09, /* DPSnaa */ + /* 21 */ 0x00210248, /* SDPxon */ + /* 22 */ 0x00220326, /* DSna */ + /* 23 */ 0x00230B24, /* SPDnaon */ + /* 24 */ 0x00240D55, /* SPxDSxa */ + /* 25 */ 0x00251CC5, /* PDSPanaxn */ + /* 26 */ 0x002606C8, /* SDPSaox */ + /* 27 */ 0x00271868, /* SDPSxnox */ + /* 28 */ 0x00280369, /* DPSxa */ + /* 29 */ 0x002916CA, /* PSDPSaoxxn */ + /* 2A */ 0x002A0CC9, /* DPSana */ + /* 2B */ 0x002B1D58, /* SSPxPDxaxn */ + /* 2C */ 0x002C0784, /* SPDSoax */ + /* 2D */ 0x002D060A, /* PSDnox */ + /* 2E */ 0x002E064A, /* PSDPxox */ + /* 2F */ 0x002F0E2A, /* PSDnoan */ + /* 30 */ 0x0030032A, /* PSna */ + /* 31 */ 0x00310B28, /* SDPnaon */ + /* 32 */ 0x00320688, /* SDPSoox */ + /* 33 */ 0x00330008, /* Sn NOTSRCCOPY */ + /* 34 */ 0x003406C4, /* SPDSaox */ + /* 35 */ 0x00351864, /* SPDSxnox */ + /* 36 */ 0x003601A8, /* SDPox */ + /* 37 */ 0x00370388, /* SDPoan */ + /* 38 */ 0x0038078A, /* PSDPoax */ + /* 39 */ 0x00390604, /* SPDnox */ + /* 3A */ 0x003A0644, /* SPDSxox */ + /* 3B */ 0x003B0E24, /* SPDnoan */ + /* 3C */ 0x003C004A, /* PSx */ + /* 3D */ 0x003D18A4, /* SPDSonox */ + /* 3E */ 0x003E1B24, /* SPDSnaox */ + /* 3F */ 0x003F00EA, /* PSan */ + /* 40 */ 0x00400F0A, /* PSDnaa */ + /* 41 */ 0x00410249, /* DPSxon */ + /* 42 */ 0x00420D5D, /* SDxPDxa */ + /* 43 */ 0x00431CC4, /* SPDSanaxn */ + /* 44 */ 0x00440328, /* SDna SRCERASE */ + /* 45 */ 0x00450B29, /* DPSnaon */ + /* 46 */ 0x004606C6, /* DSPDaox */ + /* 47 */ 0x0047076A, /* PSDPxaxn */ + /* 48 */ 0x00480368, /* SDPxa */ + /* 49 */ 0x004916C5, /* PDSPDaoxxn */ + /* 4A */ 0x004A0789, /* DPSDoax */ + /* 4B */ 0x004B0605, /* PDSnox */ + /* 4C */ 0x004C0CC8, /* SDPana */ + /* 4D */ 0x004D1954, /* SSPxDSxoxn */ + /* 4E */ 0x004E0645, /* PDSPxox */ + /* 4F */ 0x004F0E25, /* PDSnoan */ + /* 50 */ 0x00500325, /* PDna */ + /* 51 */ 0x00510B26, /* DSPnaon */ + /* 52 */ 0x005206C9, /* DPSDaox */ + /* 53 */ 0x00530764, /* SPDSxaxn */ + /* 54 */ 0x005408A9, /* DPSonon */ + /* 55 */ 0x00550009, /* Dn DSTINVERT */ + /* 56 */ 0x005601A9, /* DPSox */ + /* 57 */ 0x00570389, /* DPSoan */ + /* 58 */ 0x00580785, /* PDSPoax */ + /* 59 */ 0x00590609, /* DPSnox */ + /* 5A */ 0x005A0049, /* DPx PATINVERT */ + /* 5B */ 0x005B18A9, /* DPSDonox */ + /* 5C */ 0x005C0649, /* DPSDxox */ + /* 5D */ 0x005D0E29, /* DPSnoan */ + /* 5E */ 0x005E1B29, /* DPSDnaox */ + /* 5F */ 0x005F00E9, /* DPan */ + /* 60 */ 0x00600365, /* PDSxa */ + /* 61 */ 0x006116C6, /* DSPDSaoxxn */ + /* 62 */ 0x00620786, /* DSPDoax */ + /* 63 */ 0x00630608, /* SDPnox */ + /* 64 */ 0x00640788, /* SDPSoax */ + /* 65 */ 0x00650606, /* DSPnox */ + /* 66 */ 0x00660046, /* DSx SRCINVERT */ + /* 67 */ 0x006718A8, /* SDPSonox */ + /* 68 */ 0x006858A6, /* DSPDSonoxxn */ + /* 69 */ 0x00690145, /* PDSxxn */ + /* 6A */ 0x006A01E9, /* DPSax */ + /* 6B */ 0x006B178A, /* PSDPSoaxxn */ + /* 6C */ 0x006C01E8, /* SDPax */ + /* 6D */ 0x006D1785, /* PDSPDoaxxn */ + /* 6E */ 0x006E1E28, /* SDPSnoax */ + /* 6F */ 0x006F0C65, /* PDSxnan */ + /* 70 */ 0x00700CC5, /* PDSana */ + /* 71 */ 0x00711D5C, /* SSDxPDxaxn */ + /* 72 */ 0x00720648, /* SDPSxox */ + /* 73 */ 0x00730E28, /* SDPnoan */ + /* 74 */ 0x00740646, /* DSPDxox */ + /* 75 */ 0x00750E26, /* DSPnoan */ + /* 76 */ 0x00761B28, /* SDPSnaox */ + /* 77 */ 0x007700E6, /* DSan */ + /* 78 */ 0x007801E5, /* PDSax */ + /* 79 */ 0x00791786, /* DSPDSoaxxn */ + /* 7A */ 0x007A1E29, /* DPSDnoax */ + /* 7B */ 0x007B0C68, /* SDPxnan */ + /* 7C */ 0x007C1E24, /* SPDSnoax */ + /* 7D */ 0x007D0C69, /* DPSxnan */ + /* 7E */ 0x007E0955, /* SPxDSxo */ + /* 7F */ 0x007F03C9, /* DPSaan */ + /* 80 */ 0x008003E9, /* DPSaa */ + /* 81 */ 0x00810975, /* SPxDSxon */ + /* 82 */ 0x00820C49, /* DPSxna */ + /* 83 */ 0x00831E04, /* SPDSnoaxn */ + /* 84 */ 0x00840C48, /* SDPxna */ + /* 85 */ 0x00851E05, /* PDSPnoaxn */ + /* 86 */ 0x008617A6, /* DSPDSoaxx */ + /* 87 */ 0x008701C5, /* PDSaxn */ + /* 88 */ 0x008800C6, /* DSa SRCAND */ + /* 89 */ 0x00891B08, /* SDPSnaoxn */ + /* 8A */ 0x008A0E06, /* DSPnoa */ + /* 8B */ 0x008B0666, /* DSPDxoxn */ + /* 8C */ 0x008C0E08, /* SDPnoa */ + /* 8D */ 0x008D0668, /* SDPSxoxn */ + /* 8E */ 0x008E1D7C, /* SSDxPDxax */ + /* 8F */ 0x008F0CE5, /* PDSanan */ + /* 90 */ 0x00900C45, /* PDSxna */ + /* 91 */ 0x00911E08, /* SDPSnoaxn */ + /* 92 */ 0x009217A9, /* DPSDPoaxx */ + /* 93 */ 0x009301C4, /* SPDaxn */ + /* 94 */ 0x009417AA, /* PSDPSoaxx */ + /* 95 */ 0x009501C9, /* DPSaxn */ + /* 96 */ 0x00960169, /* DPSxx */ + /* 97 */ 0x0097588A, /* PSDPSonoxx */ + /* 98 */ 0x00981888, /* SDPSonoxn */ + /* 99 */ 0x00990066, /* DSxn */ + /* 9A */ 0x009A0709, /* DPSnax */ + /* 9B */ 0x009B07A8, /* SDPSoaxn */ + /* 9C */ 0x009C0704, /* SPDnax */ + /* 9D */ 0x009D07A6, /* DSPDoaxn */ + /* 9E */ 0x009E16E6, /* DSPDSaoxx */ + /* 9F */ 0x009F0345, /* PDSxan */ + /* A0 */ 0x00A000C9, /* DPa */ + /* A1 */ 0x00A11B05, /* PDSPnaoxn */ + /* A2 */ 0x00A20E09, /* DPSnoa */ + /* A3 */ 0x00A30669, /* DPSDxoxn */ + /* A4 */ 0x00A41885, /* PDSPonoxn */ + /* A5 */ 0x00A50065, /* PDxn */ + /* A6 */ 0x00A60706, /* DSPnax */ + /* A7 */ 0x00A707A5, /* PDSPoaxn */ + /* A8 */ 0x00A803A9, /* DPSoa */ + /* A9 */ 0x00A90189, /* DPSoxn */ + /* AA */ 0x00AA0029, /* D */ + /* AB */ 0x00AB0889, /* DPSono */ + /* AC */ 0x00AC0744, /* SPDSxax */ + /* AD */ 0x00AD06E9, /* DPSDaoxn */ + /* AE */ 0x00AE0B06, /* DSPnao */ + /* AF */ 0x00AF0229, /* DPno */ + /* B0 */ 0x00B00E05, /* PDSnoa */ + /* B1 */ 0x00B10665, /* PDSPxoxn */ + /* B2 */ 0x00B21974, /* SSPxDSxox */ + /* B3 */ 0x00B30CE8, /* SDPanan */ + /* B4 */ 0x00B4070A, /* PSDnax */ + /* B5 */ 0x00B507A9, /* DPSDoaxn */ + /* B6 */ 0x00B616E9, /* DPSDPaoxx */ + /* B7 */ 0x00B70348, /* SDPxan */ + /* B8 */ 0x00B8074A, /* PSDPxax */ + /* B9 */ 0x00B906E6, /* DSPDaoxn */ + /* BA */ 0x00BA0B09, /* DPSnao */ + /* BB */ 0x00BB0226, /* DSno MERGEPAINT */ + /* BC */ 0x00BC1CE4, /* SPDSanax */ + /* BD */ 0x00BD0D7D, /* SDxPDxan */ + /* BE */ 0x00BE0269, /* DPSxo */ + /* BF */ 0x00BF08C9, /* DPSano */ + /* C0 */ 0x00C000CA, /* PSa MERGECOPY */ + /* C1 */ 0x00C11B04, /* SPDSnaoxn */ + /* C2 */ 0x00C21884, /* SPDSonoxn */ + /* C3 */ 0x00C3006A, /* PSxn */ + /* C4 */ 0x00C40E04, /* SPDnoa */ + /* C5 */ 0x00C50664, /* SPDSxoxn */ + /* C6 */ 0x00C60708, /* SDPnax */ + /* C7 */ 0x00C707AA, /* PSDPoaxn */ + /* C8 */ 0x00C803A8, /* SDPoa */ + /* C9 */ 0x00C90184, /* SPDoxn */ + /* CA */ 0x00CA0749, /* DPSDxax */ + /* CB */ 0x00CB06E4, /* SPDSaoxn */ + /* CC */ 0x00CC0020, /* S SRCCOPY */ + /* CD */ 0x00CD0888, /* SDPono */ + /* CE */ 0x00CE0B08, /* SDPnao */ + /* CF */ 0x00CF0224, /* SPno */ + /* D0 */ 0x00D00E0A, /* PSDnoa */ + /* D1 */ 0x00D1066A, /* PSDPxoxn */ + /* D2 */ 0x00D20705, /* PDSnax */ + /* D3 */ 0x00D307A4, /* SPDSoaxn */ + /* D4 */ 0x00D41D78, /* SSPxPDxax */ + /* D5 */ 0x00D50CE9, /* DPSanan */ + /* D6 */ 0x00D616EA, /* PSDPSaoxx */ + /* D7 */ 0x00D70349, /* DPSxan */ + /* D8 */ 0x00D80745, /* PDSPxax */ + /* D9 */ 0x00D906E8, /* SDPSaoxn */ + /* DA */ 0x00DA1CE9, /* DPSDanax */ + /* DB */ 0x00DB0D75, /* SPxDSxan */ + /* DC */ 0x00DC0B04, /* SPDnao */ + /* DD */ 0x00DD0228, /* SDno */ + /* DE */ 0x00DE0268, /* SDPxo */ + /* DF */ 0x00DF08C8, /* SDPano */ + /* E0 */ 0x00E003A5, /* PDSoa */ + /* E1 */ 0x00E10185, /* PDSoxn */ + /* E2 */ 0x00E20746, /* DSPDxax */ + /* E3 */ 0x00E306EA, /* PSDPaoxn */ + /* E4 */ 0x00E40748, /* SDPSxax */ + /* E5 */ 0x00E506E5, /* PDSPaoxn */ + /* E6 */ 0x00E61CE8, /* SDPSanax */ + /* E7 */ 0x00E70D79, /* SPxPDxan */ + /* E8 */ 0x00E81D74, /* SSPxDSxax */ + /* E9 */ 0x00E95CE6, /* DSPDSanaxxn */ + /* EA */ 0x00EA02E9, /* DPSao */ + /* EB */ 0x00EB0849, /* DPSxno */ + /* EC */ 0x00EC02E8, /* SDPao */ + /* ED */ 0x00ED0848, /* SDPxno */ + /* EE */ 0x00EE0086, /* DSo SRCPAINT */ + /* EF */ 0x00EF0A08, /* SDPnoo */ + /* F0 */ 0x00F00021, /* P PATCOPY */ + /* F1 */ 0x00F10885, /* PDSono */ + /* F2 */ 0x00F20B05, /* PDSnao */ + /* F3 */ 0x00F3022A, /* PSno */ + /* F4 */ 0x00F40B0A, /* PSDnao */ + /* F5 */ 0x00F50225, /* PDno */ + /* F6 */ 0x00F60265, /* PDSxo */ + /* F7 */ 0x00F708C5, /* PDSano */ + /* F8 */ 0x00F802E5, /* PDSao */ + /* F9 */ 0x00F90845, /* PDSxno */ + /* FA */ 0x00FA0089, /* DPo */ + /* FB */ 0x00FB0A09, /* DPSnoo PATPAINT */ + /* FC */ 0x00FC008A, /* PSo */ + /* FD */ 0x00FD0A0A, /* PSDnoo */ + /* FE */ 0x00FE02A9, /* DPSoo */ + /* FF */ 0x00FF0062 /* 1 WHITENESS */ +}; diff --git a/Build/source/texk/windvi/withenable.ac b/Build/source/texk/windvi/withenable.ac new file mode 100644 index 00000000000..74308c117ee --- /dev/null +++ b/Build/source/texk/windvi/withenable.ac @@ -0,0 +1,43 @@ +dnl withenable.ac: --with and --enable options. + +# Check if the user wants to use Ghostscript, DPS or NeWS to +# display PostScript. +AC_ARG_WITH(ps, +[ --with-ps=PS use PostScript; default gs (PS=no/yes/gs/dps/news)], +[case $withval in + yes|gs) PS_DEF="$PS_DEF -DPS_GS";; + no) PS_DEF=no;; + dps) PS_DEF="$PS_DEF -DPS_DPS";; + news) PS_DEF="$PS_DEF -DPS_NEWS";; + *)] AC_MSG_WARN(Unknown --with-ps argument \`$withval'; using gs.);; + esac) + +AC_ARG_ENABLE(grey, +[ --disable-grey disable greyscale anti-aliasing for shrunken bitmaps] +, +[if test "$enableval" = yes; then + AC_DEFINE(GREY) +fi], +AC_DEFINE(GREY)) + +AC_ARG_ENABLE(buttons, +[ --disable-buttons disable buttons on the side of the window], +[if test "$enableval" = yes; then + AC_DEFINE(BUTTONS) +fi], +AC_DEFINE(BUTTONS)) + +AC_ARG_ENABLE(gf, +[ --enable-gf enable gf format pixel files (in addition to pk)], +[if test "$enableval" != no; then + AC_DEFINE(USE_GF) + OPT_SRCS="$OPT_SRCS gf.c" + OPT_OBJS="$OPT_OBJS gf.o" +fi]) + +AC_ARG_ENABLE(a4, +[ --enable-a4 set default paper size to A4 and default unit to cm], +[if test "$enableval" != no; then + AC_DEFINE(A4) +fi]) + diff --git a/Build/source/texk/windvi/wwwfetch.c b/Build/source/texk/windvi/wwwfetch.c new file mode 100644 index 00000000000..a65982d9861 --- /dev/null +++ b/Build/source/texk/windvi/wwwfetch.c @@ -0,0 +1,266 @@ +/* wwwfetch.c */ +#define HAVE_BOOLEAN +#include "xdvi-config.h" +#if defined(HTEX) || defined(XHDVI) +#include <kpathsea/c-fopen.h> +#include <kpathsea/c-stat.h> + +#define LINE 1024 + +#ifdef WIN32 +#include "winhtex.h" +#else +#include "wwwconf.h" +#include "WWWLib.h" +#include "WWWInit.h" +#include "WWWCache.h" + +#if 0 /* seems unnecessary?! */ +#ifdef HAVE_NETDB_H +#include <netdb.h> /* for struct hostent */ +#endif +#endif /* seems unnecessary?! */ + +/* Given absolute URL, open a temporary filename, and do the transfer */ +int +www_fetch(url, savefile) +char *url; +char *savefile; +{ + int status; + HTRequest * request; + HTFormat content_type; + +#if 0 /* done at startup in main() in xdvi.c */ + HTProfile_newPreemptiveClient(HTAppName, HTAppVersion); + HTCacheMode_setEnabled(NO); +#endif + /* Don't ask when overwriting temporary savefile. */ + HTAlert_setInteractive(NO); + + request = HTRequest_new(); + status = HTLoadToFile(url, request, savefile); + + /* Extract the content_type before deleting the request. */ + if (debug & DBG_HYPER) { + /* content_type = request->response->content_type; */ + content_type = HTResponse_format(HTRequest_response(request)); + + if (content_type == HTAtom_for("application/x-dvi")) + fprintf(stderr, "www_fetch(%s->%s) returned a dvi file.\n", + url, savefile); + else + fprintf(stderr, "www_fetch(%s->%s) returned content-type: %s\n", + url, savefile, HTAtom_name(content_type)); + } + HTRequest_delete(request); + +#if 0 /* done in cleanup_and_exit() in hypertex.c */ + HTCache_flushAll(); + HTProfile_delete(); +#endif + +#ifdef DOFORKS + exit(1); /* No cleanup! */ +#else /* DOFORKS */ + return status; /* return status: YES (1) or NO (0) */ +#endif /* DOFORKS */ +} +#endif /* !WIN32 */ + +/* Turn a relative URL into an absolute one: */ +void +make_absolute(rel, base, len) + char *rel, *base; + int len; +{ + char *cp, *parsed; + + if (base == NULL) return; + cp = strchr(rel, '\n'); + if (cp) *cp = '\0'; /* Eliminate newline char */ + + parsed = HTParse(rel, base, PARSE_ALL); + strncpy(rel, parsed, len); + free(parsed); +} + +/* buf is a URL - savefile is local file name to save the file in */ +static void +make_tmp_filename(tmpdir, buf, savefile) + char *tmpdir, *buf, **savefile; +{ + char *cp, *cp2; + int i, j, fd; + + *savefile = NULL; + cp = strrchr(buf, '/'); + if (cp == NULL) cp = strrchr(buf, ':'); + if (cp == NULL) return; /* Unsuccessful... */ + if (strlen(cp) < 3) cp = "/tmpfile"; + cp++; + *savefile = (char *) malloc((strlen(cp) + strlen(tmpdir)+3)*sizeof(char)); + cp2 = strrchr(cp, '.'); /* file extension */ + if (cp2 != NULL) { + *cp2 = '\0'; + cp2++; + for (i=0; i < 26; i++) { /* Attempt to create new file */ + sprintf(*savefile,"%s/%s%c.%s", tmpdir,cp,'a'+i,cp2); + for (j=0; j < nURLs; j++) { + if (!strcmp(*savefile, filelist[j].file)) break; + } + if (j < nURLs) continue; + if ((fd = creat(*savefile,0600)) >= 0) { + close(fd); + break; + } + } + cp2--; + *cp2 = '.'; /* Undo the damage we just did to buf... */ + } else { + for (i=0; i < 26; i++) { /* Attempt to create new file */ + sprintf(*savefile,"%s/%s%c", tmpdir,cp,'a'+i); + for (j=0; j < nURLs; j++) { + if (!strcmp(*savefile, filelist[j].file)) break; + } + if (j < nURLs) continue; + if ((fd = creat(*savefile,0600)) >= 0) { + close(fd); + break; + } + } + } + if (i == 26) { /* Unsuccessful */ + free(*savefile); + *savefile = NULL; + } +} + + +typedef struct { + char *url; + char *savefile; + pid_t childnum; +} Fetch_Children; + +#define MAXC 10 /* Don't send off more than 10 simultaneously */ +Fetch_Children fetch_children[MAXC]; +static int nchildren = MAXC+1; + +void +wait_for_urls() /* Wait for all the children to finish... */ +{ + int i; + + if (nchildren > MAXC) { + /* Initialization needed: */ + for (i=0; i < MAXC; i++) { + fetch_children[i].url = NULL; + fetch_children[i].savefile = NULL; + } + } else { + for (i=0; i < nchildren; i++) { +#ifdef DOFORKS + ret = wait(&status); /* Wait for one to finish */ + for (j=0; j < nchildren; j++) { + if (ret == fetch_children[j].childnum) { + if (debug & DBG_HYPER) + fprintf(stderr,"wait_for_urls(): URL %s in file %s: status %d\n", + fetch_children[j].url, + fetch_children[j].savefile, + status); + break; + } + } +#else /* DOFORKS */ + if (debug & DBG_HYPER) + fprintf(stderr, "wait_for_urls(): URL %s in file %s\n", + fetch_children[i].url, + fetch_children[i].savefile); +#endif /* DOFORKS */ + } + } + nchildren = 0; +} + +/* Start a fetch of a relative URL */ +int +fetch_relative_url(base_url, rel_url, tmpdir) + char *base_url; + const char *rel_url; + char *tmpdir; +{ + int i, resp; + char *savefile; + char *cp; + char buf[LINE]; + FILE *fp; + + /* Step 1: make the relative URL absolute: */ + strncpy(buf, rel_url, LINE); /* Put it in buf */ + make_absolute(buf, base_url, LINE); + + /* Step 1.5: Check whether we already have it - if so return */ + for (i=0; i < nURLs; i++) { + if (!strcmp(buf, filelist[i].url)) return(i); + } + + /* Step 2: Find a temporary file to store the output in */ + make_tmp_filename(tmpdir, buf, &savefile); + if (savefile == NULL) { + fprintf(stderr, "Could not find temporary file for %s in %s\n", + buf, tmpdir); + return(-1); + } + if ((fp = fopen(savefile, FOPEN_W_MODE)) == NULL) { + fprintf(stderr, "Cannot open %s for writing\n", savefile); + return(-1); + } else { + fclose(fp); unlink(savefile); + } + + /* Step 3: Fork to fetch the URL */ + if (nchildren >= MAXC) wait_for_urls(); /* Wait for the old ones */ + cp = NULL; + fetch_children[nchildren].url = MyStrAllocCopy(&cp, buf); + cp = NULL; + fetch_children[nchildren].savefile = MyStrAllocCopy(&cp, savefile); + + /* Step 4: Update the URL-filename list */ + if (nURLs == 0) { + filelist = xmalloc(FILELISTCHUNK*sizeof(FiletoURLconv)); + bzero(filelist, FILELISTCHUNK*sizeof(FiletoURLconv)); + } else if (nURLs%FILELISTCHUNK == 0) { + filelist = (FiletoURLconv *) + realloc(filelist, (nURLs+FILELISTCHUNK)*sizeof(FiletoURLconv)); + bzero(filelist + nURLs, FILELISTCHUNK*sizeof(FiletoURLconv)); + } + MyStrAllocCopy(&(filelist[nURLs].url), buf); + MyStrAllocCopy(&(filelist[nURLs].file), savefile); + nURLs++; +#ifdef DOFORKS + fetch_children[nchildren].childnum = fork(); + if (fetch_children[nchildren].childnum == 0) { /* Child process */ + www_fetch(buf, savefile); /* Get the URL! */ + exit(0); /* Make sure this process quits... */ + } + nchildren++; +#else /* DOFORKS */ + resp = www_fetch(buf, savefile); /* Get the URL! */ + if (resp == 0) { +#if 0 + /* Don't call paint_anchor before window was opened! */ + paint_anchor("Error: Cannot locate URL: %s\n", buf); +#endif + fprintf(stderr, "Cannot locate URL: %s\n", buf); + nURLs--; + unlink(filelist[nURLs].file); /* Get rid of that temp file */ + return(-1); + } else { + nchildren++; + } +#endif /* DOFORKS */ + return(nURLs-1); +} + +#endif /* HTEX || XHDVI */ diff --git a/Build/source/texk/windvi/xdvi-config.h b/Build/source/texk/windvi/xdvi-config.h new file mode 100644 index 00000000000..81ff146c3c8 --- /dev/null +++ b/Build/source/texk/windvi/xdvi-config.h @@ -0,0 +1,72 @@ +/* xdvi-config.h: master configuration file, included first by all + compilable source files (not headers). */ + +#ifndef CONFIG_H +#define CONFIG_H + +#define KPATHSEA 1 + +/* The stuff from the path searching library. */ +#include <kpathsea/c-auto.h> +#include <kpathsea/config.h> + +#include <setjmp.h> + +#ifndef HAVE_VPRINTF +#ifdef HAVE_DOPRNT +#define vfprintf(stream, message, args) _doprnt(message, args, stream) +/* If we have neither, should fall back to fprintf with fixed args. */ +#endif +#endif + +/* Some xdvi options we want by default. */ +#ifndef USE_PK +#define USE_PK +#endif +#if 0 +/* This is defined in ./c-auto.h */ +#ifndef USE_GF +#define USE_GF +#endif +#endif /* 0 */ +#ifndef MAKEPK +#define MAKEPK +#endif + +#ifndef NOSELFILE +#define SELFILE +#endif +#ifndef NOGRID +#define GRID +#endif +#ifndef NOTEXXET +#define TEXXET +#endif +#if 0 && defined (HAVE_LIBWWW) && defined (HAVE_LIBWWW_H) +#define HTEX +#endif + +/* On the other hand, NOTOOL means we lose practically everything. */ +#if defined(NOTOOL) && !defined(WIN32) +#undef SELFILE +#undef BUTTONS +#undef GRID +#undef HTEX +#endif /* NOTOOL */ + +#ifdef WIN32 +# include "windvi.h" +#define MYRGB(r,g,b) RGB(r,g,b) +#define MYADJUSTRGB(x) (x) +# ifndef min +# define min(a, b) (((a) < (b)) ? (a) : (b)) +# endif +# ifndef max +# define max(a, b) (((a) > (b)) ? (a) : (b)) +# endif +#else +/* xdvi's definitions. */ +# include "xdvi.h" +#endif + +#endif /* not CONFIG_H */ diff --git a/Build/source/texk/windvi/xdvi-sh b/Build/source/texk/windvi/xdvi-sh new file mode 100644 index 00000000000..2e28fe4a33b --- /dev/null +++ b/Build/source/texk/windvi/xdvi-sh @@ -0,0 +1,48 @@ +#!/bin/sh + +# This is the xdvi wrapper script for teTeX, version 0.2. +# Copyright Thomas Esser, 1998. Permission to distribute under the terms +# of the GNU general public license version 2 or later. + +# This script sets some environment variables to make sure that xdvi's +# ressource file in $XDVIINPUTS/xdvi is read by xdvi.bin. +# Special care was taken to make this work for old R3, too. Therefore, +# we need to modify XAPPLRESDIR. If you are running R4 or later, you +# can set XUSERFILESEARCHPATH for user specific application default +# files. You cannot use XAPPLRESDIR for user specific application default +# files. + +test -f /bin/sh5 && test -z "$RUNNING_SH5" \ + && test x"`(uname -s) 2>&1`" = xULTRIX \ + && { RUNNING_SH5=true; export RUNNING_SH5; exec /bin/sh5 $0 ${1+"$@"}; } +RUNNING_SH5= + +test -f /bin/bsh && test -z "$RUNNING_BSH" \ + && test x"`(uname -s) 2>&1`" = xAIX \ + && { RUNNING_BSH=true; export RUNNING_BSH; exec /bin/bsh $0 ${1+"$@"}; } +RUNNING_BSH= + +# -help and -version only work if they are the only options. Therefore, +# we cannot give the "-name xdvi" parameter in that case. +case "$#:$1" in + 1:-help|1:-version) + NAMEOPT=;; + *) + NAMEOPT='-name xdvi';; +esac + +XDVIINPUTS="$XDVIINPUTS":'$TEXMF/{xdvi,web2c}'; export XDVIINPUTS +xdviappfile=`kpsewhich -progname=xdvi --format='other text files' XDvi` +if test -n "$xdviappfile"; then + xdviappdir=`dirname "$xdviappfile"` + xdviapppath="${xdviappdir}/%N" + + # For R3, we have to set XAPPLRESDIR. + XAPPLRESDIR="$xdviappdir"; export XAPPLRESDIR + + # For R4 or later, we have to set XFILESEARCHPATH, since XAPPLRESDIR might + # be ignored (if XUSERFILESEARCHPATH is set) + XFILESEARCHPATH="$xdviapppath:${XFILESEARCHPATH-%D}"; export XFILESEARCHPATH +fi + +exec xdvi.bin $NAMEOPT ${1+"$@"} diff --git a/Build/source/texk/windvi/xdvi.bmp b/Build/source/texk/windvi/xdvi.bmp Binary files differnew file mode 100644 index 00000000000..44dcb2e538d --- /dev/null +++ b/Build/source/texk/windvi/xdvi.bmp diff --git a/Build/source/texk/windvi/xdvi.c b/Build/source/texk/windvi/xdvi.c new file mode 100644 index 00000000000..0555f705cb0 --- /dev/null +++ b/Build/source/texk/windvi/xdvi.c @@ -0,0 +1,2934 @@ +/*========================================================================*\ + +Copyright (c) 1990-1999 Paul Vojta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL PAUL VOJTA OR ANYONE ELSE BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +NOTE: xdvi is based on prior work as noted in the modification history, below. + +\*========================================================================*/ + +/* + * DVI previewer for X. + * + * Eric Cooper, CMU, September 1985. + * + * Code derived from dvi-imagen.c. + * + * Modification history: + * 1/1986 Modified for X.10 --Bob Scheifler, MIT LCS. + * 7/1988 Modified for X.11 --Mark Eichin, MIT + * 12/1988 Added 'R' option, toolkit, magnifying glass + * --Paul Vojta, UC Berkeley. + * 2/1989 Added tpic support --Jeffrey Lee, U of Toronto + * 4/1989 Modified for System V --Donald Richardson, Clarkson Univ. + * 3/1990 Added VMS support --Scott Allendorf, U of Iowa + * 7/1990 Added reflection mode --Michael Pak, Hebrew U of Jerusalem + * 1/1992 Added greyscale code --Till Brychcy, Techn. Univ. Muenchen + * and Lee Hetherington, MIT + * 7/1992 Added extra menu buttons--Nelson H. F. Beebe <beebe@math.utah.edu> + * 4/1994 Added DPS support, bounding box + * --Ricardo Telichevesky + * and Luis Miguel Silveira, MIT RLE. + * 2/1995 Added rulers support --Nelson H. F. Beebe <beebe@math.utah.edu> + * + * Compilation options: + * VMS compile for VMS + * NOTOOL compile without toolkit + * BUTTONS compile with buttons on the side of the window (needs toolkit) + * WORDS_BIGENDIAN store bitmaps internally with most significant bit first + * BMTYPE store bitmaps in unsigned BMTYPE + * BMBYTES sizeof(unsigned BMTYPE) + * ALTFONT default for -altfont option + * SHRINK default for -s option (shrink factor) + * MFMODE default for -mfmode option + * A4 use European size paper, and change default dimension to cm + * TEXXET support reflection dvi codes (right-to-left typesetting) + * GREY use grey levels to shrink fonts + * PS_GS use Ghostscript to render pictures/bounding boxes + * PS_DPS use display postscript to render pictures/bounding boxes + * PS_NEWS use the NeWS server to render pictures/bounding boxes + * GS_PATH path to call the Ghostscript interpreter by + * GRID grid in magnification windows enabled + * HTEX hypertex enabled. EXPECT PROBLEMS IF USED WITH MOTIF! + * please send patches to janl@math.uio.no + */ + +#if 0 +static char copyright[] = +"@(#) Copyright (c) 1994-1999 Paul Vojta. All rights reserved.\n"; +#endif + +#define EXTERN +#define INIT(x) =x + +#include "xdvi-config.h" +#include "c-openmx.h" +#include <kpathsea/c-ctype.h> +#include <kpathsea/c-fopen.h> +#include <kpathsea/c-pathch.h> +#include <kpathsea/c-stat.h> +#include <kpathsea/proginit.h> +#include <kpathsea/progname.h> +#include <kpathsea/tex-file.h> +#include <kpathsea/tex-hush.h> +#include <kpathsea/tex-make.h> + +#ifdef HTEX +#include "wwwconf.h" +#include "WWWLib.h" +#include "WWWInit.h" +#include "WWWCache.h" +#include "HTEscape.h" +#endif + +#ifndef ALTFONT +#define ALTFONT "cmr10" +#endif + +#ifndef SHRINK +#define SHRINK 8 +#endif + +#ifndef BDPI +#define BDPI 600 +#endif + +#ifndef MFMODE +#define MFMODE NULL +#endif + +#undef MKTEXPK +#define MKTEXPK MAKEPK + +#if defined(PS_GS) && !defined(GS_PATH) +#define GS_PATH "gs" +#endif + +#if A4 +#define DEFAULT_PAPER "a4" +#else +#define DEFAULT_PAPER "us" +#endif + +#include "version.h" + +#ifdef HTEX +/* Application name and version for w3c-libwww routines. + This is what will show up in httpd's agent_log files. +*/ +#ifdef Omega +char *HTAppName = "oxdvik"; +#else +char *HTAppName = "xdvik"; +#endif +char *HTAppVersion = VERSION; +#endif + + +#ifdef X_NOT_STDC_ENV +#ifndef atof +extern double atof ARGS((_Xconst char *)); +#endif +#endif + +/* Xlib and Xutil are already included */ +#include <X11/cursorfont.h> +#include <X11/keysym.h> +#include "xdvi.icon" + +#ifdef TOOLKIT + +#ifdef OLD_X11_TOOLKIT +#include <X11/Atoms.h> +#else /* not OLD_X11_TOOLKIT */ +#include <X11/Xatom.h> +#include <X11/StringDefs.h> +#endif /* not OLD_X11_TOOLKIT */ + +#include <X11/Shell.h> /* needed for def. of XtNiconX */ + +#ifndef XtSpecificationRelease +#define XtSpecificationRelease 0 +#endif +#if XtSpecificationRelease >= 4 + +#ifndef MOTIF +#include <X11/Xaw/Viewport.h> +#ifdef HTEX +#include <X11/Xaw/AsciiText.h> +#include <X11/Xaw/Box.h> +#include <X11/Xaw/Command.h> +#include <X11/Xaw/Dialog.h> +#include <X11/Xaw/Form.h> +#include <X11/Xaw/Paned.h> +#include <X11/Xaw/Scrollbar.h> +#endif /* HTEX */ +#define VPORT_WIDGET_CLASS viewportWidgetClass +#define DRAW_WIDGET_CLASS drawWidgetClass +#else /* MOTIF */ +#include <Xm/MainW.h> +#include <Xm/ToggleB.h> +#include <Xm/RowColumn.h> +#include <Xm/MenuShell.h> +#include <Xm/DrawingA.h> +#define VPORT_WIDGET_CLASS xmMainWindowWidgetClass +#define DRAW_WIDGET_CLASS xmDrawingAreaWidgetClass +#endif /* MOTIF */ + +#ifdef BUTTONS +#ifndef MOTIF +#include <X11/Xaw/Command.h> +#define FORM_WIDGET_CLASS formWidgetClass +#else /* MOTIF */ +#include <Xm/Form.h> +#define FORM_WIDGET_CLASS xmFormWidgetClass +#endif /* MOTIF */ +#endif /* BUTTONS */ + +#else /* XtSpecificationRelease < 4 */ + +#define XtPointer caddr_t +#include <X11/Viewport.h> +#ifdef HTEX +#include <X11/AsciiText.h> +#include <X11/Box.h> +#include <X11/Command.h> +#include <X11/Dialog.h> +#include <X11/Form.h> +#include <X11/Paned.h> +#include <X11/Scroll.h> +#include <X11/VPaned.h> +#include <X11/Scrollbar.h> +#endif +#define VPORT_WIDGET_CLASS viewportWidgetClass +#define DRAW_WIDGET_CLASS drawWidgetClass +#ifdef BUTTONS +#include <X11/Command.h> +#define FORM_WIDGET_CLASS formWidgetClass +#endif + +#endif /* XtSpecificationRelease */ + +#if XtSpecificationRelease < 5 +typedef caddr_t XPointer; +#endif + +#else /* not TOOLKIT */ + +typedef int Position; + +#endif /* not TOOLKIT */ + +#ifdef VMS +/* + * Magnifying glass cursor + * + * Developed by Tom Sawyer, April 1990 + * Contibuted by Hunter Goatley, January 1991 + * + */ + +#define mag_glass_width 16 +#define mag_glass_height 16 +#define mag_glass_x_hot 6 +#define mag_glass_y_hot 6 +static char mag_glass_bits[] = { + 0xf8, 0x03, 0x0c, 0x06, 0xe2, 0x09, 0x13, 0x1a, 0x01, 0x14, 0x01, 0x14, + 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x03, 0x10, 0x02, 0x18, 0x0c, 0x34, + 0xf8, 0x6f, 0x00, 0xd8, 0x00, 0xb0, 0x00, 0xe0 +}; +#include <decw$cursor.h> /* Include the DECWindows cursor symbols */ +static int DECWCursorFont; /* Space for the DECWindows cursor font */ +static Pixmap MagnifyPixmap; /* Pixmap to hold our special mag-glass */ +#include <X11/Xresource.h> /* Motif apparently needs this one */ +#endif /* VMS */ + +/* + * Command line flags. + */ + +static Dimension bwidth = 2; + +#define fore_Pixel resource._fore_Pixel +#define back_Pixel resource._back_Pixel +#ifdef TOOLKIT +struct _resource resource; +#define brdr_Pixel resource._brdr_Pixel +#define hl_Pixel resource._hl_Pixel +#define cr_Pixel resource._cr_Pixel +#ifdef GRID +#define grid1_Pixel resource._grid1_Pixel +#define grid2_Pixel resource._grid2_Pixel +#define grid3_Pixel resource._grid3_Pixel +#endif /* GRID */ +#else /* not TOOLKIT */ +static _Xconst char *brdr_color; +static _Xconst char *high_color; +static _Xconst char *curs_color; +static Pixel hl_Pixel, cr_Pixel; +#ifdef GRID +static Pixel grid1_Pixel, grid2_Pixel, grid3_Pixel; +#endif /* GRID */ +#endif /* not TOOLKIT */ + +struct mg_size_rec mg_size[5] = {{200, 150}, {400, 250}, {700, 500}, + {1000, 800}, {1200, 1200}}; + +static char *curr_page; + +struct WindowRec mane = {(Window) 0, 1, 0, 0, 0, 0, MAXDIM, 0, MAXDIM, 0}; +struct WindowRec alt = {(Window) 0, 1, 0, 0, 0, 0, MAXDIM, 0, MAXDIM, 0}; +/* currwin is temporary storage except for within redraw() */ +struct WindowRec currwin= {(Window) 0, 1, 0, 0, 0, 0, MAXDIM, 0, MAXDIM, 0}; + +#ifdef lint +#ifdef TOOLKIT +WidgetClass widgetClass; +#ifndef MOTIF +WidgetClass viewportWidgetClass; +#ifdef BUTTONS +WidgetClass formWidgetClass, compositeWidgetClass, commandWidgetClass; +#endif /* BUTTONS */ +#else /* MOTIF */ +WidgetClass xmMainWindowWidgetClass, xmDrawingAreaWidgetClass; +#ifdef BUTTONS +WidgetClass xmFormWidgetClass, xmBulletinBoardWidgetClass; +WidgetClass xmPushButtonWidgetClass; +#endif /* BUTTONS */ +#endif /* MOTIF */ +#endif /* TOOLKIT */ +#endif /* lint */ + +/* + * Data for options processing + */ + +static _Xconst char silent[] = " "; /* flag value for usage() */ + +static _Xconst char subst[] = "x"; /* another flag value */ + +static _Xconst char *subst_val[] = { +#ifdef BUTTONS + "-shrinkbutton[1-4] <shrink>", +#endif + "-mgs[n] <size>"}; + +/* BEGIN CHUNK xdvi.c 1 */ +#ifdef SRC_SPECIALS +#define src_tickSize resource._src_tickSize +#define src_specialFormat resource._src_specialFormat +#define src_jumpButton resource._src_jumpButton +#endif +/* END CHUNK xdvi.c 1 */ + +#ifdef TOOLKIT + +static XrmOptionDescRec options[] = { +{"-s", ".shrinkFactor", XrmoptionSepArg, (caddr_t) SHRINK}, +#ifndef VMS +{"-S", ".densityPercent", XrmoptionSepArg, (caddr_t) NULL}, +#endif +{"-density", ".densityPercent", XrmoptionSepArg, (caddr_t) NULL}, +#ifdef GREY +{"-nogrey", ".grey", XrmoptionNoArg, (caddr_t) "off"}, +{"+nogrey", ".grey", XrmoptionNoArg, (caddr_t) "on"}, +{"-gamma", ".gamma", XrmoptionSepArg, (caddr_t) NULL}, +{"-install", ".install", XrmoptionNoArg, (caddr_t) "on"}, +{"-noinstall", ".install", XrmoptionNoArg, (caddr_t) "off"}, +#endif +#ifdef GRID +{"-grid1", ".grid1Color", XrmoptionSepArg, (caddr_t) NULL}, +{"-grid2", ".grid2Color", XrmoptionSepArg, (caddr_t) NULL}, +{"-grid3", ".grid3Color", XrmoptionSepArg, (caddr_t) NULL}, +#endif /* GRID */ +{"-p", ".pixelsPerInch", XrmoptionSepArg, (caddr_t) NULL}, +{"-margins", ".Margin", XrmoptionSepArg, (caddr_t) NULL}, +{"-sidemargin", ".sideMargin", XrmoptionSepArg, (caddr_t) NULL}, +{"-topmargin", ".topMargin", XrmoptionSepArg, (caddr_t) NULL}, +{"-offsets", ".Offset", XrmoptionSepArg, (caddr_t) NULL}, +{"-xoffset", ".xOffset", XrmoptionSepArg, (caddr_t) NULL}, +{"-yoffset", ".yOffset", XrmoptionSepArg, (caddr_t) NULL}, +{"-paper", ".paper", XrmoptionSepArg, (caddr_t) NULL}, +{"-altfont", ".altFont", XrmoptionSepArg, (caddr_t) NULL}, +#ifdef MKTEXPK +{"-nomakepk", ".makePk", XrmoptionNoArg, (caddr_t) "off"}, +{"+nomakepk", ".makePk", XrmoptionNoArg, (caddr_t) "on"}, +#endif +{"-mfmode", ".mfMode", XrmoptionSepArg, (caddr_t) MFMODE}, +{"-l", ".listFonts", XrmoptionNoArg, (caddr_t) "on"}, +{"+l", ".listFonts", XrmoptionNoArg, (caddr_t) "off"}, +#ifdef BUTTONS +{"-expert", ".expert", XrmoptionNoArg, (caddr_t) "on"}, +{"+expert", ".expert", XrmoptionNoArg, (caddr_t) "off"}, +{"-shrinkbutton1",".shrinkButton1",XrmoptionSepArg, (caddr_t) NULL}, +{"-shrinkbutton2",".shrinkButton2",XrmoptionSepArg, (caddr_t) NULL}, +{"-shrinkbutton3",".shrinkButton3",XrmoptionSepArg, (caddr_t) NULL}, +{"-shrinkbutton4",".shrinkButton4",XrmoptionSepArg, (caddr_t) NULL}, +#endif +{"-mgs", ".magnifierSize1",XrmoptionSepArg, (caddr_t) NULL}, +{"-mgs1", ".magnifierSize1",XrmoptionSepArg, (caddr_t) NULL}, +{"-mgs2", ".magnifierSize2",XrmoptionSepArg, (caddr_t) NULL}, +{"-mgs3", ".magnifierSize3",XrmoptionSepArg, (caddr_t) NULL}, +{"-mgs4", ".magnifierSize4",XrmoptionSepArg, (caddr_t) NULL}, +{"-mgs5", ".magnifierSize5",XrmoptionSepArg, (caddr_t) NULL}, +{"-warnspecials", ".warnSpecials", XrmoptionNoArg, (caddr_t) "on"}, +{"+warnspecials", ".warnSpecials", XrmoptionNoArg, (caddr_t) "off"}, +{"-hush", ".Hush", XrmoptionNoArg, (caddr_t) "on"}, +{"+hush", ".Hush", XrmoptionNoArg, (caddr_t) "off"}, +{"-hushchars", ".hushLostChars", XrmoptionNoArg, (caddr_t) "on"}, +{"+hushchars", ".hushLostChars", XrmoptionNoArg, (caddr_t) "off"}, +{"-hushchecksums", ".hushChecksums", XrmoptionNoArg, (caddr_t) "on"}, +{"+hushchecksums", ".hushChecksums", XrmoptionNoArg, (caddr_t) "off"}, +{"-safer", ".safer", XrmoptionNoArg, (caddr_t) "on"}, +{"+safer", ".safer", XrmoptionNoArg, (caddr_t) "off"}, +{"-fg", ".foreground", XrmoptionSepArg, (caddr_t) NULL}, +{"-foreground", ".foreground", XrmoptionSepArg, (caddr_t) NULL}, +{"-bg", ".background", XrmoptionSepArg, (caddr_t) NULL}, +{"-background", ".background", XrmoptionSepArg, (caddr_t) NULL}, +{"-hl", ".highlight", XrmoptionSepArg, (caddr_t) NULL}, +{"-cr", ".cursorColor", XrmoptionSepArg, (caddr_t) NULL}, +{"-icongeometry",".iconGeometry",XrmoptionSepArg, (caddr_t) NULL}, +{"-keep", ".keepPosition",XrmoptionNoArg, (caddr_t) "on"}, +{"+keep", ".keepPosition",XrmoptionNoArg, (caddr_t) "off"}, +{"-copy", ".copy", XrmoptionNoArg, (caddr_t) "on"}, +{"+copy", ".copy", XrmoptionNoArg, (caddr_t) "off"}, +{"-thorough", ".thorough", XrmoptionNoArg, (caddr_t) "on"}, +{"+thorough", ".thorough", XrmoptionNoArg, (caddr_t) "off"}, +#if PS +{"-nopostscript",".postscript", XrmoptionNoArg, (caddr_t) "off"}, +{"+nopostscript",".postscript", XrmoptionNoArg, (caddr_t) "on"}, +{"-noscan", ".prescan", XrmoptionNoArg, (caddr_t) "off"}, +{"+noscan", ".prescan", XrmoptionNoArg, (caddr_t) "on"}, +{"-allowshell", ".allowShell", XrmoptionNoArg, (caddr_t) "on"}, +{"+allowshell", ".allowShell", XrmoptionNoArg, (caddr_t) "off"}, +#ifdef PS_DPS +{"-nodps", ".dps", XrmoptionNoArg, (caddr_t) "off"}, +{"+nodps", ".dps", XrmoptionNoArg, (caddr_t) "on"}, +#endif +#ifdef PS_NEWS +{"-nonews", ".news", XrmoptionNoArg, (caddr_t) "off"}, +{"+nonews", ".news", XrmoptionNoArg, (caddr_t) "on"}, +#endif +#ifdef PS_GS +{"-noghostscript",".ghostscript", XrmoptionNoArg, (caddr_t) "off"}, +{"+noghostscript",".ghostscript", XrmoptionNoArg, (caddr_t) "on"}, +{"-nogssafer", ".gsSafer", XrmoptionNoArg, (caddr_t) "off"}, +{"+nogssafer", ".gsSafer", XrmoptionNoArg, (caddr_t) "on"}, +{"-gsalpha", ".gsAlpha", XrmoptionNoArg, (caddr_t) "on"}, +{"+gsalpha", ".gsAlpha", XrmoptionNoArg, (caddr_t) "off"}, +{"-interpreter",".interpreter", XrmoptionSepArg, (caddr_t) NULL}, +{"-gspalette", ".palette", XrmoptionSepArg, (caddr_t) NULL}, +#endif +#endif /* PS */ +{"-debug", ".debugLevel", XrmoptionSepArg, (caddr_t) NULL}, +{"-version", ".version", XrmoptionNoArg, (caddr_t) "on"}, +{"+version", ".version", XrmoptionNoArg, (caddr_t) "off"}, +#ifdef HTEX +{"-underlink", ".underLink", XrmoptionNoArg, (caddr_t) "on"}, +{"+underlink", ".underLink", XrmoptionNoArg, (caddr_t) "off"}, +{"-browser", ".wwwBrowser", XrmoptionSepArg, (caddr_t) NULL}, +{"-base", ".urlBase", XrmoptionSepArg, (caddr_t) NULL}, +#endif +/* BEGIN CHUNK xdvi.c 2 */ +#ifdef SRC_SPECIALS +{"-srcSpecialFormat", ".srcSpecialFormat", XrmoptionSepArg, (caddr_t) NULL}, +{"-srcJumpButton", ".srcJumpButton", XrmoptionSepArg, (caddr_t) NULL}, +{"-srcTickShape", ".srcTickShape", XrmoptionSepArg, (caddr_t) NULL}, +{"-srcTickSize", ".srcTickSize", XrmoptionSepArg, (caddr_t) NULL}, +{"-srcCursor", ".srcCursor", XrmoptionSepArg, (caddr_t) NULL}, +{"-srcEditorCommand", ".srcEditorCommand", XrmoptionSepArg, (caddr_t) NULL}, +{"-srcVerbosity", ".srcVerbosity", XrmoptionSepArg, (caddr_t) NULL}, +{"-srcVisibility", ".srcVisibility", XrmoptionNoArg, (caddr_t) "on"}, +{"+srcVisibility", ".srcVisibility", XrmoptionNoArg, (caddr_t) "off"}, +{"-srcMode", ".srcMode", XrmoptionNoArg, (caddr_t) "on"}, +{"+srcMode", ".srcMode", XrmoptionNoArg, (caddr_t) "off"}, +#endif +/* END CHUNK xdvi.c 2 */ +}; + +#define offset(field) XtOffsetOf(struct _resource, field) + +static int base_tick_length = 4; + +static char XtRBool3[] = "Bool3"; /* resource for Bool3 */ + +static XtResource application_resources[] = { +#if CFGFILE +{"name", "Name", XtRString, sizeof(char *), + offset(progname), XtRString, (caddr_t) NULL}, +#endif +{"shrinkFactor", "ShrinkFactor", XtRInt, sizeof(int), + offset(shrinkfactor), XtRImmediate, (XtPointer) SHRINK}, +/* offset(shrinkfactor), XtRString, SHRINK}, */ +{"delayRulers", "DelayRulers", XtRBoolean, sizeof(Boolean), + offset(_delay_rulers), XtRString, "true"}, +{"densityPercent", "DensityPercent", XtRInt, sizeof(int), + offset(_density), XtRString, "40"}, +#ifdef GREY +{"gamma", "Gamma", XtRFloat, sizeof(float), + offset(_gamma), XtRString, "1"}, +#endif +{"pixelsPerInch", "PixelsPerInch", XtRInt, sizeof(int), + offset(_pixels_per_inch), XtRImmediate, (XtPointer) BDPI}, +{"sideMargin", "Margin", XtRString, sizeof(char *), + offset(sidemargin), XtRString, (caddr_t) NULL}, +{"tickLength", "TickLength", XtRInt, sizeof(int), + offset(_tick_length), XtRInt, (caddr_t) &base_tick_length}, +{"tickUnits", "TickUnits", XtRString, sizeof(char *), + offset(_tick_units), XtRString, "pt"}, +{"topMargin", "Margin", XtRString, sizeof(char *), + offset(topmargin), XtRString, (caddr_t) NULL}, +{"xOffset", "Offset", XtRString, sizeof(char *), + offset(xoffset), XtRString, (caddr_t) NULL}, +{"yOffset", "Offset", XtRString, sizeof(char *), + offset(yoffset), XtRString, (caddr_t) NULL}, +{"paper", "Paper", XtRString, sizeof(char *), + offset(paper), XtRString, (caddr_t) DEFAULT_PAPER}, +{"altFont", "AltFont", XtRString, sizeof(char *), + offset(_alt_font), XtRString, (caddr_t) ALTFONT}, +{"makePk", "MakePk", XtRBoolean, sizeof(Boolean), + offset(makepk), XtRString, +#if MAKE_TEX_PK_BY_DEFAULT + "true" +#else + "false" +#endif + }, +{"mfMode", "MfMode", XtRString, sizeof(char *), + offset(mfmode), XtRString, MFMODE}, +{"listFonts", "ListFonts", XtRBoolean, sizeof(Boolean), + offset(_list_fonts), XtRString, "false"}, +{"reverseVideo", "ReverseVideo", XtRBoolean, sizeof(Boolean), + offset(reverse), XtRString, "false"}, +{"warnSpecials", "WarnSpecials", XtRBoolean, sizeof(Boolean), + offset(_warn_spec), XtRString, "false"}, +{"hushLostChars", "Hush", XtRBoolean, sizeof(Boolean), + offset(_hush_chars), XtRString, "false"}, +{"hushChecksums", "Hush", XtRBoolean, sizeof(Boolean), + offset(_hush_chk), XtRString, "false"}, +{"safer", "Safer", XtRBoolean, sizeof(Boolean), + offset(safer), XtRString, "false"}, +#ifdef VMS +{"foreground", "Foreground", XtRString, sizeof(char *), + offset(fore_color), XtRString, (caddr_t) NULL}, +{"background", "Background", XtRString, sizeof(char *), + offset(back_color), XtRString, (caddr_t) NULL}, +#endif +{"iconGeometry", "IconGeometry", XtRString, sizeof(char *), + offset(icon_geometry), XtRString, (caddr_t) NULL}, +{"keepPosition", "KeepPosition", XtRBoolean, sizeof(Boolean), + offset(keep_flag), XtRString, "false"}, +#if PS +{"postscript", "Postscript", XtRBoolean, sizeof(Boolean), + offset(_postscript), XtRString, "true"}, +{"prescan", "Prescan", XtRBoolean, sizeof(Boolean), + offset(prescan), XtRString, "true"}, +{"allowShell", "AllowShell", XtRBoolean, sizeof(Boolean), + offset(allow_shell), XtRString, "false"}, +#ifdef PS_DPS +{"dps", "DPS", XtRBoolean, sizeof(Boolean), + offset(useDPS), XtRString, "true"}, +#endif +#ifdef PS_NEWS +{"news", "News", XtRBoolean, sizeof(Boolean), + offset(useNeWS), XtRString, "true"}, +#endif +#ifdef PS_GS +{"ghostscript", "Ghostscript", XtRBoolean, sizeof(Boolean), + offset(useGS), XtRString, "true"}, +{"gsSafer", "Safer", XtRBoolean, sizeof(Boolean), + offset(gs_safer), XtRString, "true"}, +{"gsAlpha", "Alpha", XtRBoolean, sizeof(Boolean), + offset(gs_alpha), XtRString, "false"}, +{"interpreter", "Interpreter", XtRString, sizeof(char *), + offset(gs_path), XtRString, (caddr_t) GS_PATH}, +{"palette", "Palette", XtRString, sizeof(char *), + offset(gs_palette), XtRString, (caddr_t) "Color"}, +#endif +#endif /* PS */ +{"copy", "Copy", XtRBoolean, sizeof(Boolean), + offset(copy), XtRString, "false"}, +{"thorough", "Thorough", XtRBoolean, sizeof(Boolean), + offset(thorough), XtRString, "false"}, +{"debugLevel", "DebugLevel", XtRString, sizeof(char *), + offset(debug_arg), XtRString, (caddr_t) NULL}, +{"version", "Version", XtRBoolean, sizeof(Boolean), + offset(version_flag), XtRString, "false"}, +#ifdef BUTTONS +{"expert", "Expert", XtRBoolean, sizeof(Boolean), + offset(expert), XtRString, "false"}, +{"shrinkButton1", "ShrinkButton1", XtRInt, sizeof(int), + offset(shrinkbutton[0]), XtRImmediate, (XtPointer) 0}, +{"shrinkButton2", "ShrinkButton2", XtRInt, sizeof(int), + offset(shrinkbutton[1]), XtRImmediate, (XtPointer) 0}, +{"shrinkButton3", "ShrinkButton3", XtRInt, sizeof(int), + offset(shrinkbutton[2]), XtRImmediate, (XtPointer) 0}, +{"shrinkButton4", "ShrinkButton4", XtRInt, sizeof(int), + offset(shrinkbutton[3]), XtRImmediate, (XtPointer) 0}, +#endif +{"magnifierSize1", "MagnifierSize", XtRString, sizeof(char *), + offset(mg_arg[0]), XtRString, (caddr_t) NULL}, +{"magnifierSize2", "MagnifierSize", XtRString, sizeof(char *), + offset(mg_arg[1]), XtRString, (caddr_t) NULL}, +{"magnifierSize3", "MagnifierSize", XtRString, sizeof(char *), + offset(mg_arg[2]), XtRString, (caddr_t) NULL}, +{"magnifierSize4", "MagnifierSize", XtRString, sizeof(char *), + offset(mg_arg[3]), XtRString, (caddr_t) NULL}, +{"magnifierSize5", "MagnifierSize", XtRString, sizeof(char *), + offset(mg_arg[4]), XtRString, (caddr_t) NULL}, +#ifdef GREY +{"grey", "Grey", XtRBoolean, sizeof(Boolean), + offset(_use_grey), XtRString, "true"}, +{"install", "Install", XtRBool3, sizeof(Bool3), + offset(install), XtRString, "maybe"}, +#endif +#ifdef GRID +{"grid1Color", "Grid1Color", XtRPixel, sizeof(Pixel), + offset(_grid1_Pixel), XtRPixel, (caddr_t) &resource._grid1_Pixel}, +{"grid1Color", "Grid1Color", XtRString, sizeof(char *), + offset(grid1_color), XtRString, (caddr_t) NULL}, +{"grid2Color", "Grid2Color", XtRPixel, sizeof(Pixel), + offset(_grid2_Pixel), XtRPixel, (caddr_t) &resource._grid2_Pixel}, +{"grid2Color", "Grid2Color", XtRString, sizeof(char *), + offset(grid2_color), XtRString, (caddr_t) NULL}, +{"grid3Color", "Grid3Color", XtRPixel, sizeof(Pixel), + offset(_grid3_Pixel), XtRPixel, (caddr_t) &resource._grid3_Pixel}, +{"grid3Color", "Grid3Color", XtRString, sizeof(char *), + offset(grid3_color), XtRString, (caddr_t) NULL}, +#endif /* GRID */ +#ifdef HTEX +{"underLink", "UnderLink", XtRBoolean, sizeof(Boolean), + offset(_underline_link), XtRString, (caddr_t) "true"}, +{"wwwBrowser", "WWWBrowser", XtRString, sizeof(char *), + offset(_browser), XtRString, (caddr_t) NULL}, +{"urlBase", "URLBase", XtRString, sizeof(char *), + offset(_URLbase), XtRString, (caddr_t) NULL}, +#endif +/* BEGIN CHUNK xdvi.c 3 */ +#ifdef SRC_SPECIALS +{"srcSpecialFormat", "SRCSpecialFormat", XtRInt, sizeof(int), + offset(_src_specialFormat), XtRString, "1"}, +{"srcJumpButton", "SRCJumpButton", XtRInt, sizeof(int), + offset(_src_jumpButton), XtRString, "2"}, +{"srcTickShape", "SRCTickShape", XtRInt, sizeof(int), + offset(_src_tickShape), XtRString, "0"}, +{"srcTickSize", "SRCTickSize", XtRString, sizeof(char *), + offset(_src_tickSize), XtRString, "40x70"}, +{"srcCursor", "SRCCursor", XtRInt, sizeof(int), + offset(_src_cursor_shape), XtRString, "90"}, +{"srcEditorCommand", "SRCEditorCommand", XtRString, sizeof(char *), + offset(_src_editorCommand), XtRString, "emacsclient --no-wait '+%u' '%s'"}, +{"srcVerbosity", "SRCVerbosity", XtRInt, sizeof(int), + offset(_src_warn_verbosity), XtRString, "2"}, +{"srcVisibility", "SRCVisibility", XtRBoolean, sizeof(Boolean), + offset(_src_tickVisibility), XtRString, "false"}, +{"srcMode", "SRCMode", XtRBoolean, sizeof(Boolean), + offset(_src_evalMode), XtRString, "false"}, +#endif +/* END CHUNK xdvi.c 3 */ +#ifdef GREY +}; + +static XtResource app_pixel_resources[] = { /* get these later */ +#endif /* GREY */ +{"foreground", "Foreground", XtRPixel, sizeof(Pixel), + offset(_fore_Pixel), XtRString, XtDefaultForeground}, +{"background", "Background", XtRPixel, sizeof(Pixel), + offset(_back_Pixel), XtRString, XtDefaultBackground}, +{"borderColor", "BorderColor", XtRPixel, sizeof(Pixel), + offset(_brdr_Pixel), XtRPixel, (caddr_t) &resource._fore_Pixel}, +{"highlight", "Highlight", XtRPixel, sizeof(Pixel), + offset(_hl_Pixel), XtRPixel, (caddr_t) &resource._fore_Pixel}, +{"cursorColor", "CursorColor", XtRPixel, sizeof(Pixel), + offset(_cr_Pixel), XtRPixel, (caddr_t) &resource._fore_Pixel}, +}; +#undef offset + +static _Xconst char *usagestr[] = { + /* shrinkFactor */ "shrink", +#ifndef VMS + /* S */ "density", + /* density */ silent, +#else + /* density */ "density", +#endif +#ifdef GREY + /* gamma */ "g", +#endif +#ifdef GRID + /* grid1 */ "color", + /* grid2 */ "color", + /* grid3 */ "color", +#endif /* GRID */ + /* p */ "pixels", + /* margins */ "dimen", + /* sidemargin */ "dimen", + /* topmargin */ "dimen", + /* offsets */ "dimen", + /* xoffset */ "dimen", + /* yoffset */ "dimen", + /* paper */ "papertype", + /* altfont */ "font", + /* mfmode */ "mode-def", + /* rv */ "^-l", "-rv", +#ifdef BUTTONS + /* shrinkbutton1 */ subst, + /* shrinkbutton2 */ silent, + /* shrinkbutton3 */ silent, + /* shrinkbutton4 */ silent, +#endif + /* mgs */ subst, + /* mgs1 */ silent, + /* mgs2 */ silent, + /* mgs3 */ silent, + /* mgs4 */ silent, + /* mgs5 */ silent, + /* bw */ "^-safer", "-bw <width>", + /* fg */ "color", + /* foreground */ silent, + /* bg */ "color", + /* background */ silent, + /* hl */ "color", + /* bd */ "^-hl", "-bd <color>", + /* cr */ "color", +#ifndef VMS + /* display */ "^-cr", "-display <host:display>", +#else + /* display */ "^-cr", "-display <host::display>", +#endif + /* geometry */ "^-cr", "-geometry <geometry>", + /* icongeometry */ "geometry", + /* iconic */ "^-icongeometry", "-iconic", +#ifdef BUTTONS + /* font */ "^-icongeometry", "-font <font>", +#endif +#ifdef PS_GS + /* interpreter */ "path", + /* gspalette */ "monochrome|grayscale|color", +#endif + /* debug */ "bitmask", +#ifdef HTEX + /* browser */ "WWWbrowser", + /* URLbase */ "base URL", +#endif +/* BEGIN CHUNK xdvi.c 4 */ +#ifdef SRC_SPECIALS + /* src_SpecialFormat */ "[0,1,2]", + /* src_JumpButtons */ "button", + /* src_TickShape */ "[0,1,2,3]", + /* src_TickSize */ "geometry", + /* src_Cursor */ "shape", + /* src_EditorCommand */ "commandstring", + /* src_verbosity */ "[0,1,2]", + /* _src_tickVisibility */ silent, + /* _src_evalMode */ silent, +#endif +/* END CHUNK xdvi.c 4 */ + /* [dummy] */ "z" +}; + +static char *TmpDir=NULL; + +#ifndef MOTIF + +#ifdef NOQUERY +#define drawWidgetClass widgetClass +#else + +/* ARGSUSED */ +static XtGeometryResult +QueryGeometry(w, constraints, reply) + Widget w; + XtWidgetGeometry *constraints, *reply; +{ + reply->request_mode = CWWidth | CWHeight; + reply->width = page_w; + reply->height = page_h; + return XtGeometryAlmost; +} + +#include <X11/IntrinsicP.h> +#include <X11/CoreP.h> + +#ifdef lint +WidgetClassRec widgetClassRec; +#endif + + /* if the following gives you trouble, just compile with -DNOQUERY */ +static WidgetClassRec drawingWidgetClass = { + { + /* superclass */ &widgetClassRec, + /* class_name */ "Draw", + /* widget_size */ sizeof(WidgetRec), + /* class_initialize */ NULL, + /* class_part_initialize*/ NULL, + /* class_inited */ FALSE, + /* initialize */ NULL, + /* initialize_hook */ NULL, + /* realize */ XtInheritRealize, + /* actions */ NULL, + /* num_actions */ 0, + /* resources */ NULL, + /* num_resources */ 0, + /* xrm_class */ NULLQUARK, + /* compress_motion */ FALSE, + /* compress_exposure */ TRUE, + /* compress_enterleave*/ FALSE, + /* visible_interest */ FALSE, + /* destroy */ NULL, + /* resize */ XtInheritResize, + /* expose */ XtInheritExpose, + /* set_values */ NULL, + /* set_values_hook */ NULL, + /* set_values_almost */ XtInheritSetValuesAlmost, + /* get_values_hook */ NULL, + /* accept_focus */ XtInheritAcceptFocus, + /* version */ XtVersion, + /* callback_offsets */ NULL, + /* tm_table */ XtInheritTranslations, + /* query_geometry */ QueryGeometry, + /* display_accelerator */ XtInheritDisplayAccelerator, + /* extension */ NULL + } +}; + +#define drawWidgetClass &drawingWidgetClass + +#endif /* NOQUERY */ +#endif /* MOTIF */ + +static Arg vport_args[] = { +#ifndef MOTIF +#ifdef BUTTONS + {XtNborderWidth, (XtArgVal) 0}, + {XtNtop, (XtArgVal) XtChainTop}, + {XtNbottom, (XtArgVal) XtChainBottom}, + {XtNleft, (XtArgVal) XtChainLeft}, + {XtNright, (XtArgVal) XtChainRight}, +#endif + {XtNallowHoriz, (XtArgVal) True}, + {XtNallowVert, (XtArgVal) True}, +#else /* MOTIF */ + {XmNscrollingPolicy, (XtArgVal) XmAUTOMATIC}, + {XmNborderWidth, (XtArgVal) 0}, + {XmNleftAttachment, (XtArgVal) XmATTACH_FORM}, + {XmNtopAttachment, (XtArgVal) XmATTACH_FORM}, + {XmNbottomAttachment, (XtArgVal) XmATTACH_FORM}, + {XmNrightAttachment, (XtArgVal) XmATTACH_FORM}, +#endif /* MOTIF */ +}; + +static Arg draw_args[] = { +#ifndef MOTIF + {XtNwidth, (XtArgVal) 0}, + {XtNheight, (XtArgVal) 0}, + {XtNx, (XtArgVal) 0}, + {XtNy, (XtArgVal) 0}, + {XtNlabel, (XtArgVal) ""}, +#else /* MOTIF */ + {XmNwidth, (XtArgVal) 0}, + {XmNheight, (XtArgVal) 0}, + {XmNbottomAttachment, (XtArgVal) XmATTACH_WIDGET}, +#endif /* MOTIF */ +}; + +#ifdef BUTTONS +static Arg form_args[] = { +#ifndef MOTIF + {XtNdefaultDistance, (XtArgVal) 0}, +#else /* MOTIF */ + {XmNhorizontalSpacing, (XtArgVal) 0}, + {XmNverticalSpacing, (XtArgVal) 0}, +#endif /* MOTIF */ +}; +#endif + +#ifdef HTEX + +static Arg pane_args[] = { + {XtNorientation, (XtArgVal) XtorientVertical}, +}; + +/* Create the anchor information stuff at the bottom of the page */ + +/* Anchor search: a dialog box */ +char anchorsearchstring[1024]; +char anchorask[] = "Access new URL:"; +static Arg anchorsearch_args[] = { + {XtNwidth, (XtArgVal) 500}, + {XtNheight, (XtArgVal) 70}, + {XtNlabel, (XtArgVal) anchorask}, + {XtNvalue, (XtArgVal) anchorsearchstring}, + {XtNmin, (XtArgVal) 70}, + {XtNscrollHorizontal, (XtArgVal) XawtextScrollWhenNeeded}, +}; + +/* anchorinfo = Ascii text widget */ +static Arg anchorinfo_args[] = { + {XtNwidth, (XtArgVal) 500}, + {XtNheight, (XtArgVal) 20}, + {XtNstring, (XtArgVal) ""}, + {XtNmin, (XtArgVal) 20}, + {XtNscrollVertical, (XtArgVal) XawtextScrollWhenNeeded}, + {XtNscrollHorizontal, (XtArgVal) XawtextScrollWhenNeeded}, +}; + +#endif + +#else /* not TOOLKIT */ + +static char *display; +static char *geometry; +static char *margins; +static char *offsets; +static Boolean hush; +static Boolean iconic = False; + +#define ADDR(x) (caddr_t) &resource.x + +static struct option { + _Xconst char *name; + _Xconst char *resource; + enum {FalseArg, TrueArg, StickyArg, SepArg} + argclass; + enum {BooleanArg, Bool3Arg, StringArg, NumberArg, FloatArg} + argtype; + int classcount; + _Xconst char *usagestr; + caddr_t address; +} options[] = { +{"+", NULL, StickyArg, StringArg, 1, + NULL, (caddr_t) &curr_page}, +{"-s", "shrinkFactor", SepArg, NumberArg, 1, + "shrink", (caddr_t) &shrink_factor}, +#ifndef VMS +{"-S", NULL, SepArg, NumberArg, 2, + "density", ADDR(_density)}, +{"-density", "densityPercent", SepArg, NumberArg, 1, + silent, ADDR(_density)}, +#else +{"-density", "densityPercent", SepArg, NumberArg, 1, + "density", ADDR(_density)}, +#endif +#ifdef GREY +{"-nogrey", NULL, FalseArg, BooleanArg, 2, + NULL, ADDR(_use_grey)}, +{"+nogrey", "grey", TrueArg, BooleanArg, 1, + NULL, ADDR(_use_grey)}, +{"-gamma", "gamma", SepArg, FloatArg, 1, + "g", ADDR(_gamma)}, +{"-install", NULL, TrueArg, Bool3Arg, 2, + NULL, ADDR(install)}, +{"-noinstall", "install", FalseArg, Bool3Arg, 1, + NULL, ADDR(install)}, +#endif +#ifdef GRID +{"-grid1", "grid1Color", SepArg, StringArg, 1, + "color", ADDR(grid1_color)}, +{"-grid2", "grid2Color", SepArg, StringArg, 1, + "color", ADDR(grid2_color)}, +{"-grid3", "grid3Color", SepArg, StringArg, 1, + "color", ADDR(grid3_color)}, +#endif /* GRID */ +{"-p", "pixelsPerInch", SepArg, NumberArg, 1, + "pixels", ADDR(_pixels_per_inch)}, +{"-margins", "Margin", SepArg, StringArg, 3, + "dimen", (caddr_t) &margins}, +{"-sidemargin", "sideMargin", SepArg, StringArg, 1, + "dimen", ADDR(sidemargin)}, +{"-topmargin", "topMargin", SepArg, StringArg, 1, + "dimen", ADDR(topmargin)}, +{"-offsets", "Offset", SepArg, StringArg, 3, + "dimen", (caddr_t) &offsets}, +{"-xoffset", "xOffset", SepArg, StringArg, 1, + "dimen", ADDR(xoffset)}, +{"-yoffset", "yOffset", SepArg, StringArg, 1, + "dimen", ADDR(yoffset)}, +{"-paper", "paper", SepArg, StringArg, 1, + "papertype", ADDR(paper)}, +{"-altfont", "altFont", SepArg, StringArg, 1, + "font", ADDR(_alt_font)}, +{"-nomakepk", "makePk", FalseArg, BooleanArg, 2, + NULL, ADDR(makepk)}, +{"+nomakepk", "makePk", TrueArg, BooleanArg, 1, + NULL, ADDR(makepk)}, +{"-mfmode", "mfMode", SepArg, StringArg, 1, + "mode-def", ADDR(mfmode)}, +{"-l", NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(_list_fonts)}, +{"+l", "listFonts", FalseArg, BooleanArg, 1, + NULL, ADDR(_list_fonts)}, +{"-rv", NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(reverse)}, +{"+rv", "reverseVideo", FalseArg, BooleanArg, 1, + NULL, ADDR(reverse)}, +{"-mgs", NULL, SepArg, StringArg, 2, + subst, ADDR(mg_arg[0])}, +{"-mgs1", "magnifierSize1",SepArg, StringArg, 1, + silent, ADDR(mg_arg[0])}, +{"-mgs2", "magnifierSize2",SepArg, StringArg, 1, + silent, ADDR(mg_arg[1])}, +{"-mgs3", "magnifierSize3",SepArg, StringArg, 1, + silent, ADDR(mg_arg[2])}, +{"-mgs4", "magnifierSize4",SepArg, StringArg, 1, + silent, ADDR(mg_arg[3])}, +{"-mgs5", "magnifierSize5",SepArg, StringArg, 1, + silent, ADDR(mg_arg[4])}, +{"-warnspecials", NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(_warn_spec)}, +{"+warnspecials", "warnSpecials", FalseArg, BooleanArg, 1, + NULL, ADDR(_warn_spec)}, +{"-hush", NULL, TrueArg, BooleanArg, 6, + NULL, (caddr_t) &hush}, +{"+hush", "Hush", FalseArg, BooleanArg, 5, + NULL, (caddr_t) &hush}, +{"-hushchars", NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(_hush_chars)}, +{"+hushchars", "hushLostChars", FalseArg, BooleanArg, 1, + NULL, ADDR(_hush_chars)}, +{"-hushchecksums", NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(_hush_chk)}, +{"+hushchecksums","hushChecksums", FalseArg, BooleanArg, 1, + NULL, ADDR(_hush_chk)}, +{"-safer", NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(safer)}, +{"+safer", "safer", FalseArg, BooleanArg, 1, + NULL, ADDR(safer)}, +{"-bw", NULL, SepArg, NumberArg, 2, + "width", (caddr_t) &bwidth}, +{"-borderwidth", "borderWidth", SepArg, NumberArg, 1, + silent, (caddr_t) &bwidth}, +{"-fg", NULL, SepArg, StringArg, 2, + "color", ADDR(fore_color)}, +{"-foreground", "foreground", SepArg, StringArg, 1, + silent, ADDR(fore_color)}, +{"-bg", NULL, SepArg, StringArg, 2, + "color", ADDR(back_color)}, +{"-background", "background", SepArg, StringArg, 1, + silent, ADDR(back_color)}, +{"-hl", "highlight", SepArg, StringArg, 1, + "color", (caddr_t) &high_color}, +{"-bd", NULL, SepArg, StringArg, 2, + "color", (caddr_t) &brdr_color}, +{"-bordercolor","borderColor", SepArg, StringArg, 1, + silent, (caddr_t) &brdr_color}, +{"-cr", "cursorColor", SepArg, StringArg, 1, + "color", (caddr_t) &curs_color}, +#ifndef VMS +{"-display", NULL, SepArg, StringArg, 1, + "host:display", (caddr_t) &display}, +#else +{"-display", NULL, SepArg, StringArg, 1, + "host::display", (caddr_t) &display}, +#endif +{"-geometry", "geometry", SepArg, StringArg, 1, + "geometry", (caddr_t) &geometry}, +{"-icongeometry","iconGeometry",StickyArg, StringArg, 1, + "geometry", ADDR(icon_geometry)}, +{"-iconic", NULL, TrueArg, BooleanArg, 2, + NULL, (caddr_t) &iconic}, +{"+iconic", "iconic", FalseArg, BooleanArg, 1, + NULL, (caddr_t) &iconic}, +{"-keep", NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(keep_flag)}, +{"+keep", "keepPosition", FalseArg, BooleanArg, 1, + NULL, ADDR(keep_flag)}, +{"-copy", NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(copy)}, +{"+copy", "copy", FalseArg, BooleanArg, 1, + NULL, ADDR(copy)}, +{"-thorough", NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(thorough)}, +{"+thorough", "thorough", FalseArg, BooleanArg, 1, + NULL, ADDR(thorough)}, +#if PS +{"-nopostscript", NULL, FalseArg, BooleanArg, 2, + NULL, ADDR(_postscript)}, +{"+nopostscript", "postscript", TrueArg, BooleanArg, 1, + NULL, ADDR(_postscript)}, +{"-noscan", NULL, FalseArg, BooleanArg, 2, + NULL, ADDR(prescan)}, +{"+noscan", "prescan", TrueArg, BooleanArg, 1, + NULL, ADDR(prescan)}, +{"-allowshell", NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(allow_shell)}, +{"+allowshell", "allowShell", FalseArg, BooleanArg, 1, + NULL, ADDR(allow_shell)}, +#ifdef PS_DPS +{"-nodps", NULL, FalseArg, BooleanArg, 2, + NULL, ADDR(useDPS)}, +{"+nodps", "dps", TrueArg, BooleanArg, 1, + NULL, ADDR(useDPS)}, +#endif +#ifdef PS_NEWS +{"-nonews", NULL, FalseArg, BooleanArg, 2, + NULL, ADDR(useNeWS)}, +{"+nonews", "news", TrueArg, BooleanArg, 1, + NULL, ADDR(useNeWS)}, +#endif +#ifdef PS_GS +{"-noghostscript",NULL, FalseArg, BooleanArg, 2, + NULL, ADDR(useGS)}, +{"+noghostscript","ghostscript", TrueArg, BooleanArg, 1, + NULL, ADDR(useGS)}, +{"-nogssafer", NULL, FalseArg, BooleanArg, 2, + NULL, ADDR(gs_safer)}, +{"+nogssafer", "gsSafer", TrueArg, BooleanArg, 1, + NULL, ADDR(gs_safer)}, +{"-nogsalpha", NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(gs_alpha)}, +{"+nogsalpha", "gsAlpha", FalseArg, BooleanArg, 1, + NULL, ADDR(gs_alpha)}, +{"-interpreter", "interpreter", SepArg, StringArg, 1, + "path", ADDR(gs_path)}, +{"-gspalette", "palette", SepArg, StringArg, 1, + "monochrome|grayscale|color", ADDR(gs_palette)}, +#endif +#endif /* PS */ +{"-debug", "debugLevel", SepArg, StringArg, 1, + "bitmask", ADDR(debug_arg)}, +{"-version", NULL, TrueArg, BooleanArg, 2, + NULL, ADDR(version_flag)}, +{"+version", "version", FalseArg, BooleanArg, 1, + NULL, ADDR(version_flag)}, +#ifdef HTEX +{"-underlink", "underLink", TrueArg, BooleanArg, 2, + NULL, ADDR(_underline_link)}, +{"+underlink", "underLink", FalseArg, BooleanArg, 1, + NULL, ADDR(_underline_link)}, +{"-browser", "wwwBrowser", SepArg, StringArg, 1, ADDR(_browser)}, +{"-base", "urlBase", SepArg, StringArg, 1, ADDR(_URLbase)}, +#endif +/* BEGIN CHUNK xdvi.c 5 */ +#ifdef SRC_SPECIALS +{"-srcSpecialFormat", "srcSpecialFormat", SepArg, NumberArg, 1, "[0,1,2]", (caddr_t)&src_specialFormat}, +{"-srcJumpButton", "srcJumpButton", SepArg, NumberArg, 1, "button", (caddr_t)&src_jumpButton}, +{"-srcTickShape", "srcTickShape", SepArg, NumberArg, 1, "[0,1,2,3]", (caddr_t)&src_tickShape}, +{"-srcTickSize", "srcTickSize", SepArg, StringArg, 1, "geometry", "40x70"}, +{"-srcCursor", "srcCursor", SepArg, NumberArg, 1, "shape", (caddr_t)&src_cursor_shape}, +{"-srcEditorCommand", "srcEditorCommand", SepArg, StringArg, 1, "commandstring", (caddr_t)&src_editorCommand}, +{"-srcVerbosity", "srcVerbosity", SepArg, NumberArg, 1, "[0,1,2]", (caddr_t)&src_warn_verbosity}, +{"-srcVisibility", "srcVisibility", TrueArg, BooleanArg, 2, NULL, ADDR(_src_tickVisibility)}, +{"+srcVisibility", "srcVisibility", FalseArg, BooleanArg, 1, NULL, ADDR(_src_tickVisibility)}, +{"-srcMode", "srcMode", TrueArg, BooleanArg, 2, NULL, ADDR(_src_evalMode)}, +{"+srcMode", "srcMode", FalseArg, BooleanArg, 1, NULL, ADDR(_src_evalMode)}, +#endif +/* END CHUNK xdvi.c 5 */ +}; + +#endif /* not TOOLKIT */ + +static NORETURN void +usage() { +#ifdef TOOLKIT + XrmOptionDescRec *opt; + _Xconst char **usageptr = usagestr; +#else + struct option *opt; +#endif + _Xconst char **sv = subst_val; + _Xconst char *str1; + _Xconst char *str2; + int col = 23; + int n; + +#ifdef Omega + Fputs("Usage: oxdvi [+[<page>]]", stderr); +#else + Fputs("Usage: xdvi [+[<page>]]", stderr); +#endif + for (opt = options; opt < options + XtNumber(options); ++opt) { +#ifdef TOOLKIT + str1 = opt->option; + if (*str1 != '-') continue; + str2 = NULL; + if (opt->argKind != XrmoptionNoArg) { + str2 = *usageptr++; + if (str2 == silent) continue; + if (str2 == subst) { + str1 = *sv++; + str2 = NULL; + } + } + for (;;) { + n = strlen(str1) + 3; + if (str2 != NULL) n += strlen(str2) + 3; + if (col + n < 80) Putc(' ', stderr); + else { + Fputs("\n\t", stderr); + col = 8 - 1; + } + if (str2 == NULL) + Fprintf(stderr, "[%s]", str1); + else + Fprintf(stderr, "[%s <%s>]", str1, str2); + col += n; + if (**usageptr != '^' + || strcmp(*usageptr + 1, opt->option) != 0) break; + ++usageptr; + str1 = *usageptr++; + str2 = NULL; + } +#else /* not TOOLKIT */ + str1 = opt->name; + str2 = opt->usagestr; + if (*str1 != '-' || str2 == silent) continue; + if (str2 == subst) { + str1 = *sv++; + str2 = NULL; + } + n = strlen(str1) + 3; + if (str2 != NULL) n += strlen(str2) + 3; + if (col + n < 80) Putc(' ', stderr); + else { + Fputs("\n\t", stderr); + col = 8 - 1; + } + if (str2 == NULL) + Fprintf(stderr, "[%s]", str1); + else + Fprintf(stderr, "[%s <%s>]", str1, str2); + col += n; +#endif /* not TOOLKIT */ + } + if (col + 9 < 80) Putc(' ', stderr); + else Fputs("\n\t", stderr); +#ifdef SELFILE + Fputs("[dvi_file]\n", stderr); +#else + Fputs("dvi_file\n", stderr); +#endif + exit(1); +} + +static int +atopix(arg) + _Xconst char *arg; +{ + int len = strlen(arg); + _Xconst char *arg_end = arg; + char tmp[11]; + double factor; + + while ((*arg_end >= '0' && *arg_end <= '9') || *arg_end == '.') + if (arg_end >= arg + XtNumber(tmp) - 1) return 0; + else ++arg_end; + bcopy(arg, tmp, arg_end - arg); + tmp[arg_end - arg] = '\0'; + +#if A4 + factor = 1.0 / 2.54; /* cm */ +#else + factor = 1.0; /* inches */ +#endif + if (len > 2) + switch (arg[len - 2] << 8 | arg[len - 1]) { +#if A4 + case 'i' << 8 | 'n': factor = 1.0; break; +#else + case 'c' << 8 | 'm': factor = 1.0 / 2.54; break; +#endif + case 'm' << 8 | 'm': factor = 1.0 / 25.4; break; + case 'p' << 8 | 't': factor = 1.0 / 72.27; break; + case 'p' << 8 | 'c': factor = 12.0 / 72.27; break; + case 'b' << 8 | 'p': factor = 1.0 / 72.0; break; + case 'd' << 8 | 'd': factor = 1238.0 / 1157.0 / 72.27; break; + case 'c' << 8 | 'c': factor = 12 * 1238.0 / 1157.0 / 72.27; + break; + case 's' << 8 | 'p': factor = 1.0 / 72.27 / 65536; break; + } + + return factor * atof(tmp) * pixels_per_inch + 0.5; +} + +#ifdef GRID +/* extract the unit used in paper size specification */ +/* the information is used to decide the initial grid separation */ +static int +atopixunit(arg) + _Xconst char *arg; +{ + int len = strlen(arg); + + return (len > 2 && arg[len - 2] == 'c' && arg[len - 1] == 'm' ? + 1.0 / 2.54 : 1.0) * pixels_per_inch + 0.5; +} +#endif /* GRID */ + +/** + ** Main programs start here. + **/ + +#ifdef TOOLKIT + +#ifdef GREY +static Arg temp_args1[] = { + {XtNdepth, (XtArgVal) 0}, + {XtNvisual, (XtArgVal) 0}, + {XtNcolormap, (XtArgVal) 0}, +}; +#define temp_args1a (temp_args1 + 2) +#endif + +static Arg temp_args2[] = { + {XtNiconX, (XtArgVal) 0}, + {XtNiconY, (XtArgVal) 0}, +}; + +static Arg temp_args3 = {XtNborderWidth, (XtArgVal) &bwidth}; + +static Pixmap icon_pm; +static Arg temp_args4 = {XtNiconPixmap, (XtArgVal) &icon_pm}; + +static Arg temp_args5[] = { + {XtNtitle, (XtArgVal) 0}, + {XtNiconName, (XtArgVal) 0}, + {XtNinput, (XtArgVal) True}, +}; + +static Arg set_wh_args[] = { + {XtNwidth, (XtArgVal) 0}, + {XtNheight, (XtArgVal) 0}, +}; + + +#ifdef GREY + +/* + * Alternate routine to convert color name to Pixel (needed to substitute + * "black" or "white" for BlackPixelOfScreen, etc., since a different + * visual and colormap are in use). + */ + +#if XtSpecificationRelease >= 5 + +/*ARGSUSED*/ +static Boolean +XdviCvtStringToPixel(dpy, args, num_args, fromVal, toVal, closure_ret) + Display *dpy; + XrmValuePtr args; + Cardinal *num_args; + XrmValuePtr fromVal; + XrmValuePtr toVal; + XtPointer *closure_ret; +{ + XrmValue replacement_val; + Boolean default_is_fg; + + if ((strcmp((String) fromVal->addr, XtDefaultForeground) == 0 + && (default_is_fg = True)) + || (strcmp((String) fromVal->addr, XtDefaultBackground) == 0 + && ((default_is_fg = False), True))) { + replacement_val.size = sizeof(String); + replacement_val.addr = (default_is_fg == resource.reverse) + ? "white" : "black"; + fromVal = &replacement_val; + } + + return + XtCvtStringToPixel(dpy, args, num_args, fromVal, toVal, closure_ret); +} + +#else /* XtSpecificationRelease < 5 */ + +/* + * Copied from the X11R4 source code. + */ + +#define done(type, value) \ + { \ + if (toVal->addr != NULL) { \ + if (toVal->size < sizeof(type)) { \ + toVal->size = sizeof(type); \ + return False; \ + } \ + *(type*)(toVal->addr) = (value); \ + } \ + else { \ + static type static_val; \ + static_val = (value); \ + toVal->addr = (XtPointer)&static_val; \ + } \ + toVal->size = sizeof(type); \ + return True; \ + } + +static Boolean +XdviCvtStringToPixel(dpy, args, num_args, fromVal, toVal, closure_ret) + Display* dpy; + XrmValuePtr args; + Cardinal *num_args; + XrmValuePtr fromVal; + XrmValuePtr toVal; + XtPointer *closure_ret; +{ + String str = (String)fromVal->addr; + XColor screenColor; + XColor exactColor; + Screen *screen; + Colormap colormap; + Status status; + String params[1]; + Cardinal num_params=1; + + if (*num_args != 2) + XtErrorMsg("wrongParameters", "cvtStringToPixel", + "XtToolkitError", + "String to pixel conversion needs screen and colormap arguments", + (String *)NULL, (Cardinal *)NULL); + + screen = *((Screen **) args[0].addr); + colormap = *((Colormap *) args[1].addr); + + if (strcmp(str, XtDefaultBackground) == 0) { + *closure_ret = False; + str = (resource.reverse ? "black" : "white"); + } + else if (strcmp(str, XtDefaultForeground) == 0) { + *closure_ret = False; + str = (resource.reverse ? "white" : "black"); + } + + if (*str == '#') { /* some color rgb definition */ + + status = XParseColor(DisplayOfScreen(screen), colormap, + (char*)str, &screenColor); + + if (status != 0) + status = XAllocColor(DisplayOfScreen(screen), colormap, + &screenColor); + } else /* some color name */ + + status = XAllocNamedColor(DisplayOfScreen(screen), colormap, + (char*)str, &screenColor, &exactColor); + if (status == 0) { + params[0] = str; + XtWarningMsg("noColormap", "cvtStringToPixel", + "XtToolkitError", + "Cannot allocate colormap entry for \"%s\"", + params,&num_params); + return False; + } else { + *closure_ret = (char*)True; + done(Pixel, screenColor.pixel); + } +} +#undef done + +#endif /* XtSpecificationRelease < 5 */ + +/* + * Convert string to yes/no/maybe. Adapted from the X toolkit. + */ + +/*ARGSUSED*/ +Boolean XdviCvtStringToBool3(dpy, args, num_args, fromVal, toVal, closure_ret) + Display *dpy; + XrmValuePtr args; + Cardinal *num_args; + XrmValuePtr fromVal; + XrmValuePtr toVal; + XtPointer *closure_ret; +{ + String str = (String)fromVal->addr; + static Bool3 value; + + if ( memicmp(str, "true", 5) == 0 + || memicmp(str, "yes", 4) == 0 + || memicmp(str, "on", 3) == 0 + || memicmp(str, "1", 2) == 0) value = True; + + else if (memicmp(str, "false", 6) == 0 + || memicmp(str, "no", 3) == 0 + || memicmp(str, "off", 4) == 0 + || memicmp(str, "0", 2) == 0) value = False; + + else if (memicmp(str, "maybe", 6) == 0) value = Maybe; + + else { + XtDisplayStringConversionWarning(dpy, str, XtRBoolean); + return False; + } + + if (toVal->addr != NULL) { + if (toVal->size < sizeof(Bool3)) { + toVal->size = sizeof(Bool3); + return False; + } + *(Bool3 *)(toVal->addr) = value; + } + else toVal->addr = (XPointer) &value; + + toVal->size = sizeof(Bool3); + return True; +} + +#endif /* GREY */ + +#else /* not TOOLKIT */ + +struct _resource resource = { + /* density */ 40, +#ifdef GREY + /* gamma */ 1.0, +#endif + /* pixels_per_inch */ BDPI, + /* _delay_rulers */ True, + /* _tick_length */ 4, + /* _tick_units */ "pt", + /* sidemargin */ NULL, + /* topmargin */ NULL, + /* xoffset */ NULL, + /* yoffset */ NULL, + /* paper */ DEFAULT_PAPER, + /* alt_font */ ALTFONT, + /* makepk */ MAKE_TEX_PK_BY_DEFAULT, + /* mfmode */ MFMODE, + /* list_fonts */ False, + /* reverse */ False, + /* warn_spec */ False, + /* hush_chars */ False, + /* hush_chk */ False, + /* safer */ False, + /* fore_color */ NULL, + /* back_color */ NULL, + /* fore_Pixel */ (Pixel) 0, + /* back_Pixel */ (Pixel) 0, + /* icon_geometry */ NULL, + /* keep_flag */ False, + /* copy */ False, + /* thorough */ False, +#if PS + /* postscript */ True, + /* prescan */ True, + /* allow_shell */ False, +#ifdef PS_DPS + /* useDPS */ True, +#endif +#ifdef PS_NEWS + /* useNeWS */ True, +#endif +#ifdef PS_GS + /* useGS */ True, + /* gs_safer */ True, + /* gs_alpha */ False, + /* gs_path */ GS_PATH, + /* gs_palette */ "Color", +#endif +#endif /* PS */ + /* debug_arg */ NULL, + /* version_flag */ False, + /* mg_arg */ {NULL, NULL, NULL, NULL, NULL}, +#ifdef GREY + /* use_grey */ True, + /* install */ Maybe, +#endif +#ifdef GRID + /* grid_mode */ 0, + /* grid1_color */ NULL, + /* grid2_color */ NULL, + /* grid3_color */ NULL, +#endif /* GRID */ +#ifdef HTEX + /* _underline_link */ True, + /* _browser */ (char *) NULL, + /* _URLbase */ (char *) NULL, +#endif +/* BEGIN CHUNK xdvi.c 6 */ +#ifdef SRC_SPECIALS + /* _src_specialFormat */ 2, + /* _src_jumpButton */ 1, + /* _src_tickShape */ 1, + /* _src_tickSize */ "40x70", + /* _src_cursor_shape */ 90, + /* _src_editorCommand */ "emacsclient --no-wait '+%u' '%s'", + /* _src_warn_verbosity */ 2, + /* _src_tickVisibility */ False, + /* _src_evalMode */ False, +#endif +/* END CHUNK xdvi.c 6 */ +}; + +static Pixel +string_to_pixel(strp) /* adapted from the toolkit */ + char **strp; +{ + char *str = *strp; + Status status; + XColor color, junk; + + if (*str == '#') { /* an rgb definition */ + status = XParseColor(DISP, our_colormap, str, &color); + if (status != 0) + status = XAllocColor(DISP, our_colormap, &color); + } + else /* a name */ + status = XAllocNamedColor(DISP, our_colormap, str, &color, &junk); + if (status == 0) { + Fprintf(stderr, "Cannot allocate colormap entry for \"%s\"\n", str); + *strp = NULL; + return (Pixel) 0; + } + return color.pixel; +} + +/* + * Process the option table. This is not guaranteed for all possible + * option tables, but at least it works for this one. + */ + +static void +parse_options(argc, argv) + int argc; + char **argv; +{ + char **arg; + char **argvend = argv + argc; + char *optstring; + caddr_t addr; + struct option *opt, *lastopt, *candidate; + int len1, len2, matchlen; + + /* + * Step 1. Process command line options. + */ + for (arg = argv + 1; arg < argvend; ++arg) { + len1 = strlen(*arg); + candidate = NULL; + matchlen = 0; + for (opt = options; opt < options + XtNumber(options); ++opt) { + len2 = strlen(opt->name); + if (opt->argclass == StickyArg) { + if (matchlen <= len2 && !strncmp(*arg, opt->name, len2)) { + candidate = opt; + matchlen = len2; + } + } + else if (len1 <= len2 && matchlen <= len1 && + !strncmp(*arg, opt->name, len1)) { + if (len1 == len2) { + candidate = opt; + break; + } + if (matchlen < len1) candidate = opt; + else if (candidate && candidate->argclass != StickyArg) + candidate = NULL; + matchlen = len1; + } + } + if (candidate == NULL) { + if (**arg == '-' || dvi_name) usage(); + else { + /* need to make sure that dvi_name can be freed safely */ + dvi_name = xmalloc((unsigned) strlen(*arg)+1); + Strcpy(dvi_name, *arg); + continue; + } + } + /* flag it for subsequent processing */ + candidate->resource = (char *) candidate; + /* store the value */ + addr = candidate->address; + switch (candidate->argclass) { + case FalseArg: *((Boolean *) addr) = False; continue; + case TrueArg: *((Boolean *) addr) = True; continue; + case StickyArg: optstring = *arg + strlen(candidate->name); + break; + case SepArg: + ++arg; + if (arg >= argvend) usage(); + optstring = *arg; + break; + } + switch (candidate->argtype) { + case StringArg: *((char **) addr) = optstring; break; + case NumberArg: *((int *) addr) = atoi(optstring); break; + case FloatArg: *((float *) addr) = atof(optstring); break; + default: ; + } + } + /* + * Step 2. Propagate classes for command line arguments. Backwards. + */ + for (opt = options + XtNumber(options) - 1; opt >= options; --opt) + if (opt->resource == (char *) opt) { + addr = opt->address; + lastopt = opt + opt->classcount; + for (candidate = opt; candidate < lastopt; ++candidate) { + if (candidate->resource != NULL) { + switch (opt->argtype) { + case BooleanArg: + case Bool3Arg: /* same type as Boolean */ + *((Boolean *) candidate->address) = + *((Boolean *) addr); + break; + case StringArg: + *((char **) candidate->address) = + *((char **) addr); + break; + case NumberArg: + *((int *) candidate->address) = *((int *) addr); + break; + case FloatArg: + *((float *) candidate->address) = + *((float *) addr); + break; + } + candidate->resource = NULL; + } + } + } + + if ((DISP = XOpenDisplay(display)) == NULL) + oops("Can't open display"); + SCRN = DefaultScreenOfDisplay(DISP); + /* + * Step 3. Handle resources (including classes). + */ + for (opt = options; opt < options + XtNumber(options); ++opt) + if (opt->resource && + ((optstring = XGetDefault(DISP, prog, opt->resource)) || + (optstring = XGetDefault(DISP, "XDvi", opt->resource)))) + { + lastopt = opt + opt->classcount; + for (candidate = opt; candidate < lastopt; ++candidate) + if (candidate->resource != NULL) switch (opt->argtype) { + case Bool3Arg: + if ( memicmp(optstring, "maybe", 6) == 0) + { + * (Bool3 *) candidate->address = Maybe; + break; + } + /* otherwise, fall through; the underlying */ + /* types of Bool3 and Boolean are the same. */ + case BooleanArg: + * (Boolean *) candidate->address = + ( memicmp(optstring, "true", 5) == 0 + || memicmp(optstring, "yes", 4) == 0 + || memicmp(optstring, "on", 3) == 0 + || memicmp(optstring, "1", 2) == 0); + break; + case StringArg: + * (char **) candidate->address = optstring; + break; + case NumberArg: + * (int *) candidate->address = atoi(optstring); + break; + case FloatArg: + * (float *) candidate->address = + atof(optstring); + } + } +} + +#endif /* not TOOLKIT */ + +static _Xconst char *paper_types[] = { + "us", "8.5x11in", + "usr", "11x8.5in", + "legal", "8.5x14in", + "foolscap", "13.5x17.0in", /* ??? */ + + /* ISO `A' formats, Portrait */ + "a1", "59.4x84.0cm", + "a2", "42.0x59.4cm", + "a3", "29.7x42.0cm", + "a4", "21.0x29.7cm", + "a5", "14.85x21.0cm", + "a6", "10.5x14.85cm", + "a7", "7.42x10.5cm", + + /* ISO `A' formats, Landscape */ + "a1r", "84.0x59.4cm", + "a2r", "59.4x42.0cm", + "a3r", "42.0x29.7cm", + "a4r", "29.7x21.0cm", + "a5r", "21.0x14.85cm", + "a6r", "14.85x10.5cm", + "a7r", "10.5x7.42cm", + + /* ISO `B' formats, Portrait */ + "b1", "70.6x100.0cm", + "b2", "50.0x70.6cm", + "b3", "35.3x50.0cm", + "b4", "25.0x35.3cm", + "b5", "17.6x25.0cm", + "b6", "13.5x17.6cm", + "b7", "8.8x13.5cm", + + /* ISO `B' formats, Landscape */ + "b1r", "100.0x70.6cm", + "b2r", "70.6x50.0cm", + "b3r", "50.0x35.3cm", + "b4r", "35.3x25.0cm", + "b5r", "25.0x17.6cm", + "b6r", "17.6x13.5cm", + "b7r", "13.5x8.8cm", + + /* ISO `C' formats, Portrait */ + "c1", "64.8x91.6cm", + "c2", "45.8x64.8cm", + "c3", "32.4x45.8cm", + "c4", "22.9x32.4cm", + "c5", "16.2x22.9cm", + "c6", "11.46x16.2cm", + "c7", "8.1x11.46cm", + + /* ISO `C' formats, Landscape */ + "c1r", "91.6x64.8cm", + "c2r", "64.8x45.8cm", + "c3r", "45.8x32.4cm", + "c4r", "32.4x22.9cm", + "c5r", "22.9x16.2cm", + "c6r", "16.2x11.46cm", + "c7r", "11.46x8.1cm", +}; + +static Boolean +set_paper_type() { + _Xconst char *arg, *arg1; + char temp[21]; + _Xconst char **p; + char *q; + + if (strlen(resource.paper) > sizeof(temp) - 1) return False; + arg = resource.paper; + q = temp; + for (;;) { /* convert to lower case */ + char c = *arg++; + if (c >= 'A' && c <= 'Z') c ^= ('a' ^ 'A'); + *q++ = c; + if (c == '\0') break; + } + arg = temp; + /* perform substitutions */ + for (p = paper_types; p < paper_types + XtNumber(paper_types); p += 2) + if (strcmp(temp, *p) == 0) { + arg = p[1]; + break; + } + arg1 = strchr(arg, 'x'); + if (arg1 == NULL) return False; + unshrunk_paper_w = atopix(arg); + unshrunk_paper_h = atopix(arg1 + 1); +#ifdef GRID + unshrunk_paper_unit = atopixunit(arg); +#endif /* GRID */ + return (unshrunk_paper_w != 0 && unshrunk_paper_h != 0); +} + +/* Set the icon name and title name standard properties on `top_level' + (which we don't pass in because it is a different type for TOOLKIT + !and TOOLKIT). We use the basename of the DVI file (without the + .dvi), so different xdvi invocations can be distinguished, yet + do not use up too much real estate. */ + +void +set_icon_and_title (dvi_name, icon_ret, title_ret, set_std) + char *dvi_name; + char **icon_ret; + char **title_ret; + int set_std; +{ + /* Use basename of DVI file for name in icon and title. */ + unsigned baselen; + char *icon_name, *title_name; + + icon_name = strrchr(dvi_name, '/'); + if (icon_name != NULL) ++icon_name; else icon_name = dvi_name; + baselen = strlen(icon_name); + if (baselen >= sizeof(".dvi") + && strcmp(icon_name + baselen - sizeof(".dvi") + 1, ".dvi") + == 0) { /* remove the .dvi */ + char *p; + + baselen -= sizeof(".dvi") - 1; + p = xmalloc(baselen + 1); + (void) strncpy(p, icon_name, (int) baselen); + p[baselen] = '\0'; + icon_name = p; + } +#ifdef Omega + title_name = xmalloc(baselen + sizeof("(Omega) OXdvi: ")); + Strcpy(title_name, "(Omega) OXdvi: "); +#else + title_name = xmalloc(baselen + sizeof("Xdvi: ")); + Strcpy(title_name, "Xdvi: "); +#endif + Strcat(title_name, icon_name); + + if (icon_ret) *icon_ret = icon_name; + if (title_ret) *title_ret = title_name; + if (set_std) { + Window top_window = +#ifdef TOOLKIT + XtWindow (top_level); +#else + top_level; +#endif + + XSetStandardProperties(DISP, top_window, title_name, icon_name, + (Pixmap) 0, NULL, 0, NULL); + } +} + + +static void remove_temporary_dir(void) + +{ + int err; + + if (TmpDir!=NULL) { + err=rmdir(TmpDir); + if (err!=0 && errno!=ENOENT) { + char *buffer=malloc(160); + if (buffer==NULL) oops("Please buy more RAM"); + sprintf(buffer,"xdvik: Warning: Could not remove temporary directory %s", + TmpDir); + perror(buffer); + } + } +} + +/* Create a temporary directory where we can write files from this program */ +static void make_temporary_dir P1C(char **,tmpdir) + +{ + int ret; + + *tmpdir = tempnam(NULL,"xdvi"); + + if (*tmpdir == NULL) + oops("Out of memory. Exiting."); + + if (debug & DBG_HYPER) + fprintf(stderr,"Making temporary directory %s\n",*tmpdir); + + ret = mkdir(*tmpdir, 0700); + + /* The use of atexit and one variable to store the directory name + makes this procedure a oneoff. Enforce it */ + if (TmpDir!=NULL) + oops("make_temporary_dir called twice!\n"); + + TmpDir=strdup(*tmpdir); + + atexit(remove_temporary_dir); + + if (ret != 0) + /* Didn't work, PANIC! */ + oops("Could not create temporary directory. Exiting."); + +} + + +/* + * main program + */ + +int +main(argc, argv) + int argc; + char **argv; +{ + +#ifndef TOOLKIT + XSizeHints size_hints; + XWMHints wmhints; + int flag; + int x_thick = 0; + int y_thick = 0; +#endif /* TOOLKIT */ +#ifdef MOTIF + Widget menubar; + Widget scale_menu; +#endif + Dimension screen_w, screen_h; + char *title_name; + char *icon_name; + int i; + + /* + * Step 1: Process command-line options and resources. + */ + + /* This has to be a special case, for now. */ + + if (argc == 2 && (strcmp(argv[1], "-version") == 0 || + strcmp(argv[1], "--version") == 0 || + strcmp(argv[1], "+version") == 0 + )) + { + Printf("xdvi(k) version %s\n", TVERSION); + Printf("Copyright (C) 1990-1999 Paul Vojta.\n\ +Primary author of Xdvi: Paul Vojta;\n\ +Xdvi-k maintainer: janl@math.uio.no.\n\ +\n\ +xdvi itself is licensed under the X Consortium license. xdvik relies\n\ +on the kpathsea library which is covered by the GNU LIBRARY General\n\ +Public License (see COPYING.LIB for full details) and libwww which is\n\ +copyrighted by the World Wide Web Consortium and CERN (see COPYRIGH for\n\ +full details).\n\ +\n\ +There is NO WARRANTY of anything.\n"); + exit(0); + } + + if (argc == 2 && ((strcmp (argv[1], "-help") == 0) + || (strcmp (argv[1], "+help") == 0) + || (strcmp (argv[1], "--help") == 0) + )) + { + extern char *kpse_bug_address; + Printf("xdvi(k) version %s\n", TVERSION); + Printf("Preview a DVI file under the X window system.\n%s\n", + kpse_bug_address); + usage (); /* Unfortunately this exits with status 1. */ + } + + +#ifndef VMS + prog = strrchr(*argv, '/'); +#else + prog = strrchr(*argv, ']'); +#endif + if (prog != NULL) ++prog; else prog = *argv; + +#ifdef VMS + if (strchr(prog, '.') != NULL) *strchr(prog, '.') = '\0'; +#endif + + /* We can't initialize this at compile time, because it might be + the result of a function call under POSIX. */ + n_files_left = OPEN_MAX; + + kpse_set_program_name (argv[0], "xdvi"); + kpse_set_program_enabled (kpse_any_glyph_format, + MAKE_TEX_PK_BY_DEFAULT, kpse_src_compile); + + +#if CFGFILE + /* get the debug value (if any) from the environment */ + /* (it's too early to get it from the command line) */ + { + _Xconst char *dbg_str; + + dbg_str = getenv("XDVIDEBUG"); + if (dbg_str != NULL) + debug = atoi(dbg_str); + } +#ifdef SELFAUTO + argv0 = argv[0]; +#endif +#ifndef CFG2RES + readconfig(); /* read config file(s). */ +#else /* CFG2RES */ + { + static _Xconst struct cfg2res cfg2reslist[] = { + {"MFMODE", "mfMode", False}, + {"PIXELSPERINCH", "pixelsPerInch", True}, + {"SHRINKFACTOR", "shrinkFactor", True}, +#ifdef BUTTONS + {"SHRINKBUTTON1", "shrinkButton1", True}, + {"SHRINKBUTTON2", "shrinkButton2", True}, + {"SHRINKBUTTON3", "shrinkButton3", True}, + {"SHRINKBUTTON4", "shrinkButton4", True}, +#endif + {"PAPER", "paper", False}, + }; + + readconfig(cfg2reslist, cfg2reslist + XtNumber(cfg2reslist), + application_resources, + application_resources + XtNumber(application_resources)); + } +#endif /* CFG2RES */ +#endif /* CFGFILE */ + +#ifdef TOOLKIT + + top_level = XtInitialize(prog, "XDvi", options, XtNumber(options), + &argc, argv); + while (--argc > 0) { + if (*(*++argv) == '+') + if (curr_page != NULL) usage(); + else curr_page = *argv + 1; + else if (dvi_name != NULL) usage(); + else { + /* need to make sure that dvi_name can be freed safely */ + dvi_name = xmalloc((unsigned) strlen(*argv)+1); + Strcpy(dvi_name, *argv); + } + } + + DISP = XtDisplay(top_level); + SCRN = XtScreen(top_level); + +#ifdef GREY + XtSetTypeConverter(XtRString, XtRBool3, XdviCvtStringToBool3, + NULL, 0, XtCacheNone, NULL); +#endif + + XtGetApplicationResources(top_level, (XtPointer) &resource, + application_resources, XtNumber(application_resources), + (ArgList) NULL, 0); + shrink_factor = resource.shrinkfactor; + +#if CFGFILE + if (resource.progname != NULL) + prog = resource.progname; +#endif + +#else /* not TOOLKIT */ + + parse_options(argc, argv); + +#endif /* not TOOLKIT */ + + if (resource.mfmode != NULL) { + char *p; + + p = strrchr(resource.mfmode, ':'); + if (p != NULL) { + unsigned int len; + char *p1; + + ++p; + len = p - resource.mfmode; + p1 = xmalloc(len); + bcopy(resource.mfmode, p1, len - 1); + p1[len - 1] = '\0'; + resource.mfmode = p1; + pixels_per_inch = atoi(p); + } + } + if (shrink_factor < 0 || density <= 0 || pixels_per_inch <= 0 +#ifndef SELFILE + || dvi_name == NULL +#endif + ) usage(); + if (shrink_factor > 1) { + bak_shrink = shrink_factor; + mane.shrinkfactor = shrink_factor; /* otherwise it's 1 */ + } + if (resource.debug_arg != NULL) { + debug = isdigit(*resource.debug_arg) ? atoi(resource.debug_arg) + : DBG_ALL; + if (debug & DBG_OPEN) KPSE_DEBUG_SET (KPSE_DEBUG_FOPEN); + if (debug & DBG_STAT) KPSE_DEBUG_SET (KPSE_DEBUG_STAT); + if (debug & DBG_HASH) KPSE_DEBUG_SET (KPSE_DEBUG_HASH); + if (debug & DBG_PATHS) KPSE_DEBUG_SET (KPSE_DEBUG_PATHS); + if (debug & DBG_EXPAND) KPSE_DEBUG_SET (KPSE_DEBUG_EXPAND); + if (debug & DBG_SEARCH) KPSE_DEBUG_SET (KPSE_DEBUG_SEARCH); + } + + if (resource.sidemargin) home_x = atopix(resource.sidemargin); + if (resource.topmargin) home_y = atopix(resource.topmargin); + offset_x = resource.xoffset ? atopix(resource.xoffset) + : pixels_per_inch; + offset_y = resource.yoffset ? atopix(resource.yoffset) + : pixels_per_inch; + if (!set_paper_type()) + oops("Don't recognize paper type %s", resource.paper); + for (i = 0; i < 5; ++i) + if (resource.mg_arg[i] != NULL) { + char *s; + + mg_size[i].w = mg_size[i].h = atoi(resource.mg_arg[i]); + s = strchr(resource.mg_arg[i], 'x'); + if (s != NULL) { + mg_size[i].h = atoi(s + 1); + if (mg_size[i].h <= 0) mg_size[i].w = 0; + } + } +#if PS + if (resource.safer) { + resource.allow_shell = False; +#ifdef PS_GS + resource.gs_safer = True; +#endif + } +#endif /* PS */ +#ifdef PS_GS + { + _Xconst char *CGMcgm = "CGMcgm"; + _Xconst char *cgmp; + + cgmp = strchr(CGMcgm, resource.gs_palette[0]); + if (cgmp == NULL) + oops("Invalid value %s for gs palette option", + resource.gs_palette); + if (cgmp >= CGMcgm + 3) { + static char gsp[] = "x"; + + gsp[0] = *(cgmp - 3); + resource.gs_palette = gsp; + } + } +#endif + + if (resource.version_flag) + Printf("xdvi version %s\n", TVERSION); + + kpse_init_prog ("XDVI", pixels_per_inch, resource.mfmode, alt_font); + + if (debug) { + fprintf(stderr,"XDVI %d/%d/%s/%s\n", pixels_per_inch, shrink_factor, + resource.mfmode, alt_font); + fprintf(stderr,"Paper %s\n", resource.paper); + } + + kpse_set_program_enabled (kpse_any_glyph_format, + resource.makepk, kpse_src_compile); + + /* janl 16/11/98: I have changed this. The above line used to + say the settings in resource.makepk was supplied on the + commandline, resulting in it overriding _all other_ + settings, derived from the environment or texmf.cnf, no + matter what the value. The value in resource.makepk could + be the compile-time default... + + Personaly I like the environment/texmf.cnf to override + resources and thus changed the 'level' of this setting to + kpse_src_compile so the environment/texmf.cnf will override + the values derived by Xt. + + Previous comment here: + + ``Let true values as an X resource/command line override false + values in texmf.cnf/envvar.'' */ + + /* + * Step 2: Settle colormap issues. This should be done before + * other widgets are created, so that they get the right + * pixel values. (The top-level widget won't have the right + * values, but I don't think that makes any difference.) + */ + +#ifdef GREY + + screen_number = 0; /* yyuucchh */ + while (SCRN != ScreenOfDisplay(DISP, screen_number)) ++screen_number; + + our_depth = DefaultDepthOfScreen(SCRN); + our_visual = DefaultVisualOfScreen(SCRN); + our_colormap = DefaultColormapOfScreen(SCRN); + copyGC = DefaultGCOfScreen(SCRN); + + if (resource.install != False && our_visual->class == PseudoColor) { + /* look for a TrueColor visual with more bits */ + XVisualInfo template; + XVisualInfo *list; + int nitems_return; + + template.screen = screen_number; + template.class = TrueColor; + list = XGetVisualInfo(DISP, VisualScreenMask | VisualClassMask, + &template, &nitems_return); + if (list != NULL) { + XVisualInfo *list1; + XVisualInfo *best = NULL; + + for (list1 = list; list1 < list + nitems_return; ++list1) + if (list1->depth > our_depth + && (best == NULL || list1->depth > best->depth)) + best = list1; + if (best != NULL) { + our_depth = best->depth; + our_visual = best->visual; + our_colormap = XCreateColormap(DISP, + RootWindowOfScreen(SCRN), our_visual, AllocNone); + XInstallColormap(DISP, our_colormap); + copyGC = NULL; +#ifdef TOOLKIT + temp_args1[0].value = (XtArgVal) our_depth; + temp_args1[1].value = (XtArgVal) our_visual; + temp_args1[2].value = (XtArgVal) our_colormap; + XtSetValues(top_level, temp_args1, XtNumber(temp_args1)); + XtSetTypeConverter(XtRString, XtRPixel, + XdviCvtStringToPixel, + (XtConvertArgList) colorConvertArgs, 2, + XtCacheByDisplay, NULL); +#else + /* Can't use {Black,White}PixelOfScreen() any more */ + if (!resource.fore_color) + resource.fore_color = + (resource.reverse ? "white" : "black"); + if (!resource.back_color) + resource.back_color = + (resource.reverse ? "black" : "white"); +#endif + } + XFree(list); + } + } + + if (resource.install == True && our_visual->class == PseudoColor) { + XColor tmp_color; + + /* This next bit makes sure that the standard black and white pixels + are allocated in the new colormap. */ + + tmp_color.pixel = BlackPixelOfScreen(SCRN); + XQueryColor(DISP, our_colormap, &tmp_color); + XAllocColor(DISP, our_colormap, &tmp_color); + + tmp_color.pixel = WhitePixelOfScreen(SCRN); + XQueryColor(DISP, our_colormap, &tmp_color); + XAllocColor(DISP, our_colormap, &tmp_color); + + our_colormap = XCopyColormapAndFree(DISP, our_colormap); +#ifdef TOOLKIT + temp_args1a[0].value = (XtArgVal) our_colormap; + XtSetValues(top_level, temp_args1a, 1); +#endif + } + +#ifdef TOOLKIT + XtGetApplicationResources(top_level, (XtPointer) &resource, + app_pixel_resources, XtNumber(app_pixel_resources), + (ArgList) NULL, 0); +#endif + +#endif /* GREY */ + +#ifndef TOOLKIT + fore_Pixel = (resource.fore_color + ? string_to_pixel(&resource.fore_color) + : (resource.reverse ? WhitePixelOfScreen(SCRN) + : BlackPixelOfScreen(SCRN))); + back_Pixel = (resource.back_color + ? string_to_pixel(&resource.back_color) + : (resource.reverse ? BlackPixelOfScreen(SCRN) + : WhitePixelOfScreen(SCRN))); + brdr_Pixel = (brdr_color ? string_to_pixel(&brdr_color) : fore_Pixel); + hl_Pixel = (high_color ? string_to_pixel(&high_color) : fore_Pixel); + cr_Pixel = (curs_color ? string_to_pixel(&curs_color) : fore_Pixel); + +#ifdef GRID + if (resource.grid1_color) + grid1_Pixel = string_to_pixel(&resource.grid1_color); + if (resource.grid2_color) + grid2_Pixel = string_to_pixel(&resource.grid2_color); + if (resource.grid3_color) + grid3_Pixel = string_to_pixel(&resource.grid3_color); +#endif /* GRID */ + +#endif /* not TOOLKIT */ + +#ifdef GREY + if (our_depth == 1) + use_grey = False; + + if (use_grey && our_visual->class != TrueColor) { + fore_color_data.pixel = fore_Pixel; + XQueryColor(DISP, our_colormap, &fore_color_data); + back_color_data.pixel = back_Pixel; + XQueryColor(DISP, our_colormap, &back_color_data); + init_plane_masks(); + if (!copy) { + back_color_data.pixel = back_Pixel; + XStoreColor(DISP, our_colormap, &back_color_data); + } + } +#endif + + /* + * Step 3: Open the dvi file and set titles. + */ + +#ifdef SELFILE + /* If no filename by here, so pop up a selection box. */ + if (dvi_name == NULL) + { + extern FILE *select_filename (); + (void) select_filename(False, False) ; + /* User might have cancled -janl */ + if (dvi_name == NULL) exit(1); + } +#endif /* SELFILE */ + + make_temporary_dir(&temporary_dir); /* For storing temporary files.. */ + +#ifdef HTEX + { + char *cp = getenv("WWWBROWSER"); + if (cp) browser = cp; + } + HTProfile_newPreemptiveClient(HTAppName, HTAppVersion); + HTCacheMode_setEnabled(NO); + +#if 0 + /* Optionally, turn on tracing of WWW library calls. */ + if (debug & DBG_HYPER) { + WWWTRACE = SHOW_STREAM_TRACE; + } +#endif + +#if T1 + /* At this point DISP, our_visual, our_depth and our_colormap must + be defined, and they are */ + init_t1(); +#endif + + /* Open the input file. Turn filename into URL first if needed */ + URL_aware = TRUE; + + if (!(URLbase || htex_is_url(dvi_name))) { + char *new_name; + int n; + + n = strlen(dvi_name); + new_name = dvi_name; + /* Find the right filename */ + if (n < sizeof(".dvi") + || strcmp(dvi_name + n - sizeof(".dvi") + 1, ".dvi") != 0) { + dvi_name = xmalloc((unsigned) n + sizeof(".dvi")); + Strcpy(dvi_name, new_name); + Strcat(dvi_name, ".dvi"); + /* Atempt $dvi_name.dvi */ + dvi_file = xfopen(dvi_name, OPEN_MODE); + if (dvi_file == NULL) { + /* Didn't work, revert to original $dvi_name */ + free(dvi_name); + dvi_name = new_name; + } + } + + /* Turn filename into URL */ + /* Escape dangers, esp. # from emacs */ + new_name=HTEscape(dvi_name,URL_PATH); + free(dvi_name); + dvi_name = xmalloc((unsigned) strlen(new_name)+6); + strcat(strcpy(dvi_name,"file:"),new_name); + /* Now we have the right filename, in a URL */ + } + + detach_anchor(); + if (!open_www_file()) { + fprintf(stderr,"Could not open dvi file. Exiting.\n"); + exit(1); + } + + URL_aware = FALSE; +#else + open_dvi_file(); +#endif /* not HTEX */ + + if (curr_page) { + current_page = (*curr_page ? atoi(curr_page) : total_pages) - 1; + if (current_page < 0 || current_page >= total_pages) usage(); + } + set_icon_and_title (dvi_name, &icon_name, &title_name, 0); + + /* + * Step 4: Set initial window size. + * This needs to be done before colors are assigned because if + * -s 0 is specified, then we need to compute the shrink factor + * (which in turn affects whether init_pix is called). + */ + +#ifdef TOOLKIT + + /* The following code is lifted from Xterm */ + if (resource.icon_geometry != NULL) { +#ifndef GREY + int screen_number; +#endif + int junk; + +#ifndef GREY + for (screen_number = 0; /* yyuucchh */ + SCRN != ScreenOfDisplay(DISP, screen_number); + ++screen_number); +#endif + + (void) XGeometry(DISP, screen_number, resource.icon_geometry, "", + 0, 0, 0, 0, 0, + (int *) &temp_args2[0].value, + (int *) &temp_args2[1].value, &junk, &junk); + XtSetValues(top_level, temp_args2, XtNumber(temp_args2)); + } + /* Set icon pixmap */ + XtGetValues(top_level, &temp_args4, 1); + if (icon_pm == (Pixmap) 0) { + temp_args4.value = (XtArgVal) (XCreateBitmapFromData(DISP, + RootWindowOfScreen(SCRN), (_Xconst char *) xdvi_bits, + xdvi_width, xdvi_height)); + XtSetValues(top_level, &temp_args4, 1); + } + temp_args5[0].value = (XtArgVal) title_name; + temp_args5[1].value = (XtArgVal) icon_name; + XtSetValues(top_level, temp_args5, XtNumber(temp_args5)); + +#ifdef BUTTONS + form_widget = XtCreateManagedWidget("form", FORM_WIDGET_CLASS, + top_level, form_args, XtNumber(form_args)); +#define form_or_top form_widget /* for calls later on */ +#define form_or_vport form_widget +#else /* !BUTTONS */ +#define form_or_top top_level /* for calls later on */ +#define form_or_vport vport_widget +#endif /* BUTTONS */ + + vport_widget = XtCreateManagedWidget("vport", VPORT_WIDGET_CLASS, + form_or_top, vport_args, XtNumber(vport_args)); + +#ifndef MOTIF + + clip_widget = XtNameToWidget(vport_widget, "clip"); + +#else /* MOTIF */ + + menubar = XmVaCreateSimpleMenuBar(vport_widget, "menubar", + XmNdepth, (XtArgVal) our_depth, + XmNvisual, (XtArgVal) our_visual, + XmNcolormap, (XtArgVal) our_colormap, + XmVaCASCADEBUTTON, (XtArgVal) XmCvtCTToXmString("File"), 0, + XmVaCASCADEBUTTON, (XtArgVal) XmCvtCTToXmString("Navigate"), 0, + XmVaCASCADEBUTTON, (XtArgVal) XmCvtCTToXmString("Scale"), 0, + 0); + XmVaCreateSimplePulldownMenu(menubar, + "file_pulldown", 0, file_pulldown_callback, + XmNtearOffModel, (XtArgVal) XmTEAR_OFF_ENABLED, + XmNdepth, (XtArgVal) our_depth, + XmNvisual, (XtArgVal) our_visual, + XmNcolormap, (XtArgVal) our_colormap, + XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Reload"), 0, 0, 0, + XmVaSEPARATOR, + XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Quit"), 0, 0, 0, + 0); + XmVaCreateSimplePulldownMenu(menubar, + "navigate_pulldown", 1, navigate_pulldown_callback, + XmNtearOffModel, (XtArgVal) XmTEAR_OFF_ENABLED, + XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Page-10"), 0, 0, 0, + XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Page-5"), 0, 0, 0, + XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Prev"), 0, 0, 0, + XmVaSEPARATOR, + XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Next"), 0, 0, 0, + XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Page+5"), 0, 0, 0, + XmVaPUSHBUTTON, (XtArgVal) XmCvtCTToXmString("Page+10"), 0, 0, 0, + 0); + scale_menu = XmVaCreateSimplePulldownMenu(menubar, + "scale_pulldown", 2, scale_pulldown_callback, + XmNradioBehavior, (XtArgVal) True, + XmNtearOffModel, (XtArgVal) XmTEAR_OFF_ENABLED, + XmVaRADIOBUTTON, (XtArgVal) XmCvtCTToXmString("Shrink1"), 0, 0, 0, + XmVaRADIOBUTTON, (XtArgVal) XmCvtCTToXmString("Shrink2"), 0, 0, 0, + XmVaRADIOBUTTON, (XtArgVal) XmCvtCTToXmString("Shrink3"), 0, 0, 0, + XmVaRADIOBUTTON, (XtArgVal) XmCvtCTToXmString("Shrink4"), 0, 0, 0, + 0); + shrink_button[0] = XtNameToWidget(scale_menu, "button_0"); + shrink_button[1] = XtNameToWidget(scale_menu, "button_1"); + shrink_button[2] = XtNameToWidget(scale_menu, "button_2"); + shrink_button[3] = XtNameToWidget(scale_menu, "button_3"); + + x_bar = XtNameToWidget(vport_widget, "HorScrollBar"); + y_bar = XtNameToWidget(vport_widget, "VertScrollBar"); + +#endif /* MOTIF */ + + draw_args[0].value = (XtArgVal) page_w; + draw_args[1].value = (XtArgVal) page_h; + draw_widget = XtCreateManagedWidget("drawing", DRAW_WIDGET_CLASS, + vport_widget, draw_args, XtNumber(draw_args)); + +#ifdef MOTIF + XtVaSetValues(vport_widget, XmNworkWindow, draw_widget, + XmNmenuBar, menubar, NULL); + XtManageChild(menubar); + XtVaGetValues(vport_widget, XmNclipWindow, &clip_widget, NULL); +#endif /* MOTIF */ + + { /* set default window size */ +#ifdef BUTTONS + int xtra_wid = resource.expert ? 0 : XTRA_WID; +#else +#define xtra_wid 0 +#endif + XtWidgetGeometry constraints; + XtWidgetGeometry reply; + + XtGetValues(top_level, &temp_args3, 1); /* get border width */ + screen_w = WidthOfScreen(SCRN) - 2 * bwidth - xtra_wid; + screen_h = HeightOfScreen(SCRN) - 2 * bwidth; + for (;;) { /* actually, at most two passes */ + constraints.request_mode = reply.request_mode = 0; + constraints.width = page_w; + if (page_w > screen_w) { + constraints.request_mode = CWWidth; + constraints.width = screen_w; + } + constraints.height = page_h; + if (page_h > screen_h) { + constraints.request_mode |= CWHeight; + constraints.height = screen_h; + } + if (constraints.request_mode != 0 + && constraints.request_mode != (CWWidth | CWHeight)) + (void) XtQueryGeometry(vport_widget, &constraints, &reply); + if (!(reply.request_mode & CWWidth)) + reply.width = constraints.width; + if (reply.width >= screen_w) + reply.width = screen_w; + if (!(reply.request_mode & CWHeight)) + reply.height = constraints.height; + if (reply.height >= screen_h) + reply.height = screen_h; + + /* now reply.{width,height} contain max. usable window size */ + + if (shrink_factor != 0) + break; + + shrink_factor = ROUNDUP(unshrunk_page_w, reply.width - 2); + i = ROUNDUP(unshrunk_page_h, reply.height - 2); + if (i >= shrink_factor) shrink_factor = i; + if (shrink_factor > 1) bak_shrink = shrink_factor; + mane.shrinkfactor = shrink_factor; + init_page(); + set_wh_args[0].value = (XtArgVal) page_w; + set_wh_args[1].value = (XtArgVal) page_h; + XtSetValues(draw_widget, set_wh_args, XtNumber(set_wh_args)); + } + set_wh_args[0].value = (XtArgVal) (reply.width + xtra_wid); + set_wh_args[1].value = (XtArgVal) reply.height; + XtSetValues(top_level, set_wh_args, XtNumber(set_wh_args)); +#ifdef BUTTONS + set_wh_args[0].value -= xtra_wid; + XtSetValues(vport_widget, set_wh_args, XtNumber(set_wh_args)); +#endif /* BUTTONS */ + } +#ifdef MOTIF + set_shrink_factor(mane.shrinkfactor); +#endif + +#else /* not TOOLKIT */ + + screen_w = WidthOfScreen(SCRN) - 2*bwidth; + screen_h = HeightOfScreen(SCRN) - 2*bwidth; + + size_hints.flags = PMinSize; + size_hints.min_width = size_hints.min_height = 50; + size_hints.x = size_hints.y = 0; + + /* compute largest possible window */ + flag = 0; + if (geometry != NULL) { + flag = XParseGeometry(geometry, &size_hints.x, &size_hints.y, + &window_w, &window_h); + if (flag & (XValue | YValue)) + size_hints.flags |= USPosition; + if (flag & (WidthValue | HeightValue)) + size_hints.flags |= USSize; + } + if (!(flag & WidthValue)) window_w = screen_w; + if (!(flag & HeightValue)) window_h = screen_h; + + if (shrink_factor == 0) { + /* compute best shrink factor based on window_w and window_h */ + shrink_factor = ROUNDUP(unshrunk_page_w, window_w - 2); + i = ROUNDUP(unshrunk_page_h, window_h - 2); + if (i >= shrink_factor) shrink_factor = i; + if (shrink_factor > 1) bak_shrink = shrink_factor; + mane.shrinkfactor = shrink_factor; + init_page(); + } + + if (window_w < page_w) x_thick = BAR_THICK; + if (window_h < page_h + x_thick) y_thick = BAR_THICK; + if (!(flag & WidthValue)) { + window_w = page_w + y_thick; + if (window_w > screen_w) { + x_thick = BAR_THICK; + window_w = screen_w; + } + size_hints.flags |= PSize; + } + if (!(flag & HeightValue)) { + window_h = page_h + x_thick; + if (window_h > screen_h) window_h = screen_h; + size_hints.flags |= PSize; + } + + if (flag & XNegative) size_hints.x += screen_w - window_w; + if (flag & YNegative) size_hints.y += screen_h - window_h; + +#endif /* not TOOLKIT */ + + /* + * Step 5: Realize the widgets (or windows). + */ + +#ifdef TOOLKIT + + { + static Arg back_args = {XtNbackground, (XtArgVal) 0}; + + back_args.value = back_Pixel; + XtSetValues(draw_widget, &back_args, 1); + XtSetValues(clip_widget, &back_args, 1); + } + +#ifdef BUTTONS + if (!resource.expert) + create_buttons(set_wh_args[1].value); +#endif +#ifdef HTEX + pane_widget = XtCreateManagedWidget("pane", panedWidgetClass, + top_level, pane_args, XtNumber(pane_args)); + /* Set up anchor search and information widgets: */ + anchor_search = XtCreateManagedWidget("anchorsearch", + dialogWidgetClass, pane_widget, anchorsearch_args, + XtNumber(anchorsearch_args)); + XawDialogAddButton(anchor_search, "Open", search_callback, NULL); + anchor_info = XtCreateManagedWidget("anchorinfo", asciiTextWidgetClass, + pane_widget, anchorinfo_args, XtNumber(anchorinfo_args)); + /* Eliminate the silly caret */ + XawTextDisplayCaret(anchor_info, False); +#endif + +#ifndef MOTIF + XtAddEventHandler(form_or_vport, KeyPressMask, False, + handle_key, (caddr_t) NULL); +#else /* MOTIF */ + XtSetSensitive(draw_widget, TRUE); + XtAddEventHandler(draw_widget, KeyPressMask, False, + handle_key, (caddr_t) NULL); +#endif /* MOTIF */ + XtAddEventHandler(vport_widget, StructureNotifyMask, False, + handle_resize, (caddr_t) NULL); + XtAddEventHandler(draw_widget, ExposureMask, False, handle_exp, + (caddr_t) &mane); + XtAddEventHandler(draw_widget, ButtonPressMask, False, handle_button, + (caddr_t) NULL); + XtAddEventHandler(draw_widget, ButtonMotionMask, False, handle_motion, + (caddr_t) NULL); + XtAddEventHandler(draw_widget, ButtonReleaseMask, False, handle_release, + (caddr_t) NULL); + XtRealizeWidget(top_level); +#ifdef MOTIF + XmProcessTraversal(draw_widget, XmTRAVERSE_CURRENT); +#endif + + currwin.win = mane.win = XtWindow(draw_widget); + + { + XWindowAttributes attrs; + + (void) XGetWindowAttributes(DISP, mane.win, &attrs); + backing_store = attrs.backing_store; + } + +#else /* not TOOLKIT */ + + size_hints.width = window_w; + size_hints.height = window_h; +#ifndef GREY + top_level = XCreateSimpleWindow(DISP, RootWindowOfScreen(SCRN), + size_hints.x, size_hints.y, window_w, window_h, bwidth, + brdr_Pixel, back_Pixel); +#else + { + XSetWindowAttributes attr; + + attr.border_pixel = brdr_Pixel; + attr.background_pixel = back_Pixel; + attr.colormap = our_colormap; + top_level = XCreateWindow(DISP, RootWindowOfScreen(SCRN), + size_hints.x, size_hints.y, window_w, window_h, bwidth, + our_depth, InputOutput, our_visual, + CWBorderPixel | CWBackPixel | CWColormap, &attr); + } +#endif + XSetStandardProperties(DISP, top_level, title_name, icon_name, + (Pixmap) 0, argv, argc, &size_hints); + + wmhints.flags = InputHint | StateHint | IconPixmapHint; + wmhints.input = True; /* window manager must direct input */ + wmhints.initial_state = iconic ? IconicState : NormalState; + wmhints.icon_pixmap = XCreateBitmapFromData(DISP, + RootWindowOfScreen(SCRN), (_Xconst char *) xdvi_bits, + xdvi_width, xdvi_height); + if (resource.icon_geometry != NULL) { + int junk; + + wmhints.flags |= IconPositionHint; + (void) XGeometry(DISP, DefaultScreen(DISP), resource.icon_geometry, + "", 0, 0, 0, 0, 0, &wmhints.icon_x, &wmhints.icon_y, + &junk, &junk); + } + XSetWMHints(DISP, top_level, &wmhints); + + XSelectInput(DISP, top_level, KeyPressMask | StructureNotifyMask); + XMapWindow(DISP, top_level); + XFlush(DISP); + +#endif /* not TOOLKIT */ + +{ + static KeySym list[2] = {XK_Caps_Lock, XK_Num_Lock}; + +#define rebindkey(ks, str) XRebindKeysym(DISP, (KeySym) ks, \ + (KeySym *) NULL, 0, (_Xconst ubyte *) str, 1); \ + XRebindKeysym(DISP, (KeySym) ks, \ + list, 1, (_Xconst ubyte *) str, 1); \ + XRebindKeysym(DISP, (KeySym) ks, \ + list + 1, 1, (_Xconst ubyte *) str, 1); \ + XRebindKeysym(DISP, (KeySym) ks, \ + list, 2, (_Xconst ubyte *) str, 1); + + rebindkey(XK_Help, "?"); + rebindkey(XK_Cancel, "q"); + rebindkey(XK_Redo, "A"); + rebindkey(XK_Home, "^"); + rebindkey(XK_Left, "l"); + rebindkey(XK_Up, "u"); + rebindkey(XK_Right, "r"); + rebindkey(XK_Down, "d"); + rebindkey(XK_End, "g"); +#ifdef XK_Page_Up + rebindkey(XK_Page_Up, "b"); + rebindkey(XK_Page_Down, "f"); +#endif +#ifdef XK_KP_Left + rebindkey(XK_KP_Home, "^"); + rebindkey(XK_KP_Left, "l"); + rebindkey(XK_KP_Up, "u"); + rebindkey(XK_KP_Right, "r"); + rebindkey(XK_KP_Down, "d"); + rebindkey(XK_KP_Prior, "b"); + rebindkey(XK_KP_Next, "f"); + rebindkey(XK_KP_Delete, "\177"); +#ifdef XK_KP_Page_Up + rebindkey(XK_KP_Page_Up, "b"); + rebindkey(XK_KP_Page_Down, "f"); +#endif /* XK_KP_Page_Up */ +#endif /* XK_KP_Left */ +} +#undef rebindkey + + image = XCreateImage(DISP, our_visual, 1, XYBitmap, 0, + (char *) NULL, 0, 0, BMBITS, 0); + image->bitmap_unit = BMBITS; +#ifdef WORDS_BIGENDIAN + image->bitmap_bit_order = MSBFirst; +#else + image->bitmap_bit_order = LSBFirst; +#endif + { + short endian = MSBFirst << 8 | LSBFirst; + image->byte_order = *((char *) &endian); + } + + /* + * Step 6: Assign colors and GCs. + * Because of the latter, this has to go after Step 5. + */ + +#ifndef TOOLKIT +#define XtWindow(win) win +#endif + +#define MakeGC(fcn, fg, bg) (values.function = fcn, \ + values.foreground=fg, values.background=bg, \ + XCreateGC(DISP, XtWindow(top_level), \ + GCFunction | GCForeground | GCBackground, &values)) + +#ifdef GRID + if (!resource.grid1_color) grid1_Pixel = fore_Pixel; + if (!resource.grid2_color) grid2_Pixel = grid1_Pixel; + if (!resource.grid3_color) grid3_Pixel = grid1_Pixel; +#endif /* GRID */ + + +#ifdef GREY + if (resource._gamma == 0.0) + resource._gamma = 1.0; + +#endif + + copy = resource.copy; + + init_colors(); + + { + XGCValues values; + + highGC = ruleGC; + if (hl_Pixel != fore_Pixel +#ifdef GREY + || (!copy && our_visual != DefaultVisualOfScreen(SCRN)) +#endif + ) +#ifdef GREY + copyGC = +#endif + highGC = MakeGC(GXcopy, hl_Pixel, back_Pixel); + +#ifdef GRID + grid1GC = MakeGC(GXcopy, grid1_Pixel, fore_Pixel); + grid2GC = MakeGC(GXcopy, grid2_Pixel, fore_Pixel); + grid3GC = MakeGC(GXcopy, grid3_Pixel, fore_Pixel); +#endif /* GRID */ + + } + +#ifndef VMS + ready_cursor = XCreateFontCursor(DISP, XC_cross); + redraw_cursor = XCreateFontCursor(DISP, XC_watch); +/* BEGIN CHUNK xdvi.c 2 */ +#ifdef SRC_SPECIALS + src_cursor = XCreateFontCursor(DISP, src_cursor_shape); +#endif +/* END CHUNK xdvi.c 2 */ + +#else + DECWCursorFont = XLoadFont(DISP, "DECW$CURSOR"); + XSetFont(DISP, foreGC, DECWCursorFont); + redraw_cursor = XCreateGlyphCursor(DISP, DECWCursorFont, DECWCursorFont, + decw$c_wait_cursor, decw$c_wait_cursor + 1, + &resource.fore_color, &resource.back_color); + MagnifyPixmap = XCreateBitmapFromData(DISP, RootWindowOfScreen(SCRN), + mag_glass_bits, mag_glass_width, mag_glass_height); + ready_cursor = XCreatePixmapCursor(DISP, MagnifyPixmap, MagnifyPixmap, + &resource.back_color, &resource.fore_color, + mag_glass_x_hot, mag_glass_y_hot); +/* BEGIN CHUNK xdvi.c 2 */ +#ifdef SRC_SPECIALS + /* sorry, I dunno about VMS. Someone else will have to tackle that */ + src_cursor = ready_cursor; +#endif +/* END CHUNK xdvi.c 2 */ +#endif /* VMS */ + + { + XColor bg_Color, cr_Color; + + bg_Color.pixel = back_Pixel; + XQueryColor(DISP, our_colormap, &bg_Color); + cr_Color.pixel = cr_Pixel; + XQueryColor(DISP, our_colormap, &cr_Color); + XRecolorCursor(DISP, ready_cursor, &cr_Color, &bg_Color); + XRecolorCursor(DISP, redraw_cursor, &cr_Color, &bg_Color); + } + + do_pages(); + return 0; /* do_pages() returns if DBG_BATCH is specified */ +} diff --git a/Build/source/texk/windvi/xdvi.h b/Build/source/texk/windvi/xdvi.h new file mode 100644 index 00000000000..e76f42a1534 --- /dev/null +++ b/Build/source/texk/windvi/xdvi.h @@ -0,0 +1,1108 @@ +/*========================================================================*\ + +Copyright (c) 1990-1999 Paul Vojta + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL PAUL VOJTA OR ANYONE ELSE BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +NOTE: + xdvi is based on prior work, as noted in the modification history + in xdvi.c. + +\*========================================================================*/ + +/* + * Written by Eric C. Cooper, CMU + */ + +#ifndef XDVI_H +#define XDVI_H + +#define T1 1 + +/******************************** + * The C environment * + *******************************/ + +#include "c-auto.h" + +#ifdef __linux +#define FLAKY_SIGPOLL 1 +#endif + +#if STDC_HEADERS +# include <stddef.h> +# include <stdlib.h> + /* the following works around the wchar_t problem */ +# include <X11/X.h> +# if HAVE_X11_XOSDEFS_H +# include <X11/Xosdefs.h> +# endif +# ifdef X_NOT_STDC_ENV +# undef X_NOT_STDC_ENV +# undef X_WCHAR +# include <X11/Xlib.h> +# define X_NOT_STDC_ENV +# endif +#endif + +/* Avoid name clashes with kpathsea. */ +#define xfopen xdvi_xfopen + +/* For wchar_t et al., that the X files might want. */ +#include <kpathsea/systypes.h> +#include <kpathsea/c-memstr.h> + +#include <X11/Xlib.h> /* include Xfuncs.h, if available */ +#include <X11/Xutil.h> /* needed for XDestroyImage */ +#include <X11/Xos.h> +#undef wchar_t + +#if XlibSpecificationRelease >= 5 +#include <X11/Xfuncs.h> +#endif + +#ifndef NOTOOL + +#include <X11/Intrinsic.h> +#if (defined(VMS) && (XtSpecificationRelease <= 4)) || defined(lint) +#include <X11/IntrinsicP.h> +#endif +#define TOOLKIT 1 + +#else /* NOTOOL */ + +#define XtNumber(arr) (sizeof(arr)/sizeof(arr[0])) +typedef unsigned long Pixel; +typedef char Boolean; +typedef unsigned int Dimension; +#undef TOOLKIT +#undef MOTIF +#undef BUTTONS +#undef CFG2RES + +#endif /* NOTOOL */ + +#if defined(CFG2RES) && !defined(SELFAUTO) +#define SELFAUTO 1 +#endif + +#if defined(SELFAUTO) && !defined(DEFAULT_CONFIG_PATH) +#define DEFAULT_CONFIG_PATH "$SELFAUTODIR:$SELFAUTOPARENT" +#endif + +#undef CFGFILE /* no cheating */ + +#if defined(DEFAULT_CONFIG_PATH) +#define CFGFILE 1 +#endif + +typedef char Bool3; /* Yes/No/Maybe */ + +#define True 1 +#define False 0 +#define Maybe 2 + +#define INVALID_WIDTH 017777777777 + +#ifdef VMS +#include <string.h> +#define index strchr +#define rindex strrchr +#define bzero(a, b) (void) memset ((void *) (a), 0, (size_t) (b)) +#define bcopy(a, b, c) (void) memmove ((void *) (b), (void *) (a), (size_t) (c)) +#endif + +#include <stdio.h> +#include <setjmp.h> + +#if HAVE_UNISTD_H +#include <unistd.h> +#endif + +#if HAVE_DIRENT_H +# include <dirent.h> +# define NAMLEN(dirent) strlen((dirent)->d_name) +#else +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# if HAVE_SYS_NDIR_H +# include <sys/ndir.h> +# endif +# if HAVE_SYS_DIR_H +# include <sys/dir.h> +# endif +# if HAVE_NDIR_H +# include <ndir.h> +# endif +#endif + +/* These are for X headers */ +#ifndef NeedFunctionPrototypes +#if __STDC__ +#define NeedFunctionPrototypes 1 +#else /* STDC */ +#define NeedFunctionPrototypes 0 +#endif /* STDC */ +#endif /* NeedFunctionPrototypes */ + +#ifndef HAVE_PROTOTYPES +#if __STDC__ +#define HAVE_PROTOTYPES 1 +#else /* STDC */ +#define HAVE_PROTOTYPES 0 +#endif /* STDC */ +#endif + +/* These are for xdvi */ +#if HAVE_PROTOTYPES +#define ARGS(x) x +#else +#define ARGS(x) () +#endif + +#ifndef KPATHSEA + +/* These macros munge function declarations to make them work in both + cases. The P?H macros are used for declarations, the P?C for + definitions. See <ansidecl.h> from the GNU C library. P1H(void) + also works for definitions of routines which take no args. */ + +#if __STDC__ + +#define P1H(p1) (p1) +#define P2H(p1,p2) (p1, p2) +#define P3H(p1,p2,p3) (p1, p2, p3) +#define P4H(p1,p2,p3,p4) (p1, p2, p3, p4) +#define P5H(p1,p2,p3,p4,p5) (p1, p2, p3, p4, p5) +#define P6H(p1,p2,p3,p4,p5,p6) (p1, p2, p3, p4, p5, p6) +#define P7H(p1,p2,p3,p4,p5,p6,p7) (p1, p2, p3, p4, p5, p6,p7) + +#define P1C(t1,n1)(t1 n1) +#define P2C(t1,n1, t2,n2) (t1 n1, t2 n2) +#define P3C(t1,n1, t2,n2, t3,n3)(t1 n1, t2 n2, t3 n3) +#define P4C(t1,n1, t2,n2, t3,n3, t4,n4) (t1 n1, t2 n2, t3 n3, t4 n4) +#define P5C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5) \ + (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5) +#define P6C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6) \ + (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6) +#define P7C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6, t7,n7) \ + (t1 n1, t2 n2, t3 n3, t4 n4, t5 n5, t6 n6, t7,n7) + +#else /* not __STDC__ */ + +#define P1H(p1) () +#define P2H(p1, p2) () +#define P3H(p1, p2, p3) () +#define P4H(p1,p2,p3,p4) () +#define P5H(p1, p2, p3, p4, p5) () +#define P6H(p1, p2, p3, p4, p5, p6) () +#define P6H(p1, p2, p3, p4, p5, p6, p7) () + +#define P1C(t1,n1) (n1) t1 n1; +#define P2C(t1,n1, t2,n2) (n1,n2) t1 n1; t2 n2; +#define P3C(t1,n1, t2,n2, t3,n3) (n1,n2,n3) t1 n1; t2 n2; t3 n3; +#define P4C(t1,n1, t2,n2, t3,n3, t4,n4) (n1,n2,n3,n4) \ + t1 n1; t2 n2; t3 n3; t4 n4; +#define P5C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5) (n1,n2,n3,n4,n5) \ + t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; +#define P6C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6) (n1,n2,n3,n4,n5,n6) \ + t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; +#define P7C(t1,n1, t2,n2, t3,n3, t4,n4, t5,n5, t6,n6, t7,n7) \ + (n1,n2,n3,n4,n5,n6,n7) \ + t1 n1; t2 n2; t3 n3; t4 n4; t5 n5; t6 n6; t7,n7; + +#endif /* not __STDC__ */ + +#endif /* not KPATHSEA */ + +#ifndef NeedWidePrototypes +#define NeedWidePrototypes NeedFunctionPrototypes +#endif + +#include <kpathsea/c-vararg.h> + +#ifndef _XFUNCPROTOBEGIN +#define _XFUNCPROTOBEGIN +#define _XFUNCPROTOEND +#endif + +#ifndef _Xconst +#if __STDC__ +#define _Xconst const +#else /* STDC */ +#define _Xconst +#endif /* STDC */ +#endif /* _Xconst */ + +#ifndef VOLATILE +#if __STDC__ || (defined(__stdc__) && defined(__convex__)) +#define VOLATILE volatile +#else +#define VOLATILE /* nothing */ +#endif +#endif + +#ifndef NORETURN +#ifdef __GNUC__ +#define NORETURN volatile +#else +#define NORETURN /* nothing */ +#endif +#endif + +#ifndef OPEN_MODE +#define OPEN_MODE FOPEN_R_MODE +#endif /* OPEN_MODE */ + +#ifndef VMS +#define OPEN_MODE_ARGS _Xconst char * +#else +#define OPEN_MODE_ARGS _Xconst char *, _Xconst char * +#endif + +#define Printf (void) printf +#define Puts (void) puts +#define Fprintf (void) fprintf +#define Sprintf (void) sprintf +#define Fseek (void) fseek +#define Fread (void) fread +#define Fputs (void) fputs +#define Putc (void) putc +#define Putchar (void) putchar +#define Fclose (void) fclose +#define Fflush (void) fflush +#define Strcat (void) strcat +#define Strcpy (void) strcpy + +#ifdef HTEX +char *urlocalize P1H(char *filename); +extern int lastwwwopen; +#endif + +/******************************** + * Types and data * + *******************************/ + +#ifndef EXTERN +#define EXTERN extern +#define INIT(x) +#endif + +#define MAXDIM 32767 + +typedef unsigned char ubyte; + +#if NeedWidePrototypes +typedef unsigned int wide_ubyte; +typedef int wide_bool; +#define WIDENINT (int) +#else +typedef ubyte wide_ubyte; +typedef Boolean wide_bool; +#define WIDENINT +#endif + +#if defined(MAKETEXPK) && !defined(MKTEXPK) +#define MKTEXPK 1 +#endif + +/* + * pixel_conv is currently used only for converting absolute positions + * to pixel values; although normally it should be + * ((int) ((x) / shrink_factor + (1 << 15) >> 16)), + * the rounding is achieved instead by moving the constant 1 << 15 to + * PAGE_OFFSET in dvi-draw.c. + */ +#define pixel_conv(x) ((int) ((x) / shrink_factor >> 16)) +#define pixel_round(x) ((int) ROUNDUP(x, shrink_factor << 16)) +#define spell_conv0(n, f) ((long) (n * f)) +#define spell_conv(n) spell_conv0(n, dimconv) + +#define BMUNIT unsigned BMTYPE +#define BMBITS (8 * BMBYTES) + +#define ADD(a, b) ((BMUNIT *) (((char *) a) + b)) +#define SUB(a, b) ((BMUNIT *) (((char *) a) - b)) + +extern BMUNIT bit_masks[BMBITS + 1]; + +struct frame { + /* dvi_h and dvi_v is the horizontal and vertical baseline position + it is the responsebility of the set_char procedure to update + them. */ + struct framedata { + long dvi_h, dvi_v, w, x, y, z; + int pxl_v; + } data; + struct frame *next, *prev; +}; + +#ifndef TEXXET +typedef long (*set_char_proc) P1H(wide_ubyte); +#else +typedef void (*set_char_proc) P2H(wide_ubyte, wide_ubyte); +#endif + +struct drawinf { /* this information is saved when using virtual fonts */ + struct framedata data; + struct font *fontp; + set_char_proc set_char_p; + int tn_table_len; + struct font **tn_table; + struct tn *tn_head; + ubyte *pos, *end; + struct font *virtual; +#ifdef TEXXET + int dir; +#endif +}; + +EXTERN struct drawinf currinf; + +/* entries below with the characters 'dvi' in them are actually stored in + scaled pixel units */ + +#define DVI_H currinf.data.dvi_h +#define PXL_H pixel_conv(currinf.data.dvi_h) +#define DVI_V currinf.data.dvi_v +#define PXL_V currinf.data.pxl_v +#define WW currinf.data.w +#define XX currinf.data.x +#define YY currinf.data.y +#define ZZ currinf.data.z +#define ROUNDUP(x,y) (((x)+(y)-1)/(y)) + +EXTERN int current_page; +EXTERN int total_pages; +EXTERN int pageno_correct INIT(1); +EXTERN long magnification; +EXTERN double dimconv; +EXTERN double tpic_conv; +EXTERN int n_files_left; /* for LRU closing of fonts */ +EXTERN time_t dvi_time; /* last mod. time for dvi file */ +EXTERN unsigned int page_w, page_h; + +#if defined(GS_PATH) && !defined(PS_GS) +#define PS_GS +#endif + +#if defined(PS_DPS) || defined(PS_NEWS) || defined(PS_GS) +#define PS 1 +#else +#define PS 0 +#endif + +#if PS +EXTERN int scanned_page; /* last page prescanned */ +EXTERN int scanned_page_bak; /* actual value of the above */ +EXTERN int scanned_page_reset; /* number to reset the above to */ +#endif + +/* + * Table of page offsets in DVI file, indexed by page number - 1. + * Initialized in prepare_pages(). + */ +EXTERN long *page_offset; + +/* + * Mechanism for reducing repeated warning about specials, lost characters, etc. + */ +EXTERN Boolean warn_spec_now; + +// added SU +EXTERN Boolean delay_src; + +/* + * If we're in the middle of a PSFIG special. + */ +EXTERN Boolean psfig_begun INIT(False); + +/* BEGIN CHUNK xdvi.h 1 */ +#ifdef SRC_SPECIALS +EXTERN Boolean src_specials_are_evaluated INIT(False); +EXTERN Boolean src_EditorCmd_filename_first; +EXTERN int src_tickShape; +EXTERN int src_tick_height, src_tick_width; /* size of the src tick glyphs */ +#define SPECIAL_SHAPE_MAX_NUM 3 /* number of different shapes (starting from 0) + for drawing src specials. Hardcoding these here is a bad idea ... */ +EXTERN Cursor save_cursor; +#define SRC_WARNINGS_SILENT 0 +#define SRC_WARNINGS_MEDIUM 1 +#define SRC_WARNINGS_VERBOSE 2 +#endif +/* END CHUNK xdvi.h 1 */ + +/* + * Bitmap structure for raster ops. + */ +struct bitmap { + unsigned short w, h; /* width and height in pixels */ + short bytes_wide; /* scan-line width in bytes */ + char *bits; /* pointer to the bits */ +}; + +/* + * Per-character information. + * There is one of these for each character in a font (raster fonts only). + * All fields are filled in at font definition time, + * except for the bitmap, which is "faulted in" + * when the character is first referenced. + */ +struct glyph { + long addr; /* address of bitmap in font file */ + long dvi_adv; /* DVI units to move reference point */ + short x, y; /* x and y offset in pixels */ + struct bitmap bitmap; /* bitmap for character */ + short x2, y2; /* x and y offset in pixels (shrunken bitmap) */ +#ifdef GREY + XImage *image2; + char *pixmap2; + char *pixmap2_t; +#endif + struct bitmap bitmap2; /* shrunken bitmap for character */ +}; + +/* + * Per character information for virtual fonts + */ +struct macro { + ubyte *pos; /* address of first byte of macro */ + ubyte *end; /* address of last+1 byte */ + long dvi_adv; /* DVI units to move reference point */ + Boolean free_me; /* if free(pos) should be called when */ + /* freeing space */ +}; + +/* + * The layout of a font information block. + * There is one of these for every loaded font or magnification thereof. + * Duplicates are eliminated: this is necessary because of possible recursion + * in virtual fonts. + * + * Also note the strange units. The design size is in 1/2^20 point + * units (also called micro-points), and the individual character widths + * are in the TFM file in 1/2^20 ems units, i.e., relative to the design size. + * + * We then change the sizes to SPELL units (unshrunk pixel / 2^16). + */ + +#define NOMAGSTP (-29999) + +typedef void (*read_char_proc) ARGS((register struct font *, wide_ubyte)); + +struct font { + struct font *next; /* link to next font info block */ + char *fontname; /* name of font */ + float fsize; /* size information (dots per inch) */ + int magstepval; /* magstep number * two, or NOMAGSTP */ + FILE *file; /* open font file or NULL */ + char *filename; /* name of font file */ + long checksum; /* checksum */ + unsigned short timestamp; /* for LRU management of fonts */ + ubyte flags; /* flags byte (see values below) */ +#ifdef Omega + wide_ubyte maxchar; /* largest character code */ +#else + ubyte maxchar; /* largest character code */ +#endif +/* BEGIN CHUNK xdvi.h 2 */ +#ifdef SRC_SPECIALS + float pt_size; /* font size in pt, needed for specials evaluation */ +#endif +/* END CHUNK xdvi.h 2 */ + double dimconv; /* size conversion factor */ + set_char_proc set_char_p; /* proc used to set char */ + /* these fields are used by (loaded) raster fonts */ + read_char_proc read_char; /* function to read bitmap */ + struct glyph *glyph; + /* these fields are used by (loaded) virtual fonts */ + struct font **vf_table; /* list of fonts used by this vf */ + struct tn *vf_chain; /* ditto, if TeXnumber >= VFTABLELEN */ + struct font *first_font; /* first font defined */ + struct macro *macro; + /* I suppose the above could be put into a union, but we */ + /* wouldn't save all that much space. */ + + /* These were added for t1 use */ + int t1id; + long scale; +}; + +#define FONT_IN_USE 1 /* used for housekeeping */ +#define FONT_LOADED 2 /* if font file has been read */ +#define FONT_VIRTUAL 4 /* if font is virtual */ + +#define TNTABLELEN 30 /* length of TeXnumber array (dvi file) */ +#define VFTABLELEN 5 /* length of TeXnumber array (virtual fonts) */ + +struct tn { + struct tn *next; /* link to next TeXnumber info block */ + int TeXnumber; /* font number (in DVI file) */ + struct font *fontp; /* pointer to the rest of the info */ +}; + +EXTERN struct font *tn_table[TNTABLELEN]; +EXTERN struct font *font_head INIT(NULL); +EXTERN struct tn *tn_head INIT(NULL); +#ifdef Omega +EXTERN wide_ubyte maxchar; +#else +EXTERN ubyte maxchar; +#endif +EXTERN unsigned short current_timestamp INIT(0); + +/* + * Command line flags. + */ + +extern struct _resource { +#if CFGFILE && TOOLKIT + _Xconst char *progname; +#endif +#if TOOLKIT + int shrinkfactor; +#endif + int _density; +#ifdef GREY + float _gamma; +#endif + int _pixels_per_inch; + Boolean _delay_rulers; + int _tick_length; + char *_tick_units; + _Xconst char *sidemargin; + _Xconst char *topmargin; + _Xconst char *xoffset; + _Xconst char *yoffset; + _Xconst char *paper; + _Xconst char *_alt_font; + Boolean makepk; + _Xconst char *mfmode; + Boolean _list_fonts; + Boolean reverse; + Boolean _warn_spec; + Boolean _hush_chars; + Boolean _hush_chk; + Boolean safer; +#if defined(VMS) || !defined(TOOLKIT) + _Xconst char *fore_color; + _Xconst char *back_color; +#endif + Pixel _fore_Pixel; + Pixel _back_Pixel; +#ifdef TOOLKIT + Pixel _brdr_Pixel; + Pixel _hl_Pixel; + Pixel _cr_Pixel; +#endif + _Xconst char *icon_geometry; + Boolean keep_flag; + Boolean copy; + Boolean thorough; +#if PS + /* default is to use DPS, then NEWS, then GhostScript; + * we will figure out later on which one we will use */ + Boolean _postscript; + Boolean prescan; + Boolean allow_shell; +#ifdef PS_DPS + Boolean useDPS; +#endif +#ifdef PS_NEWS + Boolean useNeWS; +#endif +#ifdef PS_GS + Boolean useGS; + Boolean gs_safer; + Boolean gs_alpha; + _Xconst char *gs_path; + _Xconst char *gs_palette; +#endif +#endif /* PS */ + _Xconst char *debug_arg; + Boolean version_flag; +#ifdef BUTTONS + Boolean expert; + int shrinkbutton[4]; +#endif + _Xconst char *mg_arg[5]; +#ifdef GREY + Boolean _use_grey; + Bool3 install; +#endif +#ifdef GRID + int _grid_mode; + char *grid1_color, *grid2_color, *grid3_color; +#ifdef TOOLKIT + Pixel _grid1_Pixel, _grid2_Pixel, _grid3_Pixel; +#endif /* TOOLKIT */ +#endif /* GRID */ +#ifdef HTEX + Boolean _underline_link; + char *_browser; + char *_URLbase; + char *_scroll_pages; +#endif /* HTEX */ +/* BEGIN CHUNK xdvi.h 3 */ +#ifdef SRC_SPECIALS + int _src_specialFormat; + int _src_jumpButton; + int _src_tickShape; + char *_src_tickSize; + int _src_cursor_shape; + char *_src_editorCommand; + int _src_warn_verbosity; + Boolean _src_tickVisibility; + Boolean _src_evalMode; +#endif +/* END CHUNK xdvi.h 3 */ +} resource; + +/* As a convenience, we define the field names without leading underscores + * to point to the field of the above record. Here are the global ones; + * the local ones are defined in each module. */ + +/* BEGIN CHUNK xdvi.h 4 */ +#ifdef SRC_SPECIALS +#define src_cursor_shape resource._src_cursor_shape +#define src_editorCommand resource._src_editorCommand +#define src_warn_verbosity resource._src_warn_verbosity +#define src_tickShape resource._src_tickShape +#define src_tickVisibility resource._src_tickVisibility +#define src_evalMode resource._src_evalMode +#endif +/* END CHUNK xdvi.h 4 */ +#define density resource._density +#define pixels_per_inch resource._pixels_per_inch +#define alt_font resource._alt_font +#define list_fonts resource._list_fonts +#define warn_spec resource._warn_spec +#define hush_chars resource._hush_chars +#define hush_chk resource._hush_chk +#ifdef GREY +#define use_grey resource._use_grey +#endif +#ifdef GRID +#define grid_mode resource._grid_mode +#endif /* GRID */ +#ifdef HTEX +#define underline_link resource._underline_link +#define browser resource._browser +#define URLbase resource._URLbase +#define scroll_pages resource._scroll_pages +#define KPSE_DEBUG_HYPER 6 +#endif + +#ifndef TOOLKIT +EXTERN Pixel brdr_Pixel; +#ifdef GRID +EXTERN Pixel grid1_Pixel; +EXTERN Pixel grid2_Pixel; +EXTERN Pixel grid3_Pixel; +#endif /* GRID */ +#endif + + + +#ifdef GREY +EXTERN Pixel plane_masks[4]; +EXTERN XColor fore_color_data, back_color_data; +#endif + +extern struct mg_size_rec { + int w; + int h; +} + mg_size[5]; + +EXTERN int debug INIT(0); + +#define DBG_BITMAP 1 +#define DBG_DVI 2 +#define DBG_PK 4 +#define DBG_BATCH 8 +#define DBG_EVENT 16 +#define DBG_OPEN 32 +#define DBG_PS 64 +#define DBG_STAT 128 +#define DBG_HASH 256 +#define DBG_PATHS 512 +#define DBG_EXPAND 1024 +#define DBG_SEARCH 2048 +#ifdef HTEX +#define DBG_HYPER 4096 +#define DBG_ANCHOR 8192 +#endif +/* BEGIN CHUNK xdvi.h 5 */ +#ifdef SRC_SPECIALS +#define DBG_SRC_SPECIALS 16384 +#endif +/* END CHUNK xdvi.h 5 */ +#define DBG_ALL (~DBG_BATCH) + + +EXTERN int offset_x, offset_y; +EXTERN unsigned int unshrunk_paper_w, unshrunk_paper_h; +EXTERN unsigned int unshrunk_page_w, unshrunk_page_h; +#ifdef GRID +EXTERN unsigned int unshrunk_paper_unit; +#endif /* GRID */ + +#ifdef HTEX +EXTERN int HTeXnext_extern; /* Bring up next file in new xdvi window */ +EXTERN char *temporary_dir INIT(NULL); +EXTERN char *anchor_name INIT(NULL); +EXTERN Boolean URL_aware INIT(False); +EXTERN Boolean highlight INIT(False); +extern int HTeXAnestlevel; /* Hypertext nesting level */ +extern int HTeXreflevel; /* flag for whether we are inside an href */ +#endif + +EXTERN char *dvi_name INIT(NULL); +EXTERN FILE *dvi_file; /* user's file */ +EXTERN _Xconst char *prog; +EXTERN int bak_shrink; /* last shrink factor != 1 */ +EXTERN Dimension window_w, window_h; +EXTERN XImage *image; +EXTERN int backing_store; +EXTERN int home_x, home_y; + +EXTERN Display *DISP; +EXTERN Screen *SCRN; +#ifdef GREY +EXTERN int screen_number; +EXTERN Visual *our_visual; +EXTERN unsigned int our_depth; +EXTERN Colormap our_colormap; +EXTERN GC copyGC; +#else +#define our_depth (unsigned int) DefaultDepthOfScreen(SCRN) +#define our_visual DefaultVisualOfScreen(SCRN) +#define our_colormap DefaultColormapOfScreen(SCRN) +#define copyGC DefaultGCOfScreen(SCRN) +#endif +EXTERN GC ruleGC; +EXTERN GC foreGC, highGC; +EXTERN GC foreGC2; +#ifdef GRID +EXTERN GC grid1GC, grid2GC, grid3GC; +#endif /* GRID */ +EXTERN Boolean copy; + +EXTERN Cursor redraw_cursor, ready_cursor; +/* BEGIN CHUNK xdvi.h 6 */ +#ifdef SRC_SPECIALS +EXTERN Cursor src_cursor; +#endif +/* END CHUNK xdvi.h 6 */ + +#ifdef GREY +EXTERN Pixel *pixeltbl; +EXTERN Pixel *pixeltbl_t; +#endif /* GREY */ + +EXTERN Boolean canit INIT(False); +EXTERN jmp_buf canit_env; +EXTERN VOLATILE short event_counter INIT(0); +EXTERN Boolean terminate_flag INIT(False); + +struct WindowRec { + Window win; + int shrinkfactor; + int base_x, base_y; + unsigned int width, height; + int min_x, max_x, min_y, max_y; /* for pending expose events */ +}; + +extern struct WindowRec mane, alt, currwin; +EXTERN int min_x, max_x, min_y, max_y; + +#define shrink_factor currwin.shrinkfactor + +#ifdef TOOLKIT +EXTERN Widget top_level, vport_widget, draw_widget, clip_widget; +#ifdef HTEX +EXTERN Widget pane_widget, anchor_search, anchor_info; +#endif +#ifdef MOTIF +EXTERN Widget shrink_button[4]; +EXTERN Widget x_bar, y_bar; /* horizontal and vert. scroll bars */ +#endif /* MOTIF */ +#ifdef BUTTONS +#ifndef MOTIF +#define XTRA_WID 79 +#else +#define XTRA_WID 120 +#endif +EXTERN Widget form_widget; +#endif +#else /* !TOOLKIT */ +EXTERN Window top_level; + +#define BAR_WID 12 /* width of darkened area */ +#define BAR_THICK 15 /* gross amount removed */ +#endif /* TOOLKIT */ + +EXTERN jmp_buf dvi_env; /* mechanism to relay dvi file errors */ +EXTERN _Xconst char *dvi_oops_msg; /* error message */ + +EXTERN char *ffline INIT(NULL); /* an array used by filefind to store */ + /* the file name being formed. */ + /* It expands as needed. */ + /* Also used elsewhere. */ +EXTERN int ffline_len INIT(0); /* current length of ffline[] */ + +#ifdef SELFAUTO +EXTERN _Xconst char *argv0; /* argv[0] */ +#endif + +#ifdef CFG2RES +struct cfg2res { + _Xconst char *cfgname; /* name in config file */ + _Xconst char *resname; /* name of resource */ + Boolean numeric; /* if numeric */ +}; +#endif + +#if PS + +extern struct psprocs { + void (*toggle) ARGS((void)); + void (*destroy) ARGS((void)); + void (*interrupt) ARGS((void)); + void (*endpage) ARGS((void)); + void (*drawbegin) ARGS((int, int, _Xconst char *)); + void (*drawraw) ARGS((_Xconst char *)); + void (*drawfile) ARGS((_Xconst char *, FILE *)); + void (*drawend) ARGS((_Xconst char *)); + void (*beginheader) ARGS((void)); + void (*endheader) ARGS((void)); + void (*newdoc) ARGS((void)); +} psp, no_ps_procs; + +#endif /* PS */ + +/******************************** + * Procedures * + *******************************/ + +_XFUNCPROTOBEGIN +#ifdef BUTTONS +extern void create_buttons ARGS((XtArgVal)); +#endif +#ifdef GREY +extern void init_plane_masks ARGS((void)); +#endif +extern void init_colors ARGS((void)); +extern void reconfig ARGS((void)); +#ifdef TOOLKIT +extern void handle_key ARGS((Widget, XtPointer, XEvent *, Boolean *)); +extern void handle_resize ARGS((Widget, XtPointer, XEvent *, Boolean *)); +extern void handle_button ARGS((Widget, XtPointer, XEvent *, Boolean *)); +extern void handle_motion ARGS((Widget, XtPointer, XEvent *, Boolean *)); +extern void handle_release ARGS((Widget, XtPointer, XEvent *, Boolean *)); +extern void handle_exp ARGS((Widget, XtPointer, XEvent *, Boolean *)); +#endif +#ifdef MOTIF +extern void file_pulldown_callback ARGS((Widget, XtPointer, XtPointer)); +extern void navigate_pulldown_callback ARGS((Widget, XtPointer, XtPointer)); +extern void scale_pulldown_callback ARGS((Widget, XtPointer, XtPointer)); +extern void set_shrink_factor ARGS((int)); +#endif +extern void showmessage ARGS((_Xconst char *)); +#if PS +extern void ps_read_events ARGS((wide_bool, wide_bool)); +#define read_events(wait) ps_read_events(wait, True) +#else +extern void read_events ARGS((wide_bool)); +#endif +extern void redraw_page ARGS((void)); +extern void do_pages ARGS((void)); +extern void reset_fonts ARGS((void)); +extern void realloc_font ARGS((struct font *, wide_ubyte)); +extern void realloc_virtual_font ARGS((struct font *, wide_ubyte)); +extern Boolean load_font ARGS((struct font *)); +extern struct font *define_font ARGS((FILE *, wide_ubyte, + struct font *, struct font **, unsigned int, + struct tn **)); +extern void init_page ARGS((void)); +extern void open_dvi_file ARGS((void)); +extern Boolean check_dvi_file ARGS((void)); +#ifdef GRID +extern void put_grid ARGS((int, int, unsigned int, unsigned int, unsigned int, GC, GC, GC)); +#endif /* GRID */ +#ifndef TEXXET +extern long set_char ARGS((wide_ubyte)); +extern long load_n_set_char ARGS((wide_ubyte)); +extern long set_vf_char ARGS((wide_ubyte)); +extern long set_t1_char P1H(wide_ubyte); +#else +extern void set_char ARGS((wide_ubyte, wide_ubyte)); +extern void load_n_set_char ARGS((wide_ubyte, wide_ubyte)); +extern void set_vf_char ARGS((wide_ubyte, wide_ubyte)); +extern void set_t1_char P2H(wide_ubyte, wide_ubyte); +#endif +extern int tfmload P3H(char *, long *, long *); +extern void read_T1_char P2H(struct font *, ubyte); +extern int find_T1_font P1H(char *); +extern int getpsinfo P1H(char *); +extern void draw_page P1H(void); +extern void init_t1 P1H(void); +#if CFGFILE +#ifndef CFG2RES +extern void readconfig ARGS((void)); +#else +extern void readconfig ARGS((_Xconst struct cfg2res *, + _Xconst struct cfg2res *, XtResource *, XtResource *)); +#endif /* CFG2RES */ +#endif /* CFGFILE */ +extern void init_font_open ARGS((void)); +extern FILE *font_open P7H(char *, char **, double, int *, int, + char **,int *); +#if PS +extern void ps_newdoc ARGS((void)); +extern void ps_destroy ARGS((void)); +#endif +extern void applicationDoSpecial ARGS((char *)); +#if PS +extern void scan_special ARGS((char *)); +#endif +extern NORETURN void oops ARGS((_Xconst char *message, ...)); +#ifndef KPATHSEA +extern void *xmalloc ARGS((unsigned)); +extern void *xrealloc ARGS((void *, unsigned)); +extern char *xstrdup ARGS((_Xconst char *, int)); +extern char *xmemdump ARGS((_Xconst char *, int)); +#endif +extern void expandline ARGS((int)); +extern void alloc_bitmap ARGS((struct bitmap *)); +#ifndef KPATHSEA +extern void xputenv ARGS((_Xconst char *, _Xconst char *)); +#endif +extern int memicmp ARGS((_Xconst char *, _Xconst char *, size_t)); +extern FILE *xfopen P2H(char *, OPEN_MODE_ARGS); +#ifdef HTEX +extern FILE *xfopen_local P2H(char *, OPEN_MODE_ARGS); +#else +#define xfopen_local xfopen +#endif +extern int xpipe ARGS((int *)); +extern DIR *xdvi_xopendir ARGS((_Xconst char *)); +extern _Xconst struct passwd *ff_getpw ARGS((_Xconst char **, _Xconst char *)); +extern unsigned long num ARGS((FILE *, int)); +extern long snum ARGS((FILE *, int)); +extern void read_PK_index ARGS((struct font *, wide_bool)); +extern void read_GF_index ARGS((struct font *, wide_bool)); +#ifdef Omega +extern unsigned long read_VF_index ARGS((struct font *, wide_bool)); +#else +extern void read_VF_index ARGS((struct font *, wide_bool)); +#endif + +#if PS +extern void drawbegin_none ARGS((int, int, _Xconst char *)); +extern void draw_bbox ARGS((void)); +extern void NullProc ARGS((void)); +#ifdef PS_DPS +extern Boolean initDPS ARGS((void)); +#endif +#ifdef PS_NEWS +extern Boolean initNeWS ARGS((void)); +#endif +#ifdef PS_GS +extern Boolean initGS ARGS((void)); +#endif +#endif /* PS */ +#ifdef HTEX +extern int open_www_file ARGS((void)); +extern void htex_can_it ARGS((void)); +extern void search_callback ARGS((Widget, XtPointer, XtPointer)); +extern void detach_anchor ARGS((void)); +extern char *MyStrAllocCopy ARGS((char **, char *)); +extern int pointerlocate ARGS((int *, int *)); +extern void htex_recordbits ARGS((int, int, int, int)); +extern void htex_initpage ARGS((void)); +extern void htex_donepage ARGS((int, int)); +extern void htex_parsepages ARGS((void)); +extern void htex_parse_page ARGS((int)); +extern void htex_scanpage ARGS((int)); +extern void htex_scanpage ARGS((int)); +extern void htex_dospecial ARGS((long, int)); +extern void htex_reinit ARGS((void)); +extern void htex_do_loc ARGS((char *)); +extern void add_search ARGS((char *, int)); +extern int htex_handleref ARGS((int, int, int)); +extern void htex_displayanchor ARGS((int, int, int)); +extern void htex_goback ARGS((void)); +extern int checkHyperTeX ARGS((char *, int)); +extern void htex_handletag ARGS((char *, int)); +extern void htex_anchor ARGS((int, char *, int)); +extern void htex_dohref ARGS((char *)); +extern void htex_drawboxes ARGS((void)); +extern void htex_to_page ARGS((int)); +extern void htex_to_anchor ARGS((int, int)); +extern int htex_is_url ARGS((const char *)); +extern void htex_do_url ARGS((char *)); +extern void paint_anchor ARGS((char *)); +extern int fetch_relative_url ARGS((char *, const char *, char *)); +extern void wait_for_urls ARGS((void)); +char *figure_mime_type ARGS((char *)); +#endif + +/* BEGIN CHUNK xdvi.h 7 */ +#ifdef SRC_SPECIALS +/* functions in src_special.c */ +extern void src_find_special ARGS((int, Position, Position)); +extern void src_delete_all_specials ARGS((void)); +extern void src_warn_outdated ARGS((void)); +extern void src_eval_special ARGS((char *, Position, Position)); +extern void src_check_editorCommand ARGS((void)); +extern void src_cleanup ARGS((void)); +// extern void src_do_special ARGS((float)); +extern float src_look_forward ARGS((double)); +#endif +/* END CHUNK xdvi.h 7 */ +#if !HAVE_TEMPNAM +char *tempnam ARGS((char *, char *)) +#endif + +_XFUNCPROTOEND + +#define one(fp) ((unsigned char) getc(fp)) +#define sone(fp) ((long) one(fp)) +#define two(fp) num (fp, 2) +#define stwo(fp) snum(fp, 2) +#define four(fp) num (fp, 4) +#define sfour(fp) snum(fp, 4) + +#ifdef HTEX +/* From xhdvi/url.h */ +/* Some URL stuff: */ +typedef struct { + char *url; /* Full address of the URL we have locally */ + char *file; /* Local file name it is stored as */ +} FiletoURLconv; + +#define FILELISTCHUNK 20 +EXTERN FiletoURLconv *filelist INIT(NULL); +EXTERN int nURLs INIT(0); + +#endif /* HTEX */ + +#endif /* XDVI_H */ diff --git a/Build/source/texk/windvi/xdvi.icon b/Build/source/texk/windvi/xdvi.icon new file mode 100644 index 00000000000..dcfd263510f --- /dev/null +++ b/Build/source/texk/windvi/xdvi.icon @@ -0,0 +1,27 @@ +#define xdvi_width 48 +#define xdvi_height 48 +static const unsigned char xdvi_bits[] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x22, 0x00, 0x00, 0x01, 0x00, 0x00, 0xa2, 0xe0, 0x44, 0x38, 0x95, 0x13, + 0x9e, 0x17, 0x45, 0x45, 0x55, 0xf4, 0x82, 0xf0, 0x28, 0x3d, 0xd5, 0x13, + 0x82, 0x10, 0x28, 0x05, 0x55, 0x10, 0x82, 0xe0, 0x10, 0x39, 0x8a, 0x13, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x1f, 0x00, + 0x79, 0x18, 0x18, 0x13, 0x16, 0x00, 0x69, 0x10, 0x18, 0x0e, 0x16, 0x00, + 0xcf, 0x20, 0x1c, 0x0e, 0xd6, 0x00, 0xe9, 0xc3, 0x7b, 0x84, 0x3f, 0x01, + 0x09, 0x00, 0x00, 0x00, 0x30, 0x00, 0x08, 0x00, 0x00, 0x00, 0x70, 0xcc, + 0x08, 0x00, 0x00, 0x00, 0x30, 0x52, 0x0a, 0x00, 0x00, 0x00, 0x30, 0x52, + 0x0a, 0xc0, 0xff, 0x03, 0x30, 0x4c, 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x0a, 0xc0, 0xff, 0x03, 0x10, 0x00, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, + 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00, 0xf0, 0x17, + 0x0b, 0x0c, 0x3c, 0xc0, 0x93, 0x20, 0x0c, 0x0e, 0x43, 0x20, 0x96, 0x40, + 0x0c, 0x8e, 0x81, 0x10, 0x96, 0xbe, 0x0a, 0x8d, 0x81, 0x19, 0x90, 0x82, + 0x8a, 0x8c, 0x81, 0x0d, 0x90, 0x42, 0x48, 0x8c, 0x81, 0xed, 0x91, 0x3e, + 0x6a, 0x0c, 0xc3, 0x1d, 0x96, 0x12, 0x38, 0x0c, 0xbc, 0x0d, 0x1c, 0x02, + 0xf8, 0x3f, 0x80, 0x0d, 0x1c, 0x3e, 0x0b, 0x0c, 0x80, 0x0c, 0x1c, 0x00, + 0x0b, 0x0c, 0xc3, 0x18, 0x1c, 0x00, 0x0a, 0x0c, 0x63, 0x10, 0x16, 0x00, + 0x89, 0x3f, 0x1e, 0xe0, 0x11, 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x10, 0x00, + 0xff, 0xff, 0xff, 0xff, 0x1f, 0xae, 0x0f, 0x00, 0x80, 0x84, 0x0a, 0xae, + 0x87, 0x64, 0x86, 0x84, 0x08, 0x42, 0x42, 0x45, 0xe2, 0x1c, 0x07, 0x42}; diff --git a/Build/source/texk/windvi/xdvi.man b/Build/source/texk/windvi/xdvi.man new file mode 100644 index 00000000000..4dcf7f8c2b4 --- /dev/null +++ b/Build/source/texk/windvi/xdvi.man @@ -0,0 +1,1569 @@ +.\" Copyright (c) 1990-1999 Paul Vojta +.\" +.\" Permission is hereby granted, free of charge, to any person obtaining a copy +.\" of this software and associated documentation files (the "Software"), to +.\" deal in the Software without restriction, including without limitation the +.\" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +.\" sell copies of the Software, and to permit persons to whom the Software is +.\" furnished to do so, subject to the following conditions: +.\" +.\" The above copyright notice and this permission notice shall be included in +.\" all copies or substantial portions of the Software. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +.\" PAUL VOJTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +.\" IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +.\" +.if t .ds Te T\\h'-0.1667m'\\v'0.20v'E\\v'-0.20v'\\h'-0.125m'X +.if n .ds Te TeX +' # small and boldface (not all -man's provide it) +.de SB +\&\fB\s-1\&\\$1 \\$2\s0\fR +.. +.TH XDVI 1 "15 February 1999" "X Version 11" +.SH NAME +xdvi \- DVI Previewer for the X Window System +.SH SYNOPSIS +.B xdvi +.nh +[\fB+\fP[\fIpage\fP]] [\fB\-s\fP \fIshrink\fP] [\fB\-S\fP \fIdensity\fP] +#ifgrey +[\fB\-nogrey\fP] [\fB\-gamma\fP \fIg\fP] [\fB\-install\fP] [\fB\-noinstall\fP] +#endif +[\fB\-p\fP \fIpixels\fP] +[\fB\-margins\fP \fIdimen\fP] +[\fB\-sidemargin\fP \fIdimen\fP] [\fB\-topmargin\fP \fIdimen\fP] +[\fB\-offsets\fP \fIdimen\fP] +[\fB\-xoffset\fP \fIdimen\fP] [\fB\-yoffset\fP \fIdimen\fP] +[\fB\-paper\fP \fIpapertype\fP] [\fB\-altfont\fP \fIfont\fP] +#ifmakepk +[\fB\-nomakepk\fP] +#endif +#ifkpathsea +.BI \-mfmode " mode-def\fR[\fP\fB:\fPdpi\fR]\fP" +#endif +#ifnokpathsea +[\fB\-mfmode\fP \fImode-def\fP] +#endif +[\fB\-l\fP] +[\fB\-rv\fP] +#ifbuttons +[\fB\-expert\fP] +[\fB\-shrinkbutton\fP\fIn\fP \fIshrink\fP] +#endif +[\fB\-mgs\fP[\fIn\fP] \fIsize\fP] [\fB\-warnspecials\fP] +[\fB\-hush\fP] +[\fB\-hushchars\fP] [\fB\-hushchecksums\fP] +#ifkpathsea +[\fB\-hushspecials\fP] +#endif +[\fB\-safer\fP] +[\fB\-fg\fP \fIcolor\fP] [\fB\-bg\fP \fIcolor\fP] [\fB\-hl\fP \fIcolor\fP] +[\fB\-bd\fP \fIcolor\fP] [\fB\-cr\fP \fIcolor\fP] +[\fB\-bw\fP \fIwidth\fP] +#ifgrid +[\fB\-grid1\fP \fIcolor\fP] +[\fB\-grid2\fP \fIcolor\fP] +[\fB\-grid3\fP \fIcolor\fP] +#endif +[\fB\-bw\fP \fIwidth\fP] +[\fB\-display\fP \fIhost:display\fP] [\fB\-geometry\fP \fIgeometry\fP] +[\fB\-icongeometry\fP \fIgeometry\fP] [\fB\-iconic\fP] +#ifbuttons +[\fB\-font\fP \fIfont\fP] +#endif +[\fB\-keep\fP] [\fB\-copy\fP] [\fB\-thorough\fP] +#ifps +[\fB\-nopostscript\fP] +[\fB\-noscan\fP] +[\fB\-allowshell\fP] +#endif +#ifdps +[\fB\-nodps\fP] +#endif +#ifnews +[\fB\-nonews\fP] +#endif +#ifghost +[\fB\-noghostscript\fP] +[\fB\-nogssafer\fP] +[\fB\-gsalpha\fP] +[\fB\-interpreter\fP \fIpath\fP] +[\fB\-gspalette\fP \fIpalette\fP] +#endif +#ifhyper +[\fB\-underlink\fP] +[\fB\-browser\fP \fIWWWbrowser\fP] +[\fB\-base\fP \fIbase URL\fP] +#endif +#ifsrcspecials +[\fB\-srcMode\fP] +[\fB\-srcVisibility\fP] +[\fB\-srcTickShape\fP \fIn\fP] +[\fB\-srcTickSize\fP \fIgeometry\fP] +[\fB\-srcCursor\fP \fIn\fP] +[\fB\-srcJumpButton\fP \fIbutton\fP] +[\fB\-srcEditorCommand\fP \fIcommand string\fP] +[\fB\-srcSpecialFormat\fP \fIn\fP] +#endif +[\fB\-debug\fP \fIbitmask\fP] [\fB\-version\fP] +#ifselfile +[\fIdvi_file\fP] +#endif +#ifnoselfile +.I dvi_file +#endif +.hy +.SH DESCRIPTION +.B xdvi +is a program which runs under the X window system. It is used to preview +.I dvi +files, such as are produced by +.BR tex (1). +.PP +This program has the capability of showing the file shrunken by various +(integer) factors, and also has a ``magnifying glass'' which allows one +to see a small part of the unshrunk image momentarily. +.PP +Before displaying any page or part thereof, it checks to see if the +.I dvi +file has changed since the last time it was displayed. If this is the case, +then +.B xdvi +will reinitialize itself for the new +.I dvi +file. For this reason, exposing parts of the +.B xdvi +window while \*(Te\& is running should be avoided. This feature allows you +to preview many versions of the same file while running +.B xdvi +only once. +#ifbuttons +.PP +In addition to using keystrokes to move within the file, +.B xdvi +provides buttons on the right side of the window, which are synonymous +with various sequences of keystrokes. +#endif +#ifps +.PP +.B xdvi +can show PostScript<tm> specials by any of three methods. +It will try first to use Display PostScript<tm>, then NeWS, then it +will try to use Ghostscript to render the images. All of these options +depend on additional software to work properly; moreover, some of them +may not be compiled into this copy of +.BR xdvi . +.PP +For performance reasons, +.B xdvi +does not render PostScript specials in the magnifying glass. +#endif +#ifselfile +.PP +If +.I dvi_file +is not specified, a file-selection widget is popped up for you to choose the +.I dvi +file. +#endif +.SH OPTIONS +In addition to specifying the +.I dvi +file (with or without the +.B .dvi +extension), +.B xdvi +supports the following command line options. If the option begins with a +.RB ` + ' +instead of a +.RB ` \- ', +the option is restored to its default value. By default, these options can +be set via the resource names given in parentheses in the description of +each option. +.TP +.BI + page +Specifies the first page to show. If +.B + +is given without a number, the last page is assumed; the first page is +the default. +#ifps +.TP +.B \-allowshell +.RB ( .allowShell ) +This option enables the shell escape in PostScript specials. +(For security reasons, shell escapes are disabled by default.) +This option should be rarely used; in particular it should not be used just +to uncompress files: that function is done automatically if the file name +ends in +.BR .Z , +.BR .gz , +or +.BR .bz2 +Shell escapes are always turned off if the +.B \-safer +option is used. +#endif +.TP +.BI \-altfont " font" +.RB ( .altFont ) +Declares a default font to use when the font in the +.I dvi +file cannot be found. This is useful, for example, with PostScript <tm> fonts. +.TP +.BI \-background " color" +.RB ( .background ) +Determines the color of the background. Same as +.BR -bg . +#ifhyper +.TP +.BI \-base " base URL" +.RB ( .urlBase ) +Sets the base URL value that external links given in the +.I dvi +file are assumed relative to - normally this should be the URL +of the document itself (?). +#endif +.TP +.BI \-bd " color" +.RB ( .borderColor ) +Determines the color of the window border. +.TP +.BI \-bg " color" +.RB ( .background ) +Determines the color of the background. +.TP +.BI \-bordercolor " color" +Same as +.BR -bd . +.TP +.BI \-borderwidth " width" +.RB ( .borderWidth ) +Specifies the width of the border of the window. Same as +.BR -bw . +#ifhyper +.TP +.BI \-browser " WWWbrowser" +.RB ( .wwwBrowser ) +Defines the World Wide Web browser to be used to handle external URL's, +for example mosaic. If neither the command-line option nor the X +resource are set, uses the environment variable WWWBROWSER. +#endif +.TP +.BI \-bw " width" +.RB ( .borderWidth ) +Specifies the width of the border of the window. +.TP +.B \-copy +.RB ( .copy ) +Always use the +.I copy +operation when writing characters to the display. +This option may be necessary for correct operation on a color display, but +overstrike characters will be incorrect. +#ifgrey +If greyscale anti-aliasing is in use, the +.B \-copy +operation will disable the use of colorplanes and make overstrikes come +out incorrectly. +#endif +See also +.BR \-thorough . +.TP +.BI \-cr " color" +.RB ( .cursorColor ) +Determines the color of the cursor. The default is the color of the page +border. +.TP +.BI \-debug " bitmask" +.RB ( .debugLevel ) +#ifnokpathsea +If nonzero, prints additional debugging information on standard output. +The bitmask should be given as a decimal number. The values of the bits +are defined in the source file +.BR xdvi.h . +#endif +#ifkpathsea +If nonzero, prints additional information on standard output. The +number is taken as a set of independent bits. The meaning of each bit +follows. 1=bitmaps; 2=dvi translation; 4=pk reading; 8=batch +operation; 16=events; 32=file opening; 64=PostScript communication; +128=Kpathsea stat(2) calls; 256=Kpathsea hash table lookups; 512=Kpathsea +path definitions; 1024=Kpathsea path expansion; 2048=Kpathsea searches. +To trace everything having to do with file searching and opening, use 4000. +Some of these debugging options are actually provided by Kpathsea. +See the Debugging section in the Kpathsea manual. +#endif +.TP +.BI \-density " density" +.RB ( .densityPercent ) +Determines the density used when shrinking bitmaps for fonts. +A higher value produces a lighter font. The default value is 40. +#ifgrey +If greyscaling is in use this argument does not apply; use +.B \-gamma +instead. +#endif +See also the +.RB ` S '. +keystroke. +Same as +.BR \-S +.TP +.BI \-display " host" : display +Specifies the host and screen to be used for displaying the +.I dvi +file. By default this is obtained from the environment variable +.SB DISPLAY. +#ifbuttons +.TP +.B \-expert +.RB ( .expert ) +Prevent the buttons from appearing. See also the +.RB ` x ' +keystroke. +#endif +.TP +.BI \-fg " color" +.RB ( .foreground ) +Determines the color of the text (foreground). +.TP +.BI \-foreground " color" +Same as +.BR -fg . +#ifbuttons +.TP +.BI \-font " font" +.RB ( *font ) +Sets the font for use in the buttons. +#endif +#ifgrey +.TP +.BI \-gamma " gamma" +.RB ( .gamma ) +Controls the interpolation of colors in the greyscale anti-aliasing color +palette. Default value is 1.0. For 0 < +.I gamma +< 1, the fonts will be lighter (more like the background), and for +.I gamma +> 1, the fonts will be darker (more like the foreground). Negative +values behave the same way, but use a slightly different algorithm. +For color and greyscale displays; for monochrome, see +.BR \-density . +See also the +.RB ` S ' +keystroke +#endif +#ifgrid +.TP +.BI \-grid1 " color" +.RB ( .grid1Color ) +Determines the color of level 1 grid (default as foreground) +.TP +.BI \-grid2 " color" +.RB ( .grid2Color ) +Determines the color of level 2 grid (default as foreground) +.TP +.BI \-grid3 " color" +.RB ( .grid3Color ) +Determines the color of level 3 grid (default as foreground) +#endif +.TP +.BI \-geometry " geometry" +.RB ( *geometry ) +Specifies the initial geometry of the window. +#ifghost +.TP +.BI \-gspalette " palette" +.RB ( .palette ) +Specifies the palette to be used when using Ghostscript for rendering +PostScript specials. Possible values are +.BR Color , +.BR Greyscale , +and +.BR Monochrome . +The default is +.BR Color . +.TP +.B \-gsalpha +.RB ( .gsAlpha ) +Causes +.B Ghostscript +to be called with the +.B x11alpha +driver instead of the +.B x11 +driver. The +.B x11alpha +driver enables anti-aliasing in PostScript figures, for a nicer appearance. +It is available on newer versions of +.BR Ghostscript . +This option can also be toggled with the +.RB ` V ' +keystroke. +#endif +.TP +.BI \-hl " color" +.RB ( .highlight ) +Determines the color of the page border. The default is the foreground color. +.TP +.B \-hush +.RB ( .Hush ) +Causes +.B xdvi +to suppress all suppressible warnings. +.TP +.B \-hushchars +.RB ( .hushLostChars ) +Causes +.B xdvi +to suppress warnings about references to characters which are not defined +in the font. +.TP +.B \-hushchecksums +.RB ( .hushChecksums ) +Causes +.B xdvi +to suppress warnings about checksum mismatches between the +.I dvi +file and the font file. +.TP +#ifkpathsea +.B \-hushspecials +.RB ( .hushSpecials ) +Causes +.B xdvi +to suppress warnings about +.B \especial +strings that it cannot process. +#endif +.TP +.BI \-icongeometry " geometry" +.RB ( .iconGeometry ) +Specifies the initial position for the icon. +.TP +.B \-iconic +.RB ( .iconic ) +Causes the +.B xdvi +window to start in the iconic state. The default is to start with the +window open. +#ifgrey +.TP +.B \-install +.RB ( .install ) +If +.B xdvi +is running under a +.B PseudoColor +visual, then (by default) it will check for +.B TrueColor +visuals with more bits per pixel, and switch to such a visual if one exists. +If no such visual exists, it will use the current visual and colormap. If +.B \-install +is selected, however, it will still use a +.B TrueColor +visual with a greater depth, if one is available; otherwise, it will +install its own colormap on the current visual. If the current visual is not +.BR PseudoColor , +then +.B xdvi +will not switch the visual or colormap, regardless of its options. +The default value of the +.B install +resource is the special value, +.BR maybe . +There is no +.B +install +option. See also +.BR \-noinstall , +and the GREYSCALING AND COLORMAPS section. +#endif +#ifghost +.TP +.BI \-interpreter " filename" +.RB ( .interpreter ) +Use +.I filename +as the Ghostscript interpreter. By default it uses +.BR @GS_PATH@ . +#endif +.TP +.B \-keep +.RB ( .keepPosition ) +Sets a flag to indicate that +.B xdvi +should not move to the home position when moving to a new page. See also the +.RB ` k ' +keystroke. +.TP +.B \-l +.RB ( .listFonts ) +Causes the names of the fonts used to be listed. +.TP +.BI \-margins " dimen" +.RB ( .Margin ) +Specifies the size of both the top margin and side margin. +This determines the ``home'' position of the page within the window as +follows. If the entire page fits in the window, then the margin settings +are ignored. If, even after removing the margins from the left, right, +top, and bottom, the page still cannot fit in the window, then the page +is put in the window such that the top and left margins are hidden, and +presumably the upper left-hand corner of the text on the page will be +in the upper left-hand corner of the window. +Otherwise, the text is centered in the window. +The dimension should be a decimal number optionally followed by +any of the two-letter abbreviations for units accepted by \*(Te\& +.RB ( pt , +.BR pc , +.BR in , +.BR bp , +.BR cm , +.BR mm , +.BR dd , +.BR cc , +or +.BR sp ). +By default, the unit will be +.BR @DEFAULT_UNIT@. +See also +.BR \-sidemargin ", " \-topmargin , +and the keystroke +.RB ` M .' +.TP +#ifkpathsea +.BI \-mfmode " mode-def" +#endif +#ifnokpathsea +.BI \-mfmode " mode-def\fR[\fP\fB:\fPdpi\fR]\fP" +#endif +.RB ( .mfMode ) +Specifies a +.I mode-def +string, which can be used in searching for fonts (see ENVIRONMENT, below). +Generally, when changing the +.IR mode-def , +it is also necessary to change the font size to the appropriate value +for that mode. This is done by adding a colon and the value in dots per inch; +for example, +.BR "\-mfmode ljfour:600" . +This method overrides any value given by the +.B pixelsPerInch +resource or the +.B \-p +command-line argument. +#ifmakepk +The metafont mode is also passed to +.B metafont +during automatic creation of fonts. +#endif +By default, it is +.BR "@MFMODE@" . +.TP +.BI \-mgs " size" +Same as +.BR \-mgs1 . +.TP +.BI "\-mgs\fR[\fIn\fR]" " size" +.RB ( .magnifierSize\fR[\fIn\fR] ) +Specifies the size of the window to be used for the ``magnifying glass'' +for Button +.IR n . +The size may be given as an integer (indicating that the magnifying glass +is to be square), or it may be given in the form +.IR width x height . +See the MOUSE ACTIONS section. Defaults are 200x150, 400x250, 700x500, +1000x800, and 1200x1200. +#ifdps +.TP +.B \-nodps +.RB ( .dps ) +Inhibits the use of Display PostScript<tm> for displaying PostScript<tm> +specials. Other forms of PostScript emulation, if installed, will be used +instead. +(For this option, the logic of the corresponding resource is reversed: +.B \-nodps +corresponds to +.BR dps:off ; +.B +nodps +to +.BR dps:on .) +#endif +#ifghost +.TP +.B \-noghostscript +.RB ( .ghostscript ) +Inhibits the use of Ghostscript for displaying PostScript<tm> specials. +(For this option, the logic of the corresponding resource is reversed: +.B \-noghostscript +corresponds to +.BR ghostscript:off ; +.B +noghostscript +to +.BR ghostscript:on .) +#endif +#ifgrey +.TP +.B \-nogrey +.RB ( .grey ) +Turns off the use of greyscale anti-aliasing when printing shrunken bitmaps. +(For this option, the logic of the corresponding resource is reversed: +.B \-nogrey +corresponds to +.BR grey:off ; +.B +nogrey +to +.BR grey:on .) +See also the +.RB ` G ' +keystroke. +#endif +#ifghost +.TP +.B \-nogssafer +.RB ( .gsSafer ) +Normally, if Ghostscript is used to render PostScript specials, the Ghostscript +interpreter is run with the option +.BR \-dSAFER . +The +.B \-nogssafer +option runs Ghostscript without +.BR \-dSAFER . +The +.B \-dSAFER +option in Ghostscript disables PostScript operators such as +.BR deletefile , +to prevent possibly malicious PostScript programs from having any effect. +If the +.B \-safer +option is specified, then this option has no effect; in that case Ghostscript +is always run with +.BR \-dSAFER . +(For the +.B \-nogssafer +option, the logic of the corresponding resource is reversed: +.B \-nogssafer +corresponds to +.BR gsSafer:off ; +.B +nogssafer +to +.BR gsSafer:on .) +#endif +#ifgrey +.TP +.B \-noinstall +.RB ( .install ) +Inhibit the default behavior of switching to a +.B TrueColor +visual if one is available with more bits per pixel than the current visual. +This option corresponds to a resource of +.BR install:off . +There is no +.B +noinstall +option. See also +.BR \-install , +and the GREYSCALING AND COLORMAPS section. +#endif +#ifmakepk +.TP +.B \-nomakepk +.RB ( .makePk ) +Turns off automatic generation of font files that cannot be found by other +means. +(For this option, the logic of the corresponding resource is reversed: +.B \-nomakepk +corresponds to +.BR makePk:off ; +.B +nomakepk +to +.BR makePK:on .) +#endif +#ifnews +.TP +.B \-nonews +.RB ( .news ) +Inhibits the use of NeWS<tm> for displaying PostScript<tm> specials. +Ghostscript, if enabled by the installation, will be used instead. +(For this option, the logic of the corresponding resource is reversed: +.B \-nonews +corresponds to +.BR news:off ; +.B +news +to +.BR news:on .) +#endif +#ifps +.TP +.B \-nopostscript +.RB ( .postscript ) +Turns off rendering of PostScript<tm> specials. Bounding boxes, if known, +will be displayed instead. This option can also be toggled with the +.RB ` v ' +keystroke. +(For this option, the logic of the corresponding resource is reversed: +.B \-nopostscript +corresponds to +.BR postscript:off ; +.B +postscript +to +.BR postscript:on .) +#endif +#ifps +.TP +.B \-noscan +.RB ( .prescan ) +Normally, when PostScript<tm> is turned on, +.B xdvi +will do a preliminary scan of the +.I dvi +file, in order to send any necessary header files before sending the +PostScript code that requires them. This option turns off such prescanning. +(It will be automatically be turned back on if +.B xdvi +detects any specials that require headers.) (For the +.B \-noscan +option, the logic of the corresponding resource is reversed: +.B \-noscan +corresponds to +.BR prescan:off ; +.B +noscan +to +.BR prescan:on .) +#endif +.TP +.BI \-offsets " dimen" +.RB ( .Offset ) +Specifies the size of both the horizontal and vertical offsets of the +output on the page. By decree of the Stanford \*(Te\& Project, +the default \*(Te\& page origin is always 1 inch over and down from +the top-left page corner, even when non-American paper sizes are used. +Therefore, the default offsets are 1.0 inch. +The argument +.I dimen +should be a decimal number optionally followed by any of the two-letter +abbreviations for units accepted by \*(Te\& +.RB ( pt , +.BR pc , +.BR in , +.BR bp , +.BR cm , +.BR mm , +.BR dd , +.BR cc , +or +.BR sp ). +By default, the unit will be +.BR @DEFAULT_UNIT@. +See also +.B \-xoffset +and +.BR \-yoffset . +.TP +.BI \-p " pixels" +.RB ( .pixelsPerInch ) +Defines the size of the fonts to use, in pixels per inch. The +default value is @BDPI@. This option is provided only for backwards +compatibility; the preferred way of setting the font size is by setting the +Metafont mode at the same time; see the +.B \-mfmode +option. +.TP +.BI \-paper " papertype" +.RB ( .paper ) +Specifies the size of the printed page. This may be of the form +\fIwidth\fBx\fIheight\fR optionally followed by a unit, where +.I width +and +.I height +are decimal numbers giving the width and height of the paper, respectively, +and the unit is any of the two-letter abbreviations for units accepted +by \*(Te\& +.RB ( pt , +.BR pc , +.BR in , +.BR bp , +.BR cm , +.BR mm , +.BR dd , +.BR cc , +or +.BR sp ). +By default, the unit will be +.BR @DEFAULT_UNIT@. +There are also synonyms which may be used: +.B us +(8.5x11in), +.B usr +(11x8.5in), +.B legal +(8.5x14in), +.B foolscap +(13.5x17in), +as well as the ISO sizes +.BR a1 - a7 , +.BR b1 - b7 , +.BR c1 - c7 , +.BR a1r - a7r +.RB ( a1 - a7 +rotated), etc. The default size is @DEFAULT_PAGE_SIZE@. +.TP +.B \-rv +.RB ( .reverseVideo ) +Causes the page to be displayed with white characters on a black background, +instead of vice versa. +.TP +.BI \-s " shrink" +.RB ( .shrinkFactor ) +Defines the initial shrink factor. The default value is @SHRINK@. If +.I shrink +is given as 0, then the initial shrink factor is computed so that the +page fits within the window (as if the `s' keystroke were given without +a number). +.TP +.BI \-S " density" +.RB ( .densityPercent ) +Same as +.BR \-density , +.I q.v. +.TP +.B \-safer +.RB ( .safer ) +This option turns on all available security options; it is designed for use when +.B xdvi +is called by a browser that obtains a +.I dvi +or \*(Te\& file from another site. +#ifps +In the present case, this option selects +#endif +#ifghost +.B +nogssafer +and +#endif +#ifps +.BR +allowshell . +#endif +#ifnops +In the present case, this option is accepted but has no effect, since +.B xdvi +has been compiled without support for PostScript specials. +#endif +#ifbuttons +.TP +.BI \-shrinkbutton "n shrink" +.RB ( .shrinkButton\fIn\fP ) +Specifies that the +.IR n th +button changing shrink factors shall change to shrink factor +.IR factor . +This is not very usefull in the normal run of things. xdvik scales the +scaling factors according to resolution (currently 300dpi and 600dpi). +Here +.I n +may be a number from 1 to 4. Typical +.I factors +are powers of 2. +#endif +.TP +.BI \-sidemargin " dimen" +.RB ( .sideMargin ) +Specifies the side margin (see +.BR \-margins ). +#ifsrc +.TP +.BI \-srcMode +.RB ( .srcMode ) +Starts xdvi in src special mode (see the section SRC +SPECIAL MODE below for details). The mode can be toggled +with `Ctrl-s'; when the mode is on, the cursor +has a different shape (see the \fB-srcCursor\fR option below). +For security reasons, evaluation of src specials is off by default, +and it might be a good idea to enable it only for selected .dvi files +on the command line. +.TP +.BI \-srcVisibility +.RB ( .srcVisibility ) +Makes the source specials visible by drawing small tick marks +for each special. This can be toggled with the `V' key (see +the section SRC SPECIAL MODE for more details). +.TP +.BI \-srcTickShape " n" +.RB ( .srcTickShape ) +Specifies the shape of the src tick marks, where \fIn\fR can be +one of \fB0\fR, \fB1\fR, \fB2\fR or \fB3\fR: +\fB0\fR is a rectangle, +\fB1\fR is a triangle, +\fB2\fR is an upward angle and +\fB3\fR is a downward angle. +See the section SRC SPECIAL MODE for more details. +.TP +.BI \-srcTickSize " geometry" +.RB ( .srcTickSize ) +Specifies the size of the src tick marks in pixels +\fIwidth\fR x \fIheight\fR, with respect to magnification factor 1. +Default is 40x70, which is a reasonable value for 600dpi +fonts. For higher resolutions, you might want to increase +the size. The two attributes \fIwidth\fR and \fIheight\fR only have a +natural meaning for the \fBrectangle\fR shape; for the \fBtriangle\fR, +\fIwidth\fR is ignored; for the \fBangle\fR shapes, \fIwidth\fR is half +the width of the lines, and \fIheight\fR is the length of the lines. +See the section SRC SPECIAL MODE for more details. +.TP +.BI \-srcCursor " n" +.RB ( .srcCursor ) +The shape of the cursor in SRC SPECIAL MODE. For possible +values, see e. g. `cursorfont.h'. +.TP +.BI \-srcJumpButton " button" +.RB ( .srcJumpButton ) +The mouse button used in SRC SPECIAL MODE to +jump to the next special near point. See +the section SRC SPECIAL MODE for more details. +.TP +.BI \-srcEditorCommand " command string" +.RB ( .srcEditorCommand ) +Specifies the editor command that will be called when +the user wants to jump to a src special. +This should be a C format string containing 2 placeholders +(aka `conversion specifications'): +%s (for the filename) and %u (for the line number) pointed +to by that special. You should always enclose both of these +conversion specifications into a pair of quotes like this: '%u'; +this will ensure that the shell won't interpret the resulting +format string directly. This way it will do no harm when +some evil user puts commands like `ls -lR /` into the src +specials of a .dvi file, instead of the ordinary filename. +The default for this command string is: +.sp +emacsclient --no-wait '+%u' '%s' +.sp +which will work together with Emacs. For Xemacs you would +have to use something like: +.sp +gnuclient -q +'%u' '%s' +.sp +Note that when the command-line option, you'll have to +enclose the string into another pair of quotes; don't +enclose the string in quotes when specifying it as an +X resource. +.TP +.BI \-srcSpecialFormat " n" +.RB ( .srcSpecialFormat ) +The format of the +.B \especial +strings in the dvi file. The formats currently supported are: +.sp +\fB0\fR \especial{src:filename:linenumber} +.sp +\fB1\fR \especial{src:linenumber<space>filename} +.sp +\fB2\fR \especial{src:linenumber<space>*filename} +.sp +In the first format, the colon separating the linenumber from the filename +is the last colon in the entire string. +.sp +The second format requires exactly one space between the line number and +the file name. +.sp +In the third format, there can be any number of spaces (including 0 -- +but then of course the file name shouldn't start with a digit, so using +no space at all is usually not a good idea). +.sp +Xdvi will warn you about specials that don't conform to the +format currently selected. +#endif +.TP +.B \-thorough +.RB ( .thorough ) +.B xdvi +will usually try to ensure that overstrike characters +.RI ( e.g. , +.BR \enotin ) +are printed correctly. On monochrome displays, this is always possible +with one logical operation, either +.I and +or +.IR or . +On color displays, however, this may take two operations, one to set the +appropriate bits and one to clear other bits. If this is the case, then +by default +.B xdvi +will instead use the +.I copy +operation, which does not handle overstriking correctly. The +.B \-thorough +option chooses the slower but more correct choice. See also +.BR \-copy . +.TP +.BI \-topmargin " dimen" +.RB ( .topMargin ) +Specifies the top and bottom margins (see +.BR \-margins ). +.TP +#ifhyper +.BI \-underlink +.RB ( .underLink ) +Underline links. Default is true. +#endif +.TP +.BI \-version +Print information on the version of +.BR xdvi . +.TP +.B \-warnspecials +.RB ( .warnSpecials ) +Causes +.B xdvi +to issue warnings about +.B \especial +strings that it cannot process. +.TP +.BI \-xoffset " dimen" +.RB ( .xOffset ) +Specifies the size of the horizontal offset of the output on the page. See +.BR \-offsets . +.TP +.BI \-yoffset " dimen" +.RB ( .yOffset ) +Specifies the size of the vertical offset of the output on the page. See +.BR -offsets . +.SH KEYSTROKES +.B xdvi +recognizes the following keystrokes when typed in its window. +Each may optionally be preceded by a (positive or negative) number, whose +interpretation will depend on the particular keystroke. +Also, the ``Help'', ``Home'', ``Prior'', ``Next'', and arrow cursor keys +are synonyms for +.RB ` ? ', +.RB ` ^ ', +.RB ` b ', +.RB ` f ', +.RB ` l ', +.RB ` r ', +.RB ` u ', +and +.RB ` d ' +keys, respectively. +.TP +.B q +Quits the program. Control-C and control-D will do this, too. +.TP +.B Q +Quits the program with exit status 2. +.TP +.B n +Moves to the next page (or to the +.IR n th +next page if a number is given). Synonyms are +.RB ` f ', +Space, Return, and Line Feed. +.TP +.B p +Moves to the previous page (or back +.I n +pages). Synonyms are +.RB ` b ', +control-H, and Delete. +.TP +.B g +Moves to the page with the given number. Initially, the first page is assumed +to be page number 1, but this can be changed with the +.RB ` P ' +keystroke, below. If no page number is given, then it goes to the last page. +.TP +.B P +``This is page number +.IR n .'' +This can be used to make the +.RB ` g ' +keystroke refer to actual page numbers instead of absolute page numbers. +.TP +Control-L +Redisplays the current page. +.TP +.B ^ +Move to the ``home'' position of the page. This is normally the upper +left-hand corner of the page, depending on the margins as described in the +.B \-margins +option, above. +.TP +.B u +Moves up two thirds of a window-full. +.TP +.B d +Moves down two thirds of a window-full. +.TP +.B l +Moves left two thirds of a window-full. +.TP +.B r +Moves right two thirds of a window-full. +.TP +.B c +Moves the page so that the point currently beneath the cursor is moved to +the middle of the window. It also (gasp!) warps the cursor to the same place. +.TP +.B M +Sets the margins so that the point currently under the cursor is the upper +left-hand corner of the text in the page. Note that this command itself does +not move the image at all. For details on how the margins are used, see +the +.B \-margins +option. +.TP +.B s +Changes the shrink factor to the given number. If no number is given, the +smallest factor that makes the entire page fit in the window will be used. +(Margins are ignored in this computation.) +.TP +.B S +Sets the density factor to be used when shrinking bitmaps. This should +be a number between 0 and 100; higher numbers produce lighter characters. +#ifgrey +If greyscaling mode is in effect, this changes the value of gamma instead. +The new value of gamma is the given number divided by 100; negative values +are allowed. +#endif +.TP +.B t +Toggles to the next unit in a sorted list of \*(Te\& dimension +units for the popup magnifier ruler. +.TP +.B R +Forces the +.I dvi +file to be reread. This allows you to preview many versions of the same +file while running +.B xdvi +only once. +.TP +.B k +Normally when +.B xdvi +switches pages, it moves to the home position as well. The +.RB ` k ' +keystroke toggles a `keep-position' flag which, when set, will keep +the same position when moving between pages. Also +.RB ` 0k ' +and +.RB ` 1k ' +clear and set this flag, respectively. See also the +.B \-keep +option. +#ifbuttons +.TP +.B x +Toggles expert mode (in which the buttons do not appear). Also +.RB ` 0x ' +and +.RB ` 1x ' +clear and reset this mode, respectively. See also the +.B \-expert +option. +#endif +#ifgrey +.TP +.B G +This key toggles the use of greyscale anti-aliasing for displaying shrunken +bitmaps. In addition, the key sequences +.RB ` 0G ' +and +.RB ` 1G ' +clear and set this flag, respectively. See also the +.B \-nogrey +option. +.PP +If given a numeric argument that is not 0 or 1, greyscale anti-aliasing is +turned on, and the gamma resource is set to the value divided by +100. E.g., +.RB ` 150G ' +turns on greyscale and sets gamma to 1.5. +#endif +#ifgrid +.TP +.B D +This key toggles the use of grid over the document. +If no number is given, the grid mode toggles. +By prepending number, 3 grid levels can be set. +The grid in each level is drawn in the colour specified. +See also the +.B \-grid1, \-grid2, +and +.B \-grid3 +options. +#endif +#ifps +.TP +.B v +This key toggles the rendering of PostScript<tm> specials. If rendering +is turned off, then bounding boxes are displayed when available. +In addition the key sequences +.RB ` 0v ' +and +.RB ` 1v ' +clear and set this flag, respectively. See also the +.B \-nopostscript +option. +#endif +#ifghost +.TP +.B V +This key toggles tha anti-aliasing of PostScript<tm> specials when +.B Ghostscript +is used as renderer. In addition the key sequences +.RB ` 0V ' +and +.RB ` 1V ' +clear and set this flag, See also the ++.B \-gsalpha +option. +#endif +#ifselfile +.TP +.B F +Read a new +.I dvi +file. A file-selection widget is popped up for you to choose the dvi +file from. +#endif +.SH MOUSE ACTIONS +If the shrink factor is set to any number other than one, then clicking +#ifkpathsea +mouse button 3 +#endif +#ifnokpathsea +any mouse button +#endif +will pop up a ``magnifying glass'' which shows the unshrunk +image in the vicinity of the mouse click. This subwindow disappears when +the mouse button is released. Different mouse buttons produce different sized +windows, as indicated by the +.B \-mgs +option. Moving the cursor while holding the button down will move the +magnifying glass. +#ifhyper +.PP +If the cursor is on a hypertext link (underlined by default), then +that link overrides the magnifying glass for Buttons 1 and 2. +If Button 1 is clicked over a link, then +.B xdvi +jumps to the target in the current window. If Button 2 is clicked over a link, +then +.B xdvi +opens a new window on the target. +.PP +More precisely, for internal links, Button 1 jumps in the same window to +the link, while Button 2 starts up a new +.B xdvi +on the link. For external links to +.I dvi +files, Button 1 changes the current +.B xdvi +to be reading that file, while Button 2 starts a new +.B xdvi +on that file. For other file types, +.B mime.types +and +.B mailcap +are parsed to determine the viewer; finally, if no suitable +.B mailcap +entry was found, if the +.SB WWWBROWSER +environment variable is set, or +.B \-browser +was specified on the command line, it is started up on the file. +#endif +.PP +The scrollbars (if present) behave in the standard way: pushing Button 2 +in a scrollbar moves the top or left edge of the scrollbar to that point +and optionally drags it; +pushing Button 1 moves the image up or right by an amount equal to the distance +from the button press to the upper left-hand corner of the window; pushing +Button 3 moves the image down or left by the same amount. +.SH SIGNALS +When +.B xdvi +receives a +.SB SIGUSR1 +signal, it rereads the +.I dvi +file. +#ifgrey +.SH GREYSCALING AND COLORMAPS +The greyscale anti-aliasing feature in +.B xdvi +will not work at its best if the display does not have enough colors available. +This can happen if other applications are using most of the colormap +(even if they are iconified). If this occurs, then +.B xdvi +will print an error message and turn on the +.B -copy +option. This will result in overstrike characters appearing wrong; +it may also result in poor display quality if the number of available +colors is very small. +.PP +Typically this problem occurs on displays that allocate eight bits +of video memory per pixel. To see how many bits per pixel your display +uses, type +.B xwininfo +in an +.B xterm +window, and then click the mouse on the root window when asked. The +``Depth:'' entry will tell you how many bits are allocated per pixel. +.PP +Displays using at least 15 bits per pixel are typically +.B TrueColor +visuals, which do not have this problem, since their colormap is +permanently allocated and available to all applications. (The visual +class is also displayed by +.BR xwininfo .) +For more information on visual classes see the documentation for the +X Window System. +.PP +To alleviate this problem, therefore, one may (a) run with more bits +per pixel (this may require adding more video memory or replacing the video +card), (b) shut down other applications that may be using much of the colormap +and then restart +.BR xdvi , +or (c) run +.B xdvi +with the +.B \-install +option. +.PP +One application which is often the cause of this problem is +.BR Netscape . +In this case there are two more alternatives to remedying the situation. +One can run +.RB `` "netscape -install" '' +to cause +.B Netscape +to install a private colormap. This can cause colors to change in +bizarre ways when the mouse is moved to a different window. +Or, one can run +.RB `` "netscape -ncols 220" '' +to limit +.B Netscape +to a smaller number of colors. A smaller number will ensure that +other applications have more colors available, but will degrade the +color quality in the +.B Netscape +window. +#endif +#ifkpathsea +.SH ENVIRONMENT +Please see the +.B kpathsea +documentation. +#endif + +#ifps +.SH HANDLING OF POSTSCRIPT FIGURES +.B xdvi +can display PostScript files included in the +.I dvi +file. Such files are first searched for in the directory where the +.I dvi +file is, and then using normal +.B Kpathsea +rules. There is an exception to this, however: if the file name begins +with a backtick +.RB ( ` ), +then the remaining characters in the file name give a shell command (often +.BR zcat ) +which is executed; its standard output is then sent to be interpreted as +PostScript. Note that there is some potential for security problems here; +see the +.B \-allowshell +command-line option. It is better to use compressed files directly (see below). +.PP +If a file name is given (as opposed to a shell command), +if that file name ends in +.RB `` .Z '', +.RB `` .gz '', +or +.RB `` .bz2 '' +and if the first two bytes of the file indicate that it was compressed with +.BR compress (1), +.BR gzip (1), +or +.BR bzip2 (1) +respectively, then the file is first uncompressed with +.BR "uncompress \-c" , +.BR "gunzip \-c" , +or +.BR "bunzip2 \-c" , +respectively. This is preferred over using a backtick to call the command +directly, since you do not have to specify +.B \-allowshell +and since it allows for path searching. +#endif +#ifdef src +.SH SRC SPECIAL MODE +ADD SOMETHING HERE, including: +.sp +- general description (concept of separate mode; maybe something +more about security issues) +.sp +- description of keys/buttons available in src special mode +(\fBV\fR toggles visibility of tick marks, \fBX\fR highlights +next special without jumping to it, \fBT\fR changes the +shapes of the marks, Mouse button 2 jumps to +next special unless user has specified another button +with \fB-srcJumpButton\fR) +.sp +- meaning of the tick marks (reference points: +the reference point is the upper-left corner for +the rectangle shape, the top of the triangle for the triangular shape, +the inner angle point for the upangle and the +outer angle point for the downangle shape). +.sp +- searching of `next' special on page (xdvi will search `linewise', +i.e. it will jump to the next special on the current line (to the +right of the mouse click) if there is one, and to the first special on +the next line else). +.sp +#endif +.SH ENVIRONMENT +.B xdvik +uses the same environment variables and algorithms for finding +font files as \*(Te\& and friends. See the documentation for the +.B Kpathsea +library for details (repeating it here is too cumbersome). In addition, +.B xdvik +accepts the following variables: +.TP +.SB DISPLAY +Specifies which graphics display terminal to use. +#ifnokpathsea +.TP +.SB XDVISIZES +A list of font resolutions separated by colons. If a font cannot be found +or made at its stated size, then these sizes are tried as a fallback. +See the `Fallback font' section in the +.B Kpathsea +manual for more details. +.B xdvi +tries the actual size of the font before trying any of the given sizes. +Each font resolution should be a positive integer, specifying the number +of dots per inch, or a string of the form +.BR magstep\fIn\fP , +where +.I n +is a number -9.5, -9, -8.5, ..., 8, 8.5, 9, or 9.5. The string +.B magstep +may be shortened to any non-empty initial substring (so that +.B magstep0.5 +may be shortened to +.B mag0.5 +or +.B m0.5 +(but not +.BR mag.5 )). +The entries +.BI magstep n +signify the current pixels-per-inch value, multiplied by 1.2 raised to the +.IR n th +power, and rounded to the nearest integer. +If the list begins with a colon, the system default sizes are used, as well. +Sizes are expressed in dots per inch and must be integers. +The current default set of sizes is @DEFAULT_FONT_SIZES@. +#endif +.TP +.SB KPATHSEA_DEBUG +Trace +.B Kpathsea +lookups; set it to +.B -1 +for complete tracing. +.TP +.SB MIMELIBDIR +Directory containing the +.B mime.types +file, if +.B ~/.mime-types +does not exist. +.TP +.SB MAILCAPDIR +Directory containing the +.B .mailcap +file, if +.B ~/.mailcap +does not exist. +#ifhyper +.TP +.SB WWWBROWSER +The browser used to open URL's, if neither the +.B \-browser +option nor the +.B .wwwBrowser +resource are set. For more information on hyper-\*(Te\& support, +see the `Hypertext' node in the +.B dvipsk +manual. +#endif +#ifps +.TP +.SB TMPDIR +The directory to use for storing temporary files created when uncompressing +PostScript files. +#ifps +.SH LIMITATIONS +.B xdvi +accepts many but not all types of PostScript specials accepted by +.BR dvips . +For example, it accepts most specials generated by +.B epsf +and +.BR psfig , +It does not, however, support +.B bop\-hook +or +.BR eop\-hook , +nor does it allow PostScript commands to affect the rendering of things that +are not PostScript (for example, the ``NEAT'' and rotated ``A'' examples in the +.B dvips +manual). These restrictions are due to the design of +.BR xdvi ; +in all likelihood they will always remain. +.PP +La\*(Te\&2e color and rotation specials are not currently supported. +#endif +.SH FILES +Please see the kpathsea documentation. +.SH COPYRIGHTS +.B xdvi +itself is Copyrighted by Paul Vojta and distributed under the X-Consortium +license. +.B xdvi +uses the +.B libwww +library of the World Wide Web Consortium, which includes computer software +creaded and made available by CERN. It also uses the +.B kpathsea +library which is distributed under the GNU LIBRARY General Public License. +.PP +THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL PAUL VOJTA OR ANY OTHERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR +THE USE OR OTHER DEALINGS IN THE SOFTWARE. +.SH SEE ALSO +.BR X (1), +.BR dvips (1), +.BR Kpathsea documentation +.SH AUTHORS +Eric Cooper, CMU, did a version for direct output to a QVSS. Modified +for X by Bob Scheifler, MIT Laboratory for Computer Science. Modified +for X11 by Mark Eichin, MIT SIPB. +Additional enhancements by many +others. The current maintainer of the original +.B xdvi +is Paul Vojta, U.C. Berkeley; the maintainer of the +.B xdvik +variant is Nicolai Langfeldt, Dept. of Math, UiO, Norway, with the help +of many others. |