tmview/0040755000175000017500000000000007250444702011463 5ustar tmoortmoortmview/CHANGES0100644000175000017500000001563407250444702012464 0ustar tmoortmoor*************************************************************************** *******CHANGESfile to tmview*********************************************** *************************************************************************** v01.03 - minor fixes to v00.06: dvilx now accepts the "-geometry" commandline option; fixed bug regarding "funny" filenames, i.e. hidden directories; command now skips filemarks to nonexisting files; now use "-Wall" compiletime opteion and hopefully fixed all those warnings; *************************************************************************** v00.06 (experimetal) - minor fixes to v00.05: reviewed code unter the perspective of "long int" having 8 rather than 4 bytes, which happens to be the case on Alpha architecture. See Readme. - added MINIMAL support for color specials: \colorbox{}{} should now produce a light grey background instead of a black rule. Use command to ajust the thresholds for the two availbale greylevels. *************************************************************************** v00.05 - Introduced basic support for double-page viewing. This involves keeping decoded dvi commands in tmview's lru-buffer-memory. And thus competing against ghostscript's rendering results and pk-glyphs. I'm not quite sure whether this was a good idea? Anyway, double-page mode can be turned of by (re-designed) command . - The maximum amount of lru-buffer-memory can now be configured by the startup-file. No compiling required anymore. - <*>v now fits the page w.r.t. the width of the screen. - Klaus Stehle pointed out some bugs in the virtual font section. Well, I went through Klaus' patch and recalled that my vf support was sort of experimental. Things are much better now. Thanks. - Introduced a version of tmview which goes with the so called framebuffer device, linux kernel >= 2.2.1. The name of the game is 'dvifb', to be compiled by 'make -f MakeFb'. Here, the mouse is handled by /dev/gpmdata. I.e. gpm is suggested to run with option "-R". See README. - If some other program has grabbed all the colors on an X Window pseudocolor device dvilx now falls back to sort of black and white display. *************************************************************************** v99.06 - introduced experimental handling of the PSFile-special by calling ghostscript. This is enabled/disabled by the command , see online-help. The mechanism of interacting with ghostscript is quite different to the one used by xdvi: xdvi allows gs to draw directly in the dvi-previewing-window, using gs's device "x11". tmview cannot allow this, as it is meant to go with svgalib. Hence, tmview uses gs's device "bit" and buffers the result of rendering in an internal buffer. Thus, tmview is sort of slow with vectorgraphics, and sort of fast with pixelgraphics. However, once the rendering result is buffered, scrolling causes no re-rendering. So after all, this works out fine -- at least to my opinion. - Richard Vosse found some of those really ugly bugs, Robert Heuser and me found some too. This version was "beta-tested" by serveral users and I hope that all the seg-fault stuff was found this way. If you still find seg-faults, please report them (see README, topic 5). I've read the pointers to pointers stuff again and a again ... and I'm ashamed of seg-faults, as they are almost always my faults. Sorry. - The former compile-time option MECK used for 640x480 mode at 16 colors is now a "runtime-option": Whenever either the desired resolution or 640x480 is not supported at 256 colors, the 640x480 mode at 16-colors is used. This is meant for easy installation on "old" notebooks and such. Its also meant for easy installation without configuring svgalib. - reorganized docs: now README holds information about first steps, including installing/compiling tmview. All the details only of interest after successful installation are kept only in tmview.dvi and of course in the online-help. *************************************************************************** v98.06 - improved Xlib support: now goes with solaris/openwindows too - added virtual fonts support. Main effect: can now view times.sty documents, while gs builds the pk-files. Did not test this with general vf-files. - <*> not only re-reads the dvi-file, but re-initializes the fontdatabase too. *************************************************************************** v96.06 - added portrait modus (see ./tmview/linux/defssvga.h) *************************************************************************** v96.05 - removed bugs: can now view groff output, tab-key now works - added kpathsea support (see ./tmview/linux/defsx.h) - introduced an experimental version for linux/XFree *************************************************************************** v96.03 - added bookmarks. - allow to load more than one file (still viewing only one at a time ...) - added reading-from / writing-to a startup-file, holding configuration data and the bookmarks. - got the OS2/PM version a bit more usable ... *************************************************************************** v96.02 (experimental) - added some of the hyper-tex specials (that is only those, which act on the current dvi-file). You may now follow hrefs by mouse-click. - added support for 640x480x16 modus as compile-time-option. usefull on system with standard-vga support only, like most notebooks. - added a scroll-over-pages-mode, allowing to go through the whole dvi-file using only the resp. key. - did the memorymanagement now. You may specify at compile-time the maximum amount of memory used as LRU-buffer for glyph's. *************************************************************************** v96.01 - added text-string-searching - added commands for measurement - look for TeX-counter when going to a page - added a little bit of mouse-support - added some online-help - added arbitrary zoom-factors - removed workaround about S3 related svgalib-bugs, since the svgalib-people fixed them in v1.28. Thanks to them !!! The last point about the svgalib things was the main reason for releasing v96.01, since the dvi-reading and -drawing had been ugly hacks, involving an immense waste of memory and some assembler code. This was necessary to work around those S3 related bugs. Dvi-reading and -drawing is now done in C only, at nearly the same performance and with less memory used. On turn that means that v96.01 is NOT the tidied up version I promised when releasing v95.10. So I keep promising ... *************************************************************************** v95.10 (for a spelling-mistake also called v10.95, sorry) This was the first version of tmview and just worked. The aim was to have a previewer that goes with S3-cards. *************************************************************************** ****End of CHANGES********************************************************* tmview/IAFA-PACKAGE0100644000175000017500000000123207250444702013132 0ustar tmoortmoorTitle: tmview Version: 01.03 Description: DVI-previewer for SVGA-lib, framebuffer device or Xlib. Fast, offers xdvi-like anti-aliasing, text-string searching, arbitrary-zooming, bookmarks, some of the hypertex features, renders eps-figures by running ghostscript. Author: Thomas Moor, qelis@aol.com Maintained-by: Thomas Moor, qelis@aol.com Maintained-at: ftp.dante.de Platforms: linux (SVGA-lib 1.2.5, framebuffer device or Xlib) solaris (Xlib), programming language C Copying-Policy: "Freely Redistributable" Keywords: dvi previewer tex svgalib framebuffer device Xlib tmview/MakeSVGA0100644000175000017500000000464407250444702012751 0ustar tmoortmoor# Compiling everything: # svga/linux section WRITEVGAFLAGS= -DVGAHASWAITIO # comment this for svgalib 1.2.10 and below SRC=./src/ SSRC=./svga/ OBJ=./src/svga. LIBS= -lvgagl -lvga -lm #LIBS= -lkpathsea -lvgagl -lvga -lm # when kpathsea is to be used LL=gcc -L /usr/lib CC=gcc -c -O2 -g -Wall $(WRITEVGAFLAGS) -I$(SRC) -I$(SSRC) OBJDEPEND=$(SSRC)defssvga.h $(SRC)defsgen.h $(SRC)subs.c default: cp $(SSRC)defssvga.h $(SRC)defs.h cp $(SSRC)writevga.h $(SRC)writedis.h make -f MakeSVGA tmview rm $(SRC)defs.h rm $(SRC)writedis.h rm -f ./dvisvga.linux mv $(OBJ)tmview ./dvisvga.linux strip ./dvisvga.linux tmview: $(OBJ)tmview.o $(OBJ)readdvi.o $(OBJ)globals.o $(OBJ)readpk.o $(OBJ)readvf.o\ $(OBJ)subs.o $(OBJ)readtfm.o $(OBJ)drawit.o $(OBJ)halfhyp.o\ $(OBJ)writevga.o $(OBJ)bookmks.o $(OBJ)rwconf.o $(OBJ)epsfile.o $(OBJ)colors.o $(LL) $(OBJ)tmview.o $(OBJ)globals.o $(OBJ)subs.o $(OBJ)readpk.o $(OBJ)readvf.o\ $(OBJ)readtfm.o $(OBJ)readdvi.o $(OBJ)drawit.o $(OBJ)halfhyp.o \ $(OBJ)writevga.o $(OBJ)bookmks.o $(OBJ)rwconf.o $(OBJ)epsfile.o $(OBJ)colors.o\ -o $(OBJ)tmview $(LIBS) chmod 4755 $(OBJ)tmview $(OBJ)tmview.o: $(SRC)tmview.c $(SRC)help.h $(OBJDEPEND) $(CC) $(SRC)tmview.c -o $(OBJ)tmview.o $(OBJ)readdvi.o: $(SRC)readdvi.c $(OBJDEPEND) $(CC) $(SRC)readdvi.c -o $(OBJ)readdvi.o $(OBJ)readpk.o: $(SRC)readpk.c $(OBJDEPEND) $(CC) $(SRC)readpk.c -o $(OBJ)readpk.o $(OBJ)readvf.o: $(SRC)readvf.c $(OBJDEPEND) $(CC) $(SRC)readvf.c -o $(OBJ)readvf.o $(OBJ)readtfm.o: $(SRC)readtfm.c $(OBJDEPEND) $(CC) $(SRC)readtfm.c -o $(OBJ)readtfm.o $(OBJ)drawit.o: $(SRC)drawit.c $(OBJDEPEND) $(CC) $(SRC)drawit.c -o $(OBJ)drawit.o $(OBJ)halfhyp.o: $(SRC)halfhyp.c $(OBJDEPEND) $(CC) $(SRC)halfhyp.c -o $(OBJ)halfhyp.o $(OBJ)epsfile.o: $(SRC)epsfile.c $(OBJDEPEND) $(CC) $(SRC)epsfile.c -o $(OBJ)epsfile.o $(OBJ)colors.o: $(SRC)colors.c $(OBJDEPEND) $(CC) $(SRC)colors.c -o $(OBJ)colors.o $(OBJ)writevga.o: $(SSRC)writevga.c $(OBJDEPEND) $(CC) $(SSRC)writevga.c -o $(OBJ)writevga.o $(OBJ)subs.o: $(SRC)subs.c $(OBJDEPEND) $(CC) $(SRC)subs.c -o $(OBJ)subs.o $(OBJ)bookmks.o: $(SRC)bookmks.c $(OBJDEPEND) $(CC) $(SRC)bookmks.c -o $(OBJ)bookmks.o $(OBJ)rwconf.o: $(SRC)rwconf.c $(OBJDEPEND) $(CC) $(SRC)rwconf.c -o $(OBJ)rwconf.o $(OBJ)globals.o: $(SRC)globals.c $(OBJDEPEND) $(CC) $(SRC)globals.c -o $(OBJ)globals.o clean: rm -f $(OBJ)*.o tmview/MakeSolaris0100644000175000017500000000620607250444702013621 0ustar tmoortmoor# Makefile for tmview, X section, here:solaris # Compiling everything: #compiler options: #1.: where to look for Xlib headers OPENWINCCOP= -I /usr/openwin/include #2.: where to look for kpathsea headers, if used # you'll NEED TO EDIT THIS LINE if you plan to compile with kpathsea!! KPCCOP= -I ../teTeX/distrib/sources/teTeX-src-0.4/kpse-2.6 # Compile, with kpathsea #CC=gcc -c -O2 -g -Wall -I$(SRC) -I$(SSRC) $(KPCCOP) # Complile without kpathsea CC=gcc -c -O2 -g -Wall -I$(SRC) -I$(SSRC) SRC=./src/ SSRC=./lX/ OBJ=./src/sol. LL=gcc #link options: #1.: link dynamicly with Xlib LIBS= -L /usr/openwin/lib -lm -lX11 #2.: link dynamicly with Xlib and staticly with kpathsea # you'll NEED TO EDIT THIS LINE if you plan to compile with kpathsea!! #LIBS= ../teTeX/distrib/sources/teTeX-src-0.4/kpse-2.6/kpathsea/kpathsea.a -L /usr/openwin/lib -lm -lX11 OBJDEPEND=$(SSRC)defssolaris.h $(SRC)defsgen.h $(SRC)subs.c default: cp $(SSRC)defssolaris.h $(SRC)defs.h cp $(SSRC)writelx.h $(SRC)writedis.h cp $(OBJ)regex.h $(SRC)regex.h make -f MakeSolaris tmview rm $(SRC)defs.h rm $(SRC)writedis.h rm $(SRC)regex.h mv $(OBJ)tmview ./dvilx.solaris strip ./dvilx.solaris tmview: $(OBJ)tmview.o $(OBJ)readdvi.o $(OBJ)globals.o $(OBJ)readpk.o $(OBJ)readvf.o\ $(OBJ)subs.o $(OBJ)readtfm.o $(OBJ)drawit.o $(OBJ)halfhyp.o $(OBJ)epsfile.o\ $(OBJ)colors.o $(OBJ)writelx.o $(OBJ)bookmks.o $(OBJ)rwconf.o $(OBJ)regex.o $(LL) $(OBJ)tmview.o $(OBJ)globals.o $(OBJ)subs.o $(OBJ)readpk.o $(OBJ)readvf.o\ $(OBJ)readtfm.o $(OBJ)readdvi.o $(OBJ)drawit.o $(OBJ)halfhyp.o $(OBJ)epsfile.o\ $(OBJ)colors.o $(OBJ)writelx.o $(OBJ)bookmks.o $(OBJ)rwconf.o $(OBJ)regex.o \ -o $(OBJ)tmview $(LIBS) $(OBJ)tmview.o: $(SRC)tmview.c $(SRC)help.h $(OBJDEPEND) $(CC) $(SRC)tmview.c -o $(OBJ)tmview.o $(OBJ)readdvi.o: $(SRC)readdvi.c $(OBJDEPEND) $(CC) -I $(SSRC) $(SRC)readdvi.c -o $(OBJ)readdvi.o $(OBJ)readpk.o: $(SRC)readpk.c $(OBJDEPEND) $(CC) $(SRC)readpk.c -o $(OBJ)readpk.o $(OBJ)readvf.o: $(SRC)readvf.c $(OBJDEPEND) $(CC) $(SRC)readvf.c -o $(OBJ)readvf.o $(OBJ)readtfm.o: $(SRC)readtfm.c $(OBJDEPEND) $(CC) $(SRC)readtfm.c -o $(OBJ)readtfm.o $(OBJ)drawit.o: $(SRC)drawit.c $(OBJDEPEND) $(CC) $(SRC)drawit.c -o $(OBJ)drawit.o $(OBJ)halfhyp.o: $(SRC)halfhyp.c $(OBJDEPEND) $(CC) $(SRC)halfhyp.c -o $(OBJ)halfhyp.o $(OBJ)epsfile.o: $(SRC)epsfile.c $(OBJDEPEND) $(CC) $(SRC)epsfile.c -o $(OBJ)epsfile.o $(OBJ)colors.o: $(SRC)colors.c $(OBJDEPEND) $(CC) $(SRC)colors.c -o $(OBJ)colors.o $(OBJ)writelx.o: $(SSRC)writelx.c $(OBJDEPEND) $(CC) $(OPENWINCCOP) $(SSRC)writelx.c -o $(OBJ)writelx.o $(OBJ)subs.o: $(SRC)subs.c $(OBJDEPEND) $(CC) $(SRC)subs.c -o $(OBJ)subs.o $(OBJ)bookmks.o: $(SRC)bookmks.c $(OBJDEPEND) $(CC) $(SRC)bookmks.c -o $(OBJ)bookmks.o $(OBJ)rwconf.o: $(SRC)rwconf.c $(OBJDEPEND) $(CC) $(SRC)rwconf.c -o $(OBJ)rwconf.o $(OBJ)globals.o: $(SRC)globals.c $(OBJDEPEND) $(CC) $(SRC)globals.c -o $(OBJ)globals.o clean: mv -f $(OBJ)regex.o $(OBJ)regex.o.keep mv -f $(OBJ)regex.h $(OBJ)regex.h.keep rm -f $(OBJ)*.o mv -f $(OBJ)regex.o.keep $(OBJ)regex.o mv -f $(OBJ)regex.h.keep $(OBJ)regex.h tmview/MakeLX0100644000175000017500000000455607250444702012536 0ustar tmoortmoor# Makefile for tmview, Linux X section # Compiling everything: SRC=./src/ SSRC=./lX/ OBJ=./src/lX. #1. when kpathsea is to be used #LIBS= -L /usr/X11R6/lib -L /usr/X11/lib -lkpathsea -lX11 -lm #2. when kpathsea is not used LIBS= -L /usr/X11R6/lib -L /usr/X11/lib -lX11 -lm LL=gcc CC=gcc -c -O2 -g -Wall -I$(SRC) -I$(SSRC) OBJDEPEND=$(SSRC)defslx.h $(SRC)defsgen.h $(SRC)subs.c default: cp $(SSRC)defslx.h $(SRC)defs.h cp $(SSRC)writelx.h $(SRC)writedis.h make -f MakeLX tmview rm $(SRC)defs.h rm $(SRC)writedis.h mv $(OBJ)tmview ./dvilx.linux strip ./dvilx.linux tmview: $(OBJ)tmview.o $(OBJ)readdvi.o $(OBJ)globals.o $(OBJ)readpk.o $(OBJ)readvf.o\ $(OBJ)subs.o $(OBJ)readtfm.o $(OBJ)drawit.o $(OBJ)halfhyp.o $(OBJ)epsfile.o\ $(OBJ)colors.o $(OBJ)writelx.o $(OBJ)bookmks.o $(OBJ)rwconf.o $(LL) $(OBJ)tmview.o $(OBJ)globals.o $(OBJ)subs.o $(OBJ)readpk.o $(OBJ)readvf.o\ $(OBJ)readtfm.o $(OBJ)readdvi.o $(OBJ)drawit.o $(OBJ)halfhyp.o $(OBJ)epsfile.o\ $(OBJ)colors.o $(OBJ)writelx.o $(OBJ)bookmks.o $(OBJ)rwconf.o \ -o $(OBJ)tmview $(LIBS) $(OBJ)tmview.o: $(SRC)tmview.c $(SRC)help.h $(OBJDEPEND) $(CC) $(SRC)tmview.c -o $(OBJ)tmview.o $(OBJ)readdvi.o: $(SRC)readdvi.c $(OBJDEPEND) $(CC) $(SRC)readdvi.c -o $(OBJ)readdvi.o $(OBJ)readpk.o: $(SRC)readpk.c $(OBJDEPEND) $(CC) $(SRC)readpk.c -o $(OBJ)readpk.o $(OBJ)readvf.o: $(SRC)readvf.c $(OBJDEPEND) $(CC) $(SRC)readvf.c -o $(OBJ)readvf.o $(OBJ)readtfm.o: $(SRC)readtfm.c $(OBJDEPEND) $(CC) $(SRC)readtfm.c -o $(OBJ)readtfm.o $(OBJ)drawit.o: $(SRC)drawit.c $(OBJDEPEND) $(CC) $(SRC)drawit.c -o $(OBJ)drawit.o $(OBJ)halfhyp.o: $(SRC)halfhyp.c $(OBJDEPEND) $(CC) $(SRC)halfhyp.c -o $(OBJ)halfhyp.o $(OBJ)epsfile.o: $(SRC)epsfile.c $(OBJDEPEND) $(CC) $(SRC)epsfile.c -o $(OBJ)epsfile.o $(OBJ)colors.o: $(SRC)colors.c $(OBJDEPEND) $(CC) $(SRC)colors.c -o $(OBJ)colors.o $(OBJ)writelx.o: $(SSRC)writelx.c $(OBJDEPEND) $(CC) $(WRITELXFLAGS) $(SSRC)writelx.c -o $(OBJ)writelx.o $(OBJ)subs.o: $(SRC)subs.c $(OBJDEPEND) $(CC) $(SRC)subs.c -o $(OBJ)subs.o $(OBJ)bookmks.o: $(SRC)bookmks.c $(OBJDEPEND) $(CC) $(SRC)bookmks.c -o $(OBJ)bookmks.o $(OBJ)rwconf.o: $(SRC)rwconf.c $(OBJDEPEND) $(CC) $(SRC)rwconf.c -o $(OBJ)rwconf.o $(OBJ)globals.o: $(SRC)globals.c $(OBJDEPEND) $(CC) $(SRC)globals.c -o $(OBJ)globals.o clean: rm -f $(OBJ)*.o tmview/README0100644000175000017500000005005707250444702012347 0ustar tmoortmoor***************************************************************************** ******this is the README for tmview v01.03*********************************** ***************************************************************************** 1. What is tmview? 2. Compiling tmview - EXTRA NOTES compiling for Solaris 3. Installation and configuration - EXTRA NOTES dvisvga.linux - EXTRA NOTES dvifb.linux - EXTRA NOTES dvilx.linux/dvilx.solaris 4. Compiletime options - EXTRA NOTES ghostscript - EXTRA NOTES kpathsea - EXTRA NOTES mouse - EXTRA NOTES X-Window System - EXTRA NOTES non-i386 architectures e.g. Alpha. 5. Get the newest version, send me your comments ***************************************************************************** ***************************************************************************** ***************************************************************************** 1. What is tmview? tmview is a screen-previewer for .dvi-files compiled by TeX. It let's you see what your printed output will look like. You can choose between a black-and-white representation and greyscaling. You can choose an arbitrary zoomfactor (at some cost of performance). You can set marks to measure distances. You can search for textstrings. You can visit lots of DVIfiles, set bookmarks and get them saved to a startup-file. tmview does not support pxl-files since I think they are prehistoric. tmview ignores almost all 'special'-commands, sorry lads. tmview tries its best with virtual fonts and included .eps-figures. tmview is prepared to be linked with kpathsea. The current version supports three environments: Linux/svgalib, Linux/framebuffer and the X Window System (by Xlib). List of files: ./tmview/README this file: installing and compiling tmview ./tmview/CHANGES file of changes to tmview ./tmview/IAFA-PACKAGE specification of the package according to IAFA ./tmview/VER0103 empty file, indicating current version ./tmview/MakeFb makefile for dvifb.linux (Linux/sframebuffer) ./tmview/MakeSVGA makefile for dvisvga.linux (Linux/svgalib) ./tmview/MakeLX makefile for dvilx.linux (Linux/X Window System) ./tmview/MakeSolaris makefile for dvilx.solaris (Solaris/X Window System) ./tmview/src/* general source files ./tmview/fb/* source files related to the framebuffer support ./tmview/lX/* source files related to the X Window System support ./tmview/svga/* source files related to the svgalib support ./tmview/doc/tmview.tex manual (tex source): user interface ./tmview/doc/tmview.dvi manual (dvi file) ./tmview/doc/tm.ps example eps-file for the manual ./tmview/doc/tmview.1 man page: commandline options only ***************************************************************************** ***************************************************************************** ***************************************************************************** 2. Compiling tmview tmview come with makefiles to go with Linux/svgalib, Linux/framebuffer, Linux/X Window System or Solaris/X Window System: ./tmview/MakeSVGA Linux/svgalib ./tmview/MakeFb Linux/framebuffer ./tmview/MakeLX Linux/X Window System ./tmview/MakeSolaris Solaris/X Window System To compile tmview, copy one of the above makefiles to "./tmview/Makefile". Then, make the directory "./tmview" the current directory. Now, running 'make' should generate the desired binary, i.e. ./tmview/dvisvga.linux Linux/svgalib ./tmview/dvifb.linux Linux/framebuffer ./tmview/dvilx.linux Linux/X-Window System ./tmview/dvilx.solaris Solaris/X-Window System In the case of dvisvga.linux, running 'make' as root will set the superuser flag of dvisvga.linux. This is usually required. As long as you don't change any compile-time options of tmview, compiling should go through without errors. In the rare case that certain include-files or libraries are not found, you will need to adjust the paths at the beginning of the Makefile. ***************************************************************************** EXTRA NOTES compiling for Solaris As there are serveral development environments for Solaris, it is very likely that you have to edit the makefile. I only tested compiling with GNU gcc, GNU binutils etc. Furthermore, you will need to get the GNU regex-package since others won't do. After configuring/compiling GNU's regex, copy the resulting "regex.o" to "./tmview/src/sol.regex.o"; copy "regex.h" to "./tmview/src/sol.regex.h". ***************************************************************************** ***************************************************************************** ***************************************************************************** 3. Installation and configuration To install one of the above binaries, simply copy it to a suitable place, e.g. "/usr/local/bin/dvisvga" for the svgalib version. There is also a man-page "./tmview/doc/tmview.1", to be copied e.g. to "/usr/local/man/man1/dvisvga.1". The man-page provides information about the command-line options. These are meant to make tmview go with your TeX installation, e.g. they are used to set up search paths for fonts. The following shall give a quick guide to get tmview running. As an example, focus is on using dvisvga to view the .dvi-file "./tmview/doc/tmview.dvi". The latter provides detailed information about tmview's user interface, e.g. how to navigate within .dvi-files. Thus, "tmview.dvi" is essential to make best use of tmview. There is no additional info on installing tmview in tmview.dvi ;-). Watch out for the platform dependent EXTRA NOTES below. Make the directory "./tmview/doc/" the current directory. Make sure, that the fonts used by tmview.dvi exist, e.g. generate them by dvips -D 300 -o /dev/null tmview.dvi Here, 300dpi is assumed to be your standard resolution. Hence, you should replace "300" by "xxx" if you use an xxxdpi printer by default. Now, invoke tmview by dvisvga -r300x300 tmview.dvi It is essential that no "space" appears between the option flag "-r" and its argument "300x300". After searching for fonts, tmview should show up with the first page of "tmview.dvi", where the boarder of the page is indicated by a green rectangle. Below you should find a status line. tmview now accepts a wide range of commands, e.g. use the cursor keys to navigate, or press twice for online help, or even to quit tmview. If only lots of blue boxes (instead of glyphs) appear, tmview did manage to find your .tfm-files, but did not find the according .pk-files. If only the green border of the page shows up (check this by using the cursor keys!), tmview neither found .tfm- nor .pk-files. In both cases you will need to adjust tmview's search paths to your TeX installation. Typical places for fonts are "/usr/local/lib/texmf//", "/var/spool/texmf//", "/usr/local/teTeX/texmf/fonts//" a.s.o. In order to inform tmview about those paths, use the command-line options: dvisvga -r300x300 -f/where/pk-files/are// -t/where/tfm-files/are// tmview.dvi By the double slash "...//" all subdirectories are searched. Hence, with "-f/usr//:/var//" tmview should find all fonts, but becomes quite slow. See the man-page "./tmview/doc/tmview.1" for details. You can find the command-line-options of tmview to go with your TeX Installation just by playing along: they will be automatically saved to a user startup-file (default "~/.dvisvga","~/.dvifb" or "~/.dvilx"). Once you are satisfied, you can copy the user startup-file to the system startup-file, i.e. "/etc/dvisvga", "/etc/dvifb" or "/etc/dvilx". From now on, just calling "dvisvga" with no options at all will be fine. You can check the current command-line defaults by invoking tmview with the "-?" option. By editing the startup-file you can replace the line "verb 0" by "verb 1". This will make tmview a lot more verbose. ***************************************************************************** EXTRA NOTES dvisvga.linux Like with any other program using svgalib, the superuser flag has to be set to dvisvga. The makefile will take care of this, if it's run by the superuser root. Otherwise you will need to apply the following as root: chown root /usr/local/bin/dvisvga chmod 4755 /usr/local/bin/dvisvga Installing, configuring and testing svgalib requires some knowledge. The required information can be found in the docs of svgalib. dvisvga should "run on any system with svgalib 1.2.11 or above". But this is at the cost of performance and display quality (flickering screen, low resolution etc.). If you plan to use tmview frequently, it may be worth taking the time to optimize your svgalib setup. Otherwise, skip these extra notes. Usually, a Linux distribution comes along with an svga-library called "svgalib". In general, dvisvga goes with svgalib version 1.2.11 or above. If you recompile dvisvga with the VGAHASWAITIO compile-time option turned off, this will dramaticly reduce the speed of eps-figure rendering. However, svgalib version 1.2.5 will be sufficient in that case. If you use a graphics-adapter with an S3 chip, you should use at least svgalib 1.2.8 since the older versions have "certain problems" with those cards. In general, updating to the newest version of svgalib is recommended. See "ftp://sunsite.edu.unc/pub/Linux/libs/graphics/svgalib*". You should carefully read the docs of svgalib in order to set up the configuration file correctly. This usually is located in "/etc/vga/libvga.conf". Then test your configuration using the "vgatest" program which comes with svgalib. Unfortunately, this binary is not included in some Linux distributions. In this case, it is strongly recommended to get the svgalib sources and compile the demo programs which come along. "vgatest" is one of those. Running "vgatest" will list the available graphic- modes. Since dvisvga prefers 256-color-modes, and since you want more than a 320x200-pixel screen, (standard-)vga won't be enough: super-vga is required. Hence, your graphic-chip must be supported by svgalib. Make sure, that your favorite 256-color-mode works. To make tmview use that mode, set the variable $GSVGAMODE or use the "-d" command-line option of dvisvga. For the case your svgalib supports (standard-)vga only, you can still use dvisvga with the 640x480 mode at 16 colors (instead of 320x200 at 256 colors). Whenever either the desired resolution or 640x480 is not supported at 256 colors, the 640x480 mode at 16-colors is used. This is meant for easy installation on "old" notebooks and such. ***************************************************************************** EXTRA NOTES dvifb.linux The framebuffer device is a kernel module which allows to map the physical memory of your graphics adaptor in user space. As within the svgalib environment, the low level prodeures of such a device driver will depend on very harware specific issues as chipset and I/O addresses. But the framebuffer device has one extra "compatibility" bonus: the so called VESA framebuffer module switches to graphics mode right at boot time and can thus use the build-in real mode routines on your actual graphic card ... you have payed for it. So even rather exoctic graphic devices can now be addressed -- as long as they are VESA 2.0 compilant. A drawback of the VESA framebuffer module is that the boot time graphics mode cannot be changed without re-booting. See the kernel docs for how to compile the framebuffer device module. Note that the VESA framebuffer module may conflict with svgalib and SVGATextMode. If your machine runs SVGATextMode at startup you may want to alter this behaviour. dvifb was not tested with kernels below 2.2.1. dvifb requires a 256 pseudocolor mode. You can query --and eventually set-- the mode of the framebuffer device by the util "fbset". See the man-page. Examples for boot-time VESA modes are 0x101 and 0x103. The according module parameters are 0x301 and 0x303 respectively. Again, see the framebuffer kernel docs. dvifb uses by default "/dev/fb0" as framebuffer device. However, this can be overwritten by the environment variable $FRAMEBUFFER. A rather brutal test of your framebuffer device would be to copy som4 data to "/dev/fb0" and watch the screen beeing messed up. Be prepared to blind-type "reset" to get the console back to work. An example output of "fbset" indicating a framebuffer that suits tmview is as follows (only "geometry" is of relevance here): mode "name" # D: 48.001 MHz, H: 46.876 kHz, V: 75.121 Hz geometry 800 600 800 600 8 timings 20833 96 32 16 4 96 4 endmode Memory mapping the framebuffer requires root permissions, i.e. effective uid 0. Thus, the superuser flag has to be set to dvifb. The makefile will take care, if it's run by root. Otherwise you will need to apply the following as root: chown root /usr/local/bin/dvifb chmod 4755 /usr/local/bin/dvifb The program "gpm" is (ab)used as a mouse driver. The "-R" option of gpm puts gpm in "repeater mode" translating mouse data into mouse-systems protocol and piping it to "/dev/gpmdata". Make sure that the "-R" option is applied to gpm on your system. If you don't have gpm, you should disable the mouse support of dvifb. See compile time options below. dvifb was not tested with gpm below version 1.14. ***************************************************************************** EXTRA NOTES dvilx.linux/dvilx.solaris These go with the X-Window System. They only rely on Xlib, no motiv or such required. However, I'm not an expert with Xlib at all, just found a book about Xlib and played along. Thus, dvilx.linux and dvilx.solaris are not as portable as they could be. Probably, the popular xdvi is part of your TeX distribution, perfectly configured, ready to run and able to deal with lots of "specials". However, for the case that you've got used to a couple of tmview's features you can take them along to your new computer, now running with the X Window System ... dvilx still "searches text with regular expressions", "keeps bookmarks for visited dvi-files". If you are an expert, you may try to get dvilx running under Unix/X even if this not Linux/XFree or Solaris/Openwindows. Send me your patches for a true X support of tmview. If you don't get a tmview-window at all, use the DEBUGX option in "./tmview/lX/writelx.c". The following resources are used by tmview: DviLX.geometry standard geometry, e.g. 600x300+10+20 DviLX.foreground dvi foreground, e.g. black DviLX.background dvi background, e.g. white DviLX.sforeground statusline foreground, e.g. tomato4 DviLX.sbackground statusline background, e.g. OldLace DviLX.sfont statusline font, e.g. -b&h-lucidatypewriter-medium-*-*-*-14-*-*-*-*-*-*-* Note: The sfont should be a fixed-width-font. The file "./tmview/lX/DviLX" is an example for tmview app-defaults. There are also icons "./tmview/lX/tmview.x?m" to be used by window managers. ***************************************************************************** ***************************************************************************** ***************************************************************************** 4. Compiletime options Hopefully, the above runtime-options allow configuring tmview to go with you TeX installation. There are also some compile time options you might like to adjust to your needs. They can be found in the defs*.h files indicated below. Probably some programming skills are required to understand what's going on in these files. However, those options which are meant to be adjusted are sort of "well documented". ./tmview/src/defsgen.h platform independent options ./tmview/svga/defssvga.h Linux/svgalib related options ./tmview/fb/defsfb.h Linux/framebuffer related options ./tmview/lX/defslx.h Linux/X Window related options ./tmview/lX/defssolaris.h Solaris/X Window related options In the platform independent section, you will find a couple of startup defaults, like how far the / keys scroll or whether tmview shall be verbose by default. There also is a constant to define the maximum amount memory in the glyph buffer. This effects how large a glyph (this includes eps-figures!) can be before being ignored. The platform dependent things are more interesting. Beside certain defaults for commandline arguments, one will find options to enable/disable eps-figure rendering by ghostscript enable/disable kpathsea support define name of user-startupfile/system-startupfile EXTRA NOTES ghostscript: If you don't have ghostscript on your system disable eps-figure rendering. Otherwise check the path specified in GSBIN. The quality (and the speed) of rendering can be adjusted by GSGREY. EXTRA NOTES kpathsea: Kpathsea is disabled by default because there are various versions of kpathsea and static linking makes no sense here. If your TeX-installation supports kpathsea, you can compile tmview with kpathsea support as well. You'll need the include-files and libkpathsea of exactly your TeX-installation to do so. I did test this with the kpathsea which comes along with dviljk-2.5, see CTAN in the "dviware" directory. I also tested with teTeX-0.4, see CTAN "systems/unix/". Finally, the Makefile (and of course defs*.h) has to be edited to enable kpathsea support. Depending on your version of kpathsea, it might be essential to place the binary dvilx/dvisvga/dvifb in the same directory as the other TeX related binaries, e.g. dvips. EXTRA NOTES mouse: If mousesupport is enabled in dvisvga while your mouse (or exotic touchpad ...) actually isn't supported by svgalib, you wont be able to move the screenmark. This is obviously not desired. In this case you might like to disable mousesupport for dvisvga in "./tmview/svga/defssvga.h". This line of thought also applies to the framebuffer version dvifb. EXTRA NOTES X-Window System: tmview/dvilx runs faster, if the depth of your screen is known at compiletime. Because of my poor equipment (Linux on a pc, no fancy X-terminals) this is only tested for 8bit and 16bit screens. See the file "./tmview/lX/writelx.c" to set things up for your needs. To watch what's going on when tmview tries to find its way to the XServer, setting up colors, asking for fonts and so, set DEBUGX in writelx.c . This helps if no tmview window shows up at all. EXTRA NOTES non-i386 architectures: Of course I realize that there are several non-i386 architectures. The clean way of dealing with machine dependand stuff is to make use of and such. Unfortunately I didn't. In a future version I shall carefully review the code from this perspective. In the meanwhile there is on crucial compiletime option to set up how many bits actually make a "long int". On i386 these are 32. Thus, enable "#define BMLONG32" in the platformm dependant "defs*.h", e.g. "./tmview/lX/defslx.h". On Alpha systems a "long int" is made up from 64 bits. Here, "#define BMLONG64" needs to be enabled. tmview will issue a runtime warning message if it figures out that ends don't meet here. ***************************************************************************** ***************************************************************************** ***************************************************************************** 5. Get the newest version, send me your comments Final releases are to be found on CTAN ftp-servers such as "ftp.dante.de". Since uploading to an ftp-server is some work, for both, me and the supervisors of the server, this is not done too often. Bugfixes and minor changes are therefore uploaded on "members.aol.com", my "private" ftp partition. Make the directory "/qelis" current, even if it is NOT listed by the dir command. There you will find any tmview related stuff in tar-gz-archives named "tmvXXXX.tgz" where XXXX is the release number. You may have some ideas how tmview could become better. You might have added code to process some of these fancy special command some macro-packages spread all over the dvi-files they produce. Bug reports or even fixes are welcome too. qelis@aol.com ******************************************************************************* End of README****************************************************************** tmview/doc/0040755000175000017500000000000007250444702012230 5ustar tmoortmoortmview/doc/tmview.dvi0100644000175000017500000022175407250444702014257 0ustar tmoortmoor; TeX output 2001.03.04:1632i1H 9zTҕpqGDtHGcmr17GTMVIEW{V01.03ҕp<ʍ9K`y cmr10Whatfistmview?tmviewfisascreen-previewerfor$'ExX.Itlet'syousee 9whatVyourprintedoutputwillloGoklike.XY*oucanchoGosebetweenVablack-and-whiterepresentation9andIgreyscaling.mY*oucanchoGoseanarbitraryzoomfactor(atsomecostofperformance).mY*oucan9setmarkstomeasuredistances.=CY*oucansearchfortextstrings.Y*oumayvisitlotsof.dvi- les,Jset9bGookmarksUandgetthemsavedUtoastartup- le.stmviewdoGesnotsupport.pxl- lessinceIthink9they+areprehistoric.Ztmviewignoresallspecial-commands,sorrylads.tmviewtriesitsbGestwith9virtualUUfontsandincluded.eps- gures.qtmviewispreparedtobGelinkedwithkpathsea. J9TheUUcurrentversiongoGeswithlinux/svgalib,linux/framebu eraswellastheXWindowSystem.!9'ExX-setup.9Whilethedefaultswork neonmysystem, @youmayhavetopasssuitablevqalues.[Defaultsareset9atRwcompiletime.pOnyoursystem,S theymaydi erfromthebGelowexamples.pAnyway*,S compiletime9defaultslwillbGeoverwrittenlbydefaultsfromasystemstartup- le,whichinturnareoverwritten9byUUauserstartup- le.qSee-sforkeepingyourdefaultsinastartup- le.-?'9(HelpUUcommand-line-options)'9List;allcommand-line-optionsandtheirdefaults,afterreadingstartup- les,ifany*.XThisalso'9repGortsUUtheactualnamesofsystemanduserstartup- les.qSee-s.򍍍-h'9(Horizontal-o set)'9ACulotCzofprinterdriversdoahorizontalo setof1inch.kIfyoursdoGesaswell,G youshoulduse'9-h25.4.qTheUUlengthfollowing-hmustbGegiveninmm.qDefault:25.4-v'9(V*ertical-o set)'9A.lotMofprinterdriversdoaverticalo setof1inch.߰IfyoursdoGesaswell,youshoulduse'9-v25.4.qTheUUlengthfollowing-vmustbGegiveninmm.qDefault:25.4-p'9(PapGer-size)'9T*ells~tmviewwidthandheightofthepapGeryouareusing.Thewidthisgiven rstand'9bGothwidthandheightaregiveninmm.Widthandheightareseparatedbyanx.Default:'9210.0x297.0UU(GermanDINA4)-r'9(Resolution)'9T*ellsntmviewwhatkindof.pk- lestouse. %Thehorizontalresolutionisgiven rstand'9bGothhorizontalandverticalresolutionaregivenindpi(dotspGerinch). tThetwovqaluesare'9separated1Sbyanx.eSaying-r600x600meanstmviewwillusefontswhichweregeneratedfor'9a600-dpi-printer.c Astmviewassumesthatpixelsonthescreenaresquare,di erentvqalues'9forahorizontalandverticalresolutionwillresultinadistortedimage.eAlwaysmakesurethe'9desiredt.pk- lesareavqailable.rThechosenresolutiondeterminesthe(maximum)sizeofthe '9representationUU(comp.33>< lcircle10>͉fe3333>>͉fe33qǟ33feqǟ33fe#|{Ycmr8+bGelow).qDefault:300x300*ۍ=1*i1H ee-f'9(F*ont-path) '9A֏list֯ofpathstellingtmviewwheretoloGokforthe.pk- les.GTheitemsinthislisthavetobGe'9separated:by':'.BThegivenlistisexecutedfromlefttoright.BIfanitemendswith//allsub-'9directoriesQwillbGescannedtoo.,Thisisprogrammedinaveryoddway*,zsoQittakesalotoftime.'9Y*ouUUshouldplacesuchitemsattheendofthelist.qDefault:./:/usr/lib/texmf/fonts//򍍍-n'9(Name-of-the-font- le)'9If%your.dvi letellstmviewtouseafontcalledthisnthatfontandtmviewwastoldtouse'9a0resolutionof123dpi,gtmviewhastoknowhowthedesired leisnamed.Inthestring'9followingUU-nthefollowingreplacementsaremade:+BG֍'9xxxuVreplacedUUby''9@NCQthisnthatfont'9@KCQthisnthaUU(thisis@Rreducedto8characters(MS-DOG!))'9@MCQ123UU(theresolution)'9@RCQ615UU(thisis@M !", cmsy105,intendedformagni ed200dpifontsusedinsteadof300dpifonts)'9Default:q@N.@Mpk򍍍-t'9(Tfm-path)'9AOlistwofpathstellingtmviewwheretoloGokforthe.tfm- les.C-Theitemsinthislisthave'9toLbGeseparatedby':'.WThegivenlistisexecutedfromlefttoright.W.tfm- lesareused,'9whenS;tmviewcan't ndafonts.pk- le.qInthatcasebGoxesaredrawninsteadoftheglyphs.'9Default:q./:usr/lib/texmf/fonts//-q'9(Vf-path)'9AlistofpathstellingtmviewwheretoloGokforthevf- les.IfanythinggoGeswrongwith'9vf- les,LuseVdvicopytoreplacethembyordinarydvi-coGde.Nomenclatureofthelistisas'9abGove.qDefault:./:usr/lib/texmf/fonts//-d'9(Display)'9T*ellsϗtmviewthedesiredsizeofyourdisplay*.Thewidthisgiven rstandbGothwidthand'9height.aregiveninpixels.dWidthandheightareseparatedbyanx.dUsinglinux/svgalibyou'9may hchoGosearesolutionsupportedbyyourversionofsvgalibwithrespGecttoyourhardware.'9Only256-color-moGdesareallowed.3Thatmeanstogetmorethan320x240youmusthavea'9suppGortedssvgachip-set,3standardvgawon'tdo. SeeR}'eadmeβonshowtoruntmviewwith'9standardwvga.^(Usinglinux/framebu ertmviewwilltaketheframebu erdeveiceinwhatever'9resolution?itisfoundThe-doptionisignored.Again,ztmviewinsistsina256-color-moGde.'9UsingёtheX/WindowSystem-dwillsuggestthesizeofthetmviewwindow.zHowever,'9youBAmayalternativelyusetheresourceDviLX.geometryorthestandardgeometryoption'9-geometry?wxh+x+y.CTmviewwillacceptalmostanycolor-moGdewhenrunningwiththeX'9WindowUUSystem.y'9Defaults:(6(linux/svgalib4only)loGokforthevqalueof$GSVGAMODEifset,ߡotherwisetry640x480.-m'9(Magni cation)'9If2~youwanttomagnifybyafactor b> cmmi10nyouhavetospGecifyn310002~asanargumentto-m,9ve.g.'9-m2000IJmeansalllengthswillbGedoubled. Note:ئtmviewmagni esaccordingtotheorigin'9of7thedvi-coGordinates,pewhichis{inmostcases{not*theupperleftcornerofthepaper.'9Always makesurethedesired.pk- lesareavqailable.Y4-mdoGesn'tmagnifythepaper,Zsoifyou 8䍑'9wishUUalargerimageuse33""""͉fe3333 "" ""͉fe33UU33feUU33fe+ UU/33͉ͮ͟fe3333  ͉͟fe3333fe33fe㍑T-orUUthe-roption.qDefault:getUUmagni cationfrom.dvi- le.-k'9(Kannot-print-any-further)'9Most?printersstopprintingiftheyaretoGocloseatthepapersedge(somemightevendo'9strange things).XThe-koptiondescribGestheprintablearea,e.g.saying-k1.0,2.0,3.0,4.0'9meansUUthatyourprintercanprintascloseas'91UUmmtotheleft'92UUmmtotheright'93UUmmtotheuppGer'94UUmmtothelower*ۍ=2i1H ee'9edgeTofthepapGer.2Thesevqaluesareusedtodrawaframeindicatingtheprintablearea(comp. 33'®'Ÿ͉fe333311Ÿ͉fe33+933fe+933feǍ)݁p5ݲbGelow).Whensearchingtextstrings,anytextoutsidetheprintableareaisignored.All '9fourvqalueshavetobGegivenandtheyhavetobGeseparatedby','.cWAlllengthsaregivenin'9mm.qDefault:4.0,4.0,4.0,12.0-s'9(userUUstartup- le)'9TheRdefaultvqaluesfortheabGoveRoptionsarereadfromasystemstartup- le,Itypically'9/etc/dvisvga.=AfterCthisauserstartup- leisread.ThelattercanbGespeci eddirectly'9afterthe-s.JWhenyouspGecify-s ,qi.e.givenoargumentto-s,qnostartup- leisloaded.'9When\mquittingtmview,^3thecurrentoptions,^3thelistofvisited.dvi- les(seebGookmarks\mbe-'9low)andlotsofotherinternaarewrittentotheuserstartup- le.Ifthisisnotdesired,the'9startup- leUUhastobGesetread-only!!'9Both7startup- lesarereadb}'efore0reading7anycommandline-options{thismeansyoucan'9overrideUUthedefaultsfromthestartup- le.'9TheEoveralltacticwithstartup- lescanbGeasfollows:(i) gureoutsuitableoptionsofinterest'9forzallusers,e.g.font-pathsandpapGer-size;(ii)copytheuserstartup- legeneratedbytmview'9toƄthesystemstartup- le;(iii)anyusermaynowruntmviewwithoutanyoptions,visitoften'9used.dvi les,رsetwithinthesedesiredmanual-bGookmarksandgetthatinformationsavedall'9totheuserstartup- le;*(iv)thensettheuserstartup- leread-onlyand/orcopyitsomewhere'9save.qSeeUUalsoe}'ditingthestartup- lebGelow.Default:~/.dvisvga"\o92&Usingfftmview{ViewingaT߆Tff cmtt12T.dvi- le1ƍ9When5everythingissetuptosuityourneeds,mvisitinga.dvi lesimplymeanstonavigatethe9visibleareathroughthe lesusingthecursor-keys.Agreatvqarietyofcommandsisavqailable,9includingcommandsforloading les,0changingthepapGer-sizeorsettingmarks.hThetableshows9allUUavqailablecommands.qCommandsareinvokedbysinglekey-strokese.g.33""""͉fe3333 "" ""͉fe33UU33feUU33feǍqquitstmview. J9F*orthesakeofinformationthereisamoresecurewayofinvokingacommand:1Ifyouinsert33͉fe3333͉fe33933fe933fe8*?bGeforehittinganotherkeythestatus-linewillgiveashortdescriptionofthecommandwhich9includes%2informationabGoutthecommandsarguments.^Now%2therearetwo%2possibilities:Hit33qq͉fe3333qq͉fe33233fe233felJK cmsy8 T2cmmi8-9(pGerhapsyafterinsertingarguments)toexecutethecommandor33FWFW͉fe3333FWFW͉fe33y33fey33fe'`ESCtocancel.fBesides33FWFW͉fe3333 FW FW͉fe33y33fey33few?there9is(anotherway(ofinvoking(commandsthisway:[wJust(inserttheappropriateuppGercaseletter.bThis9leads@toaconvenient@wayofgettingaccustomedtotmview,Ethetutorial-mo}'de[.jDocaps-loGckright9afterUUtmviewhasstarted:qfromnowonnothinghappGenswithoutyourexplicitcon rmation.Hፍ95N cmbx122.1,Arguments9Somekofthecommandsintable1takenumericalarguments.6Argumentsarealwaysoptional.6They9haveHtobGeenteredb}'efore 1callingHthecommand.mMultipleargumentsareseparatedby','or';'.mIf9youTar}'eSgivingargumentstoacommand,>giveall]arguments,>ifyoudon'tgiveenough,>thecommand9willSbGehaveasifnonehadbGeengiven.Afterinsertingtheargumentsjustcallthecommand,no9Returnvorwhateverisrequired(asamatteroffact33KCKC͉fe3333KCKC͉fe33~v33fe~v33feE T-evendestroysyourarguments).TIfyougive9arguments(toacommandthatdoGesn'twantthem,1theargumentsaresimplydiscarded{noerror.9Iftnoargumentisgiven,~adefaultisused.&Ifanargumentispassed,~itservesasthedefaultforfuture9invoGcationsUUofthiscommand.qCommandsdoingsimilarthingssharethesamedefaultarguments.9Example:N typing 1033w{w{͉fe3333 w{ w{͉fe3333fe33fej resultsinscrolling10%totheleft.YThustyping33ګګ͉fe3333 ګ ګ͉fe33 ޟ33fe ޟ33fe!afterwardsscrolls10%9toUUtherightand33""""͉fe3333 "" ""͉fe33UU33feUU33fe5S"scrolls10%upwards.Hፍ92.1.11]u*T{themagicargumen9t9As&aspGecialargumentmostofthecommandsaccepttheso-calledmagicar}'gument*.;Itisused9eitherttomoGdifythebehaviourofthecommandinsomewayortogettheargumentsfromsome-9whereXelse(e.g.fromthecommand-lineoreventhestartup- le).%T*ogetanunderstandingofthe9magicar}'gumentH-considerUUthefollowingexamples:*ۍ=3%Ai1H {0g$commandsToftm9view 9html: html:ö*OF33͉fe3333͉fe33933fe933fe8+?\VfgiveUUashortdescriptionofthefollowingcommand 33͉fe3333͉fe33933fe933fe8+?33oo͉fe3333)o)o͉fe33#䢟33fe#䢟33fe"?\VfgiveUUalistofallcommands33͉fe3333..͉fe3333fe33fePgUp/9,33""͉fe3333""͉fe33U33feU33fe\PgDn\VfselectUUapagerelativetothecurrentpage33͉fe3333͉fe33933fe933feǍg\VfselectUUapagew.r.t.TU>'ExX-counters33͉fe3333͉fe33933fe933fe 9,33""""͉fe3333 "" ""͉fe33UU33feUU33feQ! UU,33""""͉fe3333 "" ""͉fe33UU33feUU33fe5S",33""""͉fe3333 "" ""͉fe33UU33feUU33fe5S#\VfscrollUUthevisiblearea33͉fe3333͉fe33933fe933fef9,33""""͉fe3333 "" ""͉fe33UU33feUU33fe㍑qc\VfmakeUUscrolling ner/coarser33͉fe3333͉fe33933fe933fe㍑Vdz\VfcenterUUvisiblearea33͉fe3333͉fe33933fe933fe+9,33""""͉fe3333 "" ""͉fe33UU33feUU33fe\VfzoGomUUin/out33͉fe3333͉fe33933fe933fe㍑v\VfsetUUzoGom-factor33͉fe3333͉fe33933fe933fe݀b\VfsetUUabGookmark33͉fe3333͉fe33933fe933fe㍑(*w\VfmoveUUtoabGookmark33͉fe3333͉fe33933fe933feƿU2@cmbx8U^\VfmoveUUback33͉fe3333͉fe33933fe933fe㍑o\VfdisplayUUoptions(e.g.greyscaling,eps-rendering)33͉fe3333͉fe33933fe933fe㍑x\VftoggleUUstatusline-information33͉fe3333͉fe33933fe933feu׍t\VfsetUUunitofmeasurement33͉fe3333͉fe33933fe933fe l\Vfshow/hideUUscreenmarkandpagemark33͉fe3333͉fe33933fe933feǍy\VfsetUUpagemarkatthepGositionofscreenmark33͉fe3333͉fe33933fe933fe㍑a\Vfhow/hideUUmarkedrectangle33͉fe3333͉fe33933fe933feǍ݀p\Vfshow/hideUUprintablearea33͉fe3333͉fe33933fe933fe㍑Vde\VfsetUUpage-o setand-size33͉fe3333͉fe33933fe933fehtml: k html:\Vfshow/hideUUhalf-hypGer-tex-mark33͉fe3333**͉fe3333fe33feQTJAB\VfmoveUUtonexthref33͉fe3333""͉fe3333fe33fe T-\VffollowUUcurrenthref33͉fe3333͉fe33933fe933fe㍑s\VfsearchUUfortext33͉fe3333͉fe33933fe933fe㍑r\Vfre-readUU.dvi leandre-drawscreen33͉fe3333͉fe33933fe933fe݀d\Vfload/killUU.dvi le33͉fe3333͉fe33933fe933feǍq\VfquitUUtmview33®Ÿ͉fe3333""Ÿ͉fe33933fe933feǍ݁p'9drawsarectangleshowingtheprintableBsar}'eac.Ittakesfourargumentsstatingwhereyour '9printer7*willrefusetoprintanyclosertothepapGer'sedges.gIf*isgivenasanargument(one'9'*'UUnotfour),theaccordingnumbGersUUaretakenfromthestartup- le.33®Ÿ͉fe3333""Ÿ͉fe33933fe933fe㍑(+w'9movesthroughoneoftworingsofbGookmarks:Ltheringof le-bGookmarksortheringof'9manual-bGookmarks.@If33mm͉fe3333 m m͉fe33 33fe 33fe㍑w@receives themagic ar}'gumentxtheotherringischosen,nomovement'9is!pGerformed.$Thestatus-linewillsay'SET TOMANUAL-BOOKMARKS'if!thecurrent'9ring}wasthe le-bGookmark-ring}(andisnow themanual-bGookmark-ring).>So}inthiscase*'9actsUUasakindof agargument.Hፍ92.2,Thedetailedcommandlist9Mo9vingTthroughthedoQcument33  ͉fe3333((͉fe3333fe33fePgUp)9,33""͉fe3333""͉fe33U33feU33fe\PgDn!SelectUUapagerelativetothecurrentpage33  ͉fe3333((͉fe3333fe33fePgUp,|gmovesBttowardsthebGeginningofthe.dvi le,F;while33AA͉fe3333AA͉fe33t33fet33fe{PgDn!movestowardstheend.k|ABosingle 9argument nspGeci esthenumbGerofpagestomove.= However,ĵnwillNOTbGecomethedefaultvqalue.9TheUUargumentis(*),thepage-moving-moGdeistoggled.qSeeabove. J9Ifctheargumentis*,thepage-moving-moGdeistoggled(nomovement).MThetwopGossiblemodiare:Jr1.'9KeepUUthevisibleareawhereitis.*ۍ=4?&i1H eerײ2.'9Perform6acentering(horizontalandտvertical){justlikecalling33͉fe3333  ͉fe33633fe633fe㍑z33DD͉fe3333DD͉fe33w33few33fe㍑TzE{afterreachingthenew '9page.J9The3secondmoGduscomesinquitehandywhenyouwanttoreadthe.dvi leratherthantocheck9it.c_Aftera33͉fe3333͉fe33%ݟ33fe%ݟ33fePgDn"KthetopofthepagewillalwaysbGevisible{atleastifthecenteredpointisset9upUUappropriately*,see33""""͉fe3333 "" ""͉fe33UU33feUU33fe㍑qzbGelow. J9Example:q133{{͉fe3333{{͉fe33*33fe*33feZPgUp selectsUUthepreviouspage33""͉fe3333""͉fe33U33feU33fe\PgDn!selectsthenextpageHፍ33͉fe3333͉fe33933fe933feǍgHSelectUUapagewithrespGecttoTU>'ExXcounters9Alist$oftenarguments(cٓRcmr70|s,c1,...c9|s)$spGeci esthepagetobeselected.m3tmviewwilljumptothe9 rstpagewithavqalueofc 0ercmmi7i?iin\counti(i=0;:::9),*maybGeusedasawildcard.3Ifthereare9moreUUthanonebutlessthantenargumentsgiven,theotherswillbGetakenas*.9Example:q2633w{w{͉fe3333 w{ w{͉fe3333fe33feǍgselectsUUthe rstpagewithavqalueof26in\count0.Hፍ33͉fe3333͉fe33933fe933fe"9,33""""͉fe3333 "" ""͉fe33UU33feUU33fe5S# UU,33""""͉fe3333 "" ""͉fe33UU33feUU33feQ ,33""""͉fe3333 "" ""͉fe33UU33feUU33feQ!ScrollingUUthevisiblearea9AsingleargumentpmaybGeusedtospecifytheamountofscrollinginpercentofthescreen-width.33͉fe3333͉fe33933fe933fe"33쪮쪟͉fe3333%%쪟͉fe33 ݟ33fe ݟ33fe#*DzbGothaccepttheargument*totogglebetween:1.stayonthecurrentpage;.42.scrollover9pages..TWhen/scrollingover/pages,youmayviewthewholedoGcumentwhileusingonlythesingle9key33""""͉fe3333 "" ""͉fe33UU33feUU33fe5S# UU.9Example:q2033w{w{͉fe3333 w{ w{͉fe3333fe33fej scrollsUU1=5totheleft.ፍ33͉fe3333͉fe33933fe933fef9,33""""͉fe3333 "" ""͉fe33UU33feUU33fe㍑qcMakeUUscrolling ner/coarser?9ThesecommandschangethedefaultargumentfortheabGovescrollingcommands..eSo33WW͉fe3333 W W͉fe33銟33fe銟33fefand33WW͉fe3333 W W͉fe33銟33fe銟33fe㍑c9don'tUUmovethevisibleareaatall,buttheychangethewaythescrolling-commandsact.Hፑ9replacemen9tsTforthecursorkeys9IfyourterminalsendsstrangeescapGesequenceswhenyouhitacursorkey*,youdon'tneedtoworry:9tmview JsuppGortskeystoreplacethecursorkeys.YnTheseare:33͉fe3333͉fe33MA33feMA33feiYtoreplace33YY͉fe3333YY͉fe33J33feJ33fe|PgUp J,33糮糟͉fe3333  糟͉fe3333fe33fe㍑8m'0for33YY͉fe3333YY͉fe33J33feJ33femQPgDn,33糮糟͉fe3333  糟͉fe3333fe33fe㍑ru9for33""""͉fe3333 "" ""͉fe33UU33feUU33fe5S" UU,33""""͉fe3333 "" ""͉fe33UU33feUU33fe㍑nfor33""""͉fe3333 "" ""͉fe33UU33feUU33fe5S#,33""""͉fe3333 "" ""͉fe33UU33feUU33fehfor33""""͉fe3333 "" ""͉fe33UU33feUU33feQ and33""""͉fe3333 "" ""͉fe33UU33feUU33fe瞍jfor33""""͉fe3333 "" ""͉fe33UU33feUU33feQ!.-...At... 33tt͉fe3333~~͉fe33xIߟ33fexIߟ33few)"33AZAZ͉fe3333AZAZ͉fe33t33fet33fee9PgUp33==͉fe3333GG͉fe33AI33feAI33fe㍒?{u33HjHj͉fe3333RjRj͉fe33L33feL33feLci rU3...33nAUnAU͉fe3333xAUxAU͉fe33rt33fert33feo4 33yy͉fe3333͉fe33~633fe~633fez2!...C...337Ae7Ae͉fe3333AAeAAe͉fe33;t33fe;t33fe:$h33BB͉fe3333LL͉fe33GF33feGF33fe瞍Fjd...33tt͉fe3333~~͉fe33xIߟ33fexIߟ33few)#33AZAZ͉fe3333AZAZ͉fe33t33fet33feUPgDn33==͉fe3333GG͉fe33AI33feAI33fe㍒?{n33HjHj͉fe3333RjRj͉fe33L33feL33fe㍒Jim ...At...6/33͉fe3333͉fe33933fe933fe㍑VczHCenterUUthevisiblearea9WithoutnCanyargument33;;͉fe3333 ; ;͉fe33nC33fenC33fe㍑z܆centershorizontallyonly*,t~while33;;͉fe3333 ; ;͉fe33nC33fenC33fe㍑z33微徟͉fe3333徟͉fe3333fe33fe㍑5az4centersinbGothdirections.When9twojIargumentsx,oy"aregiven,otheydescribGethepointonthepage,owhichwillbGecomethemiddle9of6thevisiblearea.PWhentheargument*isgiven,o8thecurrentpGositionistakenasthecentre.9When߮thescreenmarkisshown(seebGelow33{{͉fe3333 { {͉fe33߮33fe߮33fetl ߮),Dandtheargument*isgiven,DthepGositionofthe9screenmarkbGecomesthecenter.PThismovesthevisiblearea,butitdoGesnotmovethescreenmark.Hፍ33͉fe3333͉fe33933fe933fe㍑vHSetUUthezoGom-factor9ThisHzcommandrequiresoneargumentf\ whichmustbGebetweenHz0.1and2.K7f\ willbecomethe9zoGom-factor@andthevisible-areawillberedrawn.TkUse*33w{w{͉fe3333 w{ w{͉fe3333fe33fe㍑lsvtoadjustthezoom-factorsuchthatthe9pageUUhorizontaly tsthevisible-area. J9IfthezoGom-factoris1,thepixelsfoundinthe.pk- lesarejustcopiedonebyonetothescreen.9SincectheresolutionofourdaysscreensseemstobGelessthanthatofourdaysprinters,gandsince9youͫprobablystillwanttousethesame.pk- lesforprintingandviewing,f5=1usuallyresults*ۍ=5bi1H ee9in)apGositivemagni cation.cRSowhenyou'rejustreadingsometextinsome.dvi lethebGestvqalue 9for2ٵfFhissomethinglike0.3,9depGendingontheinvolvedresolutions.fHWhenthescreenmarkisvisible9(see33ƮƟ͉fe3333  Ɵ͉fe3333fe33fel )thepGositionofthescreenmarkistakenastheoriginofzooming,! i.e.[itis xed.Whenthe9screenmark`isnotvisible,cthemiddleofthescreenis xed.UThecurrentzoGom-factorisdisplayed9inUUthese}'condUUstatusline,see33""""͉fe3333 "" ""͉fe33UU33feUU33fe㍑x UU. J9TherearetwozoGomingmodi.Theintegermodusrequieres1=f html:tmviewdoGessomeofthefancyhypGer-texthings.MHItalkabouthalf-hyper-tex,becausetmviewonly9followsSlinkswhichpGointtosomewhereinthecurrentlyvisited.dvi- le.QqSothereisnoconnection9toV*thenetorso.tGButyoumight ndituseful(wheneditingama8jorproject)toviewanequation9numbGerthis-and-thatbyclickingonthis-and-thatwhereverthetextreferstothatequation._F*or9informationUUabGouthyper-tex,relatedmacropackqagesandfullycompatibleviewerscanthenet...33͉fe3333͉fe33933fe933fekHShow/hideUUhalf-hypGer-mark?33  ͉fe3333$$͉fe3333fe33feQTJAB(HGotoUUnexthref33  ͉fe3333͉fe3333fe33fe T- HF*ollowUUcurrenthref,ifoneispresentonthecurrentpage9The(.dvi- leyou'reviewingrightnowprovidestwolinks:oneofthemisfromheretothelist 9ofhtml: commands html:.eSoyoumaypress33svsv͉fe3333svsv͉fe3333fe33fehnk,33GˮG˟͉fe3333GG˟͉fe33z33fez33feTJAB and33vv͉fe3333vv͉fe33&33fe&33fe T-MRtocheckthisout.eHint:33<<͉fe3333<<͉fe33 o33fe o33fe :U^movesback.9Alternatively33""͉fe3333""͉fe33U33feU33femTJABwillUUbringyoutothenexthref.9Miscellaneous33͉fe3333͉fe33933fe933fe㍑oHDisplayUUoptions9ThisUcommandcollectsanumbGerUofgeneraloptionsonhowthingsgetonthescreen.sUsethe 9cursorUUkeys(or33""""͉fe3333 "" ""͉fe33UU33feUU33fe㍑u UU,33""""͉fe3333 "" ""͉fe33UU33feUU33fe㍑n,33""""͉fe3333 "" ""͉fe33UU33feUU33feh,33""""͉fe3333 "" ""͉fe33UU33feUU33feh)UUtonavigate. J9Gr}'eyscales.נWhen̝thezoGom-factorislessthan1,otheglyphsmaybedisplayed̝usinggrey-levels,9makingNythemmoresmoGoth.]2Thistakessomememory*,soyouareallowedtoswitchito .]2On9high-resUUdisplaysthereisnoneedforgreyscalinganyway*.L?9Eps-r}'endering.There\islimitedsuppGortforrendering.eps- lesbyrunning9ghostscript.}Moreprecisely*,tmviewimplementsthePSFileo spGecial,including9allargumentsforscalingandrotating.3However,thevqarioususerlevelpackqages9forxgraphicsinclusionusethatspGecialinratherdi erentways.Bottomlineis9thatrtmviewworks newiththeepsfig-packqage,zBincludingscalingbutfailing9on!rotatinng:=-\epsfig{file=some.eps,?width=7cm}issuppGortedbytmview,9andDsois\epsfxsize=2cm\epsfbox{some.eps}.WIngeneral,rendering.eps-9 lesO{canbGequiteslowandmemoryintensive,soyoumayturnito .Ifrendering9isoenabledtheresultsarebu ered.7{Hence,jifthe.eps- lesareupGdatedbysome 8䍑9graphicsmprogram,youneedtodoa*33͉ͮ͟fe3333  ͉͟fe3333fe33fe㍑Wr mtoforcererendering.=%T*odisablecertain9.eps- lesUUindividually*,abGorttherenderingprocessby33""""͉fe3333""""͉fe33UU33feUU33fe+ESCUU.4PSfile=tm.ps llx=100 lly=100 urx=145 ury=130 rwi=566L9Double-p}'age.5wThereissomesuppGortforviewingtwopagesbesideeachother.5wThiswillrequirea9reasonableamountofextramemory*.\Youmaydisabledoublepagedviewingentirely*.\Youmaylet9tmviewUUdeceideonbasisofthezoGom-factor.qOryoumaypGermanentlyenablethisfeature.9Zo}'oming.1ThereIisafastzoGomingmodeallowingonlyzoomingby1=fزwherefisrequiredtobGe9anUUinteger.qAndtherealsoisanarbitrarymoGdetobeselected.9㎍9Colors.dTmview-pGerformsallitsdrawingsinblackcolor.dHowever,5thiscanbGe9dimmned'ExXinput9\c?o,kproGducingg_an|Go,willbGerepresentedasasimple'o'inthetext-string.Thisrulealsoapplies9toJmallkindofligatures.n$TheTU>'ExXinputffl\AE,proGducingwillberepresentedbyfflAE.JmAny9accentTon~7topofaglyphwillbGetranslatedtoa",precedingwhatevertheglyphwithoutthat9accentCwouldbGetranslatedto.kTheTU>'ExXinput\"aproducingthegermanumlauta,G:willbefound9as Z"ainthegeneratedtext-string.YTheTU>'ExXinput\aaproGducingthescandinavianZawillbefound9asUU"atoGo.qAnyotherglyphsareignored.9Third:qInUUwhatdoGestheaboveUUresult?9VisitingGenglishdoGcuments,&sayGmanualstosomecomputerrelatedstu likeelisp.dvi,&searching9forkeywordsworks ne.eSearchingindoGcumentsinwhichextensiveuseofaccentsandfunny9charactersh\ismadeworkstoGo,mbutrequiressomeluckand/orexpGerienceinhowTU>'ExXactsonsuch9things.9Example:qDzT*akeUUthe lestory.texfromtheTU>'ExXbGook,UUchapter6,page24.qItcontainstheline,9galaxy?called\"O\"o\cc9TheUUtext-stringbuildfromthecorrespGondingstory*.dviwillthereforecontain@9galaxycalled"O"ocJ9SoUUyoucansearchforstrhgettingasresultans9ffffğ J= "5-:Aacmr61LhereX'regularexpression'means#fcmti8extendedMregularexpression*ۍ=9 ߑi1H eeHstrPans',9galaxy]`found ,9galaxycalled]`found,9galaxy?called|yвnotUUfound,9d"]`found,9galaxy.*"O"oc]`found,9Ooc|yвnotUUfoundh 33͉fe3333͉fe33933fe933fe㍑rHRe-readUUcurrent.dvi leandre-drawscreen33͉fe3333͉fe33933fe933fe㍑rHwon'tUUre-readthefont- lesnorrenderedeps- gures.qUse*33w{w{͉fe3333 w{ w{͉fe3333fe33fe㍑rtoforcethosetobGere-readalso.Hፍ33͉fe3333͉fe33933fe933fedHLoad/killUU.dvi le?9AfterUUtyping33""""͉fe3333 "" ""͉fe33UU33feUU33fedyoumayselectbGetween33""""͉fe3333 "" ""͉fe33UU33feUU33fe'ltoloada.dvi leand33""""͉fe3333 "" ""͉fe33UU33feUU33fektokilla.dvi le. J9LoadingUUa.dvi le:9tmviewSUwillloGokfora le-bookmarkbelongingtothat le.qIfthereisone,Sitbecomesthecurrent 9 le-bGookmark."Theh>.dvi lewillbGeshownasleft,andanyde nedmanual-bGookmarksh>areaccessible9by33a߮aߟ͉fe3333 a aߟ͉fe3333fe33fe㍑Hw .0Whenloadinga.dvi leforthe rsttime,anew le-bGookmarkwillbGecreated.Thiswill9bGesetupwithdefaultvqaluesfromthecommand-lineoptionsandwon'tcontainanymanual-9bGookmarks. J9Killinga.dvi le: PT*okilla.dvi lemeanstokillit's le-bGookmarkandanyrelatedmanual-9bGookmark._Killinga.dvi lewon'thurtthe leitself._Y*oudon'thavetokilla.dvi lejustto9loadUUanotherone.33͉fe3333͉fe33933fe933feǍqHQuitUUtmview9When3quitting,:astartup- lewillbGewritten.2gWhenrunningtmviewnexttime,youwill ndalmost9everythingUUasyouleftit."\o93&Customizingfftmview{Thestartup- le1ƍ9The^followingexplainsthecontentsofthestartup- lewhichisusedtosetuptmview.Whenthe9startup- leeisnotsetread-only*,itmviewwritesdownastartup- leeverytimeyouquittmview.If9noXstartup- lecanbGefound,Yanewonewillbecreated.|HHencethelistofbookmarksresp.|Hvisited9 les=willkeepgrowing,Baslongasyoudon'texplicitlykillthemwith33d d ͉fe3333 d  d ͉fe33=33fe=33fe:d33͉fe3333͉fe33A33feA33fekA.2jSincealsocommand-line9optionsxarekeptinthestartup- leyouarenotabletoresetanynonsensebyquitting/restarting9tmview(whichisnotnecessaryanywaybGecauseyoucanreseteverythingfrominsidetmviewusing9theYAmagicar}'gumentز).}Ifyouaretryingoutfunnycommand-lineoptionswhichyoudon'twantto9creepintoyourstartup- le,Fjustsetthestartup- leread-only{orcalltmviewwith-s .T,Although9there|Faregreatchancestogetalotofnonsenseintoyourstartup- le,therearetwogoGod|Freasons9toUUmaketmviewremembGeralltheaboveUUmentionedinformation:^2 J91.gY*ou6areworkingonama8jorTU>'ExXproject, cmmi10 0ercmmi7K`y cmr10ٓRcmr7< lcircle10"+tmview/doc/tmview.tex0100644000175000017500000013341007250444702014264 0ustar tmoortmoor% -*- mode: latex; buffer-read-only: nil; -*- \documentstyle{article} \input epsf.tex \input colordvi.tex \topmargin0.5cm \footskip15mm \oddsidemargin0.5cm \headheight0in\headsep0in \textwidth150mm \textheight297mm \advance\textheight-1in \advance\textheight-14mm \advance\textheight-\topmargin \advance\textheight-\headheight \advance\textheight-\headsep \advance\textheight-\footskip \pagestyle{plain} \newbox\mybox \newcount\keywidth \newcount\halfkeywidth \def\keys#1{% %<------- \setbox\mybox=\hbox spread 6pt{\hfill\footnotesize #1\hfill}% \keywidth=\wd\mybox% \divide\keywidth by 65536% \halfkeywidth=\keywidth% \divide \halfkeywidth by 2% \unitlength1pt\begin{picture}(\keywidth,10)(0,3) \put(\halfkeywidth,5){\oval(\keywidth,10)}% \put(\halfkeywidth,5){\vbox to0pt{\vss\hbox to0pt{\hss\unhbox\mybox\hss}\vss}} \end{picture}} \def\key#1{% %<------- \unitlength1pt\begin{picture}(10,10)(0,3) \put(5,5){\oval(10,10)}% \put(5,5){\vbox to 0pt{\vss\hbox to 0pt{\hss\footnotesize #1\hss}\vss}} \end{picture}} \def\kitem#1{\subsubsection*{\mediumseries #1}} \parindent0in \parskip.3ex plus .1pt \bgroup \catcode`\!00\relax \catcode`\[01\relax \catcode`\]02\relax \catcode`\"12\relax \catcode`\}12\relax \catcode`\{12\relax !catcode`!\12!relax !gdef!hyperquote["] !gdef!hyperbackslash[\] !gdef!hypergopen[{] !gdef!hypergclose[}] !global!edef!hyperhash[!string#] !global!edef!hypertilde[!string~] !egroup \def\fragilehyperanchor#1#2{% \ifvmode\leavevmode\fi% \special{% html:% }#2% \special{html:}% } \let\fha\fragilehyperanchor \edef\fragilehyperref#1#2{% \special{% html: % }#2% \special{html:}% } \let\fhr\fragilehyperref \begin{document} \language0 \def\bottomfraction{1} \setbox\mybox=\hbox spread 5pt{\hfill\Huge TMVIEW -- V 01.03\hfill} \vglue-2cm \centerline{\vtop spread 5pt{\hsize\wd\mybox\hrule height 1pt\vfill \box\mybox \vfill\hrule height 1pt}} \vskip1cm %\section{Introduction} What is tmview? tmview is a screen-previewer for \verb+.dvi+-files compiled by \TeX. It let's you see what your printed output will look like. You can choose between a black-and-white representation and greyscaling. You can choose an arbitrary zoomfactor (at some cost of performance). You can set marks to measure distances. You can search for textstrings. You may visit lots of \verb+.dvi+-files, set bookmarks and get them saved to a startup-file. tmview does not support \verb+.pxl+-files since I think they are prehistoric. tmview ignores all \verb'special'-commands, sorry lads. tmview tries its best with virtual fonts and included \verb+.eps+-figures. tmview is prepared to be linked with kpathsea.\\ The current version goes with linux/svgalib, linux/framebuffer as well as the X Window System. \tableofcontents \section[Commandline options]{Starting tmview -- Commandline options} \subsubsection*{Usage} {\catcode`\<\active\def<#1>{{\rm\em #1\/}} \begin{verbatim} tmview [-?] [-h] [-v] [-px] [-rx] [-f] [-n] [-t] [-q] [-dx] [-m] [-k,,,] [-s] [[.[dvi]]] \end{verbatim}} If you call tmview with the option \verb+-?+, tmview will give a complete list of all possible options and their default-values. {\bf Important:} All options have to be followed {\bf immediately} by their arguments, {\bf no} spaces must be inserted !!! %\subsection{Commandline-Options} The command-line-options are meant to prepare tmview for going with your systems \TeX-setup. While the defaults work fine on my system, you may have to pass suitable values. Defaults are set at compiletime. On your system, they may differ from the below examples. Anyway, compiletime defaults will be overwritten by defaults from a system startup-file, which in turn are overwritten by a user startup-file. See \verb+-s+ for keeping your defaults in a startup-file. \begin{itemize} \def\tem#1{\item[\verb+#1+]} \tem{-?} (Help command-line-options)\\ List all command-line-options and their defaults, after reading startup-files, if any. This also reports the actual names of system and user startup-files. See \verb+-s+. \tem{-h} (Horizontal-offset)\\ A lot of printer drivers do a horizontal offset of 1 inch. If yours does as well, you should use \verb+-h25.4+. The length following \verb+-h+ must be given in mm. Default: \verb+25.4+ \tem{-v} (Vertical-offset)\\ A lot of printer drivers do a vertical offset of 1 inch. If yours does as well, you should use \verb+-v25.4+. The length following \verb+-v+ must be given in mm. Default: \verb+25.4+ \tem{-p} (Paper-size)\\ Tells tmview width and height of the paper you are using. The width is given first and both width and height are given in mm. Width and height are separated by an \verb+x+. Default: \verb+210.0x297.0+ (German DIN A4) \tem{-r} (Resolution)\\ Tells tmview what kind of \verb+.pk+-files to use. The horizontal resolution is given first and both horizontal and vertical resolution are given in dpi (dots per inch). The two values are separated by an \verb+x+. Saying \verb+-r600x600+ means tmview will use fonts which were generated for a 600-dpi-printer. As tmview assumes that pixels on the screen are square, different values for horizontal and vertical resolution will result in a distorted image. Always make sure the desired \verb+.pk+-files are available. The chosen resolution determines the (maximum) size of the representation (comp. \key{+} below). Default: \verb+300x300+ \tem{-f} (Font-path)\\ A list of paths telling tmview where to look for the \verb+.pk+-files. The items in this list have to be separated by '\verb+:+'. The given list is executed from left to right. If an item ends with \verb+//+ all subdirectories will be scanned too. This is programmed in a very odd way, so it takes a lot of time. You should place such items at the end of the list. Default: \verb+./:/usr/lib/texmf/fonts//+ \tem{-n} (Name-of-the-font-file)\\ If your \verb+.dvi+file tells tmview to use a font called \verb+thisnthatfont+ and tmview was told to use a resolution of \verb"123" dpi, tmview has to know how the desired file is named. In the string following \verb+-n+ the following replacements are made: \smallbreak \begin{tabular}{@{\unskip}ll} \hskip0pt plus 1filxxx & \hskip5em replaced by\\[.5ex] \verb+@N+ & thisnthatfont\\ \verb+@K+ & thisntha (this is \verb+@R+ reduced to 8 characters (MS-DOG !))\\ \verb+@M+ & 123 (the resolution)\\ \verb+@R+ & 615 (this is \verb+@M+$*5$, intended for magnified 200 dpi fonts used instead of 300 dpi fonts)\\ \end{tabular} \smallbreak Default: \verb+@N.@Mpk+ \tem{-t} (Tfm-path)\\ A list of paths telling tmview where to look for the \verb+.tfm+-files. The items in this list have to be separated by '\verb+:+'. The given list is executed from left to right. \verb+.tfm+-files are used, when tmview can't find a fonts \verb+.pk+-file. In that case boxes are drawn instead of the glyphs. Default: \verb+./:usr/lib/texmf/fonts//+ \tem{-q} (Vf-path)\\ A list of paths telling tmview where to look for the \verb+vf+-files. If anything goes wrong with \verb+vf+-files, use dvicopy to replace them by ordinary dvi-code. Nomenclature of the list is as above. Default: \verb+./:usr/lib/texmf/fonts//+ \tem{-d} (Display)\\ Tells tmview the desired size of your display. The width is given first and both width and height are given in pixels. Width and height are separated by an \verb+x+. Using linux/svgalib you may choose a resolution supported by your version of svgalib with respect to your hardware. Only 256-color-modes are allowed. That means to get more than 320x240 you must have a supported svga chip-set, standard vga won't do. See {\em Readme\/} on how to run tmview with standard vga. Using linux/framebuffer tmview will take the framebuffer deveice in whatever resolution it is found The \verb+-d+ option is ignored. Again, tmview insists in a 256-color-mode. Using the X Window System \verb+-d+ will suggest the size of the tmview window. However, you may alternatively use the resource \verb+DviLX.geometry+ or the standard geometry option \verb/-geometry wxh+x+y/. Tmview will accept almost any color-mode when running with the X Window System. Defaults: (linux/svgalib only) look for the value of \verb+$GSVGAMODE+ if set, otherwise try \verb+640x480+. \tem{-m} (Magnification)\\ If you want to magnify by a factor $n$ you have to specify $n*1000$ as an argument to \verb+-m+, e.g. \verb+-m2000+ means all lengths will be doubled. {\bf Note:} tmview magnifies according to the origin of the dvi-coordinates, which is -- in most cases -- {\em not\/} the upper left corner of the paper. Always make sure the desired \verb+.pk+-files are available. \verb+-m+ doesn't magnify the paper, so if you wish a larger image use \key{+}/\key{-} or the \verb+-r+ option. Default: get magnification from \verb+.dvi+-file. \tem{-k} (Kannot-print-any-further)\\ Most printers stop printing if they are too close at the papers edge (some might even do strange things). The \verb+-k+ option describes the printable area, e.g. saying \verb+-k1.0,2.0,3.0,4.0+ means that your printer can print as close as\\ 1 mm to the left\\ 2 mm to the right\\ 3 mm to the upper\\ 4 mm to the lower\\ edge of the paper. These values are used to draw a frame indicating the printable area (comp. \key{p} below). When searching textstrings, any text outside the printable area is ignored. All four values have to be given and they have to be separated by '\verb+,+'. All lengths are given in mm. Default: \verb+4.0,4.0,4.0,12.0+ \tem{-s} (user startup-file)\\ The default values for the above options are read from a system startup-file, typically \verb+/etc/dvisvga+. After this a user startup-file is read. The latter can be specified directly after the -s. When you specify \verb*+-s +, i.e.\ give {\em no\/} argument to \verb+-s+, {\em no\/} startup-file is loaded. When quitting tmview, the current options, the list of visited \verb+.dvi+-files (see bookmarks below) and lots of other interna are written to the user startup-file. If this is not desired, the startup-file has to be set read-only !! Both startup-files are read {\em before\/} reading any commandline-options -- this means you can override the defaults from the startup-file. The over all tactic with startup-files can be as follows: (i) figure out suitable options of interest for all users, e.g.\ font-paths and paper-size; (ii) copy the user startup-file generated by tmview to the system startup-file; (iii) any user may now run tmview without any options, visit often used \verb+.dvi+files, set within these desired manual-bookmarks and get that information saved all to the user startup-file; (iv) then set the user startup-file read-only and/or copy it somewhere save. See also {\em editing the startup-file\/} below. Default: \verb+~/.dvisvga+ \end{itemize} \section[Viewing a .dvi-file]{Using tmview -- Viewing a \verb+.dvi+-file} \begin{table}[t] \centerline{\bf commands of tmview} \fha{keylist}{}% \vskip2ex \begin{tabular}{lp{10cm}} \key{?} & give a short description of the following command\\ \key{?}\,\key{?} & give a list of all commands\\ \keys{PgUp}, \keys{PgDn}& select a page relative to the current page\\ %\key{\fhr{goto}{g}} & select a page w.r.t.\ \TeX-counters\\ \key{g} & select a page w.r.t.\ \TeX-counters\\ %\key{\fhr{left}{$\leftarrow$}}, \key{$\rightarrow$}, \key{$\leftarrow$}, \key{$\rightarrow$}, \key{$\uparrow$}, \key{$\downarrow$} & scroll the visible area\\ \key{f}, \key{c}& make scrolling finer/coarser\\ \key{z} & center visible area\\ \key{$+$}, \key{$-$} & zoom in/out\\ \key{v} & set zoom-factor\\ \key{b} & set a bookmark\\ \key{w} & move to a bookmark\\ \key{\bf\^{}} & move back\\ \key{o} & display options (e.g.\ greyscaling, eps-rendering)\\ \key{x} & toggle statusline-information\\ \key{t} & set unit of measurement\\ \key{l} & show/hide screenmark and pagemark\\ \key{y} & set pagemark at the position of screenmark\\ \key{a} & how/hide marked rectangle\\ \key{p} & show/hide printable area\\ \key{e} & set page-offset and -size\\ \key{\fhr{half-hyper}{k}} & show/hide half-hyper-tex-mark\\ %\key{k} \keys{TAB} & move to next href\\ %\keys{RET} & follow current href\\ \keys{$\hookleftarrow$} & follow current href\\ \key{s} & search for text\\ \key{r} & re-read \verb+.dvi+file and re-draw screen\\ \key{d} & load/kill \verb+.dvi+file\\ \key{q} & quit tmview\\ \end{tabular} \end{table} When everything is set up to suit your needs, visiting a \verb+.dvi+file simply means to navigate the visible area through the files using the cursor-keys. A great variety of commands is available, including commands for loading files, changing the paper-size or setting marks. The table shows all available commands. Commands are invoked by single key-strokes e.g.\ \key{q} quits tmview. For the sake of information there is a more secure way of invoking a command: If you insert \key{?} before hitting another key the status-line will give a short description of the command which includes information about the commands arguments. Now there are two possibilities: Hit \keys{$\hookleftarrow$} (perhaps after inserting arguments) to execute the command or \keys{ESC} to cancel. Besides \key{?} there is another way of invoking commands this way: Just insert the appropriate uppercase letter. This leads to a convenient way of getting accustomed to tmview, the {\em tutorial-mode\/}. Do caps-lock right after tmview has started: from now on nothing happens without your explicit confirmation. \subsection{Arguments} Some of the commands in table 1 take numerical arguments. Arguments are always {\em optional\/}. They have to be entered {\em before\/} calling the command. Multiple arguments are separated by '\verb+,+' or '\verb+;+'. If you {\em are\/} giving arguments to a command, give {\em all\/} arguments, if you don't give enough, the command will behave as if {\em none\/} had been given. After inserting the arguments just call the command, no Return or whatever is required (as a matter of fact \keys{$\hookleftarrow$} even destroys your arguments). If you give arguments to a command that doesn't want them, the arguments are simply discarded -- no error. If no argument is given, a default is used. If an argument is passed, it serves as the default for future invocations of this command. Commands doing similar things share the same default arguments. {\bf Example:} typing {\tt 10}\,\key{$\leftarrow$} results in scrolling 10\% to the left. Thus typing \key{$\rightarrow$} afterwards scrolls 10\% to the right and \key{$\uparrow$} scrolls 10\% upwards. \subsubsection{{\tt *} -- the magic argument} As a special argument most of the commands accept the so-called {\em magic argument\/} \verb+*+. It is used either to modify the behaviour of the command in some way or to get the arguments from somewhere else (e.g.\ from the command-line or even the startup-file). To get an understanding of the {\em magic argument\/} consider the following examples: \begin{itemize} \item[\key{p}] draws a rectangle showing the {\em printable area\/}. It takes four arguments stating where your printer will refuse to print any closer to the paper's edges. If \verb+*+ is given as an argument (one '\verb+*+' {\bf not} four), the according numbers are taken from the startup-file. \item[\key{w}] moves through one of two rings of bookmarks: the ring of file-bookmarks or the ring of manual-bookmarks. If \key{w} receives the {\em magic argument\/} the other ring is chosen, no movement is performed. The status-line will say 'SET TO MANUAL-BOOKMARKS' if the current ring {\em was\/} the file-bookmark-ring (and is {\em now\/} the manual-bookmark-ring). So in this case \verb+*+ acts as a kind of flag argument. \end{itemize} \subsection{The detailed command list} %\subsubsection*{Selecting the page} \subsubsection*{Moving through the document} \kitem{\keys{PgUp}, \keys{PgDn} Select a page relative to the current page} \keys{PgUp} moves towards the beginning of the \verb+.dvi+file, while \keys{PgDn} moves towards the end. A single argument $n$ specifies the number of pages to move. However, $n$ will NOT become the default value. The argument is (*), the page-moving-mode is toggled. See above. If the argument is \verb+*+, the page-moving-mode is toggled (no movement). The two possible modi are: \begin{enumerate} \item Keep the visible area where it is. \item Perform a centering (horizontal {\em and\/} vertical) -- just like calling \key{z}\,\key{z} -- after reaching the new page. \end{enumerate} The second modus comes in quite handy when you want to read the \verb+.dvi+file rather than to check it. After a \keys{PgDn} the top of the page will always be visible -- at least if the centered point is set up appropriately, see \key{z} below. {\bf Example:} \verb+1+\,\keys{PgUp} selects the previous page \keys{PgDn} selects the next page %\kitem{\key{\fha{goto}g} Select a page with respect to \TeX counters} \kitem{\key{g} Select a page with respect to \TeX counters} A list of ten arguments ($c_0$, $c_1$, \dots $c_9$) specifies the page to be selected. tmview will jump to the first page with a value of $c_i$ in \verb+\count+$i$ ($i=0,\dots9$), \verb+*+ may be used as a wildcard. If there are more than one but less than ten arguments given, the others will be taken as \verb+*+. {\bf Example:} \verb+26+\,\key{g} selects the first page with a value of 26 in \verb+\count0+. %\subsection{Moving around on the current page} %\kitem{\fha{left}{}\key{$\uparrow$}, \key{$\downarrow$}, \key{$\leftarrow$}, \kitem{\key{$\uparrow$}, \key{$\downarrow$}, \key{$\leftarrow$}, \key{$\rightarrow$} Scrolling the visible area} A single argument $p$ may be used to specify the amount of scrolling in percent of the screen-width. \key{$\uparrow$} \key{$\downarrow$} both accept the argument \verb+*+ to toggle between: 1.~stay on the current page; 2.~scroll over pages. When scrolling over pages, you may view the whole document while using only the single key \key{$\downarrow$}. {\bf Example:} \verb+20+\,\key{$\leftarrow$} scrolls $1/5$ to the left. %\kitem{\fha{finer}{\key{f}}, \key{c} Make scrolling finer/coarser} \kitem{\key{f}, \key{c} Make scrolling finer/coarser} These commands change the default argument for the above scrolling commands. So \key{f} and \key{c} don't move the visible area at all, but they change the way the scrolling-commands act. \subsubsection*{replacements for the cursor keys} If your terminal sends strange escape sequences when you hit a cursor key, you don't need to worry: tmview supports keys to replace the cursor keys. These are: \key{i} to replace \keys{PgUp}, \key{m} for \keys{PgDn}, \key{u} for \key{$\uparrow$}, \key{n} for \key{$\downarrow$}, \key{h} for \key{$\leftarrow$} and \key{j} for \key{$\rightarrow$}. $$\begin{tabular}{ccc@{\hspace{10em}}ccc} & \dots & & & \dots & \\ & \key{$\uparrow$}\,\keys{PgUp}& & & \key{u}\,\key{i} & \\[-.5ex] \dots & \key{$\leftarrow$}\,\key{$\rightarrow$}\,\hphantom{\keys{PgUp}}&\dots& \dots & \key{h}\,\key{j}\,\hphantom{\key{x}} & \dots\\[-.5ex] & \key{$\downarrow$}\,\keys{PgDn} & & & \key{n}\,\key{m} & \\ &\dots& & &\dots& \\ \end{tabular}$$ \kitem{\key{z} Center the visible area} Without any argument \key{z} centers horizontally only, while \key{z}\,\key{z} centers in both directions. When two arguments $x$, $y$ are given, they describe the point on the page, which will become the middle of the visible area. When the argument \verb+*+ is given, the current position is taken as the centre. When the screenmark is shown (see below \key{l}), and the argument \verb+*+ is given, the position of the screenmark becomes the center. This moves the visible area, but it does not move the screenmark. %\subsection{Zooming} \kitem{\key{v} Set the zoom-factor} This command requires one argument $f$ which must be between 0.1 and 2. $f$ will become the zoom-factor and the visible-area will be redrawn. Use \verb+*+\,\key{v} to adjust the zoom-factor such that the page horizontaly fits the visible-area. If the zoom-factor is 1, the pixels found in the \verb+.pk+-files are just copied one by one to the screen. Since the resolution of our days screens seems to be less than that of our days printers, and since you probably still want to use the same \verb+.pk+-files for printing and viewing, $f=1$ usually results in a positive magnification. So when you're just reading some text in some \verb+.dvi+file the best value for $f$ is something like 0.3, depending on the involved resolutions. When the screenmark is visible (see \key{l}) the position of the screenmark is taken as the origin of zooming, i.e. it is fixed. When the screenmark is not visible, the middle of the screen is fixed. The current zoom-factor is displayed in the {\em second} statusline, see \key{x}. There are two zooming modi. The integer modus requieres $1/f$ to be an integer. This modus is quite fast, so good values are $f=1.0$, 0.5, 0.333, 0.25, 0.2, 0.167 etc. The good thing about the slower modus is, that it allows you to choose the zoom-factor arbitrarily (between 0.1 and 2). So poor students with small screens might find some optimum to make the text fit on the screen still being readable. The bad thing about the slow modus is that it is slow. But since glyphs are kept in memory once zoomed, this slowlyness only hurts while viewing the first few pages after changing the zoom-factor. Modus selection is done by the display options \key{o}. \kitem{\key{$+$}, \key{$-$} Zoom in/out} Increase/decrease the zoom-factor. When in the integer modus, step through the fast values only (see above). When an argument $p$ is given, it is taken as the amount of increasing/decreasing in percent of the current zoom-factor. This is likely to result in slow modus. \subsubsection*{Bookmarks} A bookmark remembers what is seen on the screen. That is the \verb+.dvi+file, the page within that file, the position of the visible area and the zoom-factor. There are three kinds of bookmarks: {\bf back-bookmarks:} When searching a text-string, following a href or moving to a bookmark, the position within the \verb+.dvi+file might be changed to somewhere far far away. To allow returning from such excursions easily , a back-bookmark will be generated automaticly. To prevent getting fed up with thousands of back-bookmarks, the total number of these is limited. See \key{\bf\^{}} below. {\bf file-bookmarks:} Each file visited has one (and {\em only\/} one) file-bookmark, containing the information mentioned above, plus some information on the file, that is the paper-offset and -position, the location of the printable-area. File-bookmarks are generated automaticly. This results in easy re-visiting a \verb+.dvi+file: you'll find it as left. A file-bookmark is removed by killing the \verb+.dvi+file with \key{d}\,\key{k}, see \key{d} below. {\bf manual-bookmarks:} After all you may install your own bookmarks, marking often visited places, say in some manuals. manual-bookmarks are named by a number. This number has to be unique within the \verb+.dvi+file they belong to. To define a manual-bookmark use \key{b}. Since manual-bookmarks belong to the \verb+.dvi+file they are defined on, they get lost, when that \verb+.dvi+file is killed by \key{d}\,\key{k}. All kinds of bookmarks are kept in a ring-buffer. There is a so called current bookmark of each type. Visiting the bookmarks along the ring-buffer is done by \key{w} for file- and manual-bookmarks, while \key{\bf\^{}} acts on back-bookmarks. \kitem{\key{b} Define/undefine manual-bookmark.} When the current position is not already defined as a manual-bookmark, \key{b} defines one. When a single numeric argument $n$ is given, $n$ will be the name of the newly defined bookmark. With no argument, a name will be generated automaticly. See \key{w} below, for how to visit manual-bookmarks. When the current position is already defined as a manual-bookmark, \key{b} undefines that manual-bookmark. \kitem{\key{w} Move to bookmark.} When a single numeric argument $n$ is given, \key{w} moves to the manual-bookmark named $n$, if there is one. Since manual bookmarks are bound to \verb+.dvi+files, the current \verb+.dvi+file will never change in that case. If no argument is given, \key{w} moves the position either through the ring-buffer of file-bookmarks or through the one of manual-bookmarks. When \key{w} is acting on file-bookmarks, it will switch to another \verb+.dvi+file , since every \verb+.dvi+file has got only one file-bookmark. To toggle between these two modi, use the magic argument \verb+*+. \kitem{\key{\bf\^{}} Move back} Move to the latest back-bookmark, if there is one. When a single numeric argument $n$ is given, the $n$ latest back-bookmarks are kept and all the others are discarded. \subsubsection*{Measuring} To allow you to measure distances on the page, there are two marks, the screenmark, which is fixed on the physical screen you're looking at, and the pagemark, which is fixed on the \verb+.dvi+files page. When you move the visible-area, the screenmark acts as drawn with chalk on your monitor. The pagemark acts as drawn on the page. The second statusline tells the position of the pagemark relative to the corner of the sheet of paper you're viewing. It also tells the position of the screenmark relative to the pagemark. To measure distances you first switch this marks on, using \key{l}. When the marks are shown, the scrolling commands don't act on the visible area anymore, but move the screenmark, now only moving the screenmark at the boarder of the screen results in scrolling. To move the pagemark just move the screenmark at the desired position and use \key{y} to make the pagemark follow. \kitem{\key{l} (this is the letter 'ell') Show/hide screenmark and pagemark} This commands takes the two arguments $x,y$. The pagemark is put at position $x,y$ w.r.t. the upper left corner of the page. The Screenmark may be moved with the scrolling-commands. \kitem{\key{y} Set pagemark at the position of the screenmark} \subsubsection*{Rectangles} Besides the marks there are three rectangles for measurement. First there is the boarder of the paper setup by the command-line options \verb+-h+,\verb+-v+ and \verb+-p+. Then there is the printable area, setup with the \verb+-k+ command-line option. Third the so called marked rectangle. \kitem{\key{a} Show/hide marked rectangle} The four arguments $t,l,w,h$ specify the position on the page and the size of the marked rectangle. When no argument is given and pagemark and screenmark are shown, their positions are used as default. When they are hidden, the last position of the marked rectangle is used as default. \kitem{\key{t} Set unit of measurement} Whenever you specify arguments which are to describe a point on the page, this is done w.r.t.\ a unit of measurement, i.e.\ cm, mm, a.s.o. This unit is also used, when the position of a mark is displayed in the statusline. \kitem{\key{p} Show/hide printable area } The four arguments $l,r,t,b$ specify the margins of the printable area with respect to the boarder of the page. When pagemark and screenmark are shown, the argument \verb+*+ sets the printable area to the rectangle described by screenmark and pagemark. When they are hidden, \verb+*+ takes the command-line-options resp. defaults for \verb+-k+. \kitem{\key{e} Set paper-offset and -size} The four arguments $h,v,w,h$ describe the boarder of the page. Have the top-left corner of a sheet of paper in mind. $h,v$ is the offset of the \verb+.dvi+file's origin to this top-left point of the paper. Standard values are $h=v=2.54$cm. $w$ and $h$ are the width and the height of the sheet of paper. The sheet of paper is represented only by a frame on the screen. It does not affect the drawing of the \verb+.dvi+file. When pagemark and screenmark are shown, the argument \verb+*+ sets the boarder of the page to the rectangle described by screenmark and pagemark. When they are hidden, \verb+*+ takes the command-line-options resp. defaults for \verb+-h+,\verb+-v+ and \verb+-p+. \subsubsection*{Half-hyper} \fha{half-hyper}{}% tmview does some of the fancy hyper-tex things. I talk about {\em half\/}-hyper-tex, because tmview only follows links which point to somewhere in the currently visited \verb+.dvi+-file. So there is no connection to the net or so. But you might find it useful (when editing a major project) to view an equation number this-and-that by clicking on this-and-that wherever the text refers to that equation. For information about hyper-tex, related macropackages and fully compatible viewer scan the net \dots \kitem{\key{k} Show/hide half-hyper-mark} \kitem{\keys{TAB} Goto next href} \kitem{\keys{$\hookleftarrow$} Follow current href, if one is present on the current page} The \verb+.dvi+-file you're viewing right now provides two links: one of them is from here to the list of \fhr{keylist}{commands}. So you may press \key{k}, \keys{TAB} and \keys{$\hookleftarrow$} to check this out. Hint: \key{\bf\^{}} moves back. Alternatively \keys{TAB} will bring you to the next href. \subsubsection*{Miscellaneous} \kitem{\key{o} Display options} This command collects a number of general options on how things get on the screen. Use the cursor keys (or \key{u}, \key{n}, \key{h}, \key{h}) to navigate. \\ \emph{Greyscales.} When the zoom-factor is less than 1, the glyphs may be displayed using grey-levels, making them more smooth. This takes some memory, so you are allowed to switch it off. On high-res displays there is no need for greyscaling anyway. \\[0.5\baselineskip] \begin{minipage}{12cm}% \emph{Eps-rendering.} There is limited support for rendering \verb+.eps+-files by running ghostscript. More precisely, tmview implements the \emph{PSFile} special, including all arguments for scaling and rotating. However, the various user level packages for graphics inclusion use that special in rather different ways. Bottom line is that tmview works fine with the \verb+epsfig+-package, including scaling but failing on rotatinng: \verb+\epsfig{file=some.eps, width=7cm}+ is supported by tmview, and so is \verb+\epsfxsize=2cm\epsfbox{some.eps}+. In general, rendering \verb+.eps+-files can be quite slow and memory intensive, so you may turn it off. If rendering is enabled the results are buffered. Hence, if the \verb+.eps+-files are updated by some graphics program, you need to do a \verb+*+\key{r} to force rerendering. To disable certain \verb+.eps+-files individually, abort the rendering process by \keys{ESC}. \end{minipage} \hfill \hbox {\epsfxsize=2cm \epsfbox{tm.ps}}% \\[0.5\baselineskip] \emph{Double-page.} There is some support for viewing two pages beside each other. This will require a reasonable amount of extra memory. You may disable double paged viewing entirely. You may let tmview deceide on basis of the zoom-factor. Or you may permanently enable this feature. \\[0.5\baselineskip] \emph{Zooming.} There is a fast zooming mode allowing only zooming by $1/f$ where $f$ is required to be an integer. And there also is an arbitrary mode to be selected. \\[0.5\baselineskip] \begin{minipage}{12cm}% \emph{Colors.} Tmview performs all its drawings in black color. However, this can be dimmned down to one out of two greylevels. Thus, we end up with some support for the color-specials as generated by the color package: black text within a light grey box should work out fine. The color option allows to adjust the mapping of the continuous range of greylevels to the two actually implemented ones. In the \verb+BLACK+ position everything will be drawn in solid black. In the \verb+WHITE+ position every color different from black will be ignored. However, tmview will fail on fancy rainbow layouts. \end{minipage} \hfil \raisebox{2ex}{% \begin{minipage}{2.5cm}% \begin{flushright} \framebox{\hbox to 0mm {\rule{2.3cm}{0ex}}% \hbox to 0mm {\ Black on white}% \hbox to 2.3cm {\ }}\\[0.5\baselineskip] \framebox{\hbox to 0mm {\Color{.0 .0 .0 .2}{\rule[-.7ex]{2.3cm}{2.7ex}}}% \hbox to 0mm {\Color{.0 .0 .0 .7}{\ Grey on Grey}}% \hbox to 2.3cm {\ }}\\[0.5\baselineskip] \framebox{\hbox to 0mm {\Color{.0 .0 .0 .3}{\rule[-.7ex]{2.3cm}{2.7ex}}}% \hbox to 0mm {\Color{.0 .0 .0 1}{\ Black on grey}}% \hbox to 2.3cm {\ }} \end{flushright} \end{minipage}} \kitem{\key{x} Toggle statusline-information} In the bottom line of your screen tmview will always display a statusline. This statusline is either the {\em standard\/} statusline or the {\em second\/} statusline. While the standard statusline shows you the number of the current page and the arguments you are about to pass to a command, the second one shows additional information for measuring out distances and the current zoom. See below. \key{x} toggles between these two statuslines. \kitem{\key{s} Search for text} You will be asked for the text-string to search for. You may enter a regular expression\footnote{here 'regular expression' means {\em extended\/} regular expression} describing that string, this especially includes just to enter the string as it is. If a search appears to take infinitely long (which might easily happen, if you enter a funny regexp), just hit \keys{ESC}, this stops the search. tmview will take the entire \verb+.dvi+file as one huge text-string and then search for the next substring, matching the regular expression you've entered. Here {\em next\/} is meant with respect to the current page. So far this sounds quite easy, but there are some ugly details, based on the fact, that a \verb+.dvi+file contains information on how to draw a bitmap representing your text. It does not contain information about from what characters in which order your text is made up. Even the PKfiles which are used to draw your text consist only of lots of glyphs but no character-codes, like ASCII or so. Building a huge text-string from a \verb+.dvi+file is some kind of guessing. First: What kind of huge text-string is build from the \verb+.dvi+file? This string will consist of the letters A \dots Z, a \dots z, the accent \verb+"+ and the digits 0 \dots 9. It does {\bf not} contain anything else like whitespaces, linefeeds or hyphens.\\ Whenbeingprinteditwouldlooklikethisnotreadableatall.\\ Taking the \verb+.dvi+file as a huge string allows you to find all locations of a sub-string, say \verb+commandline+, even those that are seperarted by linebreaks (and hyphens) or pagebreaks. In turn, there is no chance to find {\em only\/} those locations, where \verb+commandline+ is separated by a hyphen. To keep tmview from getting confused by headings, there is another rule for building up the huge text-string: any glyph outside the printable area (see \key{p}) is ignored. So you may set up the printable area to ignore headings when searching. Second: How is the huge text-string build up? %To translate the list of glyphs found in the \verb+.dvi+file to a text-string, %the tfm-files are asked for the encoding-scheme. This works with dc-fonts and %cm-fonts, since the following encoding-scheme names are accepted: {\bf ASCII}, %{\bf \TeX text}, {\bf TeX math italic}, {\bf TeX math symbols}, {\bf TeX %typewriter text}, {\bf Extended TeX Font Encoding - Latin}, {\bf Adobe %StandardEncoding}. The alphanumerics A \dots Z, a \dots z, 0 \dots 9 are copied one by one to the huge text-string. Glyphs that look like a simple alphanumeric will be taken as the one they look like. So the \TeX\ input \verb'\c o', producing an \c o, will be represented as a simple 'o' in the text-string. This rule also applies to all kind of ligatures. The \TeX\ input \verb'ffl\AE', producing ffl\AE\ will be represented by f\/f\/lAE. Any accent {\em on top\/} of a glyph will be translated to a \verb+"+, preceding whatever the glyph without that accent would be translated to. The \TeX\ input \verb'\"a' producing the german umlaut \"a, will be found as \verb+"a+ in the generated text-string. The \TeX\ input \verb'\aa' producing the scandinavian \aa\ will be found as \verb+"a+ too. Any other glyphs are ignored. Third: In what does the above result? Visiting english documents, say manuals to some computer related stuff like elisp.dvi, searching for keywords works fine. Searching in documents in which extensive use of accents and funny characters is made works too, but requires some luck and/or experience in how \TeX\ acts on such things. {\bf Example:} Take the file story.tex from the \TeX book, chapter 6, page 24. It contains the line \hglue3em \verb+galaxy called \"O\"o\c c+ The text-string build from the corresponding story.dvi will therefore contain \hglue5em \verb+galaxycalled"O"oc+ %\medbreak \smallbreak So you can search for {\em str\/} getting as result {\em ans\/} \smallbreak\hglue3em \begin{tabular}[t]{@{\unskip\tt}lc} \hskip0pt plus 1fil\rm\em str & \em ans \\[.5ex] %\hline galaxy & found \\ galaxycalled & found \\ galaxy called & not found \\ \verb+d"+ & found \\ galaxy.\verb+*"O"+oc & found \\ Ooc & not found \\ \end{tabular} \kitem{\key{r} Re-read current \verb+.dvi+file and re-draw screen} \key{r} won't re-read the font-files nor rendered eps-figures. Use {\tt *}\,\key{r} to force those to be re-read also. \kitem{\key{d} Load/kill \verb+.dvi+file} After typing \key{d} you may select between \key{l} to load a \verb+.dvi+file and \key{k} to kill a \verb+.dvi+file. Loading a \verb+.dvi+file: tmview will look for a file-bookmark belonging to that file. If there is one, it becomes the current file-bookmark. The \verb+.dvi+file will be shown as left, and any defined manual-bookmarks are accessible by \key{w}. When loading a \verb+.dvi+file for the first time, a new file-bookmark will be created. This will be set up with default values from the command-line options and won't contain any manual-bookmarks. Killing a \verb+.dvi+file: To kill a \verb+.dvi+file means to kill it's file-bookmark and any related manual-bookmark. Killing a \verb+.dvi+file won't hurt the file itself. You don't have to kill a \verb+.dvi+file just to load another one. \kitem{\key{q} Quit tmview } When quitting, a startup-file will be written. When running tmview next time, you will find almost everything as you left it. \section[The startup-file]{Customizing tmview -- The startup-file} The following explains the contents of the startup-file which is used to set up tmview. When the startup-file is not set read-only, tmview writes down a startup-file every time you quit tmview. If no startup-file can be found, a new one will be created. Hence the list of bookmarks resp. visited files will keep growing, as long as you don't explicitly kill them with \key{d}\,\key{k}. Since also command-line options are kept in the startup-file you are not able to reset any nonsense by quitting/restarting tmview (which is not necessary anyway because you can reset everything from inside tmview using the {\em magic argument\/}). If you are trying out funny command-line options which you don't want to creep into your startup-file, just set the startup-file read-only -- or call tmview with \verb*+-s +. Although there are great chances to get a lot of nonsense into your startup-file, there are two good reasons to make tmview remember all the above mentioned information:\footnote{I designed this feature -- no wonder I like it.} 1. You are working on a major \TeX\ project, creating a huge document. This will take some days, and you still turn the system off now and then. You want tmview to remember all the bookmarks you have set in your document, the unusual papersize, the paths to special fonts used nowhere else, a.s.o. Since this kind of information is tied to your document, call tmview with \verb+-sMyDoc.tmv+. So the tmview related settings on that project will be kept in \verb+MyDoc.tmv+ and won't disturb your standard startup-file in \verb+~/.dvisvga+. 2. You are using tmview as a viewer of several manuals. This is similar to the above. Every once in a while you should save the current startup-file, to prevent loosing the valuable information (=bookmarks) by accident. However, as mentioned above, you might one day end up in a somehow ugly large or even corrupted startup-file. The easy way out is to remove the startup-file, call tmview with suitable standard-options and thereby get a new startup-file. In case you want to copy some of the information contained in the old startup-file to the new one, the internal structure of the startup-file will be explained by the following example startup-file: \begin{verbatim} # **** this is an example startupfile of tmview ***** # # # basic rules: # 1. all characters from a '#' to the end of a line are ignored. # 2. spaces, tabs and newlines act as separators. # 3. a symbol starts with a letter, consists of letters and digits, # and ends at the next separator. # 4. a string starts just after a '"' and ends just be-for the next '"'. # exception: to get a string containing a '"' type '""'. # 5. a number starts with '+' '-' '.' or a digit and must look like # numbers look like, i.e. no two '.' and so on. # 6. a value is a list of strings and/or numbers separated by separators. # # The purpose of the startup-file is to set symbols to values. This is done # by typing the symbol followed by a value (separated by ... guess ...) # Therefore a number of valid symbols are defined, each expecting some # kind of value. If a valid symbol is not set in the startup-file, a # default value is used. You may therefore remove any suspect setting from # your startup-file. # most important: the symbol sufp # Set the startupfile. # Setting sufp sets the name of the file # to write startup information when quitting tmview. # Not setting sufp prevents writing a startup-file at all. # Setting sufp to some other file prevents overwriting the current # startup-file, while still saving newly generated bookmarks a.s.o. sufp "/home/thomas/.dvisvga" # now set the commandline-options ... hoff 25.40 # -h(hoff) voff 25.40 # -v(voff) papx 210.00 # -p(papx)x(papy) papy 297.00 xres 300 # -r(xres)x(yres) yres 300 tfmp "./:/usr/lib/texmf/fonts/tfm//:/usr/lib/texmf/fonts//" # -t(tfmp) vffp "./:/usr/lib/texmf/fonts/vf//:/usr/lib/texmf/fonts//" # -q(vf) ffor "@N.@Mpk" # -n(ffor) fntp "./:/usr/lib/texmf/fonts/tmp/pk//:/usr/lib/texmf/fonts//" # -f(fntp) disx 640 # -d(disx)x(disy) disy 480 nmag 0 # -m(nmag) lrnd 4.00 # -k(lrnd);(rrnd);(ornd);(urnd) rrnd 4.00 ornd 4.00 urnd 12.00 #other defaults verb 0 # 'verb 1' makes tmview a bit more verbose lrmu 4.0 # maximal 4Mb of (lru) buffer memory # file-bookmarks and manual-bookmarks # # The symbol fmk starts the definition of a file-bookmark. # It is followed by the name of the file as a string and lots # of other values. Manual-bookmarks, belonging to a file, have to follow # immediately, starting with the symbol bmk. This results in blocks # starting with fmk and ending just before the next fmk, containing # all the information related one DVIfile. # # You may either delete some of the lines starting with bmk to get rid # of those bookmarks. Or you may delete all the lines belonging to one # file-bookmark, including the manual-bookmarks that follow. Be sure # not to leave some of the related manual-bookmarks, when deleting # a file-bookmark. # You may either copy a file-bookmark only, or copy a file-bookmark together # with the related manual-bookmarks from another startup-file. # one block, containing 3 manual-bookmarks fmk "/home/thomas/cc/tmview/asmith.dvi" 210.00 297.00 25.40 25.40 105.00 148.50 4.00 4.00 4.00 12.00 0 1 -7 389 3.000 bmk 3 1 -7 517 3.000 bmk 1 1 -7 261 3.000 bmk 2 1 -7 389 3.000 # another block, not containing manual-bookmarks at all. fmk "/home/thomas/cc/tmview/tmview/dort.dvi" 186.10 276.78 17.19 8.89 186.10 261.37 4.00 4.00 4.00 12.00 0 3 -163 -120 7.000 # end of example startup-file \end{verbatim} \section[Copying]{Copying tmview -- rights and lefts} The code of tmview uses some rather basic ideas stolen from xdvi. This includes some few lines of code just copied. The author of xdvi is Eric Cooper. In a similar kind, tmview's code depends on some lines of dvidjc, written by Wolfgang R. Mueller. The hyper-TeX related parts are taken from xhdvi, written by Arthur Smith. The sources of the above can be found on the CTAN. So by having mentioned the authors here, and giving a reference how to get the original sources, this should not be a violation of their copyrights. As far as I am concerned, tmview may be modified or distributed without any restrictions. tmview is distributed in the hope that it will be useful, but without any warranty. \end{document} tmview/doc/tmview.10100644000175000017500000002037207250444702013626 0ustar tmoortmoor.TH TMVIEW 1 "1 March 2001" .SH NAME tmview, dvisvga, dvifb, dvilx \- view DVI files on SVGA, framebuffer devices or X Window displays .SH SYNOPSIS \fBdvi\fP[\fBsvga\fP|\fBfb\fP|\fBlx\fP] [\fB\-?\fP] [\fB\-h\fP<\fImarg\fP>] [\fB\-v\fP<\fImarg\fP>] [\fB\-p\fP<\fIwidth\fP>\fBx\fP<\fIheight\fP>] [\fB-r\fP<\fBxres\fP>\fBx\fP<\fIyres\fP>] [\fB\-f\fP<\fIpath\fP>] [\fB\-n\fP<\fIname\fP>] [\fB\-t\fP<\fIpath\fP>] [\fB\-q\fP<\fIpath\fP>] [\fB\-d\fP<\fIwidth\fP>\fBx\fP<\fIheight\fP>] [\fB\-m\fP<\fImag\fP>] [\fB\-k\fP<\fIleftmarg\fP>\fI,\fP<\fIrightmarg\fP>\fI,\fP<\fIuppermarg\fP>\fI,\fP<\fIlowermarg\fP>] [\fB\-s\fP<\fIstartup-file\fP>] [\fBfile\fP[\fB.\fP[\fBdvi\fP]] .SH DESCRIPTION \fBtmview\fP is a screen-previewer for \fB.dvi\fP-files generated by \fBTeX\fP. It lets you see what your printed output will look like. You can choose between a black-and-white representation and greyscaling. You can choose an arbitrary zoomfactor. You can set marks to measure distances. You can search for textstrings. \fBtmview\fP does not support \fBpxl\fP-files since I think they are prehistoric. \fBtmview\fP ignores almost all special-commands, sorry lads. There is basic support for .vf-files. If there occur any problems with this, use \fBdvicopy\fP to get a .vf-free .dvi-file. \fBtmview\fP tries its best with included .eps-figures. \fBdvisvga\fP is a version of \fBtmview\fP based on \fBsvgalib\fP for use with (s)vga equipment. \fBdvifb\fP is a version of \fBtmview\fP writing on the "/dev/fb0" framebuffer devive. \fBdvilx\fP goes with the \fBX\fP Window System. Try \fBdvisvga\fP/\fBdvifb\fP/\fBdvilx\fP \fB-?\fP to get a complete list of command-line options and their default-values. .SS ONLINEHELP Pressing <\fB?\fP> twice shows the onlinehelp and gives a list of available commands. However, you may check the cursor-keys and <\fB+\fP>/<\fB-\fP> first ... or use <\fBq\fP> to quit. .SS IMPORTANT All options have to be followed \fBIMMEDIATELY\fP by their arguments, \fBNO spaces\fP must be inserted !!! .SS OPTIONS .TP \fB-h\fP (\fBhorizontal-offset\fP) A lot of printer drivers do a horizontal offset of 1 inch. If yours does as well, you should use \fB-h25.4\fP. The length following \fB-h\fP must be given in mm. Default: "25.4" .TP \fB-v\fP (\fBvertical-offset\fP) A lot of printer drivers do a vertival offset of 1 inch. If yours does as well, you should use \fB-v25.4\fP. The length following \fB-v\fP must be given in mm. Default: "25.4" .TP \fB-p\fP (\fBPaper-size\fP) Tells \fBtmview\fP width and height of the paper you are using. The width is given first and both width and height are given in mm. Width and height are seperated by an "x". Default: "210.0x297.0" (german DIN A4) .TP \fB-r\fP (\fBResolution\fP) Tells \fBtmview\fP what kind of pk-files to use. The horizontal resolution is given first and both horizontal and vertical resolution are given in dpi (dots per inch). The two values are seperated by an "x". Saying \fB-r600x600\fP means \fBtmview\fP will use fonts which were generated for a 600-dpi-printer. As \fBtmview\fP assumes that pixels on the screen are square, different values for horizontal and vertical resolution will result in a distorted image. Always make sure the desired pk-files are available. The chosen resolution determines the (maximum) size of the representation. Default: "300x300" .TP \fB-f\fP (\fBFont-path\fP) A list of paths telling \fBtmview\fP where to look for the pk-files. The items in this list have to be seperated by \fB:\fP's. The given list is executed from left to right. If an item ends with \fB//\fP all subdirectories will be scanned too. This is programed in a very odd way, so it takes lots of time. You should place such items at the end of the list. Defaults: "./:/usr/lib/texmf/fonts//". .TP \fB-n\fP (\fBName-of-the-font-file\fP) If your dvi-file tells \fBtmview\fP to use a font called "thisnthatfont" and \fBtmview\fP was told to use a resolution of "123" dpi, \fBtmview\fP has to know how the desired file is named. In the string following "-n" the following replacements are made: .PP .PD 0 xx replaced by .PP @N thisnthatfont .PP @K thisntha .PP (this is @N reduced to 8 char. (MS-DOG !)) .PP @M 123 .PP (the resolution) .PP @R 615 .PP (this is @M*5, intended for magnified 200 .PP dpi fonts used instead of 300 dpi fonts) .PD 1 .TP Defaults: "@N.@Mpk" .TP \fB-t\fP (\fBtfm-path\fP) A list of paths telling \fBtmview\fP where to look for the tfm-files. The items in this list have to be separated by \fB:\fP's. The given list is executed from left to right. tfm-files are used, to figure out the encoding. Therefore they are essential for searching text to work. Defaults: "./:usr/lib/texmf/fonts//". .TP \fB-q\fP (\fBvf-path\fP) A list of paths where to look for vf-files. Defaults: "./:usr/lib/texmf/fonts//". .TP \fB-d\fP (\fBDisplay\fP) Size desired resolution of your display (\fBdvisvga\fP). The width is given first and both width and height are given in pixels. Width and height are seperated by an "x". Using svgalib you may choose a resulution supported by your version with respect to your hardware. \fBdvisvga\fP prefers 256-color-modes. Hence, to get more than 320x200 an super vga chipset supported by svgalib is required, standard vga wont do. If the desired resolution is not available, \fBdvisvga\fP falls back to 640x480 at 256 colors, then to 640x480 at 16 colors. The framebuffer version \fBdvifb\fP ignores this option. Use the program \fBfbset\fP to set up the framebuffer device before starting tmview. Using the X Window System (\fBdvisvga\fP) \verb+-d+ will suggest the size of the tmview window. However, you may alternatively use the resource \verb+DviLX.geometry+ or the standard geometry option \verb*-geometry widthxheigth+x+y*. Defaults: (dvisvga) "640x480" .TP \fB-m\fP (\fBmagnification\fP) If you want to magnify by a factor n you have to specify n*1000 as an argument to \fB-m\fP, e.g. \fB-m2000\fP means all lengths will be doubled. \fBNOTE: tmview\fP magnifies according to the origin of the dvi-coordinates, which is -in most cases- NOT the upper left corner of the paper. Always make sure the desired pk-files are available. \fB-m\fP doesn't magnify the paper, so if you wish a larger image use the \fB+\fP and \fB-\fP keys or the \fB-r\fP option. Default: get magnification from dvi-file. .TP \fB-k\fP (\fBkannot-print-any-further\fP) Most printers stop printing if they are too close at the papers edge (some might even do strange things). The \fB-k\fP option describes the printable area, e.g. saying \fB-k1.0,2.0,3.0,4.0\fP means that your printer can print as close as 1 mm to the left 2 mm to the right 3 mm to the upper 4 mm to the lower edge of the paper. These values are used to draw a frame indicating the printable area. All four values have to be given and they have to be seperated by ",". All lengths are given in mm. Default: "4.0,4.0,4.0,12.0" .TP \fB-s\fP (\fBstartup-file\fP) \fBtmview\fP reads default values for the commandline-options, a list of visited dvi-files and lots of other interna from a system startup-file, typically "/etc/dvisvga", "/etc/dvifb" or "/etc/dvilx". After this a user startup-file is read. The name of the latter can be specified directly after the \fB-s\fP. When quitting \fBtmview\fP, the current options etc. will be saved in the user startup-file. \fBIf this is not desired, the user startup-file has to be set read-only !!\fP However, \fBtmview\fP will never write to the system startup-file. The default the user start-upfile is "~/.dvisvga", "~/.dvifb" or "~/.dvilx". .SH COPYING The code of \fBtmview\fP uses some rather basic ideas stolen from \fBxdvi\fP. This includes some few lines of code just copied. The author of \fBxdvi\fP is \fBEric Cooper\fP. In a similar kind, \fBtmview\fP's code depends on some lines of \fBdvidjc\fP, written by \fBWolfgang R.Mueller\fP. The hyper-TeX related parts are taken from \fBxhdvi\fP, written by \fBArthur Smith\fP. The sources of the above can be found on the \fBCTAN\fP. So by having mentioned the authors here, and giving a reference how to get the original sources, this should not be a violation of their copyrights. As far as I am concerned, \fBtmview\fP may be modified or distributed without any restrictions. \fBtmview\fP is distributed in the hope that it will be useful, but without any warranty. .SH AUTHOR (C)opyright 1995 Thomas Moor (QElis@aol.com) tmview/doc/tm.ps0100644000175000017500000000031007250444702013203 0ustar tmoortmoor%! %%BoundingBox:100 100 145 130 100 100 moveto /Times-Roman findfont 10 scalefont setfont 100 120 moveto (this is no) show 100 110 moveto (text, but) show 100 100 moveto (this is eps) show showpage tmview/lX/0040755000175000017500000000000007250444702012046 5ustar tmoortmoortmview/lX/defssolaris.h0100644000175000017500000002367207250444702014544 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ /* defs for the X11/solaris version of tmview */ /* will be copyed to "src/defs.h" */ /* includes "src/defsgen.h" */ /* essential for I/O primitives and signalhandling: don't use pure posix, use either BSD- or GNU-extensions. */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* *************************************************************************** startup values, commandline default: here only those which tend to be deveice/platform dependant. see "src/defsgen.h" for more options *************************************************************************** */ /* set the default displaysize (option -d) = startup window-size*/ #define VGAXDIM 800 #define VGAYDIM 1000 /* set defaults for the options -t, -f, -g and -n */ #define TFMDIR "./:/opt/texmf/fonts//:/opt/teTeX/texmf/fonts//" #define PKDIR "./:/opt/texmf/fonts//:/opt/teTeX/texmf/fonts//" #define VFDIR "./:/opt/texmf/fonts//:/opt/teTeX/texmf/fonts//" #define PKNAME "@N.@Mpk" /* set defaults for the option -s (startupfile)*/ #define STARTUPFILENAME "~/.dvilx" /* fallback systemwide startupfile */ #define SYSTEMSTARTUPFILENAME "/etc/dvilx" /* Users kept asking about using kpathsea ... so: */ /* to use kpathsea, define KPATHSEA below. to use tmviews built in */ /* font searching, don't define KPATHSEA. */ /* since I'm not distributing KPATHSEA, you'll have to get the library*/ /* from somewhere. See CTAN. I did test with the library found in */ /* teTeX-src-0.4/kpse-2.6. Note: using a kpathsea different from the */ /* one of the rest of your TeX-installation makes not much sense. E.g.*/ /* teTeX users best use the kpathsea from the teTeX sources. After all*/ /* configuring tmview to go with kpathsea requires some knowhow ... */ /* */ /* I've located two different kinds of initializing kpathsea, */ /* depending on which kpathsea is used (actually I've got this info */ /* from the diff-file of debian/slink) Below exactly one of */ /* KPATHSEAOLDSTYLE and KPATHSEANEWSTYLE need to be defined to set up */ /* tmview to go with your kpathsea. To figure out the right choice, */ /* visit your /usr//include/kpathsea/proginit.h: if it defines the */ /* function kpse_init_prog to have 5 arguments by "P5H", then its */ /* KPATHSEAOLDSTYLE. Probably, you will go into details and check the */ /* meaning of these arguments. See also "./tmview/src/tmview.c". */ /* However, if kpse_init_prog is defined to have 4 arguments ("P4H"),*/ /* its KPATHSEANEWSTYLE. On Solaris, I've only testet with the above */ /* teTeX, ant this was KPATHSEAOLDSTYLE. */ /* */ /*#define KPATHSEA*/ #ifdef KPATHSEA #define KPATHMODE NULL /* put f.e. "cx" here, to consist on cx fonts */ #define KPATHMAKE 1 /* put 0 here, to disable running MakeTeXPK */ #define KPATHDEFF "cmr10" /* fallback font */ /*#define KPATHSEANEWSTYLE *//* be prepared to meet this */ #define KPATHSEAOLDSTYLE /* old=fine for my teTeX 0.4 */ #endif /* for eps-figures by calling ghostscript */ #define LETSTRYGS /* disable gs as startup-default. user may enable rendering by command */ /*#define GSDEFOFF */ /*#define GSBIN "/usr/local/bin/gs" *//* absolute path of binary */ #define GSBIN "gs" /* name of binary, use $PATH to locate it */ /* extra pixel to avoid clipping .. */ #define GSEXTRAPXL 3 /* plus 3 pxl on screen */ #define GSEXTRAPT 3 /* plus 3 1/72 in epsfile */ /* greyscaling for eps-files */ /*#define GSGREY 1 *//* 1x1 pxl <> turned off */ /*#define GSGREY 2 *//* 2x2 pxl <> cheap */ #define GSGREY 4 /* 4x4 pxl <> expensive */ /* bufferlength for reading from gs */ #define GSBLOCKLEN 8192L /* arguments for calling gs */ #define GSARGLEN 40 /* max length og args */ #define GSARG0 "gs" #define GSARG1 "-sDEVICE=bit" #define GSARG2 "-sOutputFile=-" #define GSARG3 "-dNOPAUSE" #define GSARG4 "-dSAFER" #define GSARG5 "-q" #define GSARGPATH "-I%s" #define GSARGSIZE "-g%dx%d" #define GSARGRES "-r%.2fx%.2f" #define GSARGLAST "-" #define GSCODEINTRO " /SDict 200 dict def SDict begin /showpage { } def " #define GSCODESCALE " %.5f %.5f scale " #define GSCODETRANS " %.2f %.2f translate " #define GSCODEROTATE " %.2f rotate " #define GSCODEFILE " (%s) run " #define GSCODEQUIT " end showpage quit " /* a little support for color specials */ #define LETSTRYCOLOR /* *************************************************************************** more internal stuff, make tmview go with Xlib *************************************************************************** */ /* be careful with storge types !!! */ #define BMLONG32 /* for architectures where "long int" has 32bits, e.g. i386 */ /* #define BMLONG64 *//* for architectures where "long int" has 64bits, e.g. alpha */ /* #define GREYINBMU *//* waste memory. may be a bit faster */ #define COLORS_PER_GREY 16 /* 2^BITS_PER_GREY, no MECK-like things in lX */ /* if DOSFILES is defined, a dosfilesystem is expected, */ /* incl. ugly naming conventions, like drive-letters and "\" instead ob "/". */ /* Dont use this with unix sytems */ /* #define DOSFILES */ /* yes, gnu does support the gnu-extensions to getcwd() ..*/ /* #define GNU_GETCWD */ /* waiting for IO available: dont do polling */ #define VGAHASWAITIO #define HASMOUSE /* do this to have a little mousesoupport */ #define HASWINDOWS /* X is a window system (tmview not!)*/ /* the following sets the way things go on the screen resp. window. tmview allways keeps the screen/windows contents in an internal buffer. You must define exactly one of the below options. To prohibit flickering, you may define NOTHINGONSCREEN, making tmview updating the screen from the buffer when the drawings are compleeted. On some Systems this will result in the best performance, depending on the screen driver. Set ALLONSCREEN, to make tmview drawing allways directly to the screen/window. This might result in higher performance, at the cost of some flickering. Set CURSORSNOTONSCREEEN to get a mixture of the above: when only cursormovement is to be drawn, use the buffer. If more than that is to be drawn, dont use the buffer. Set SCROLLONSCREEN to get a mixture of the above: when scrolling is to be done, use an XRequest directly. Anything else is done in the buffer. */ #define ALLONSCREEN 0 #define NOTHINGONSCREEN 0 #define CURSORSNOTONSCREEN 1 #define SCROLLONSCREEN 0 /* *************************************************************************** now there will be some colorstuff. colors are changable here: with care! *************************************************************************** */ /* definition of colors as bytes in the internal buffer */ /* since they eventually are translated, keep the number small */ /* to change colors, edit the palette entries below */ #define WHITECOL 0 #define BLACKCOL (COLORS_PER_GREY)-1 #define FRAMECOL (COLORS_PER_GREY) /* dark red */ #define BORDERCOL (COLORS_PER_GREY)+1 /* dark green */ #define TFMCOL (COLORS_PER_GREY)+2 /* dark blue */ #define RECTCOL (COLORS_PER_GREY)+2 #define BACKCOLS (COLORS_PER_GREY)+3 /* dummy */ #define MARKDCOL (COLORS_PER_GREY)+4 /* light red */ #define MARKHCOL (COLORS_PER_GREY)+5 /* light green */ #define FOUNDCOL (COLORS_PER_GREY)+5 #define MARKSCOL (COLORS_PER_GREY)+6 /* light blue */ #define HREFCOL (COLORS_PER_GREY)+6 #define MIXEDCOL (COLORS_PER_GREY)+7 /* light grey */ #define TEXTFCOL (COLORS_PER_GREY)+8 /* text foreground */ #define TEXTBCOL (COLORS_PER_GREY)+9 /* text background */ #define NUMBER_OF_COLORS (COLORS_PER_GREY)+10 /*number of colors */ /* definition of some rgb triples, 16-bit-per-componente */ /* in fact beside of greyscales no other colors are used. */ /* to make green more blue, edit here. */ /* if you have a grey-scale-only display, set dark colors */ /* to dark grey and light colors to light grey. */ /* Note: Textcolors are fetched from resources. */ #define PALWHITE 65535,65535,65535 /* white */ #define PALLGREY 56448,56448,56448 /* light grey */ #define PALBLACK 0,0,0 /* black */ #define PALDRED 41088,10368,5248 /* dark red */ #define PALDGREEN 0,41088,10368 /* dark green */ #define PALDBLUE 3200,10368,41088 /* dark blue */ #define PALLRED 65535,51328,44118 /* light red */ #define PALLGREEN 41088,65535,51328 /* light green */ #define PALLBLUE 44118,51328,65535 /* light blue */ /* If we cannot allocate the colors we want, we should fall back */ /* to cheap black and white style. This usually happens if we have */ /* a pseudocolor display and e.g. netscape has stolen all the */ /* colortable. The below gives the margin within tmview will accept*/ /* slightly detuned colors befor falling back to black and white. */ #define COLORMARGIN 0.1 /* float between 0. and 1. */ /* *************************************************************************** include general topics *************************************************************************** */ #include "defsgen.h" tmview/lX/DviLX0100644000175000017500000000035407250444702012756 0ustar tmoortmoor! The App-defaults file for dvilx. DviLX.geometry: 783x573+5+5 DviLX.foreground: black DviLX.background: OldLace DviLX.sforeground: tomato4 DviLX.sbackground: OldLace DviLX.sfont: -b&h-lucidatypewriter-medium-*-*-*-14-*-*-*-*-*-*-* tmview/lX/defslx.h0100644000175000017500000002352307250444702013506 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ /* defs for the X11/linux version of tmview */ /* will be copyed to "src/defs.h" */ /* includes "src/defsgen.h" */ /* essential for I/O primitives and signalhandling: don't use pure posix, use either BSD- or GNU-extensions. */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include /* *************************************************************************** startup values, commandline default: here only those which tend to be deveice/platform dependant. see "src/defsgen.h" for more options *************************************************************************** */ /* set the default displaysize (option -d) = startup window-size*/ #define VGAXDIM 500 #define VGAYDIM 600 /* set defaults for the options -t, -f -g, and -n */ #define TFMDIR "./:/usr/lib/texmf/fonts//:/usr/local/teTeX/texmf/fonts//" #define PKDIR "./:/usr/lib/texmf/fonts//:/usr/local/teTeX/texmf/fonts//" #define VFDIR "./:/usr/lib/texmf/fonts//:/usr/local/teTeX/texmf/fonts//" #define PKNAME "@N.@Mpk" /* set defaults for the option -s (startupfile)*/ #define STARTUPFILENAME "~/.dvilx" /* fallback systemwide startupfile */ #define SYSTEMSTARTUPFILENAME "/etc/dvilx" /* Users kept asking about using kpathsea ... so: */ /* to use kpathsea, define KPATHSEA below. to use tmviews built in */ /* font searching, don't define KPATHSEA. */ /* since I'm not distributing KPATHSEA, you'll have to get the library*/ /* from somewhere. See CTAN. I did test with the library which comes */ /* with dviljk-2.5. Note: it makes not much sense to use a kpathsea */ /* different from the one of the rest of your TeX-installation. E.g. */ /* teTeX users best use the kpathsea from the teTeX sources. After all*/ /* configuring tmview to go with kpathsea requires some knowhow ... */ /* */ /* I've located two different kinds of initializing kpathsea, */ /* depending on which kpathsea is used (actually I've got this info */ /* from the diff-file of debian/slink) Below exactly one of */ /* KPATHSEAOLDSTYLE and KPATHSEANEWSTYLE need to be defined to set up */ /* tmview to go with your kpathsea. To figure out the right choice, */ /* visit your /usr//include/kpathsea/proginit.h: if it defines the */ /* function kpse_init_prog to have 5 arguments by "P5H", then its */ /* KPATHSEAOLDSTYLE. Probably, you will go into details and check the */ /* meaning of these arguments. See also "./tmview/src/tmview.c". */ /* However, if kpse_init_prog is defined to have 4 arguments ("P4H"),*/ /* its KPATHSEANEWSTYLE. */ /* */ /* #define KPATHSEA */ #ifdef KPATHSEA #define KPATHMODE NULL /* put f.e. "cx" here, to consist on cx fonts */ #define KPATHMAKE 1 /* put 0 here, to disable running MakeTeXPK */ #define KPATHDEFF "cmr10" /* fallback font */ #define KPATHSEANEWSTYLE /* new=fine for teTeX from debian(see above) */ /*#define KPATHSEAOLDSTYLE*//* old=fine for NTeX from Slakware */ #endif /* support for eps-figurs by calling ghostscript */ #define LETSTRYGS /* disable rendering as startup-default. use command to turn on */ /* #define GSDEFOFF */ /*#define GSBIN "/usr/bin/gs" *//* absolute path of binary */ #define GSBIN "gs" /* name of binary, use $PATH to locate it */ /* extra pixel to avoid clipping .. */ #define GSEXTRAPXL 3 /* plus 3 pxl on screen */ #define GSEXTRAPT 3 /* plus 3 1/72 in epsfile */ /* greyscaling for eps-files */ /*#define GSGREY 1 *//* 1x1 pxl <> turned off */ /*#define GSGREY 2 *//* 2x2 pxl <> cheap */ #define GSGREY 4 /* 4x4 pxl <> expensive, but fine */ /* bufferlength for reading from gs */ #define GSBLOCKLEN 8192L /* arguments for calling gs */ #define GSARGLEN 40 /* max length of args and commands */ #define GSARG0 "gs" #define GSARG1 "-sDEVICE=bit" #define GSARG2 "-sOutputFile=-" #define GSARG3 "-dNOPAUSE" #define GSARG4 "-dSAFER" #define GSARG5 "-q" #define GSARGPATH "-I%s" #define GSARGSIZE "-g%dx%d" #define GSARGRES "-r%.2fx%.2f" #define GSARGLAST "-" #define GSCODEINTRO " /SDict 200 dict def SDict begin /showpage { } def " #define GSCODESCALE " %.5f %.5f scale " #define GSCODETRANS " %.2f %.2f translate " #define GSCODEROTATE " %.2f rotate " #define GSCODEFILE " (%s) run " #define GSCODEQUIT " end showpage quit " /* a little support for color specials */ #define LETSTRYCOLOR /* *************************************************************************** more internal stuff, make tmview go with Xlib *************************************************************************** */ /* be careful with storge types !!! */ #define BMLONG32 /* when "long int" has 32bits, e.g. i386 architecture */ /*#define BMLONG64 *//* when "long int" has 64bits, e.g. alpha architecture*/ /*#define GREYINBMU*//* waste memory. may be a bit faster */ #define COLORS_PER_GREY 16 /* 2^BITS_PER_GREY, no MECK-like things in lX */ /* if DOSFILES is defined, a dosfilesystem is expected, */ /* incl. ugly naming conventions, like drive-letters and "\" instead ob "/". */ /* Dont use this with unix sytems */ /* #define DOSFILES */ /* yes, gnu does support the gnu-extensions to getcwd() ..*/ #define GNU_GETCWD /* waiting for IO available: dont do polling */ #define VGAHASWAITIO #define HASMOUSE /* do this to have a little mousesoupport */ #define HASWINDOWS /* X is a window system (tmview not!)*/ /* the following sets the way things go on the screen resp. window. tmview allways keeps the screen/windows contents in an internal buffer. You must define exactly one of the below options. To provide flickering, you may define NOTHINGONSCREEN, making tmview updating the screen from the buffer when the drawings are compleeted. On some Systems this will result in the best performance, depending on the screen driver. Set ALLONSCREEN, to make tmview drawing allways directly to the screen/window. This might result in higher performance, at the cost of some flickering. Set CURSORSNOTONSCREEEN to get a mixture of the above: when only cursormovement is to be drawn, use the buffer. If more than that is to be drawn, dont use the buffer. Set SCROLLONSCREEN to get a mixture of the above: when scrolling is to be done, use an XRequest directly. Anything else is done in the buffer. */ #define ALLONSCREEN 0 #define NOTHINGONSCREEN 0 #define CURSORSNOTONSCREEN 1 #define SCROLLONSCREEN 0 /* *************************************************************************** now there will be some colorstuff. colors are changable here: with care! *************************************************************************** */ /* definition of colors as bytes in the internal buffer */ /* since they eventually are translated, keep the number small */ /* to change colors, edit the palette entries below */ #define WHITECOL 0 #define BLACKCOL (COLORS_PER_GREY)-1 #define FRAMECOL (COLORS_PER_GREY) /* dark red */ #define BORDERCOL (COLORS_PER_GREY)+1 /* dark green */ #define TFMCOL (COLORS_PER_GREY)+2 /* dark blue */ #define RECTCOL (COLORS_PER_GREY)+2 #define BACKCOLS (COLORS_PER_GREY)+3 /* dummy */ #define MARKDCOL (COLORS_PER_GREY)+4 /* light red */ #define MARKHCOL (COLORS_PER_GREY)+5 /* light green */ #define FOUNDCOL (COLORS_PER_GREY)+5 #define MARKSCOL (COLORS_PER_GREY)+6 /* light blue */ #define HREFCOL (COLORS_PER_GREY)+6 #define MIXEDCOL (COLORS_PER_GREY)+7 /* light grey */ #define TEXTFCOL (COLORS_PER_GREY)+8 /* text foreground */ #define TEXTBCOL (COLORS_PER_GREY)+9 /* text background */ #define NUMBER_OF_COLORS (COLORS_PER_GREY)+10 /*number of colors */ /* definition of some rgb triples, 16-bit-per-componente */ /* in fact beside of greyscales no other colors are used. */ /* to make green more blue, edit here. */ /* if you have a grey-scale-only display, set dark colors */ /* to dark grey and light colors to light grey. */ /* Note: Textcolors are fetched from resources. */ #define PALWHITE 65535,65535,65535 /* white */ #define PALLGREY 56448,56448,56448 /* light grey */ #define PALBLACK 0,0,0 /* black */ #define PALDRED 41088,10368,5248 /* dark red */ #define PALDGREEN 0,41088,10368 /* dark green */ #define PALDBLUE 3200,10368,41088 /* dark blue */ #define PALLRED 65535,51328,44118 /* light red */ #define PALLGREEN 41088,65535,51328 /* light green */ #define PALLBLUE 44118,51328,65535 /* light blue */ /* If we cannot allocate the colors we want, we should fall back */ /* to cheap black and white style. This usually happens if we have */ /* a pseudocolor display and e.g. netscape has stolen all the */ /* colortable. The below gives the margin within tmview will accept*/ /* slightly detuned colors befor falling back to black and white. */ #define COLORMARGIN 0.1 /* float between 0. and 1. */ /* *************************************************************************** include general topics *************************************************************************** */ #include "defsgen.h" tmview/lX/writelx.c0100644000175000017500000013027307250444702013713 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ #include "../src/defs.h" #include /* X header files */ #include #include #include #include /* prefered Image format */ /* you may set up tmview for the depth of your display. 8bit, 16bit and 24bit is */ /* tested. Be aware of non-i386 architectures, where a "long int" might not */ /* consist of 4 bytes; e.g. alpha uses 8 bytes. The 8bit version based on "uchar" */ /* should be pretty save ... until they introduce unicode? However, if you use */ /* tmview with a depth not the same as defined here, it will become a bit slow. */ /* 32/24 bit per pixel */ /*#define IUNIT unsigned long #define IBYTES_PER_PIXEL 4 #define IBITS_PER_PIXEL 32 */ /* 16 bit per pixel */ /*#define IUNIT unsigned short #define IBYTES_PER_PIXEL 2 #define IBITS_PER_PIXEL 16 */ /* 8 bit per pixel */ #define IUNIT unsigned char #define IBYTES_PER_PIXEL 1 #define IBITS_PER_PIXEL 8 #define IGET_PIXEL(ptr) (*(ptr)) #define ISET_PIXEL(ptr,c) (*(ptr) = (c)) /*#define DEBUGX *//* watch tmview contacting the XServer */ #include "writelx.h" typedef unsigned long Pixel; /* globals belonging to the X stuff */ static Display *dpy; static int screen; static Window dviwin; static Colormap colormap; static GC imagecopygc, wincopygc, winfillgc; static GC wincleartextgc, wintextgc; static Cursor standardcursor; static char* tfontname; static char* tbackname; static char* tforename; static char* dwhitename; static char* dblackname; static char* geometry; static int geox,geoy,geow,geoh,geodx,geody,geof=0; /* globals belongimg to ma paintings */ static Pixel palette[NUMBER_OF_COLORS]; static XImage *offimage=NULL; static char* offscreen=NULL; static int ibytes_per_line, ibytes_per_pixel; static int ofscx1, ofscy1, ofscx2, ofscy2; static int fontw, fonth, fonts, fonta; static Pixel white, black, dred, dgreen, dblue, lred, lgreen, lblue, lgrey; /* pointer to bitmap functions */ void (*vgaupdate)(int, int, int, int)=NULL; void (*vgasetclip)(int, int, int, int)=NULL; void (*vgadrawrect)(int x, int y, int w, int h, int c)=NULL; void (*vgadrawrector)(int x, int y, int w, int h, int c)=NULL; void (*vgadrawrectbg)(int x, int y, int w, int h, int c)=NULL; void (*vgacopybitmapgs)(int x, int y, int w, int h, void* src, int c)=NULL; void (*vgacopybitmapbw)(int x, int y, int w, int h, void* src, int c)=NULL; /* Function prototypes textdarwing */ void preparefont(void); void closefont(void); /* forward for exposeevent handling */ void myexpose(XEvent *event); void myupdatestatus(int,int,int,int); /* forward for bitmap function select */ void setfix(void); void setvar(void); /* #include "eventlister.c" */ /* this became display dependent. the pxlmem should be accesable by the dvi- encoding part and by the routines that come with the display. */ void free_off(void) { /* freemem(&offscreen); is done by DexstroyImage ? */ if(offimage!=NULL) XDestroyImage(offimage); offimage=NULL; } void alloc_off(void) { long size; int i,j; /*truevgaxdim is divisable by 4 !!! */ free_off(); offimage= XCreateImage(dpy, DefaultVisual(dpy,screen), DefaultDepth(dpy,screen), ZPixmap, 0, NULL, truevgaxdim,truevgaydim, 32, 0); size = MAX((long)offimage->bytes_per_line*truevgaydim,1); allocmem(&offscreen,size); offimage->data=offscreen; ibytes_per_line=offimage->bytes_per_line; ibytes_per_pixel=offimage->depth >> 3; if(ibytes_per_pixel == 3) ibytes_per_pixel =4; if(ibytes_per_pixel != IBYTES_PER_PIXEL) { pfprot("\n warning: display: found %d-bit depth while optimized for %d-bit. Recompile for better performance.\n", offimage->depth, IBYTES_PER_PIXEL*8); setvar(); } else { pfverb("writelx: using built in %d-bit pixmap functions on a %d-bit display\n", IBYTES_PER_PIXEL*8,offimage->depth); setfix(); } for(i=0;ibitmap_pad); pfprot("bitmap_unit %d ",offimage->bitmap_unit); if(offimage->byte_order==LSBFirst) { pfprot("bytes LSBfirst "); } else pfprot("bytes MSBFirst "); if(offimage->bitmap_bit_order==LSBFirst) { pfprot("bits LSBfirst "); } else pfprot("bits MSBFirst "); pfprot("bytes_per_line %d truevgaxdim %d ",ibytes_per_line,truevgaxdim); printf("image at %p, data at %p\n",offimage,offscreen); #endif } void vgaclose(void) { free_off(); /* tidy up ... is to be done ... colormap? */ /* XFreeColors(dpy,colormap,palette,NUMBER_OF_COLORS,0); */ XCloseDisplay (dpy); } void vgaerror(char* mssg) { pfprot("\nfatal error: display: %s\n",mssg); exit(1); } #define UDSIZE 10000L void myupdate(int x1, int y1, int x2, int y2) { int i,w,h; if(offscreen==NULL) return; if(x1<0) x1=0; if(y1<0) y1=0; if(x2>vgaxdim-1) x2=vgaxdim-1; if(y2>vgaydim-1) y2=vgaydim-1; if(x20;i+=h) { h=MIN(h,y2-i+1); XPutImage(dpy,dviwin,imagecopygc,offimage,x1,i,x1,i,w,h); } XFlush(dpy); /* pfprot(".. done ))"); */ } void vgascreen(int son) { directscreen=son; } void mysetclip(int x1, int y1, int x2, int y2) { if(x1<0) x1=0; if(y1<0) y1=0; if(x2>vgaxdim-1) x2=vgaxdim-1; if(y2>vgaydim-1) y2=vgaydim-1; if(x2COLORMARGIN){ colerr++; XLookupColor(dpy,colormap,"black",&blackcolor,&colorsc); XLookupColor(dpy,colormap,"white",&whitecolor,&colorsc); fail1=setcolormapcol(0,whitecolor.red,whitecolor.green,whitecolor.blue); fail2=setcolormapcol(COLORS_PER_GREY-1,blackcolor.red,blackcolor.green,blackcolor.blue); if(MAX(fail1,fail2)>COLORMARGIN) colerr++; } white =palette[0]; black =palette[COLORS_PER_GREY-1]; /* non-transparent stuff defaults to black */ if(setcolormapcol(COLORS_PER_GREY,PALDRED)>COLORMARGIN){ palette[COLORS_PER_GREY]=black; colerr++; } if(setcolormapcol(COLORS_PER_GREY+1,PALDGREEN)>COLORMARGIN){ palette[COLORS_PER_GREY+1]=black; colerr++; } if(setcolormapcol(COLORS_PER_GREY+2,PALDBLUE)>COLORMARGIN){ palette[COLORS_PER_GREY+2]=black; colerr++; } dred=palette[COLORS_PER_GREY]; dgreen=palette[COLORS_PER_GREY+1]; dblue=palette[COLORS_PER_GREY+2]; /* transparent stuff I dont care */ setcolormapcol(COLORS_PER_GREY+3,PALLGREY); setcolormapcol(COLORS_PER_GREY+4,PALLRED); setcolormapcol(COLORS_PER_GREY+5,PALLGREEN); setcolormapcol(COLORS_PER_GREY+6,PALLBLUE); setcolormapcol(COLORS_PER_GREY+7,PALLGREY); lred =palette[COLORS_PER_GREY+4]; lgreen=palette[COLORS_PER_GREY+5]; lblue =palette[COLORS_PER_GREY+6]; lgrey =palette[COLORS_PER_GREY+7]; /* try my very best on the greylevels */ for(i=1; iCOLORMARGIN){ if(gl<0.3) { colorname="black"; } else { if(gl<0.6) { colorname="grey25"; } else { if(gl<0.9) { colorname="grey50"; } else { colorname="grey75"; }}} XLookupColor(dpy,colormap,colorname,&colorex,&colorsc); if(setcolormapcol(COLORS_PER_GREY-1-i,colorex.red,colorex.green,colorex.blue)>COLORMARGIN) palette[i]=black; colerr++; } } XLookupColor(dpy,colormap,tforename,&tforecolor,&colorsc); XLookupColor(dpy,colormap,tbackname,&tbackcolor,&colorsc); fail1=setcolormapcol(TEXTFCOL,tforecolor.red,tforecolor.green,tforecolor.blue); fail2=setcolormapcol(TEXTBCOL,tbackcolor.red,tbackcolor.green,tbackcolor.blue); if(MAX(fail1,fail2)>COLORMARGIN){ colerr=1; palette[TEXTFCOL]=black; palette[TEXTBCOL]=white; } if(colerr) pfprot("warning: display: cannot allocate tmview's colors.\n"); } /* inverse of palette array: hm. this should be done better somehow */ int invpalette(Pixel cpix){ int i; if(cpix==white) return(WHITECOL); if(cpix==black) return(BLACKCOL); for(i=WHITECOL+1; iwidth = hintp->min_width = VGAXDIMMIN; hintp->height = hintp->min_height = VGAYDIMMIN; hintp->flags = PMinSize; hintp->x = hintp->y = 0; geom_result = NoValue; if(geom != NULL) { geom_result = XParseGeometry (geom, &hintp->x, &hintp->y, (unsigned int *)&hintp->width, (unsigned int *)&hintp->height); if((geom_result & WidthValue) && (geom_result & HeightValue)) { hintp->width = MAX(hintp->width, hintp->min_width); hintp->height = MAX(hintp->height, hintp->min_height); hintp->flags |= USSize; } if((geom_result & XValue) && (geom_result & YValue)) { hintp->flags += USPosition; } } if(!(hintp->flags & USSize)) { hintp->width = w; hintp->height= h; hintp->flags |= PSize; } if(geom_result & XNegative) hintp->x = DisplayWidth(dpy,DefaultScreen(dpy))+hintp->x-hintp->width; if(geom_result & YNegative) hintp->y = DisplayHeight(dpy,DefaultScreen(dpy))+hintp->y-hintp->height; } void vgaopen(void) { char* displayname=NULL; #ifdef DEBUGX XPixmapFormatValues* pixforlist; int* depthlist; XVisualInfo* vislist; XVisualInfo vistemp; int npixforlist,i,n; pfprot("(vgaopen ...\n"); #endif offscreen=NULL; /* to be shure */ /* better ask option !! */ dpy=XOpenDisplay(displayname); if (!dpy) { pfprot("vgaopen: unable to open display '%s'\n", XDisplayName (displayname)); vgaerror("display"); } screen=DefaultScreen(dpy); /* for debugging only: costs performance ! */ /* XSynchronize(dpy,True); */ /* show resources */ #ifdef DEBUGX pfprot("(rmfstr\n %s\n)\n\n",XResourceManagerString(dpy)); #endif tfontname=XGetDefault(dpy,"DviLX","sfont"); if(tfontname==NULL) tfontname="-b&h-lucidatypewriter-medium-*-*-*-14-*-*-*-*-*-*-*"; tforename=XGetDefault(dpy,"DviLX","sforeground"); if(tforename==NULL) tforename="tomato4"; tbackname=XGetDefault(dpy,"DviLX","sbackground"); if(tbackname==NULL) tbackname="OldLace"; dblackname=XGetDefault(dpy,"DviLX","foreground"); if(dblackname==NULL) dblackname="black"; dwhitename=XGetDefault(dpy,"","DviLX.background"); /*if(dwhitename==NULL) dwhitename=XGetDefault(dpy,"OpenWindows","DataBackground");*/ if(dwhitename==NULL) dwhitename="OldLace"; #ifdef DEBUGX pfprot("(getdef tfont %s)\n",tfontname); pfprot("(getdef tfore %s)\n",tforename); pfprot("(getdef tback %s)\n",tbackname); pfprot("(getdef dwhite %s)\n",dwhitename); pfprot("(getdef dblack %s)\n",dblackname); if(geometry!=NULL) pfprot("(getdef geom %s)\n",geometry); /* Get some info */ depthlist=XListDepths(dpy,screen,&n); printf("\nList of depths:"); if(depthlist != NULL) for(i=0;i>dimm); } void mycopybitsbw(int tx, int ty, int sw, int sh, void* src, int c) { /* this is with self made clipping. no good ? */ /* but it will do for all kind of BMUNIT */ int j,i,supi,supj,mini,minj,sx, skip; BMUNIT *srow, *sbmu; BMUNIT premask, firstpremask; register BMUNIT data, mask; short sbmu_wide; Pixel blackc; /*fprintf(prot,"(vgacopybitmap1 : tx %d ty %d sw %d sh %d, ...\n", tx,ty,sw, sh); */ mini=minj=0; if(ty> BITS_LOG2; premask = ((BMUNIT)1) << (BITS_PER_BMUNIT-1); firstpremask = premask >> skip; blackc=palette[(BLACKCOL)>>c]; supj=supj+tx-minj; supi=supi+ty-mini; srow=((BMUNIT*)src)+mini*sbmu_wide+sx; for (i = ty;i>= 1; if(!mask) { mask=premask; data= *(++sbmu); } } srow+=sbmu_wide; sbmu=srow; } if(directscreen) { XPutImage(dpy,dviwin,imagecopygc,offimage,tx,ty,tx,ty,supj-tx,supi-ty); /* XFlush(dpy); */ } } void mycopybitsgs(int tx, int ty, int sw, int sh, void* src, int c) { /* this is with self made clipping. no good ? */ /* but it will do for all kind of BMUNIT */ /* compatible to gl_putbox */ int j,i,supi,supj,mini,minj,sx, skip; BMUNIT *srow, *sbmu; BMUNIT premask, firstpremask; register BMUNIT data, mask; short sbmu_wide; int rs, firstrs; uchar paintc, sourcec; /* fprintf(prot,"(vgacopybitmap8 : tx %d ty %d sw %d sh %d, ...\n", tx,ty,sw, sh); fprintf(prot," clipping : %d %d %d %d, ...\n", ofscx1,ofscy1,ofscx2,ofscy2);*/ mini=minj=0; if(ty>GREYSCALE_LOG2)-1); sx= minj >> (BITS_LOG2-GREYSCALE_LOG2); premask = ((((BMUNIT)1)<> (skip<< GREYSCALE_LOG2); firstrs = BITS_PER_BMUNIT-GREYSCALE - skip*GREYSCALE; supj=supj+tx-minj; supi=supi+ty-mini; srow=((BMUNIT*)src)+mini*sbmu_wide+sx; for (i = ty;i> (rs+c)))) if(XGetPixel(offimage,j,i)==white) XPutPixel(offimage,j,i,palette[paintc]); #else if((paintc=((data & mask) >> (rs+c)))){ if((sourcec=invpalette(XGetPixel(offimage,j,i)))){ if((paintc+=sourcec & (COLORS_PER_GREY-1))>COLORS_PER_GREY-1) paintc=COLORS_PER_GREY-1; paintc|=sourcec & ~(COLORS_PER_GREY-1); } XPutPixel(offimage,j,i,palette[paintc]); } #endif mask >>= GREYSCALE; rs-=GREYSCALE; if(!mask) { mask=premask; rs=BITS_PER_BMUNIT-GREYSCALE; data= *(++sbmu); } } srow+=sbmu_wide; sbmu=srow; } if(directscreen) { XPutImage(dpy,dviwin,imagecopygc,offimage,tx,ty,tx,ty,supj-tx,supi-ty); /* XFlush(dpy); */ } } void myfillbox(int tx, int ty, int w, int h, int c) { int i,j,supj,supi; Pixel cpix; /* fprintf(prot,"(vgafillbox : tx %d ty %d sw %d sh %d, ...\n", tx,ty,sw, sh); */ if(tyofscy2+1) h=ofscy2+1-ty; if(tx+w>ofscx2+1) w=ofscx2+1-tx; if(w <= 0 || h<= 0) { /*fprintf(prot,"clipped all away. no drawings)\n"); */ return; } supi=ty+h; supj=tx+w; /* fprintf(prot,"clipped or box: tx %d ty %d w %d h %d \n", tx,ty,w,h); */ cpix=palette[c]; for (i=ty;iofscy2+1) h=ofscy2+1-ty; if(tx+w>ofscx2+1) w=ofscx2+1-tx; if(w <= 0 || h<= 0 || c==0) { /*fprintf(prot,"clipped all away or white: no drawings)\n"); */ return; } /* fprintf(prot,"clipped or box: tx %d ty %d w %d h %d \n", tx,ty,w,h); */ supi=ty+h; supj=tx+w; cpix=palette[c]; for (i=ty;iCOLORS_PER_GREY-1) paintc=COLORS_PER_GREY-1; paintc|=sourcec & ~(COLORS_PER_GREY-1); XPutPixel(offimage,j,i,palette[paintc]); } else { XPutPixel(offimage,j,i,cpix); } #endif if(directscreen) { XPutImage(dpy,dviwin,imagecopygc,offimage,tx,ty,tx,ty,w,h); /* XFlush(dpy); */ } } void myfillboxbg(int tx, int ty, int w, int h, int c) { int i,j,supj,supi; Pixel cpix; register Pixel xdc; /* fprintf(prot,"(vgafillboxor : tx %d ty %d w %d h %d, ...\n", tx,ty,w,h); */ if(tyofscy2+1) h=ofscy2+1-ty; if(tx+w>ofscx2+1) w=ofscx2+1-tx; if(w <= 0 || h<= 0) { /*fprintf(prot,"clipped all away. no drawings)\n"); */ return; } supi=ty+h; supj=tx+w; cpix=palette[c]; /* fprintf(prot,"clipped bgbox : tx %d ty %d w %d h %d \n", tx,ty,w,h); */ for (i=ty;i>c]; sbmu_wide= ROUNDUP(sw,BITS_PER_BMUNIT); skip= minj & (BITS_PER_BMUNIT-1); sx= minj >> BITS_LOG2; premask = ((BMUNIT)1) << (BITS_PER_BMUNIT-1); firstpremask = premask >> skip; ydest=((IUNIT*)(offscreen+ty*ibytes_per_line))+tx; srow=((BMUNIT*)src)+mini*sbmu_wide+sx; for (i = mini;i>= 1; xdest++; if(!mask) { mask=premask; data= *(++sbmu); } } srow+=sbmu_wide; sbmu=srow; ((char*)ydest)+=ibytes_per_line; } if(directscreen) { XPutImage(dpy,dviwin,imagecopygc,offimage,tx,ty,tx,ty,w,h); /* XFlush(dpy); */ } } void mycopybitsgsfix(int tx, int ty, int sw, int sh, void* src, int c) { /* this is with self made clipping. no good ? */ /* but it will do for all kind of BMUNIT */ /* compatible to gl_putbox */ int j,i,supi,supj,mini,minj,sx, skip; BMUNIT *srow, *sbmu; BMUNIT premask, firstpremask; register BMUNIT data, mask; short sbmu_wide; int rs, firstrs, w,h; IUNIT *ydest, *xdest; uchar paintc, sourcec; /*printf("(vgacopybitmap8 : src 0x%x tx %d ty %d sw %d sh %d, ...\n", src,tx,ty,sw, sh); printf(" clipping : %d %d %d %d, ...\n", ofscx1,ofscy1,ofscx2,ofscy2);*/ mini=minj=0; if(ty>GREYSCALE_LOG2)-1); sx= minj >> (BITS_LOG2-GREYSCALE_LOG2); premask = ((((BMUNIT)1)<> (skip<< GREYSCALE_LOG2); firstrs = BITS_PER_BMUNIT-GREYSCALE - skip*GREYSCALE; sourcec=0; ydest=((IUNIT*)(offscreen+ty*ibytes_per_line))+tx; srow=((BMUNIT*)src)+mini*sbmu_wide+sx; for (i = mini;i> (rs+c)))) if(IGET_PIXEL(xdest)==white) ISET_PIXEL(xdest,palette[paintc]); #else if((paintc=((data & mask) >> (rs+c)))){ if(IGET_PIXEL(xdest)!=white){ sourcec=invpalette(IGET_PIXEL(xdest)); if((paintc+=sourcec & (COLORS_PER_GREY-1))>COLORS_PER_GREY-1) paintc=COLORS_PER_GREY-1; paintc|=sourcec & ~(COLORS_PER_GREY-1); } ISET_PIXEL(xdest,palette[paintc]); } #endif mask >>= GREYSCALE; rs-=GREYSCALE; xdest++; if(!mask) { mask=premask; rs=BITS_PER_BMUNIT-GREYSCALE; data= *(++sbmu); } } srow+=sbmu_wide; sbmu=srow; ((char*)ydest)+=ibytes_per_line; } if(directscreen) { XPutImage(dpy,dviwin,imagecopygc,offimage,tx,ty,tx,ty,w,h); /* XFlush(dpy); */ } /*printf("..vgacopybitmap8 done)");*/ } void myfillboxfix(int tx, int ty, int w, int h, int c) { IUNIT *ydest, *xdest; int i,j; Pixel cpix; /* fprintf(prot,"(vgafillbox : tx %d ty %d sw %d sh %d, ...\n", tx,ty,sw, sh); */ if(tyofscy2+1) h=ofscy2+1-ty; if(tx+w>ofscx2+1) w=ofscx2+1-tx; if(w <= 0 || h<= 0) { /*fprintf(prot,"clipped all away. no drawings)\n"); */ return; } /* fprintf(prot,"clipped or box: tx %d ty %d w %d h %d \n", tx,ty,w,h); */ cpix=palette[c]; ydest=((IUNIT*)(offscreen+ty*ibytes_per_line))+tx; for (i=h;i>0;i--) { xdest=ydest; for (j=w;j>0;j--) { ISET_PIXEL(xdest,cpix); xdest++; } ((char*)ydest)+=ibytes_per_line; } if(directscreen) { XSetForeground(dpy,winfillgc,cpix); XFillRectangle(dpy,dviwin,winfillgc,tx,ty,w,h); } } void myfillboxorfix(int tx, int ty, int w, int h, int c) { IUNIT *ydest, *xdest; int i,j; Pixel cpix; uchar sourcec, paintc; /* fprintf(prot,"(vgafillboxor : tx %d ty %d sw %d sh %d, ...\n", tx,ty,sw, sh); */ if(tyofscy2+1) h=ofscy2+1-ty; if(tx+w>ofscx2+1) w=ofscx2+1-tx; if(w <= 0 || h<= 0 || c==0) { /*fprintf(prot,"clipped all away or white: no drawings)\n"); */ return; } /* fprintf(prot,"clipped or box: tx %d ty %d w %d h %d \n", tx,ty,w,h); */ cpix=palette[c]; ydest=((IUNIT*)(offscreen+ty*ibytes_per_line))+tx; for (i=h;i>0;i--) { xdest=ydest; for (j=w;j>0;j--) { #ifndef LETSTRYCOLOR if(IGET_PIXEL(xdest)==white) ISET_PIXEL(xdest,cpix); #else if((sourcec=invpalette(IGET_PIXEL(xdest)))){ if((paintc=c+(sourcec & (COLORS_PER_GREY-1)))>COLORS_PER_GREY-1) paintc=COLORS_PER_GREY-1; paintc|=sourcec & ~(COLORS_PER_GREY-1); ISET_PIXEL(xdest,palette[paintc]); } else { ISET_PIXEL(xdest,cpix); } #endif xdest++; } ((char*)ydest)+=ibytes_per_line; } if(directscreen) { XPutImage(dpy,dviwin,imagecopygc,offimage,tx,ty,tx,ty,w,h); /* XFlush(dpy); */ } } void myfillboxbgfix(int tx, int ty, int w, int h, int c) { IUNIT *ydest; int i,j; Pixel cpix; register IUNIT *xdest; register Pixel xdc; /* fprintf(prot,"(vgafillboxor : tx %d ty %d w %d h %d, ...\n", tx,ty,w,h); */ if(tyofscy2+1) h=ofscy2+1-ty; if(tx+w>ofscx2+1) w=ofscx2+1-tx; if(w <= 0 || h<= 0) { /*fprintf(prot,"clipped all away. no drawings)\n"); */ return; } /* fprintf(prot,"clipped bgbox : tx %d ty %d w %d h %d \n", tx,ty,w,h); */ cpix=palette[c]; ydest=((IUNIT*)(offscreen+ty*ibytes_per_line))+tx; for (i=h;i>0;i--) { xdest=ydest; for (j=w;j>0;j--) { xdc=IGET_PIXEL(xdest); if(xdc==lred || xdc==lgreen || xdc==lblue || xdc==white) { if(xdc==white) ISET_PIXEL(xdest,cpix); else if(xdc!=cpix) ISET_PIXEL(xdest,lgrey); } xdest++; } ((char*)ydest)+=ibytes_per_line; } if(directscreen) { XPutImage(dpy,dviwin,imagecopygc,offimage,tx,ty,tx,ty,w,h); /* XFlush(dpy); */ } } void vgaxscroll(short dx) { int i,dbx,len; if(abs(dx) >= vgaxdim) return; XFlush(dpy); len=(vgaxdim-abs(dx))*ibytes_per_pixel; dbx=dx*ibytes_per_pixel; if(dx<0) { for(i=0;i= vgaydim) return; XFlush(dpy); if(dy<0) { for(i=0;i=dy;i--) memmove(offscreen+(long)i*ibytes_per_line, offscreen+(long)(i-dy)*ibytes_per_line,ibytes_per_line); if(directscreen) XCopyArea(dpy, dviwin, dviwin, wincopygc, 0, 0, vgaxdim, vgaydim-dy, 0, dy); } XFlush(dpy); if(directscreen) myexpose(NULL); } void setvar(void) { vgaupdate=myupdate; vgasetclip=mysetclip; vgadrawrect=myfillbox; vgadrawrector=myfillboxor; vgadrawrectbg=myfillboxbg; vgadimm=mydimm; vgacopybitmapgs=mycopybitsgs; vgacopybitmapbw=mycopybitsbw; } void setfix(void) { vgaupdate=myupdate; vgasetclip=mysetclip; vgadrawrect=myfillboxfix; vgadrawrector=myfillboxorfix; vgadrawrectbg=myfillboxbgfix; vgadimm=mydimm; vgacopybitmapgs=mycopybitsgsfix; vgacopybitmapbw=mycopybitsbwfix; } /***************************************************************************/ /* events ******************************************************************/ /***************************************************************************/ void myexpose(XEvent *event) { /* call with an event or NULL */ XGraphicsExposeEvent *gexev; XExposeEvent *exev; XEvent aevent; XSync(dpy,False); if(event==NULL) { event=&aevent; if(!XCheckTypedEvent(dpy,Expose | GraphicsExpose,event)) return; } do{ if(event->type==Expose) { exev = (XExposeEvent *) event; myupdate(exev->x,exev->y, exev->x+exev->width-1,exev->y+exev->height-1); myupdatestatus(exev->x,exev->y, exev->x+exev->width-1,exev->y+exev->height-1); /* pfprot("Expose: x %d y %d w %d h %d ",exev->x,exev->y, exev->x+exev->width-1,exev->y+exev->height-1); */ } if(event->type==GraphicsExpose) { gexev = (XGraphicsExposeEvent *) event; myupdate(gexev->x,gexev->y, gexev->x+gexev->width-1,gexev->y+gexev->height-1); myupdatestatus(gexev->x,gexev->y, gexev->x+gexev->width-1,gexev->y+gexev->height-1); /* pfprot("GraphicsExpose: x %d y %d w %d h %d ",gexev->x,gexev->y, gexev->x+gexev->width-1,gexev->y+gexev->height-1); */ } } while(XCheckTypedEvent(dpy,Expose | GraphicsExpose,event)); /* while(XCheckTypedEvent(dpy,Expose | GraphicsExpose,&event)); */ /* pfprot("done"); */ } /**************************************************************************/ /* keys and mice .. */ /* */ int mouseleft=0; int mouseright=0; int mousex=0; int mousey=0; void vgagetmouse(int *x, int *y, int *left, int* right) { *left= mouseleft; *right= mouseright; *x=mousex; *y=mousey; /* pfprot("(getmouse x %d y %d wx %d wy %d)",mousex,mousey,clientx,clienty);*/ } void vgasetmouse(int x, int y) { mousex=x; mousey=y; /*pfprot("(setmouse x %d y %d)",x,y); */ } /* Mini key queue, holds at most one key: Use peek-key mechanism from the svgalib version. Yes, I did try XPeekEvent ... but (in very rare cases) it blocks somehow. */ int mode2char=-1; int vgawaitio(fd_set * fdsetin, fd_set * fdsetout, struct timeval *timeout) { fd_set myfdsetin; if(mode2char>=0) return(ConnectionNumber(dpy)); if (fdsetin==NULL) { fdsetin = &myfdsetin; FD_ZERO(fdsetin); } FD_SET(ConnectionNumber(dpy), fdsetin); return(select(FD_SETSIZE,fdsetin, fdsetout,NULL,timeout)); } uchar vgagetchar(int mode) { /* mode==0: get next key, dont block mode==1: get next key, wait mode==2: peek next key, dont block */ uchar res=KEYNOP; XEvent event; XEvent dummyevent; XKeyEvent *keyev; XConfigureEvent *conev; XMotionEvent *moev; XCrossingEvent *crossev; XButtonEvent *butev; KeySym keysym; char *keynam; int slen; char keystr[256+1]; int newxdim, newydim, nev; if(mode2char>=0){ res=mode2char; if(mode!=2) mode2char=-1; return(res); } nev=XEventsQueued(dpy,QueuedAfterFlush); if(mode!=1 && nev==0) return(res); XNextEvent(dpy,&event); switch (event.type) { case KeyPress: keyev = (XKeyEvent *) &event; while(XCheckTypedEvent(dpy,KeyPress,&dummyevent)); slen=XLookupString (keyev, keystr, 256, &keysym, NULL); if (keysym == NoSymbol) keynam = "NoSymbol"; else if (!(keynam = XKeysymToString (keysym))) keynam = "(no name)"; if(keysym>=' ' && keysym <127) { res=keysym; break;} if(strcmp(STR_RET,keynam)==0) { res=KEYRET; break;} if(strcmp(STR_TAB,keynam)==0) { res=KEYTAB; break;} if(strcmp(STR_ESC,keynam)==0) { res=KEYESC; break;} if(strcmp(STR_BS,keynam)==0) { res=127; break;} if(slen==1) if(keystr[0]>=' ' && keystr[0] <127) { res=keystr[0];break;} if(strcmp(STR_RIGHT,keynam)==0) { res=KEYRIGHT; break;} if(strcmp(STR_LEFT,keynam)==0) { res=KEYLEFT; break;} if(strcmp(STR_UP,keynam)==0) { res=KEYUP; break;} if(strcmp(STR_DOWN,keynam)==0) { res=KEYDOWN; break;} if(strcmp(STR_NEXT,keynam)==0) { res=KEYNEXT; break;} if(strcmp(STR_PREV,keynam)==0) { res=KEYPREV; break;} if(strcmp(STR_HOME,keynam)==0) { res=KEYHOME; break;} if(strcmp(STR_END,keynam)==0) { res=KEYEND; break;} break; case Expose: case GraphicsExpose: myexpose(&event); break; case DestroyNotify: res='q'; break; case ConfigureNotify: if(offscreen==NULL) break; /* not started up jet */ conev=(XConfigureEvent *) &event; /* figure out position of our window. anyone around who knows? */ if(conev->send_event==1 && geof==0) { geodx=geox-conev->x; geody=geoy-conev->y; geof=1; } if(conev->send_event==1 || geof==0) { geox=conev->x; geoy=conev->y; } geow=conev->width; geoh=conev->height; /* freemem(&cmlgeometry); allocmem(&cmlgeometry,100); if(-1== snprintf(cmlgeometry,99,"%dx%d+%d+%d", geow,geoh,geox+geodx,geoy+geody)) {pfprot("\nfatal error: gemetry .. writelx ??\n");exit(1);} */ #ifdef DEBUGX pfprot("(configure notify for %ld flag %d: geometry: %dx%d+%d+%d)\n", conev->window,conev->send_event,geow,geoh,geox+geodx,geoy+geody); #endif pfprot("(oldsize %d %d)",vgaxdim,truevgaydim); newxdim = MAX(VGAXDIMMIN,conev->width); newydim = MAX(VGAYDIMMIN,conev->height); if(newxdim==vgaxdim && newydim==truevgaydim) break; truevgaxdim=((newxdim-1) | 3) + 1; truevgaydim=newydim; vgaxdim=newxdim; vgaydim=newydim; /* pfprot("(resize %d %d)\n",vgaxdim,vgaydim); */ free_off(); alloc_off(); vgamaxstatuslines=(truevgaydim-3)/vgastatushight; vgastatuslines=0; vgastatuslen=(vgaxdim-2)/fontw; mysetclipoff(); res=KEYRESIZE; break; case ButtonPress: butev = (XButtonEvent *) &event; if(butev->button ==2) {mouseleft=1;mouseright=1;} if(butev->button ==1) mouseleft=1; if(butev->button ==3) mouseright=1; break; case ButtonRelease: butev = (XButtonEvent *) &event; if(butev->button ==2) {mouseleft=0;mouseright=0;} if(butev->button ==1) mouseleft=0; if(butev->button ==3) mouseright=0; break; case MotionNotify: do{ moev = (XMotionEvent *) &event; mousex=moev->x; mousey=moev->y; } while(XCheckTypedEvent(dpy,MotionNotify,&event)); case LeaveNotify: case EnterNotify: crossev= (XCrossingEvent *) &event; if(crossev->mode != NotifyNormal) break; mousex=crossev->x; mousey=crossev->y; default: break; } if(mode==2 && res!=KEYNOP) mode2char=res; return(res); } /***************************************************************************/ /* now the font stuff ... */ Font tfontfont; XFontStruct* tfontstruct; char* offstatus=NULL; void preparefont(void) { XGCValues values; unsigned long valuemask; char** fontlist; int nfontlist; if(tfontname==NULL) tfontname="*-fixed-*"; fontlist=XListFonts(dpy,tfontname,20,&nfontlist); #ifdef DEBUGX { int i; pfprot("(fontnames:\n"); for(i=0;imin_bounds.lbearing, tfontstruct->min_bounds.rbearing, tfontstruct->min_bounds.width, tfontstruct->min_bounds.ascent, tfontstruct->min_bounds.descent); pfprot("max: lb %d rb %d w %d as %d des %d)\n\n", tfontstruct->max_bounds.lbearing, tfontstruct->max_bounds.rbearing, tfontstruct->max_bounds.width, tfontstruct->max_bounds.ascent, tfontstruct->max_bounds.descent); #endif if(tfontstruct->min_bounds.width !=tfontstruct->max_bounds.width) pfprot("\nprepare font: warning: font will be taken as fixed !!\n"); fonth=tfontstruct->descent+tfontstruct->ascent; fontw=tfontstruct->max_bounds.width; fonts=2; fonta=tfontstruct->ascent+1; tfontfont=tfontstruct->fid; values.foreground=palette[TEXTFCOL]; values.background=palette[TEXTBCOL]; values.font=tfontfont; valuemask= GCForeground | GCBackground | GCFont ; wintextgc=XCreateGC(dpy, dviwin, valuemask, &values); values.foreground=palette[TEXTBCOL]; valuemask= GCForeground; wincleartextgc=XCreateGC(dpy, dviwin, valuemask, &values); vgastatushight=fonth+fonts; vgamaxstatuslines=(truevgaydim-3)/vgastatushight; vgastatuslen=(vgaxdim-2)/fontw; } void closefont(void) { XFreeFont(dpy,tfontstruct); freemem(&offstatus); } void myupdatestatus(int x1, int y1, int x2, int y2) { int i,xc,yc,hc,wc; if(offstatus==NULL) return; if(x1<0) x1=0; if(y1<0) y1=0; if(y1vgaxdim-1) x2=vgaxdim-1; if(y2>truevgaydim-1) y2=truevgaydim-1; if(x2=vgastatuslines || line <0) return; if(pos>=vgastatuslen || pos <0) return; if(posdrawlist)); thedrawpage->ndraws=0; thedrawpage->maxdraws=0; } void drawlistfix(void) { thedrawpage->maxdraws=MAX(1,thedrawpage->ndraws); realloclrumem(&(thedrawpage->drawlist), thedrawpage->maxdraws*sizeof(drawlistelement)); unlocklrumem(&(thedrawpage->drawlist)); } drawlistdata* drawlistadd(selfdrawfunction* sdf) { drawlistelement* dleptr; if(thedrawpage->maxdraws==thedrawpage->ndraws) { thedrawpage->maxdraws+=DRAWLISTSTEP; realloclrumem(&(thedrawpage->drawlist), thedrawpage->maxdraws*sizeof(drawlistelement)); locklrumem(&(thedrawpage->drawlist)); } dleptr=thedrawpage->drawlist+thedrawpage->ndraws; thedrawpage->ndraws++; dleptr->drawmyself=sdf; return(&(dleptr->data)); } #define HIDEHIS 50 /* buffer will be reset if drawing in mode 1 */ int hidehis[HIDEHIS][4]; int nexthide=0; void drawaddupdatelist(int x1, int y1,int x2, int y2) { if(directscreen==1) return; if(nexthide>=HIDEHIS) { /* this cant happen ? */ pfprot("(hidehis overflow. grep for HIDEHIS. sorry)"); for(nexthide=0;nexthide=1) { --nexthide; (*vgaupdate)(hidehis[nexthide][0], hidehis[nexthide][1], hidehis[nexthide][2], hidehis[nexthide][3]); } #if ALLSCREEN || CURSORSNOTONSCREEN vgascreen(1); /* turn screen drawing on again */ #else vgascreen(0); #endif } void updateall(void) { #if NOTHINGONSCREEN (*vgaupdate)(0,0,vgaxdim-1,vgaydim-1); nexthide=0; #else updatelist(); /* will set vgascreen */ #endif } void drawupdatepage(void) { /* this does a total reset */ #if NOTHINGONSCREEN || SCROLLONSCREEN vgascreen(0); drawpage(0,0,vgaxdim-1,vgaydim-1,1); (*vgaupdate)(0,0,vgaxdim-1,vgaydim-1); #else vgascreen(1); drawpage(0,0,vgaxdim-1,vgaydim-1,1); #endif nexthide=0; } void drawhidemark(int x, int y) { tmpnomarks=1; #if CURSORSNOTONSCREEN /* switch drirect screen off */ vgascreen(0); #endif drawpage(x-MARKSIZE,y-MARKSIZE,x+MARKSIZE,y+MARKSIZE,0); } void drawshowmark(int x, int y, int col){ int ms=MARKSIZE; /* (*vgasetclip)(0,0,vgaxdim-1,vgaydim-1); */ (*vgadrawrect)(x-ms,y,2*ms+1,1,vgadimm(BLACKCOL,0)); (*vgadrawrect)(x,y-ms,1,2*ms+1,vgadimm(BLACKCOL,0)); (*vgadrawrectbg)(x-ms,y-ms,2*ms+1,2*ms+1,col); drawaddupdatelist(x-ms,y-ms,x+ms,y+ms); } void showmarks(void){ if(markon) drawshowmark(marksxpxl,marksypxl,MARKSCOL); if(hypon) drawshowmark(marksxpxl,marksypxl,MARKHCOL); } void showmarkd(void){ if(markon) drawshowmark(MMTOPXL(markdxmm-visfmk->hoffmm)-dvixpos, MMTOPXL(markdymm-visfmk->voffmm)-dviypos,MARKDCOL); } void showmarkt(void){ if(texton) { (*vgadrawrectbg)(textx1pxl-dvixpos,texty1pxl-dviypos, textx2pxl-textx1pxl+1, texty2pxl-texty1pxl+1,FOUNDCOL); (*vgadrawrectbg)(textx3pxl-dvixpos,texty3pxl-dviypos, textx4pxl-textx3pxl+1, texty4pxl-texty3pxl+1,FOUNDCOL); drawaddupdatelist(textx1pxl-dvixpos,texty1pxl-dviypos, textx2pxl-dvixpos,texty2pxl-dviypos); drawaddupdatelist(textx3pxl-dvixpos,texty3pxl-dviypos, textx4pxl-dvixpos,texty4pxl-dviypos); } } void drawshowallmarks(void) { showmarkd(); showmarkt(); showmarks(); } void drawshowfixedmarksonly(void){ if(markon) drawshowmark(marksxpxl,marksypxl,MARKSCOL); if(hypon) drawshowmark(marksxpxl,marksypxl,MARKHCOL); } void drawhidefixedmarksonly(void){ if(markon==0 && hypon==0) return; drawhidemark(marksxpxl,marksypxl); showmarkd(); /* for the case of intersection */ showmarkt(); } void drawhideallmarks(void){ #if CURSORSNOTONSCREEN /* switch drirect screen off */ vgascreen(0); #endif if(markon!=0) { drawhidemark(MMTOPXL(markdxmm-visfmk->hoffmm)-dvixpos, MMTOPXL(markdymm-visfmk->voffmm)-dviypos); drawhidemark(marksxpxl,marksypxl); } if(hypon!=0) { drawhidemark(marksxpxl,marksypxl); } if(texton!=0) { tmpnomarks=1; drawpage(textx1pxl-dvixpos,texty1pxl-dviypos, textx2pxl-dvixpos,texty2pxl-dviypos,0); tmpnomarks=1; drawpage(textx3pxl-dvixpos,texty3pxl-dviypos, textx4pxl-dvixpos,texty4pxl-dviypos,0); } } void drawhiderect(void) { int x, y, h, w; if(recton==0) return; #if CURSORSNOTONSCREEN /* switch drirect screen off */ vgascreen(0); #endif x=-dvixpos+MMTOPXL(rectxmm-visfmk->hoffmm); y=-dviypos+MMTOPXL(rectymm-visfmk->voffmm); w=MMTOPXL(rectxmm-visfmk->hoffmm+rectwmm)-MMTOPXL(rectxmm-visfmk->hoffmm)+1; h=MMTOPXL(rectymm-visfmk->voffmm+recthmm)-MMTOPXL(rectymm-visfmk->voffmm)+1; recton=0; /*drawpage(x,y,x+w-1,y+h-1,0); */ drawpage(x,y,x+w-1,y,0); drawpage(x,y+h-1,x+w-1,y+h-1,0); drawpage(x,y,x,y+h-1,0); drawpage(x+w-1,y,x+w-1,y+h-1,0); recton=1; } void drawshowrect(void){ int x, y, h, w; if(recton==0) return; /*fprintf(prot,"(drawshowrect)");*/ x=-dvixpos+MMTOPXL(rectxmm-visfmk->hoffmm); y=-dviypos+MMTOPXL(rectymm-visfmk->voffmm); w=MMTOPXL(rectxmm-visfmk->hoffmm+rectwmm)-MMTOPXL(rectxmm-visfmk->hoffmm)+1; h=MMTOPXL(rectymm-visfmk->voffmm+recthmm)-MMTOPXL(rectymm-visfmk->voffmm)+1; (*vgadrawrect)(x,y,w,1,RECTCOL); (*vgadrawrect)(x,y+h-1,w,1,RECTCOL); (*vgadrawrect)(x,y,1,h,RECTCOL); (*vgadrawrect)(x+w-1,y,1,h,RECTCOL); drawaddupdatelist(x,y,x+w-1,y); drawaddupdatelist(x,y+h-1,x+w-1,y+h-1); drawaddupdatelist(x,y,x,y+h-1); drawaddupdatelist(x+w-1,y,x+w-1,y+h-1); } void drawhideallmarksandrect(void){ if(!recton){ drawhideallmarks(); return; } drawhiderect(); recton=0; drawhideallmarks(); recton=1; } void drawcharbmp(drawlistdata* arg) { chdesc *thechar; /*fprintf(prot,"\n");*/ thechar=(*arg).chr.chdp; if(thechar->bmp.bits == NULL) pkloadchar(thechar); else touchlrumem(&(thechar->bmp.bits)); (*vgacopybitmapbw)( (*arg).chr.h -thexpos -thechar->hof, (*arg).chr.v -theypos -thechar->vof, thechar->bmp.w, thechar->bmp.h, thechar->bmp.bits, (*arg).chr.c); } void drawcharbmp2bw(drawlistdata* arg) { chdesc *thechar; /*fprintf(prot,"\n");*/ thechar=(*arg).chr.chdp; if((thechar->bmp2.bits == NULL) || (thechar->shrink != fshrink) || (thechar->bmp2.type != BLACKNWHITE)) { if(thechar->bmp.bits == NULL) pkloadchar(thechar); pkshrinkcharazbw(thechar); } else touchlrumem(&(thechar->bmp2.bits)); (*vgacopybitmapbw)((*arg).chr.h -thexpos -thechar->hof2, (*arg).chr.v -theypos -thechar->vof2, thechar->bmp2.w, thechar->bmp2.h, thechar->bmp2.bits, (*arg).chr.c); } void drawgscript(drawlistdata* arg){ gslistelement* gse; gse=(*arg).gscript.gse; /*printf("\n");*/ /*printf("name=%s bits=0x%x suspect=%d\n", gse->gsfile,gse->bmp.bits,gse->suspect); */ if( (gse->suspect!=B_OK) || (gse->bmp.w== gse->bmp2.w && gse->bmp.bits == NULL) || (gse->bmp.w!= gse->bmp2.w && gse->bmp2.bits == NULL)) { gsloadbmp(gse); /* wont happen: see speeduplsowstuff() */ } if(gse->suspect==B_OK && gse->bmp.w== gse->bmp2.w) { touchlrumem(&(gse->bmp.bits)); (*vgacopybitmapbw)((*arg).gscript.h -thexpos, (*arg).gscript.v -theypos, gse->bmp.w, gse->bmp.h, gse->bmp.bits, 0); /* do not dimm gscript */ } if(gse->suspect==B_OK && gse->bmp.w!= gse->bmp2.w) { touchlrumem(&(gse->bmp2.bits)); (*vgacopybitmapgs)((*arg).gscript.h -thexpos, (*arg).gscript.v -theypos, gse->bmp2.w, gse->bmp2.h, gse->bmp2.bits, 0); /* do not dimm gscript */ } /*printf("bmp2.bits == NULL) || (thechar->shrink != fshrink) || (thechar->bmp2.type != GREYSCALE)) { if(thechar->bmp.bits == NULL) pkloadchar(thechar); pkshrinkcharazprecgs(thechar); } else touchlrumem(&(thechar->bmp2.bits)); #ifdef DEBUGDRAW pfprot(" call vgacopybitmapgs "); #endif (*vgacopybitmapgs)((*arg).chr.h -thexpos -thechar->hof2, (*arg).chr.v -theypos -thechar->vof2, thechar->bmp2.w, thechar->bmp2.h, thechar->bmp2.bits, (*arg).chr.c); #ifdef DEBUGDRAW pfprot(" done)"); #endif } void drawruleor(drawlistdata* arg) { (*vgadrawrector)( (*arg).rect.x-thexpos, (*arg).rect.y-theypos, (*arg).rect.w, (*arg).rect.h, (*arg).rect.c); } void drawrulebg(drawlistdata* arg) { (*vgadrawrectbg)( (*arg).rect.x-thexpos, (*arg).rect.y-theypos, (*arg).rect.w, (*arg).rect.h, (*arg).rect.c); } /* drawpage() is split up into faststuff, slowstuff, finalstuff. */ int drawpagefaststuff(pagelistelement* apage, int x1, int y1, int x2, int y2) { drawlistelement *eptr; long i, didskipslowstuff; #ifdef DEBUGDRAW pfprot("(drawpagefaststuff ..."); #endif if(apage==NULL) return(0); readpage(apage); if(apage->drawlist==NULL) return(0); thedrawpage=apage; thexpos=dvixpos-thedrawpage->xoffset; theypos=dviypos-thedrawpage->yoffset; locklrumem(&(thedrawpage->drawlist)); eptr=thedrawpage->drawlist; for(i=0; indraws; i++, eptr++) { if(eptr->drawmyself!=drawgscript) eptr->drawmyself(&(eptr->data)); } didskipslowstuff=0; eptr=thedrawpage->drawlist; for(i=0; indraws; i++, eptr++) { if(eptr->drawmyself==drawgscript){ if(eptr->data.gscript.gse->suspect==B_OK) eptr->drawmyself(&(eptr->data)); else didskipslowstuff=1; } } unlocklrumem(&(thedrawpage->drawlist)); #ifdef DEBUGDRAW pfprot("drawpagefaststuff: done)"); #endif return(didskipslowstuff); } void drawpagefinalstuff(pagelistelement *apage,int x1,int y1,int x2,int y2){ HTeX_Anchor *HTeXAp; int i; #ifdef DEBUGDRAW pfprot("(drawpagefinalstuff ..."); #endif if(apage==NULL) return; thedrawpage=apage; thexpos=dvixpos-thedrawpage->xoffset; theypos=dviypos-thedrawpage->yoffset; /* boarder = paper farme */ (*vgadrawrect)(-thexpos-MMTOPXL(visfmk->hoffmm)-1, -theypos-MMTOPXL(visfmk->voffmm)-1, MMTOPXL(visfmk->papxmm)+3,1,BORDERCOL); (*vgadrawrect)(-thexpos-MMTOPXL(visfmk->hoffmm)-1, -theypos-MMTOPXL(visfmk->voffmm)-1, 1,MMTOPXL(visfmk->papymm)+3,BORDERCOL); (*vgadrawrect)(-thexpos-MMTOPXL(visfmk->hoffmm)-1, -theypos-MMTOPXL(visfmk->voffmm)+MMTOPXL(visfmk->papymm)+1, MMTOPXL(visfmk->papxmm)+3,1,BORDERCOL); (*vgadrawrect)(-thexpos-MMTOPXL(visfmk->hoffmm)+MMTOPXL(visfmk->papxmm)+1, -theypos-MMTOPXL(visfmk->voffmm)-1, 1,MMTOPXL(visfmk->papymm)+3,BORDERCOL); if(frameon){ /* draw frame */ (*vgadrawrect)( -thexpos-MMTOPXL(visfmk->hoffmm)+MMTOPXL(visfmk->lrandmm)-1, -theypos-MMTOPXL(visfmk->voffmm)+MMTOPXL(visfmk->orandmm)-1, MMTOPXL(visfmk->papxmm-visfmk->rrandmm)- MMTOPXL(visfmk->lrandmm)+3,1,FRAMECOL); (*vgadrawrect)( -thexpos-MMTOPXL(visfmk->hoffmm)+MMTOPXL(visfmk->lrandmm)-1, -theypos-MMTOPXL(visfmk->voffmm)+MMTOPXL(visfmk->papymm-visfmk->urandmm)+1, MMTOPXL(visfmk->papxmm-visfmk->rrandmm)- MMTOPXL(visfmk->lrandmm)+3,1,FRAMECOL); (*vgadrawrect)( -thexpos-MMTOPXL(visfmk->hoffmm)+MMTOPXL(visfmk->lrandmm)-1, -theypos-MMTOPXL(visfmk->voffmm)+MMTOPXL(visfmk->orandmm)-1, 1,MMTOPXL(visfmk->papymm-visfmk->urandmm)- MMTOPXL(visfmk->orandmm)+3,FRAMECOL); (*vgadrawrect)( -thexpos-MMTOPXL(visfmk->hoffmm)+ MMTOPXL(visfmk->papxmm-visfmk->rrandmm)+1, -theypos-MMTOPXL(visfmk->voffmm)+MMTOPXL(visfmk->orandmm)-1, 1,MMTOPXL(visfmk->papymm-visfmk->urandmm)- MMTOPXL(visfmk->orandmm)+3,FRAMECOL); } /*if(apage==cpage) */ drawshowrect(); /* fprintf(prot,"(read tmp %d)",tmpnomarks); */ if(hypon) { HTeXAp = apage->anchorlist; for (i=0; i < apage->nanchors; i++, HTeXAp++) { if ((HTeXAp->type&HTeX_A_HREF) == 0) continue; /* Only box hrefs */ vgadrawrectbg(HTeXAp->x1pxl-thexpos,HTeXAp->y1pxl-theypos, HTeXAp->x2pxl-HTeXAp->x1pxl+1,HTeXAp->y2pxl-HTeXAp->y1pxl+1,HREFCOL); } } #ifdef DEBUGDRAW pfprot("drawpagefinalstuff: done)"); #endif } int speedx1, speedx2, speedy1, speedy2; int speedupslowstuff(pagelistelement* apage,int x1, int y1, int x2, int y2) { drawlistelement *eptr; int didsomeslowstuff; long i; #ifdef DEBUGDRAW pfprot("(speedupslowstuff ..."); #endif if(apage==NULL) { #ifdef DEBUGDRAW pfprot("apege=null)"); #endif return(B_SUSPECT); } readpage(apage); if(apage->drawlist==NULL) return(B_SUSPECT); thedrawpage=apage; thexpos=dvixpos-thedrawpage->xoffset; theypos=dviypos-thedrawpage->yoffset; locklrumem(&(thedrawpage->drawlist)); didsomeslowstuff=B_SUSPECT; eptr=thedrawpage->drawlist; for(i=0; indraws && didsomeslowstuff==B_SUSPECT; i++, eptr++) { if(eptr->drawmyself==drawgscript){ if( eptr->data.gscript.gse->suspect==B_SUSPECT || eptr->data.gscript.gse->suspect==B_SKIPONCE){ gsloadbmp(eptr->data.gscript.gse); didsomeslowstuff=eptr->data.gscript.gse->suspect; if(eptr->data.gscript.gse->suspect==B_OK) { speedx1=eptr->data.gscript.h -thexpos, speedy1=eptr->data.gscript.v -theypos, speedx2=eptr->data.gscript.h -thexpos +eptr->data.gscript.gse->bmp2.w -1, speedy2=eptr->data.gscript.v -theypos +eptr->data.gscript.gse->bmp2.h -1; } } } } unlocklrumem(&(thedrawpage->drawlist)); #ifdef DEBUGDRAW pfprot("speedupslowstuff: done)"); #endif return(didsomeslowstuff); } void drawpage(int x1, int y1, int x2, int y2, int speedup) { int dssscp=0; int dssspp=0; #ifdef DEBUGDRAW pfprot("(drawpage: dest: %d %d %d %d dvipos %d %d ...", x1,y1,x2,y2,dvixpos,dviypos); #endif if(visfmk==NULL) return; if(x1<0) x1=0; if(y1<0) y1=0; if(x2>vgaxdim-1) x2=vgaxdim-1; if(y2>vgaydim-1) y2=vgaydim-1; if(x20 && cpage->count[i] ==0; i--); i=MAX(0,i); counterstr[0]=0; for(j=0;j<=i;j++) { sprintf(bustr,"%ld;",MIN(9999,MAX(-9999,cpage->count[j]))); strcat(counterstr,bustr); } counterstr[strlen(counterstr)-1]=0; } void drawstatusline(void); /* forward */ int doupdate=1; void drawstatusmarks(void) { char bustr1[180], bustr2[180]; char* refstr; int ol; if(cpage==NULL || visfmk==NULL) return; if(statusforce) { drawstatusline(); return; } switch(statustype) { case 0: refstr=NULL; if(hypon) if(!htex_withinanchor(cpage,dvixpos+marksxpxl, dviypos+marksypxl, &refstr)) if(ppage!=NULL) htex_withinanchor(ppage,marksxpxl+dvixpos-ppage->xoffset, marksypxl+dviypos-ppage->yoffset, &refstr); if(refstr==NULL) { sprintf(bustr1,"(%%.%df,%%.%df) [%s]",unitcomma,unitcomma,unitname); sprintf(bustr2, bustr1, mmtounit*(PXLTOMM(dvixpos+marksxpxl)+visfmk->hoffmm-markdxmm), mmtounit*(PXLTOMM(dviypos+marksypxl)+visfmk->voffmm-markdymm)); ol=markstrlen; markstrlen=strlen(bustr2); drawsr(bustr2,0,vgastatuslen-MAX(ol,markstrlen),vgastatuslen); } else { strncpy(bustr1,refstr,100); bustr1[100]=0; sprintf(bustr2,"(%s)",bustr1); ol=markstrlen; markstrlen=strlen(bustr2); drawsr(bustr2,0,vgastatuslen-MAX(ol,markstrlen),vgastatuslen); } break; case 1: sprintf(bustr1,"(%%6.%df,%%6.%df) (%%6.%df,%%6.%df) [%s]", unitcomma,unitcomma,unitcomma,unitcomma,unitname); sprintf(bustr2, bustr1, mmtounit*markdxmm, mmtounit*markdymm, mmtounit*(PXLTOMM(dvixpos+marksxpxl)+visfmk->hoffmm-markdxmm), mmtounit*(PXLTOMM(dviypos+marksypxl)+visfmk->voffmm-markdymm)); markstrlen=strlen(bustr2); drawsr(bustr2,0,vgastatuslen-37,37); break; default: return; } if(doupdate) vgaupdatestatus(); } void drawstatuspage(void) { char bustr[MAXPATHSTR+10*10]; int ol; if(cpage==NULL || visfmk==NULL) return; if(statusforce) { drawstatusline(); return; } switch(statustype) { case 0: setcounterstr(); sprintf(bustr,"%s[%s]",dviname,counterstr); ol=pagestrlen; pagestrlen=strlen(bustr); drawsl(bustr,0,0,MAX(pagestrlen,ol)); break; default: return; } if(doupdate) vgaupdatestatus(); } void drawstatusarg(void) { char bustr[MAXARGSTR+MAXPATHSTR+10*11]; if(cpage==NULL || visfmk==NULL) return; if(statusforce) { drawstatusline(); return; } switch(statustype) { case 0: if(numberargstrlen>0) { numberargstr[numberargstrlen]=0; sprintf(bustr," <%s> ",numberargstr); drawsn(bustr,0,pagestrlen); lastarglen=1; } else { if(lastarglen>0) { drawsl(" ",0,pagestrlen,vgastatuslen); drawstatusmarks(); } lastarglen=0; } break; default: return; } if(doupdate) vgaupdatestatus(); } void drawstatuszoom(void) { char bustr[MAXARGSTR+MAXPATHSTR+10]; if(cpage==NULL || visfmk==NULL) return; if(statusforce) { drawstatusline(); return; } switch(statustype) { case 1: sprintf(bustr,"%.3f ",1/fshrink); drawsn(bustr,0,5); break; default: return; } if(doupdate) vgaupdatestatus(); } void drawstatusline(void) { int i; /* fprintf(prot,"(drawstatusline ..."); fflush(prot); */ if(vgastatuslines!=1) { i=vgastatuslines; vgasetstatuslines(1); drawpage(0,vgaydim-vgastatushight*(i+1),vgaxdim-1,vgaydim-1,1); (*vgaupdate)(0,vgaydim-vgastatushight*(i+1),vgaxdim-1,vgaydim-1); } if(cpage==NULL || visfmk==NULL) return; statusforce=0; doupdate=0; markstrlen=0; pagestrlen=0; lastarglen=0; switch(statustype) { case 0: drawsl(" ",0,0,vgastatuslen); break; case 1: if(vgastatuslen>=70) { drawsl("ZOOM ",0,0,vgastatuslen); drawsn("PAGEMARK/SCREENMARK ",0,vgastatuslen-20-37); } else { drawsl("PM/SM ",0,0,vgastatuslen); } break; } /* fprintf(prot,"details ..."); fflush(prot); */ drawstatuspage(); /* order is essential !!! */ drawstatusmarks(); drawstatusarg(); drawstatuszoom(); vgaupdatestatus(); doupdate=1; /* fprintf(prot,")"); fflush(prot);*/ } tmview/src/globals.c0100644000175000017500000000470607250444702014045 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ #include "defs.h" /* real globals used for dvi processing*/ fontdescvect* fontvect=NULL; pagelistelement *pagelist=NULL; int pageanz; gslistelement* gslistfirst=NULL; gslistelement* gslistlast=NULL; int dvierrorflag; pagelistelement *cpage=NULL; pagelistelement *ppage=NULL; float fshrink=1.0; int ishrinkonly=0; uchar colors=BLACKNWHITE; uchar doeps=DONTEPS; int dimmthresh=4; uchar *greytab=NULL; long dvimag; uchar dimmcolor; /* arguments as globals */ int verbose=0; char *cmlgeometry=NULL; int numberargstrlen; char *numberargstr=NULL; /* real globals for displaymanaging */ int vgaxdim, vgaydim; int directscreen; int vgastatuslen, vgastatushight, vgastatuslines, vgamaxstatuslines; int dvixpos, dviypos; int frameon, recton, texton; int markon, hypon, statustype, statusforce; int marksxpxl, marksypxl; float markdxmm, markdymm; int textx1pxl, texty1pxl, textx2pxl, texty2pxl; int textx3pxl, texty3pxl, textx4pxl, texty4pxl; float rectxmm, rectymm, rectwmm, recthmm; char *dviname=NULL; uchar ppagemode; float unitomm,mmtounit; int unitcomma; char* unitname; /* global constants */ long maxlrumem; long maxlinmem; BMUNIT *bit_masks=NULL; uchar *bit_count=NULL; char* workdir; /* options are global ... bad style */ char *tfmprefix=NULL; char *vfprefix=NULL; char *fontprefix=NULL; char *fontformat=NULL; char *startupfilename=NULL; int savestartup; long newmag; int xres,yres; int pagemovetop, moveoverpages, bookmkmode, unitstar; int dispos=0; /* globals for multiple files and bookmarks ... */ fontdesc* fontdatabase=NULL; filemark** filemks=NULL; int nfilemks=0; bookmarklist* curbmks=NULL; bookmarklist* visbmks=NULL; filemark* curfmk=NULL; filemark* visfmk=NULL; filemark fmkstar; /* not realy global globals */ int truevgaxdim,truevgaydim; /*allow saving windowsize*/ /* color variables, (needed only for dvisvga, almost constants) */ int varColorspergrey;; int varWhitecol; int varBlackcol; int varBordercol; int varTextcol; int varTextbackcol; int varFramecol; int varTfmcol; int varRectcol; int varBackcols; int varMarkscol; int varMarkhcol; int varFoundcol; int varHrefcol; int varMarkdcol; int varMixedcol; int varNumberofcolors; tmview/src/help.h0100644000175000017500000005746207250444702013366 0ustar tmoortmoor#define HELPWIDTH 60 #define HELPSTR "\ LIST OF COMMANDS WITH TYPICAL ARGUMENTS ************ V 01.03 / goto previous/next page (NUM) goto page NUM w.r.t. TeX-counters /// scroll the visible area / make scrolling finer/coarser center visible area <+>/<-> zoom in/out (NUM) set zoom-factor to NUM set a bookmark move to a bookmark <^> move back display options toggle statusline-information set unit of measurement show/hide screenmark and pagemark set pagemark at screenmark position show/hide marked rectangle

show/hide printable area set page-offset and -size show/hide half-hyper-tex-mark move to next href follow current href search for text <*> re-read DVIfile, fonts, eps-figures load/kill DVIfile quit tmview GENERAL USAGE ******************************************* When everything is setup right, visiting a DVIfile with tmview just means to navigate the visible area along that file, using the cursor-keys. Some of the following commands obviously require an argument, f.e. . Arguments are to be entered BEFORE executing a command. When executed by hitting the corresponding uppercase key, you will be asked for the argument. While the user-interface of tmview is meant to save keystrokes, it is not too intuitive. You may either read the following instructions, or just do . The cursor-keys and are taken as resp. . The keys and select the first resp. the last page. The cursor-keys and do resp. . All in all this means, that the cursor-keys do what they are meant to. When a mouse is connected, it moves any visible mark. When the right or left mousebutton is no good for anything else, moving the mouse while holding that button acts on the visible area instead. (That sounds bad, but works out fine) When the screenmark is shown (see ), the left mouse-button sets the pagemark (see ) and the right button marks a rectangle (see ). When the half-hyper-mark is shown, the left mouse-button follows the current href, if any. ********************************************************* NON-INTUITIVE USER-INTERFACE **************************** ********************************************************* To explain the way tmview expects to receive commands, a short nomenclature used in the sequel is given: Any text within `<' and `>' represents a single keystroke, while `(' and `)' mark the beginning resp. the end of a string to enter. So is about to hit the key named `h' and (25.4) could stand for <2><5> <.><4>. The carriage- return-key is referred by , the backspace-key or delete-key by and the escape-key by . Almost whenever a string is expected by tmview, you may use to remove the last character you typed. So even <2><5><6><.><4> results in (25.4). Note that a string does not need to be terminated by . To simplify a reference to a string, in this text any uppercase letters within `(' and `)' are not meant as a string, but as the name of some string. So we may read something like `(PP) scrolls PP percent to the left' as `typing in any number just before results in scrolling left according to that number'. COMMANDS AND ARGUMENTS*********************************** A command is executed by typing its name, which consists of a single character. Some of the above listed commands take numerical arguments. Arguments are always optional. They may be entered before executing the command. Multiple arguments are separated by <,> or <;>. If no argument is passed, a default is used. If an argument is passed, it serves as the default for following commands. Commands doing similar things share the same default arguments. Example: Typing (10) results in scrolling 10% to the left and sets the default for any scrolling commands to 10%. Thus typing afterwards results in scrolling 10% to the right. MAGIC ARGUMENT******************************************* As a special argument some commands accept the magic argument <*>. It is used either to vary the command in some way or to get the arguments from another place. <#> is equivalent to <*> and saves you from holding down the shift-key on some keyboards. for example centers the visible area. It excepts as argument the point which will be taken as origin. Since this will become the default for a future , you may measure out the origin only once. Even quicker it is to position the visible area by scrolling and then to do a <*>. This results in taking the current position as centered and so as default for a coming . As another example look at the command , which moves pages forward, according to a given argument resp. a default. By moving on the next page there are two modi available: 1. keep the visible area; 2. do center like . <*> toggles between these two modi. So in this case <*> acts as a kind of flag argument. SELECTING THE PAGE**************************************** / Select a page relative to the current page. moves towards the beginning of the DVIfile, while moves towards the end. A single argument (N) may specify the amount of movement in pages. However, (N) will NOT become the default value. The argument is (*), the page-moving-mode is toggled. See above. Example: (1) selects the previous page selects the next page Select a page with respect to TeX counters. A list of ten arguments (COUNT0; COUNT1; ... COUNT9) specifies the page to be selected. <*> may be used as wildcard. If there are more than one but less than ten arguments given, the others will be taken as <*>. Example: (26) selects the first page after the current page with a value of 26 in \\count0. MOVING AROUND ON CURRENT PAGE ****************************** /// Scrolling the visible area A single argument (PP) may be used to specify the amount of scrolling in percent of the screen-width. / resp. /down> both accept the argument (*) to toggle between: 1. stay on the current page; 2. scroll over pages. When scrolling over pages, you may view the whole document while using only the single key . Example: (20) scrolls 1/5 to the left. / Make scrolling finer/coarser These commands change the default argument for the above scrolling- commands. So and don't move the visible area at all, but they change the way the scrolling-commands act. Center the visible area Without any argument centers horizontally only, while centers in both directions. When two arguments (X,Y) are given, they describe the point on the page, which will become the middle of the visible area. When the argument (*) is given, the current position is taken as centered. When the screenmark is shown (see below ), and the argument (*) is given, the position of the screenmark becomes the center. This does move the visible area, but it does not move the screenmark. ZOOMING **************************************************** Set the zoom-factor This command requires one argument (F) which must be between 0.05 and 2. F will become the zoom-factor and the visible-area will be redrawn. Use (*) to adjust the zoom-factor such that the page horizontaly fits the visible-area. If the zoom-factor is 1, the pixels found in pk-files are just copied one by one to the screen. Since the resolution of our days screens seems to be less than that of our days printers, and since you may still want to use the same pk-files for printing and viewing, F=1 usually results in a magnification. So when you're just reading some text in some DVIfile you will set F to something like 0.3, depending on the involved resolutions. When the screenmark is visible (see ) the position of the screenmark is taken as the origin of zooming, i.e. it is fixed. When the screenmark is not visible, the middle of the screen is fixed. The current zoom-factor is displayed in the optional statusline, see . There are two zooming modi. The integer modus requieres 1/f to be an integer. This modus is quite fast, so good values are F=0.5, 0.333, 0.25, 0.2, 0.167 etc. The good thing about the slow modus is, that it allows you to choose the zoom-factor arbitrary (between 0.05 and 2). So poor students with small screens might find some optimum to make the text fit and still be readable. The bad thing about the slow modus is that it is slow. But since once zoomed glyphs are kept in memory, this slowness only hurts the first few pages after changing the zoom-factor. Modus selection is done by the display options . <+>/<-> Zoom in/out Increase/decrease the zoom-factor. When in the fast modus, step through the fast values only (see above). When an argument (PP) is given, it is taken as the amount of increasing/decreasing in percent of the current zoom-factor. This is likely to result in the slow modus. BOOKMARKS ************************************************** A bookmark remembers what is seen on the screen. That is the DVIfile, the page within that file, the position of the visable area and the zoom-factor. There are three kind of bookmarks ... file-bookmarks: Each file visited has a file-bookmark, containing the above information about what was seen on the screen when visited the last time, plus some information on the file, that is the paper-offset and -position, the location of the printable-area. file-bookmarks are generated automaticly. This results in easy re-visiting a DVIfile: you'll find it as left. A file-bookmark is removed by killing the DVIfile with , see below. back-bookmarks: When searching a text-string, following a href or moving to a bookmark, the position within the DVIfile might be changed to somewhere far far away. To simplify recovering fromsuch excursions, a back-bookmark will be generated automaticly. To prevent getting fed up with thousands of back-bookmarks, the total number of theese is limited. See <^> below. manual-bookmarks: After all you may install your own bookmarks, marking often visited places, say in some manuals. manual-bookmarks are named by a number. This number has to be unique whithin the DVIfile they belong to. To define a manual-bookmark use . Since manual-bookmarks belong to the DVIfile they are defined on, they get lost, when that DVIfile is killed by . All kind of bookmarks are kept in a ring-buffer. There is a so called current bookmark of each type. Visiting the bookmarks along the ring-buffer is done by for file- and manual-bookmarks, while <^> acts on back-bookmarks. Define/undefine manual-bookmark. When the current position is not already defined as a manual-bookmark, defines one. When an single numeric argument (NUM) is given, NUM will be the name of the newly defined bookmark. With no argument, a name will be generated automaticly. See below, for how to visit manual-bookmarks. When the current position is already defined as a manual-bookmark, undefines that manual-bookmark. Move to bookmark. When a single numeric argument (NUM) is given, moves to the manual-bookmark named NUM, if any. Since manual bookmarks are bound to DVIfiles, the current DVIfile will never change in that case. If no argument is given, goes moves the postion either thrue the ring-buffer of file-bookmarks or thrue the one of manual-bookmarks. To toggle between theese two modi, use the magic argument <*>. <^> Move back Move to the latest back-bookmark, if any. When a single numeric argument (TOTAL) is given, keep the TOTAL latest back-bookmarks and discard all the others. CHOOSING WHAT'S ON THE DISPLAY ***************************** Display options This command collects a number of general options on how the things get on the screen. Use the cursor keys (or ///) to navigate. > Greyscales. When the zoom-factor is less than 1, the glyphs may be displayed using grey-levels, making them more smooth. This takes some memory, so you are allowed to switch it off. On high-res displays there is no need for greyscaling anyway. > Eps-rendering. There is limited support for rendering eps-files by running ghostscript. However, this sometimes is quite slow and memory intensive, so you may turn it off. If rendering is enabled the results are buffered. Hence, if the eps-files are updated by some graphics program, you need to do a <*> to force rerendering. To disable certain eps-files individually, abort the rendering process by . > Double-page. There is also limited support for viewing two pages beside each other. Again their is some memory required to keep it all buffered. You may disable double paged viewing entirely. You may let tmview deceide on basis of the zoom-factor. Or you may permanently enable this feature. > Zooming. There is a fast zooming mode allowing only zomming by 1/f where f is required to be an integer. And there is an arbitrary mode to be selected. Toggle statusline-information While the standard statusline shows you the page-number of the current page and the arguments you are about to enter, you may select optional information for measuring out distances and so. See below. Set unit of measurement Whenever you specify arguments which are to describe a point on the page, this is done w.r.t. a unit of measurement, i.e. cm, mm, a.s.o.. This unit is also used, when the position of a mark is displayed in the statusline. MEASURING ************************************************** To allow you to measure distances on the page, there are two marks, the screenmark, which is fixed on the physical screen you're looking at, and the pagemark, which is fixed on the DVIfiles page. When you move the visible-area, the screenmark acts as drawn with edding on your monitor. The pagemark acts as drawn on the page. The optional statusline tells the position of the pagemark relative to the corner of the sheet of paper you're viewing. It also tells the position of the screenmark relative to the pagemark. To measure distances you first may switch this marks on, using . When the marks are shown, the scrolling commands don't act on the visible area anymore, but move the screenmark. For that case only moving the screenmark at the boarder of the screen results in scrolling. To move the pagemark just move the screenmark at the desired position and use to make the pagemark follow. Show/hide screenmark and pagemark This commands takes the two arguments (PM_X;PM_Y). The pagemark is put at position PM_X PM_Y w.r.t. the upper left corner of the page. The Screenmark may be moved with the scrolling-commands. Set pagemark at the position of the screenmark Beside of these marks there are three rectangles for measurement. First there is the boarder of the paper setup by the command-line options -h,-v and -p. Then there is the printable area, setup with the -k command-line option. Third the so called marked rectangle used. Show/hide marked rectangle The four arguments (LEFT,TOP,WIDTH,HIGHT) specify the position on page an the size of the marked rectangle. When pagemark and screenmark are shown, their positions are used as default. When they are hidden, the last position of the marked rectangle is used as default.

Show/hide printable area The four arguments (LEFT,RIGHT,TOP,BOTTOM) specify the margins of the printable area, w.r.t. the boarder of the page. When pagemark and screenmark are shown, the argument (*) sets the printable area to the rectangle described by screenmark and pagemark. When they are hidden, (*) takes the command-line-options resp. defaults -k of the printable area. Set paper-offset and -size The four arguments (HOFF;VOFF;WIDTH;HEIGHT) specify the boarder of the page. Have the top-left corner of a sheet of paper in mind. Then (HOFF,VOFF) is the offset of the DVIfile's origin to the left boarder of the paper. Standard values are HOFF=VOFF=2.54cm. WIDTH and HEIGHT are the width and the height of the sheet of paper. The sheet of paper is represented only by a frame on the screen. It does not affect the drawing of the DVIfile. When pagemark and screenmark are shown, the argument (*) sets the boarder of the page to the rectangle described by screenmark and pagemark. When they are hidden, (*) takes the command-line-options resp. defaults -h,-v and -p. HALF-HYPER ************************************************* tmview does some of the fancy hyper-tex things. I talk about HALF-hyper-tex, because tmview follows only links which point to somewhere within the currently visited dvi-file. So there is no connection to the net or so. But you might find it usefull (when editing a major project) to view an equation number this-and-that by clicking on this-and-that whereever the text refers to that equation. For information about hyper-tex, related macropackages and fully compatible viewer scan the net ... Show/hide half-hyper-mark Goto next href Follow current href, if any MISC ******************************************************* Search for text You will be asked for the text-string to be searched. You may enter a regular expression describing that string, that includes especially just to enter the string as it is. tmview will take the entire DVIfile as one huge text-string and then search for the next substring, fitting the regular expression you've enterd. Thereby \"next\" is ment with respect to the current page. So far this sounds quite easy, but there are some ugly details, based on the fact, that a DVIfile contains information on how to draw a bitmap representing your text. It does not contain information about from what characters in which order your text is made up. Even the PKfiles used to draw your text consist only of lots of glyphs but no character-codes, like ASCII or so. Building a huge text-string from a DVIfile is some kind of guessing. Fisrt: What kind of huge-string is build from the DVIfile? This string will consists of the letters ... , ... , the accent <\"> and the digits <0> ... <9>. It does NOT contain anything else, like , or <->: Whenbeingprinteditwouldlooklikethisnotreadableatall. Taking the DVIfile as huge string allows you to find all locations of a sub-string, say \"commandlineoptions\", even those that are seperarted by linebreaks (and hyphens) or pagebreaks. In turn, there is no chance to find all those locations, where \"commandlineoptions\" is seperated by a hypenation. To keep tmview from being confused by headings, there is another rule for building up the huge text-string: any glyph outside the printable area (see

) is ignored. So you may setup the printable area to ignore headings when searching. Second: How is the huge-string build up? To translate the list of glyphs found in the DVIfile to a text-string, the tfm-files are asked for the encoding-scheme. This does work with dc-fonts and cm-fonts, since the following encoding-scheme names are accepted: \"ASCII\", \"TeX text\", \"TeX math italic\", \"TeX math symbols\", \"TeX typewriter text\", \"Extended TeX Font Encoding - Latin\", \"Adobe StandardEncoding\". The alphanumerics ..., ..., <0> ... <9> are copied one by one to the huge text-string. Glyphs that \"look like\" a simple alphanumeric will be taken as that one it looks like. So the Tex input '\\c o', producing an 'o'-with-an-cedilla-accent, will be represented as a simple (o) in the text-string. This rule also works for all kind of ligatures. The TeX input 'ffl\\AE' will be represented by (fflAE). Any accent ON TOP of a glyph will be translated to a (\"), preceding whatever the glyph without that accent would be translated to. The TeX input '\\\"a' producing the german umlaut 'a'-with-two-dots-on-top, will be found as (\"a) in the generated text-string. The TeX input '\\aa' producing the scandinavian 'a'-with-circle-on-top will be found as (\"a) too. Any other glyphs are ignored. Third: In what does the above result? Visiting english documents, say manuals to some computer related stuff like elisp.dvi, searching for keywords works fine. Searching in documents in which extensive use of accents and funny characters is made works too, but requires some luck or/and experiance in how TeX acts on such things. Example: Take the file story.tex from the TeXbook, chapter 6, page 24. It contains the line galaxy called \\\"O\\\"o\\c c, The text-string build from the corresponding story.dvi will therfore contain galaxycalled\"O\"oc You may search for ... getting as result ... galaxy found galaxycalled found galaxy called not found d\" found galaxy.*\"O\"oc found Ooc not found Re-read current DVIfile and re-draw screen. Note: will not re-initialize the fontdatabase, nor the buffer for rendered eps-figures. To force everything beeing re-read, use (*). Load/kill DVIfile After typing you may select between to load a DVIfile and to kill a DVIfile. Loading a DVIFile: tmview will look for a file-bookmark belonging to that file. If there is one, it becomes the current file-bookmark. The DVIfile will be shown as left, and any defined manual-bookmarks are accessable by . When loading a DVIfile for the first time, a new file-bookmark will be generated. This will be setup with default values from the command-line options and won't contain any manual-bookmarks. Killing a DVIfile: To kill a DVIfile means to kill its file-bookmark and any related manual-bookmark. Killing a DVIfile won't hurt the file itself. You don't have to kill a DVIfile just to load another one. Quit tmview When quitting, a startup-file will be written. When running tmview next time, you will find almost everything as you left it. ********************************************************** End of help*********************************************** \n\n\n" char helpstr[]=HELPSTR; tmview/src/readdvi.c0100644000175000017500000013635007250444702014041 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ #include"defs.h" /*#define DEBUGDVI */ /*#define DEBUGFONTDATABASE */ /*#define DEBUGMACRO */ /********************************************************************/ /* fontdatabase managing ********************************************/ /********************************************************************/ #define FONTDATASTEP 32 #define MAXFONTDATA 10000 static int nfontdatabase; static int supfontdatabase; void initfontdatabase(void) { nfontdatabase=0; supfontdatabase=0; fontdatabase=NULL; #ifdef DEBUGFONTDATABASE pfprot("(initfontdatabase)"); #endif } int allocfontdesc(char* ffpath, char* ffname, long dvimag, long scf, long dsz) { fontdesc* font; int i; #ifdef DEBUGFONTDATABASE pfprot("(allocfontdesc: "); #endif for(i=0;i MAXFONTDATA) { pfprot("\nfatal error: fontdatabase exploded .. :-(\n"); exit(1); } #ifdef DEBUGFONTDATABASE pfprot(" reallocmem fontdatabase %x to ",fontdatabase); #endif supfontdatabase+=FONTDATASTEP; reallocmem(&fontdatabase,supfontdatabase * sizeof(fontdesc)); #ifdef DEBUGFONTDATABASE pfprot("%x ",fontdatabase); #endif } font=fontdatabase+nfontdatabase; i=nfontdatabase; nfontdatabase++; } font->chv = NULL; font->fonam = NULL; font->fopath = NULL; font->fodvimag = dvimag; font->foscf = scf; font->fodsz = dsz; font->pkfile = NULL; font->vffile = NULL; font->encoding = NULL; font->vffontvect = NULL; font->vffirst=-1; font->mch = -1; font->usecount=0; stralloccpy(&(font->fonam),ffname); stralloccpy(&(font->fopath),ffpath); #ifdef DEBUGFONTDATABASE pfprot("n=%d)",nfontdatabase); #endif return(i); } int searchfontdatabase(char* ffpath, char* ffname, long dvimag, long scf, long dsz) { fontdesc* font; int i; #ifdef DEBUGFONTDATABASE pfprot("(searchfontdatabase %s %s mag %6.1f scf %d dsz %d",ffpath,ffname,dvimag,scf,dsz); #endif for(i=0, font=fontdatabase;iusecount<0) continue; if(font->fodvimag != dvimag) continue; if(font->foscf != scf) continue; if(font->fodsz != dsz) continue; if(strcmp(font->fonam,ffname)) continue; if(strcmp(font->fopath,ffpath)) continue; #ifdef DEBUGFONTDATABASE pfprot(" found)"); #endif return(i); } #ifdef DEBUGFONTDATABASE pfprot(" not found)"); #endif return(-1); } void cleanfontdatabase(void) { fontdesc* font; int c,i; #ifdef DEBUGFONTDATABASE pfprot("(cleanfontdatabase "); j=0; #endif for(i=0, font=fontdatabase; iusecount==0) { #ifdef DEBUGFONTDATABASE j++; pfprot("-- font %d mch %d --",i,font->mch); #endif for(c=0;c<=font->mch;c++) if (font->chv[c].fty & PKTYPE) { freelrumem(&(font->chv[c].bmp.bits)); freelrumem(&(font->chv[c].bmp2.bits)); } if (font->chv[c].fty & VFTYPE) { freemem(&(font->chv[c].macro)); } freemem(&(font->chv)); freemem(&(font->pkfile)); freemem(&(font->vffile)); freemem(&(font->fonam)); freemem(&(font->fopath)); freemem(&(font->vffontvect)); font->usecount=-1; font->mch=-1; } } #ifdef DEBUGFONTDATABASE pfprot(" killed %d fontdescs)",j); #endif } void killfontdatabase(void) { int i; #ifdef DEBUGFONTDATABASE pfprot("(killfontdatabase)"); #endif for(i=0;i=0) fontdatabase[i].usecount=0; cleanfontdatabase(); freemem(&fontdatabase); supfontdatabase=0; nfontdatabase=0; } /*************************************************************************/ /* read from a dvifile ***************************************************/ /*************************************************************************/ FILE *dvifile=NULL; void dvibad(char* s) { if(dvierrorflag==0) { pfprot("\nbad dvi: %s\n", s); dvierrorflag=1; } } void dvibytes(char *s, long l) { if(l==0 || dvierrorflag) return; s[0]=0; s[l] = '\0'; if(fread(s,1,(long) l,dvifile)==0) dvibad("ends prematurely !"); } uchar dvibyte(void) { char rbuf[1]={138}; if(dvierrorflag) return(138); if(fread(rbuf, 1, 1, dvifile)==0) dvibad("ends prematurely !"); return(rbuf[0]); } void dviskip(long l) { if(dvierrorflag) return; if(fseek(dvifile,l,1)!=0) dvibad("ends prematurely !"); } long dvinum(uchar b) { uchar i; long n; uchar rbuf[4]={0,0,0,0}; if(dvierrorflag) return(0L); if(fread(rbuf, b, 1, dvifile)==0) dvibad("ends prematurely !"); n = 0; for (i = 1; i <= b; i++) n = (n << 8) | (uchar) rbuf[i-1]; return n; } long dviint(uchar b) { uchar i; long n; uchar rbuf[4]={0,0,0,0}; if(dvierrorflag) return(0L); if(fread(rbuf, b, 1, dvifile)==0) dvibad("ends prematurely !"); n = rbuf[0]; if (n > 127) n -= 256; for (i = 2; i <= b; i++) n = (n << 8) | rbuf[i-1]; return n; } void dviposit(long l) { if(dvierrorflag) return; if(fseek(dvifile, l, 0) !=0) dvibad("ends prematurely !") ; } long dvitell(void) { if(dvierrorflag) return(0L); return(ftell(dvifile)); } int dviopen(void) { dvifile= fopen(visfmk->dvifilename, "rb"); return(dvifile != NULL); } void dviclose(void) { if(dvifile != NULL) fclose(dvifile); dvifile=NULL; } void dvipositpost(void) { long l; uchar j, em; #ifdef DEBUGDVI pfprot("(postposit ... "); #endif if(dvierrorflag) return; dviposit(0L); if (dvibyte() != 247) { dvibad("no valid preamble"); return; } em = dvibyte(); fseek(dvifile,0L,2); do { fseek(dvifile,-2L,1); j=dvibyte(); } while (j == 223); if (j != em) { dvibad("no valid postamble"); return; } fseek(dvifile, -5L, 1); l = dvinum(4); fseek(dvifile, l, 0); if (dvibyte() != 248) dvibad("no valid postamble"); #ifdef DEBUGDVI pfprot(")"); #endif } /************************************************************************/ /* process a dvifile ****************************************************/ /************************************************************************/ /* local globals for dvi-file-processing */ /* (only dvimag is real global, since it is used by readvf.c) */ static long hs[SMAX], vs[SMAX], ws[SMAX], xs[SMAX], ys[SMAX], zs[SMAX]; static char comment[257], dvicomment[257]; static double conv, vconv, sconv, svconv; static long a, b, q, w, x, y, z, h, v; static long spl, mxh, mxv, lastpage; static int cfont; static ushort s, mst; void fontdef(long fontnr) { uchar p, q; int f,fdb; long dsz,scf,chksum; float fontmag; fontdesc *font; char ffpath[MAXPATHSTR], fftuto[MAXPATHSTR]; char fontname[MAXPATHSTR]; char messtr[MAXPATHSTR+20]; #ifdef DEBUGFONTDATABASE pfprot("(fontdef ..."); #endif if (fontnr < 0) { dvibad("negative fontnumber"); return; } chksum = dvinum(4); scf = dvinum(4); dsz = dvinum(4); p = dvibyte(); q = dvibyte(); dvibytes(fontname, q); if (p != 0) dvibytes(ffpath, p); fontmag = xres * (dvimag / 1000.0 * ((double)scf / dsz)); pfprot("preparing font: %8s at %6.1f ", fontname, fontmag); pfverb("(scf %d dsz %d) ",scf,dsz); /* messaging: this is defined in tmview.c !! */ sprintf(messtr,"%10s at %6.1f",fontname,fontmag); if(proceedthis(messtr)) {dvibad("user interrupt"); return;} fdb=-1; if (p==0) { if((fdb=searchfontdatabase(vfprefix,fontname,dvimag,scf,dsz))==-1) fdb=searchfontdatabase(fontprefix,fontname,dvimag,scf,dsz); } else { fdb=searchfontdatabase(ffpath,fontname,dvimag,scf,dsz); } if(fdb!=-1) { pfprot(" - fontdatabase"); font=fontdatabase+fdb; if(font->vffile!=NULL) /* look for involved pks/tfms */ vflookuppk(fdb); font=fontdatabase+fdb; /* vflookup might cause reallocation of fontdatabase */ } else { if (p==0) strcpy(ffpath, vfprefix); fdb=allocfontdesc(ffpath,fontname,dvimag,scf,dsz); font=fontdatabase+fdb; allocmem(&(font->chv),(MAXCHARS+1) * sizeof(chdesc)); memset(font->chv,0,(MAXCHARS+1) * sizeof(chdesc)); /* unsused bitmaps=NULL */ /* unused fty 0 */ /* unused dimensions 0*/ /* unused macros = 0*/ if(tfmfind(tfmprefix,fontname,fftuto)) tfmdef(fftuto,fdb,chksum); if(vffind(ffpath,fontname,fftuto)) { vfdef(fftuto,fdb,chksum,fontnr); font=fontdatabase+fdb; /* reallocation of fontdatabase */ } else { if (p==0) strcpy(ffpath, fontprefix); if(pkfind(ffpath,fontname,fontmag,fftuto)) { pkdef(fftuto,fdb,chksum); stralloccpy(&(font->fopath),ffpath); } } reallocmem(&(font->chv),sizeof(chdesc)*(font->mch + 2)); } /* assign an internal font numer, ie an index in fontvec */ f = fontnr % MAXFONTS; if(fontvect[f].fontdataptr != -1){ if(fontvect[f].dfn == fontnr) dvibad("double fontnumber"); for(f=MAXFONTS-1; f>=0; f--){ if(fontvect[f].fontdataptr == -1) break; if(fontvect[f].dfn == fontnr) dvibad("double fontnumber"); } } if(f<0) dvibad("too many fonts"); else { font->usecount++; fontvect[f].fontdataptr=fdb; fontvect[f].dfn = fontnr; pfprot("\n"); } #ifdef DEBUGFONTDATABASE pfprot("... fontdef: done)"); #endif } #define Getfont(fontnr) (unigetfont(fontnr,fontvect,MAXFONTS)) #define VFGetfont(fontnr,vffvect) (unigetfont(fontnr,vffvect,VFMAXFONTS)) int unigetfont(long fontnr, fontdescvect* fvect, int fvectlen) { int a, f, atleast; f = fontnr % fvectlen; if (fvect[f].fontdataptr != -1) if (fvect[f].dfn == fontnr) return(fvect[f].fontdataptr); a = 0; atleast=-1; do { if(fvect[a].fontdataptr == -1) a++; else if (fvect[a].dfn != fontnr) atleast=a++; else return(fvect[a].fontdataptr); } while (a < fvectlen); pfprot("\n %u ->",fontnr); dvibad("is not defined as a fontnumber"); if(atleast!=-1) return(fvect[atleast].fontdataptr); pfprot("\n fatal error: not a single valid font. sorry\n"); exit(1); } static void pagebeg(pagelistelement* apage) { uchar j; for (j = 0; j <= 9; j++) /* count[j] = forget it */ dvinum(4); dvinum(4); s = 0; w = 0; x = 0; y = 0; z = 0; h = 0; v = 0; htex_beginpage(apage); loadcolorstack(apage); /* assume its read already */ } static void pageend(pagelistelement* apage) { if (s != 0) pfprot("warning: stack not empty at eop"); htex_endpage(); if(apage->num+1num+1].cstackp<0) savecolorstack(pagelist+apage->num+1); } static void preamb(void) { uchar l; long num,den; #ifdef DEBUGDVI pfprot("(preamb ... "); #endif l = dvibyte(); num = dvinum(4); den = dvinum(4); den = MAX(1,den); dvimag = dvinum(4); if (newmag != 0) dvimag = newmag; conv = num / 254000.0 * ((double)xres / den) * (dvimag / 1000.0); vconv = num / 254000.0 * ((double)yres / den) * (dvimag / 1000.0); l = dvibyte(); dvibytes(dvicomment, l); pfprot("%s\n", dvicomment); pfverb("num %d den %d mag %d\n",num,den,dvimag); #ifdef DEBUGDVI pfprot("... preamb done)"); #endif } static int opentestdvi(void) { uchar l; if(!dviopen()) return(0); dviposit(14L); l=dvibyte(); dvibytes(comment, l); #ifdef DEBUGDVI pfprot("(test dvi <%s> <%s>)",dvicomment,comment); #endif if(strcmp(comment,dvicomment)==0) return(1); else return(0); } int testdvi(void) { int ret; ret=opentestdvi(); dviclose(); return(ret); } static void postamb(void) { long num,den; #ifdef DEBUGDVI pfprot("(postamb ... "); #endif lastpage=dvinum(4); num = dvinum(4); den = dvinum(4); dvimag = dvinum(4); if (newmag != 0) dvimag = newmag; den=MAX(1,den); conv = num / 254000.0 * ((double)xres / den) * (dvimag / 1000.0); vconv = num / 254000.0 * ((double)yres / den) * (dvimag / 1000.0); mxv = dvinum(4); mxh = dvinum(4); mst = dvinum(2); pageanz = dvinum(2); #ifdef DEBUGDVI pfprot(")"); #endif } static void initpagelist(void) { short i; uchar o; #ifdef DEBUGDVI pfprot("(initpagelist: pageanz %d ",pageanz); #endif allocmem(&pagelist,MAX(1,pageanz)*sizeof(pagelistelement)); memset(pagelist,0,MAX(1,pageanz)*sizeof(pagelistelement)); /* all lists NULL */ for(i=0;i=0) { dviposit(pagelist[i].addr); o= dvibyte(); if(o!=139) { dvibad("corruptet pagelist"); return; } for (o = 0; o <= 9; o++) pagelist[i].count[o] = dvinum(4); pagelist[i].num=i; if(i==0) break; /*SCHLEIFENENDE HIER !!! */ /*pfprot("%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d \n", pagelist[i].count[0],pagelist[i].count[1],pagelist[i].count[2], pagelist[i].count[3],pagelist[i].count[4],pagelist[i].count[5], pagelist[i].count[6],pagelist[i].count[7],pagelist[i].count[8], pagelist[i].count[9]);*/ pagelist[--i].addr=dvinum(4); } #ifdef DEBUGDVI pfprot(")"); #endif } short gotoprpage(short pn) { uchar o; pn=MIN(pageanz-1,pn); pn=MAX(0,pn); dviposit(pagelist[pn].addr); o= dvibyte(); if(o!=139) dvibad("corruptet pagelist"); if(dvierrorflag) return(0); /*if(pn==7) *((char*)NULL)=3; test for the signal catching */ return(pn); } short gotocccpage(double* ccc, short sp) { short i; /*fprintf(prot, "(gotocccpage pos %d ccc %f %f %f %f %f %f %f %f %f %f )", sp,ccc[0], ccc[1], ccc[2], ccc[3], ccc[4], ccc[5], ccc[6], ccc[7], ccc[8], ccc[9]); */ if(dvierrorflag) return(0); sp=MIN(pageanz-1,MAX(0,sp)); /* for safty only ?? */ i=sp+1; if(i==pageanz) i=0; do { if((ccc[0] == PGMAGIC || ccc[0] == pagelist[i].count[0]) && (ccc[1] == PGMAGIC || ccc[1] == pagelist[i].count[1]) && (ccc[2] == PGMAGIC || ccc[2] == pagelist[i].count[2]) && (ccc[3] == PGMAGIC || ccc[3] == pagelist[i].count[3]) && (ccc[4] == PGMAGIC || ccc[4] == pagelist[i].count[4]) && (ccc[5] == PGMAGIC || ccc[5] == pagelist[i].count[5]) && (ccc[6] == PGMAGIC || ccc[6] == pagelist[i].count[6]) && (ccc[7] == PGMAGIC || ccc[7] == pagelist[i].count[7]) && (ccc[8] == PGMAGIC || ccc[8] == pagelist[i].count[8]) && (ccc[9] == PGMAGIC || ccc[9] == pagelist[i].count[9]) ) break; i++; if(i==pageanz) i=0; } while(i!=sp); /*fprintf(prot,"--- found (?) %d )",i);*/ return(i); } void readcolorstack(pagelistelement*); /* forward */ void initdvi(void) { long f; uchar o; int i; #ifdef DEBUGDVI pfprot("(initdvi..."); #endif dviname=visfmk->dvifilename; for(i=0;visfmk->dvifilename[i]!=0;i++) if(visfmk->dvifilename[i]==DIRSEPCHAR) dviname=visfmk->dvifilename+i+1; pfprot("\nfile: %s\n",visfmk->dvifilename); dvierrorflag=0; allocmem(&fontvect,MAXFONTS*sizeof(fontdescvect)); for(i=0;imch < c) { pfverb( "(putchar: warning: skipping undefined charakter %d in %s)",c,font->fonam); q = 0; return; } /* pfprot("(%c)",c); */ /*pfprot("(listchar %d ... )",c);*/ /*if(font->encoding) fprintf(prot,"%s",font->encoding[c]); */ thechar=font->chv+c; if (thechar->fty & TFMTYPE) htex_recordbits(h,v-thechar->tfmtfh, thechar->tfmtfw,thechar->tfmtfd+thechar->tfmtfh); else htex_recordbits(h,v,1,1); if(thechar->fty & PKTYPE) { /* try pk first*/ /*fprintf(prot," its a pk: c %d fin %d h %d v %d ...)",c,fontintnr,h,v);*/ #ifdef LETSTRYCOLOR if(dimmcolor==3) return; #endif q = thechar->tfw; if(fshrink == 1.0) { data=drawlistadd(*drawcharbmp); (*data).chr.h= LROUND(conv * h); (*data).chr.v= LROUND(vconv * v); (*data).chr.chdp=thechar; (*data).chr.c=dimmcolor; return; } if(colors == BLACKNWHITE || fshrink < 1.0) { data=drawlistadd(*drawcharbmp2bw); (*data).chr.h= LROUND(sconv * h); (*data).chr.v= LROUND(svconv * v); (*data).chr.chdp=thechar; (*data).chr.c=dimmcolor; return; } /*if shrinked and greyed { ... */ /*pfprot("do shr&gs");*/ data=drawlistadd(*drawcharbmp2gs); (*data).chr.h= LROUND(sconv * h); (*data).chr.v= LROUND(svconv * v); (*data).chr.chdp=thechar; (*data).chr.c=dimmcolor; return; } /* end pk */ if (thechar->fty & VFTYPE) { /* try vf */ if(thechar->macro==NULL) { pfverb( "(putchar: warning: skipping macro %d in %s)",c,font->fonam); return; } /* Debugging code: draw at least something */ /*br = LROUND(sconv * (thechar->tfw)); hr = LROUND(sconv * h); vr = LROUND(svconv *v); data=drawlistadd(*drawrulebg); (*data).rect.c=TFMCOL; (*data).rect.x=hr; (*data).rect.y=vr; (*data).rect.w=br; (*data).rect.h=3; */ runvfmacro(thechar); q = thechar->tfw; return; } /* end vf */ if (thechar->fty & TFMTYPE) { /* try tfm */ hr = LROUND(sconv * h); vr = LROUND(svconv * (v - thechar->tfmtfh)); br = LROUND(sconv * (thechar->tfmtfw)); ar = LROUND(svconv * (thechar->tfmtfd + thechar->tfmtfh)); data=drawlistadd(*drawrulebg); (*data).rect.c=TFMCOL; (*data).rect.x=hr; (*data).rect.y=vr; (*data).rect.w=br; (*data).rect.h=1; data=drawlistadd(*drawrulebg); (*data).rect.c=TFMCOL; (*data).rect.x=hr; (*data).rect.y=vr+ar-1; (*data).rect.w=br; (*data).rect.h=1; data=drawlistadd(*drawrulebg); (*data).rect.c=TFMCOL; (*data).rect.x=hr; (*data).rect.y=vr; (*data).rect.w=1; (*data).rect.h=ar; data=drawlistadd(*drawrulebg); (*data).rect.c=TFMCOL; (*data).rect.x=hr+br-1; (*data).rect.y=vr; (*data).rect.w=1; (*data).rect.h=ar; /* drawlistadd(*drawrulebg,hr, vr, br, ar, TFMCOL, NULL); */ q = thechar->tfmtfw; return; } /* end tfm */ pfverb( "(putchar: warning: skipping undefined charakter %d in %s)",c,font->fonam); q = 0; } #define MAXSPECIAL 500 /*lazy, but don't expect long specials */ #define MAXSPECIALPROT 30 char specstr[MAXSPECIAL]; static void listspecial(void) { long i; #ifdef DEBUGDVI pfprot("(special: length %d)",spl); #endif if(spl>=MAXSPECIAL) { pfverb("(special too long: <"); for(i = 0; i )"); } else pfverb(">)"); return; } dvibytes(specstr,spl); if(checkndoHyperTeX(specstr,h,v)) return; if(checkndoEpsFile(specstr,h,v,sconv,svconv)) return; if(checkndoColor(specstr)) return; /* insert other specials here */ specstr[MIN(MAXSPECIALPROT,MAXSPECIAL)]=0; if(spl<=MAXSPECIALPROT) pfverb("(special <%s> ignored)",specstr); else pfverb("(special <%s ...> ignored)",specstr); }; static void listrule(void) { double le,bo,hi,wi; ushort gs; drawlistdata* data; if ((b <= 0) || (a<=0)) return; htex_recordbits(h,v,b,a); le = LROUND(sconv * h); bo = LROUND(svconv * v); hi = svconv * a; wi = sconv * b; /*fprintf(prot, "(listrule: le %5.1f bo %5.1f wi %5.1f hi %5.1f) ",le,bo,wi,hi);*/ #ifdef LETSTRYCOLOR if(dimmcolor==3) return; /* dimmned completely */ #endif if(fshrink == 1.0) { /* do it like they told me ... not shrunken*/ wi=LCEIL(wi); hi=LCEIL(hi); data=drawlistadd(*drawruleor); (*data).rect.x=le; (*data).rect.y=bo-hi+1; (*data).rect.w=wi; (*data).rect.h=hi; (*data).rect.c= vgadimm(BLACKCOL,dimmcolor); return; } if(colors==BLACKNWHITE) { /* shrunken, blacknwhite*/ wi=MAX(1,LROUND(wi)); /*enshure drawing something*/ hi=MAX(1,LROUND(hi)); data=drawlistadd(*drawruleor); (*data).rect.x=le; (*data).rect.y=bo-hi+1; (*data).rect.w=wi; (*data).rect.h=hi; (*data).rect.c=vgadimm(BLACKCOL,dimmcolor); return; } /* is greyscaled*/ data=drawlistadd(*drawruleor); (*data).rect.x=le; (*data).rect.y=bo-LFLOOR(hi)+1; (*data).rect.w=LFLOOR(wi); (*data).rect.h=LFLOOR(hi); (*data).rect.c=vgadimm(BLACKCOL,dimmcolor); gs=(uchar)(LROUND((COLORS_PER_GREY-1)*(wi-LFLOOR(wi)))); if(wi < 1) gs=MAX(1,gs); data=drawlistadd(*drawruleor); (*data).rect.x=le+LFLOOR(wi); (*data).rect.y=bo-LROUND(hi)+1; (*data).rect.w=1; (*data).rect.h=LROUND(hi); (*data).rect.c=vgadimm(gs,dimmcolor); gs=(uchar)(LROUND((COLORS_PER_GREY-1)*(hi-LFLOOR(hi)))); if(hi < 1) gs=MAX(1,gs); data=drawlistadd(*drawruleor); (*data).rect.x=le; (*data).rect.y=bo-LFLOOR(hi); (*data).rect.w=LROUND(wi); (*data).rect.h=1; (*data).rect.c=vgadimm(gs,dimmcolor); /*pfprot("did id\n");*/ } /************************************************************/ /* Macro processing: Striktly non-recursive, all global !! */ /* ... Hm. V00.04: make it recursive by backing things up */ static long macropos; static uchar* macrodata; static long macrolen; uchar macrobyte(void) { if(macrolen-macropos < 1) return 0L; return macrodata[macropos++]; } long macronum(uchar b) { uchar i; long n; if(macrolen-macropos < b) return 0L; n = 0; for (i = 1; i <= b; i++) n = (n << 8) | (uchar) macrodata[macropos+i-1]; macropos+=b; return n; } long macroint(uchar b) { uchar i; long n; if(macrolen-macropos < b) return 0L; n = macrodata[macropos]; if (n > 127) n -= 256; for (i = 2; i <= b; i++) n = (n << 8) | macrodata[macropos+i-1]; macropos+=b; return n; } void runvfmacro(chdesc* thechar){ uchar o,c; ushort d1,d2; int vfcfont; long f, scf; long omacropos,omacrolen; uchar* omacrodata; omacrolen=macrolen; omacropos=macropos; omacrodata=macrodata; macropos=0; macrodata=thechar->macro; macrolen=thechar->mlen; vfcfont=cfont; /* global from readdvi: vf we're in */ scf=FD(vfcfont)->foscf; cfont=VFGetfont(FD(vfcfont)->vffirst,FD(vfcfont)->vffontvect); #ifdef DEBUGMACRO pfprot("(run macro c %u in %s ... ", thechar->ch, fontdatabase[thechar->fontdataptr].fonam); pfprot("macrodata at 0x%x macrolen %u : ",macrodata,macrolen); for(i=0;i= 171 && o <= 234) { cfont=VFGetfont(o-171,FD(vfcfont)->vffontvect); } else switch (o) { case 128: case 129: case 130: case 131: c = macronum(o - 127); listchar(c,FD(cfont)); h += q; break; case 132: a = scaled(macroint(4), scf); b = scaled(macroint(4), scf); listrule(); h += b; break; case 133: case 134: case 135: case 136: c = macronum(o - 132); listchar(c,FD(cfont)); break; case 137: a = scaled(macroint(4), scf); b = scaled(macroint(4), scf); listrule(); break; case 138: break; case 139: dvibad("macro: unexpectet bop"); break; case 140: break; case 141: if (s < SMAX) { s++; hs[s - 1] = h; vs[s - 1] = v; ws[s - 1] = w; xs[s - 1] = x; ys[s - 1] = y; zs[s - 1] = z; } else dvibad("macro: stack overflow"); break; case 142: if (s > 0) { h = hs[s - 1]; v = vs[s - 1]; w = ws[s - 1]; x = xs[s - 1]; y = ys[s - 1]; z = zs[s - 1]; s--; } else dvibad("macro: stack underflow"); break; case 143: case 144: case 145: case 146: h += scaled(macroint(o - 142), scf); break; case 147: h += w; break; case 148: case 149: case 150: case 151: w = scaled(macroint(o - 147), scf); h += w; break; case 152: h += x; break; case 153: case 154: case 155: case 156: x = scaled(macroint(o - 152), scf); h += x; break; case 157: case 158: case 159: case 160: v += scaled(macroint(o - 156), scf); break; case 161: v += y; break; case 162: case 163: case 164: case 165: y = scaled(macroint(o - 161), scf); v += y; break; case 166: v += z; break; case 167: case 168: case 169: case 170: z = scaled(macroint(o - 166), scf); v += z; break; case 235: case 236: case 237: case 238: f = macronum(o - 234); cfont=VFGetfont(f,FD(vfcfont)->vffontvect); break; case 239: case 240: case 241: case 242: spl = macronum(o - 238); macropos+=spl; pfprot("(ignoring special within macro)"); break; case 243: case 244: case 245: case 246: f = macronum(o-242); pfprot("(fontdef within macro ignored)"); macropos+=12L; d1 = macrobyte(); d2 = macrobyte(); macropos+=((long)(d1 + d2)); break; case 250: case 251: case 252: case 253: case 254: case 255: pfprot("(skipping unknown opc > 249 within macro)");break; default: } /* end switch o */ } if (s > 0) { h = hs[s - 1]; v = vs[s - 1]; w = ws[s - 1]; x = xs[s - 1]; y = ys[s - 1]; z = zs[s - 1]; s--; } else dvibad("macro: stack underflow"); macrolen=omacrolen; macropos=omacropos; macrodata=omacrodata; cfont=vfcfont; #ifdef DEBUGMACRO pfprot("... macro)"); #endif } /*************************************/ /* finally lets read a page ... */ void readpage(pagelistelement* apage){ uchar o,c; ushort d1,d2; long f; if(apage->drawlist!=NULL) return; readcolorstack(apage); /* make sure, colorstack is in pagelist */ if(!opentestdvi()) { dvibad("dvifile changed/disappeared? reload!"); return; } #ifdef DEBUGDVI pfprot("(readpage ..."); #endif sconv=conv/apage->fshr; svconv=vconv/apage->fshr; drawlistinit(apage); gotoprpage(apage->num); if(dvierrorflag) return; pfprot("[%d",apage->num); pagebeg(apage); q=0; o = dvibyte(); while (o != 140 && dvierrorflag ==0) { #ifdef DEBUGDVI pfprot("(%d)",o); #endif if (o <= 127) { listchar(o,FD(cfont)); h += q; } else if (o >= 171 && o <= 234) { cfont=Getfont(o-171); } else switch (o) { case 128: case 129: case 130: case 131: c = dvinum(o - 127); listchar(c,FD(cfont)); h += q; break; case 132: a = dviint(4); b = dviint(4); listrule(); h += b; break; case 133: case 134: case 135: case 136: c = dvinum(o - 132); listchar(c,FD(cfont)); break; case 137: a = dviint(4); b = dviint(4); listrule(); break; case 138: break; case 139: dvibad("unexpectet bop"); break; case 140: break; case 141: if (s < SMAX) { s++; hs[s - 1] = h; vs[s - 1] = v; ws[s - 1] = w; xs[s - 1] = x; ys[s - 1] = y; zs[s - 1] = z; } else dvibad("stack overflow"); break; case 142: if (s > 0) { h = hs[s - 1]; v = vs[s - 1]; w = ws[s - 1]; x = xs[s - 1]; y = ys[s - 1]; z = zs[s - 1]; s--; } else dvibad("stack underflow"); break; case 143: case 144: case 145: case 146: h += dviint(o - 142); break; case 147: h += w; break; case 148: case 149: case 150: case 151: w = dviint(o - 147); h += w; break; case 152: h += x; break; case 153: case 154: case 155: case 156: x = dviint(o - 152); h += x; break; case 157: case 158: case 159: case 160: v += dviint(o - 156); break; case 161: v += y; break; case 162: case 163: case 164: case 165: y = dviint(o - 161); v += y; break; case 166: v += z; break; case 167: case 168: case 169: case 170: z = dviint(o - 166); v += z; break; case 235: case 236: case 237: case 238: f = dvinum(o - 234); cfont=Getfont(f); break; case 239: case 240: case 241: case 242: spl = dvinum(o - 238); listspecial(); break; case 243: case 244: case 245: case 246: f = dvinum(o-242); /* fprintf(prot,"(fontdef:%d)",f); */ dviskip(12L); d1 = dvibyte(); d2 = dvibyte(); dviskip((long)(d1 + d2)); break; case 250: case 251: case 252: case 253: case 254: case 255: pfprot("skipping unknown opc > 249 ");break; default: } /* end switch o */ o = dvibyte(); } htex_scalebox(sconv,svconv); pageend(apage); pfprot("] "); dviclose(); if(dvierrorflag) drawlistinit(apage); drawlistfix(); #ifdef DEBUGDVI pfprot("... done readpage)"); #endif return; } /****************************************************************************/ /* searching textstrings ****************************************************/ /****************************************************************************/ /* searchmachine ?? is it good? is it bad? */ /* lots of global data is used ?!? */ static int fstart,fend, found; static int boundx1pxl, boundx2pxl, boundy1pxl, boundy2pxl; static long dpos; static int dpage; static char errorstr[MAXARGSTR+1]; #define MAXSBUF MAXARGSTR typedef struct positioninfo { long pos; int page; int x1pxl; int y1pxl; int x2pxl; int y2pxl; } positioninfo; #define INFLEN sizeof(positioninfo) static positioninfo sbufinfo1[MAXSBUF+1]; static positioninfo sbufinfo2[MAXSBUF+1]; static char sbufstr1[MAXSBUF+1]; static char sbufstr2[MAXSBUF+1]; static positioninfo *sbufinfoc, *sbufinfoo; static char *sbufstrc, *sbufstro; static int slenc, sleno; static struct re_pattern_buffer repatbuf; static struct re_registers reregs; static char schnell[256]; positioninfo* cxinfo(int idx) { if(idx 0) pfprot("start[0] %d end[0] %d --",reregs.start[0],reregs.end[0]); #endif if(res>-1 && reregs.num_regs > 0) { /* asking num_regs for safty only */ fstart=MIN(MAX(0,reregs.start[0]),sleno+slenc-1); /* for safty only */ fend=MIN(MAX(0,reregs.end[0]),sleno+slenc-1); /* for safty only */ found=1; } } void settextmark(void){ int i; #ifdef DEBUGDVI pfprot("(settextmark ..."); #endif textx1pxl=cxinfo(fstart)->x1pxl; texty1pxl=cxinfo(fstart)->y1pxl; textx2pxl=cxinfo(fstart)->x2pxl; texty2pxl=cxinfo(fstart)->y2pxl; for(i=fstart+1; iy1pxl>texty2pxl && cxinfo(i)->x2pxlpage != cxinfo(i-1)->page) break; if(textx1pxl>cxinfo(i)->x1pxl) textx1pxl=cxinfo(i)->x1pxl; if(texty1pxl>cxinfo(i)->y1pxl) texty1pxl=cxinfo(i)->y1pxl; if(textx2pxlx2pxl) textx2pxl=cxinfo(i)->x2pxl; if(texty2pxly2pxl) texty2pxl=cxinfo(i)->y2pxl; } textx3pxl=textx1pxl; texty3pxl=texty1pxl; textx4pxl=textx1pxl; texty4pxl=texty1pxl; if(ipage == cxinfo(i-1)->page) { textx3pxl=cxinfo(i)->x1pxl; texty3pxl=cxinfo(i)->y1pxl; textx4pxl=cxinfo(i)->x2pxl; texty4pxl=cxinfo(i)->y2pxl; for(i++; iy1pxl>texty4pxl && cxinfo(i)->x2pxlpage != cxinfo(i-1)->page) break; if(textx3pxl>cxinfo(i)->x1pxl) textx3pxl=cxinfo(i)->x1pxl; if(texty3pxl>cxinfo(i)->y1pxl) texty3pxl=cxinfo(i)->y1pxl; if(textx4pxlx2pxl) textx4pxl=cxinfo(i)->x2pxl; if(texty4pxly2pxl) texty4pxl=cxinfo(i)->y2pxl; } }} #ifdef DEBUGDVI pfprot(")"); #endif } void searchsetq(int c,fontdesc *font) { chdesc *thechar; if(font->mch < c) { q = 0; } else { thechar=font->chv+c; if (thechar->fty == TFMTYPE) /* is only tfm !!! */ q = thechar->tfmtfw; else /* else it must be a pk */ q = thechar->tfw; } } void searchchar(int c,fontdesc *font) { chdesc *achar; int alen,i,x1pxl,x2pxl,y1pxl,y2pxl; char *astr; q=0; if(font->mch < c) return; achar=font->chv+c; if(achar->fty == TFMTYPE) /* is only tfm !!! */ q = achar->tfmtfw; else /* else it must be a pk */ q = achar->tfw; if(!font->encoding) return; if (achar->fty & TFMTYPE) { x1pxl=LROUND(sconv * h); y1pxl=LROUND(svconv * (v-achar->tfmtfh)); x2pxl=LROUND(sconv * (h+achar->tfmtfw)); y2pxl=LROUND(svconv * (v+achar->tfmtfd)); } else { x1pxl=LROUND(sconv * h); y1pxl=LROUND(svconv * v); x2pxl=LROUND(sconv * h); y2pxl=LROUND(svconv * v); } if(x1pxlboundx2pxl) return; if(y1pxlboundy2pxl) return; astr=font->encoding[c]; alen=strlen(astr); if(alen==0) return; if(alen+slenc > MAXSBUF) { /* dothesearch */ searchsbuf(); if(found) return; if(sbufstrc==sbufstr1) { /* sawp buffer 1 and 2 */ sbufstrc=sbufstr2; sbufstro=sbufstr1; sbufinfoc=sbufinfo2; sbufinfoo=sbufinfo1; } else { sbufstrc=sbufstr1; sbufstro=sbufstr2; sbufinfoc=sbufinfo1; sbufinfoo=sbufinfo2; } sleno=slenc; sbufstrc[0]=0; slenc=0; } strcat(sbufstrc,astr); /* add to buffer */ sbufinfoc[slenc].pos=dpos; sbufinfoc[slenc].page=dpage; sbufinfoc[slenc].x1pxl=x1pxl; sbufinfoc[slenc].y1pxl=y1pxl; sbufinfoc[slenc].x2pxl=x2pxl; sbufinfoc[slenc].y2pxl=y2pxl; for(i=1;i=startpos) searchchar(c,FD(cfont)); searchsetq(c,FD(cfont)); h += q; break; case 132: a = dviint(4); b = dviint(4); h += b; break; case 133: case 134: case 135: case 136: c = dvinum(o - 132); if(dpos>=startpos) searchchar(c,FD(cfont)); break; case 137: a = dviint(4); b = dviint(4); break; case 138: break; case 139: dvibad("unexpectet bop"); break; case 140: break; case 141: if (s < SMAX) { s++; hs[s - 1] = h; vs[s - 1] = v; ws[s - 1] = w; xs[s - 1] = x; ys[s - 1] = y; zs[s - 1] = z; } else dvibad("stack overflow"); break; case 142: if (s > 0) { h = hs[s - 1]; v = vs[s - 1]; w = ws[s - 1]; x = xs[s - 1]; y = ys[s - 1]; z = zs[s - 1]; s--; } else dvibad("stack underflow"); break; case 143: case 144: case 145: case 146: h += dviint(o - 142); break; case 147: h += w; break; case 148: case 149: case 150: case 151: w = dviint(o - 147); h += w; break; case 152: h += x; break; case 153: case 154: case 155: case 156: x = dviint(o - 152); h += x; break; case 157: case 158: case 159: case 160: v += dviint(o - 156); break; case 161: v += y; break; case 162: case 163: case 164: case 165: y = dviint(o - 161); v += y; break; case 166: v += z; break; case 167: case 168: case 169: case 170: z = dviint(o - 166); v += z; break; case 235: case 236: case 237: case 238: f = dvinum(o - 234); cfont=Getfont(f); break; case 239: case 240: case 241: case 242: spl = dvinum(o - 238); dviskip((long)spl); break; case 243: case 244: case 245: case 246: f = dvinum(o-242); dviskip(12L); d1 = dvibyte(); d2 = dvibyte(); dviskip((long)(d1 + d2)); break; case 250: case 251: case 252: case 253: case 254: case 255: break; default: if (o <= 127) { if(dpos>=startpos) searchchar(o,FD(cfont)); searchsetq(o,FD(cfont)); h += q; } else if (o >= 171 && o <= 234) { cfont=Getfont(o-171); } break; } /* end switch o */ dpos++; o = dvibyte(); } /* end a page */ startpos=0; } while(found ==0); /*end search*/ if(found==0) searchsbuf(); /* last chance to find anything ... */ if(found) { *spos=dpos; *spage=dpage; } #ifdef DEBUGDVI pfprot(" ... searchreaddvi done)"); #endif } const char* searchdvi(char* sstr, int* spage, long* spos){ int ssl; int myspage; long myspos; const char* restr; #ifdef DEBUGDVI pfprot("(searchdvi sstr (%d) %s ... ",ssl,sstr); #endif if(!opentestdvi()) { dvibad("dvifile changed/disappeared? reload!"); return(0); /* killdvi(); initdvi(); if(!opentestdvi()) { dvibad("dvifile reloading failed!"); return(0); } */ } boundx1pxl=MMTOPXL(visfmk->lrandmm)-MMTOPXL(visfmk->hoffmm); boundy1pxl=MMTOPXL(visfmk->orandmm)-MMTOPXL(visfmk->voffmm); boundx2pxl=MMTOPXL(visfmk->papxmm-visfmk->rrandmm)-MMTOPXL(visfmk->hoffmm); boundy2pxl=MMTOPXL(visfmk->papymm-visfmk->urandmm)-MMTOPXL(visfmk->voffmm); sbufstrc=sbufstr1; sbufstro=sbufstr2; sbufinfoc=sbufinfo1; sbufinfoo=sbufinfo2; sbufstrc[0]=0; sbufstro[0]=0; slenc=0; sleno=0; ssl=strlen(sstr); if(ssl==0) return(0); repatbuf.buffer=NULL; repatbuf.allocated=0; repatbuf.translate=NULL; repatbuf.fastmap=schnell; re_syntax_options= RE_SYNTAX_POSIX_EXTENDED; if((restr=re_compile_pattern(sstr,ssl,&repatbuf))!=NULL) { #ifdef DEBUGDVI pfprot("\nregex-error %s)\n",restr); #endif strcpy(errorstr,"REGEX PANIC: "); strncat(errorstr,restr,MAXARGSTR-13); errorstr[MAXARGSTR]=0; repatbuf.fastmap=NULL; regfree(&repatbuf); return(errorstr); } found=0; myspage=*spage; myspos=*spos; searchreaddvi(&myspage,&myspos); if(found==1) { *spage=cxinfo(fstart)->page; *spos=cxinfo(fstart)->pos; settextmark(); } repatbuf.fastmap=NULL; regfree(&repatbuf); dviclose(); #ifdef DEBUGDVI pfprot(" ..done seachdvi)"); #endif if(found) return(NULL); strcpy(errorstr,"SEARCH FAILED"); return(errorstr); } /*****************************************************************************/ /* searching anchors (hypertex) **********************************************/ /*****************************************************************************/ void anchorcharq(int c, fontdesc *font) { chdesc *thechar; if(font->mch < c) {q=0; return;} thechar=font->chv+c; if (thechar->fty == TFMTYPE) /* is only tfm !!! */ q = thechar->tfmtfw; else /* else it must be a pk */ q = thechar->tfw; if (thechar->fty & TFMTYPE) htex_recordbits(h,v-thechar->tfmtfh, thechar->tfmtfw,thechar->tfmtfd+thechar->tfmtfh); else htex_recordbits(h,v,1,1); } void readanchors(int page) { uchar o,c; ushort d1,d2; long f; if(!opentestdvi()) { dvibad("dvifile changed/disappeared? reload!"); return; /* killdvi(); initdvi(); if(!opentestdvi()) { dvibad("dvifile reloading failed!"); return; } */ } if(page != gotoprpage(page)){ dviclose(); return; } dviskip(44L); /* counts and 4*/ htex_beginpage(pagelist+page); s = 0; w = 0; x = 0; y = 0; z = 0; h = 0; v = 0; q=0; o = dvibyte(); while (!dvierrorflag && o != 140) { /* fprintf(prot,"(%d)",o);*/ switch (o) { case 128: case 129: case 130: case 131: c = dvinum(o - 127); anchorcharq(c,FD(cfont)); h += q; break; case 132: a = dviint(4); b = dviint(4); if ((b > 0) && (a>0)) htex_recordbits(h,v,b,a); h+=b; break; case 133: case 134: case 135: case 136: c = dvinum(o - 132); anchorcharq(c,FD(cfont)); break; case 137: a = dviint(4); b = dviint(4); if ((b > 0) && (a>0)) htex_recordbits(h,v,b,a); break; case 138: break; case 139: dvibad("unexpectet bop"); break; case 140: break; case 141: if (s < SMAX) { s++; hs[s - 1] = h; vs[s - 1] = v; ws[s - 1] = w; xs[s - 1] = x; ys[s - 1] = y; zs[s - 1] = z; } else dvibad("stack overflow"); break; case 142: if (s > 0) { h = hs[s - 1]; v = vs[s - 1]; w = ws[s - 1]; x = xs[s - 1]; y = ys[s - 1]; z = zs[s - 1]; s--; } else dvibad("stack underflow"); break; case 143: case 144: case 145: case 146: h += dviint(o - 142); break; case 147: h += w; break; case 148: case 149: case 150: case 151: w = dviint(o - 147); h += w; break; case 152: h += x; break; case 153: case 154: case 155: case 156: x = dviint(o - 152); h += x; break; case 157: case 158: case 159: case 160: v += dviint(o - 156); break; case 161: v += y; break; case 162: case 163: case 164: case 165: y = dviint(o - 161); v += y; break; case 166: v += z; break; case 167: case 168: case 169: case 170: z = dviint(o - 166); v += z; break; case 235: case 236: case 237: case 238: f = dvinum(o - 234); cfont=Getfont(f); break; case 239: case 240: case 241: case 242: spl = dvinum(o - 238); if(spl= 171 && o <= 234) { cfont=Getfont(o-171); } break; } /* end switch o */ o = dvibyte(); } /* end a page */ htex_endpage(); dviclose(); } int searchhref(char* href, int* spage, int* xpxl, int* ypxl){ int an; char messtr[MAXPATHSTR+20]; if(htex_is_url(href)) return(0); an=htex_findonpage(href,pagelist+ *spage); if(an==-1) { if(pageanz>1) htex_findondonepage(href,spage,&an); if(an== -1) { for(*spage=0;*spagecstackp>=0) return; killcolorstack(); if(apage->num==0) { savecolorstack(apage); return; } for(page=apage->num;page>=0;page--) /* done up to where? */ if(pagelist[page].cstackp>=0) break; if(page>=0) loadcolorstack(pagelist+page); else page=0; if(!opentestdvi()) { dvibad("dvifile changed/disappeared? reload!"); return; } for(;pagenum;page++){ /* go through pages */ /*pfprot("(read colorstack %d)",page); */ if(page != gotoprpage(page)){ dviclose(); return; } dviskip(44L); /* counts and 4*/ o = dvibyte(); while (!dvierrorflag && o != 140) { /* fprintf(prot,"(%d)",o);*/ switch (o) { case 128: case 129: case 130: case 131: dvinum(o - 127); break; case 132: dviint(4); dviint(4); break; case 133: case 134: case 135: case 136: dvinum(o - 132); break; case 137: a = dviint(4); b = dviint(4); break; case 139: dvibad("unexpectet bop"); break; case 143: case 144: case 145: case 146: dviint(o - 142); break; case 148: case 149: case 150: case 151: dviint(o - 147); break; case 153: case 154: case 155: case 156: dviint(o - 152); break; case 157: case 158: case 159: case 160: dviint(o - 156); break; case 162: case 163: case 164: case 165: dviint(o - 161); break; case 167: case 168: case 169: case 170: dviint(o - 166); break; case 235: case 236: case 237: case 238: dvinum(o - 234); break; case 239: case 240: case 241: case 242: spl = dvinum(o - 238); if(spl 127) b -= 256; return b; } short pki2(void) { short b; b = pkn1(); if (b > 127) b -= 256; return (b * 256 + pkn1()); } long pki3(void) { long b; b = pki1(); return (b * 65536L + pkn2()); } long pki4(void) { long b; b = pki2(); return (b * 65536L + pkn2()); } int pknib(void) { unsigned Result; if (pkbitpos <0) { pkactbyte = pkn1(); pkbitpos=4; } Result= pkactbyte >> pkbitpos; pkbitpos -= 4; /*fprintf(prot,"(pknib: n %d p %d)",Result & 0xf,pkbitpos);*/ return (Result & 0x0f); } int pkpackednum(void){ int i,j; /*fprintf(prot,"pkpackednum? ");*/ if ((i = pknib()) == 0) { do { j = pknib(); ++i; } while (j == 0); while (i > 0) { j = (j << 4) | pknib(); --i; } return (j - 15 + ((13 - pkdynf) << 4) + pkdynf); } else { if (i <= pkdynf) return i; if (i < 14) return (((i - pkdynf - 1) << 4) + pknib() + pkdynf + 1); if (i == 14) pkrepcount = pkpackednum(); else pkrepcount = 1; return pkpackednum(); } } void setpkname(char* fn, float fm, int delta, char* result) { char buff[MAXPATHSTR]; int i,j; /*fprintf(prot,"(setpkname: %s ",fontformat);*/ i=0; *result=0; while(1) { /*fprintf(prot,"%s ",result);*/ j=i; for(;(fontformat[i] != 0) && (fontformat[i] != '@');i++); strncat(result,fontformat+j,i-j); if(fontformat[i] == 0) break; i++; switch(fontformat[i]){ case 'm': case 'M': sprintf(buff,"%ld",(long)(fm+0.55+delta)); break; case 'r': case 'R': sprintf(buff,"%ld",(long)(5*fm+0.55+delta)); break; case 'n': case 'N': strcpy(buff,fn); break; case 'k': case 'K': strncpy(buff,fn,8); buff[8]=0; break; default: *buff=0; } strcat(result,buff); i++; } /*fprintf(prot,"%s)",ffname);*/ } #ifdef KPATHSEA /* use kpathsea if wanted */ int pkfind(char* ffpath,char* fontname,float fontmag,char* fftuto) { int foundfile; FILE* fofile; kpse_glyph_file_type font_ret; char *kpsename=NULL; unsigned dpi; dpi = kpse_magstep_fix((unsigned) (fontmag +.5), xres, NULL); kpsename = kpse_find_pk(fontname, dpi, &font_ret); foundfile = (kpsename!=NULL); if(kpsename){ strncpy(fftuto, kpsename,MAXPATHSTR-1); fftuto[MAXPATHSTR-1]=0; freemem(&kpsename); if (!(strcmp(fontname,font_ret.name)==0)) pfprot(" - using %s at %d instead ", font_ret.name, font_ret.dpi); else if (!kpse_bitmap_tolerance ((double)font_ret.dpi, (double) dpi)) pfprot(" - loading at %d ", font_ret.dpi); } #else /* use my own subs (slow) */ int pkfind(char* ffpath,char* fontname,float fontmag,char* fftuto) { char ffname[MAXPATHSTR]; int delta, foundfile; FILE* fofile; setpkname(fontname,fontmag,0,ffname); foundfile=msearch(ffpath,ffname,fftuto); if(foundfile==0) { pfverb(" - resizing "); for(delta=(int)(-0.002*fontmag) -1; delta<=(int)(0.002*fontmag)+1;delta++){ if(delta==0) delta=1; setpkname(fontname,fontmag,delta,ffname); foundfile=msearch(ffpath,ffname,fftuto); if(foundfile!=0) break; } } #endif /* tail of pkfind */ if(foundfile==0) { pfprot(" - no PKfile "); return(0); } fofile=fopen(fftuto,"rb"); if ((fgetc(fofile)!=0xf7)||(fgetc(fofile)!=0x59)){ pfprot(" - error in PKfile "); fclose(fofile); return(0); } pfprot(" - PKfile "); pfverb("%s ",fftuto); fclose(fofile); return(1); } int pkdef(char* fftuto,int fdb,long chksum) { long l, goonaddr, fpwidth, dchksum, needmem; unsigned long w,h; uchar b, bb; uchar terminate; short i, c; chdesc *achar; int mchpk; #ifdef DEBUGPK pfprot("(pkdef: "); #endif allocmem(&(FD(fdb)->pkfile),strlen(fftuto)+1); strcpy(FD(fdb)->pkfile, fftuto); pkopen(fftuto); #ifdef DEBUGPK pfprot(" %s - charakters: ",FD(fdb)->fonam); #endif l=fpwidth=w=h=c=0; mchpk=-1; terminate = 0; do { b = pkn1(); if (b >= 240) { switch (b) { case 240: case 241: case 242: case 243: /*skip specials */ l = 0; for (i = 240; i <= b; i++) l = (l << 8) + pkn1(); pkskip(l); break; case 244: pkskip(4L); break; case 245: terminate = 1; break; case 246: break; case 247: b = pkn1(); i = pkn1(); pkskip((long) i + 4); dchksum = pki4(); /* some people were too confused. since MakeTeXPk and so. */ if (chksum != 0) if (dchksum != 0) if (chksum != dchksum) pfverb(" - wrong checksum "); pkskip(8L); break; case 248: case 249: case 250: case 251: case 252: case 253: case 254: case 255: break; } } else { /* a char */ bb = b & 7; /* fprintf(prot,"(def type %d)",bb); */ switch (bb) { case 0: case 1: case 2: case 3: l = (((long) bb) << 8) + pkn1(); c = pkn1(); break; case 4: case 5: case 6: l = (((long) (bb & 3)) << 16) + pkn2(); c = pkn1(); break; case 7: l = pki4(); c = pki4(); break; } goonaddr=l+pktell(); /* fprintf(prot,"(goon off %u)",l);fflush(prot); */ if(c>=MAXCHARS) { pfprot(" - ignoring character %d ",c); } else { /* code < 256 */ achar = FD(fdb)->chv+c; #ifdef DEBUGPK pfprot(" c %d at 0x%x ", c, achar); #endif achar->flag = b; b &= 0x7; switch (b) { case 0: case 1: case 2: case 3: fpwidth = pkn3(); pkn1(); w = pkn1(); h = pkn1(); achar->hof = pki1(); achar->vof = pki1(); break; case 4: case 5: case 6: fpwidth = pkn3(); pkn2(); w = pkn2(); h = pkn2(); achar->hof = pki2(); achar->vof = pki2(); break; case 7: fpwidth = pki4(); pki4(); pki4(); w = pkn4(); h = pkn4(); achar->hof = pki4(); achar->vof = pki4(); break; } needmem=((long)h)*((long)ROUNDUP(w,BITS_PER_BMUNIT/GREYSCALE)) *BYTES_PER_BMUNIT; if (w > 0x7fff || h > 0x7fff || needmem > maxlinmem){ pfprot( " - ignoring character %d (w=%ud h=%ud mem=%ud) ", c, w,h,needmem); } else { /* mem ok */ achar->fty |= PKTYPE; achar->fontdataptr = fdb; achar->ch = c; achar->bmp.w = w; achar->bmp.h = h; achar->bmp.type=BLACKNWHITE; achar->bmp.bits= NULL; achar->bmp2.bits= NULL; achar->tfw = scaled(fpwidth,FD(fdb)->foscf); achar->addr = pktell(); /* fprintf(prot,"width %d hight %d hof %d vof %d \n", w,h,achar->hof,achar->vof); */ } /* end not too large */ } /*end code <256 */ pkposit(goonaddr); if (mchpk < c) mchpk = c; } } while (!terminate); pkclose(); #ifdef DEBUGPK pfprot(" ... pkdef)"); #endif if (mchpk < 0) { pfprot(" - PKfile in error "); freemem(&(FD(fdb)->pkfile)); return(0); } else pfverb(" - PKfile ok "); if (mchpk > FD(fdb)->mch) FD(fdb)->mch=mchpk; return(1); } void pkloadchar(chdesc *thechar){ uchar theflag; char paint_switch; char* pkfilen; int i, j; int row_bit_pos; BMUNIT *cp; BMUNIT word; int word_weight, bytes_wide; int rows_left, h_bit, count; theflag = thechar->flag; pkdynf = theflag >> 4; pkfilen=(fontdatabase+thechar->fontdataptr)->pkfile; #ifdef DEBUGPK pfprot("(pkloadchar: charpt 0x%x,fontdataptr %d char %d ...", thechar,thechar->fontdataptr,thechar->ch); #endif pkopen(pkfilen); pkposit(thechar->addr); paint_switch = ((theflag & 8) != 0); #ifdef DEBUGPK pfprot("width %d hight %d hof %d vof %d ", thechar->bmp.w,thechar->bmp.h, thechar->hof,thechar->vof); #endif /* * now read rest of character code */ alloc_bitmapbw(&thechar->bmp); cp = thechar->bmp.bits; bytes_wide = thechar->bmp.bmu_wide * BYTES_PER_BMUNIT; pkbitpos = -1; word=0; if (pkdynf == 14) { /* get raster by bits */ /* fprintf(prot,"raster: "); */ clear_bitmap(&thechar->bmp); for (i = 0; i < thechar->bmp.h; i++) { /* get all rows */ cp = ADD(thechar->bmp.bits, i * bytes_wide); row_bit_pos = BITS_PER_BMUNIT; for (j = 0; j < thechar->bmp.w; j++) { /* get one row */ if (--pkbitpos < 0) { word = pkn1(); pkbitpos = 7; } if (--row_bit_pos < 0) { cp++; row_bit_pos = BITS_PER_BMUNIT - 1; } if (word & (1 << pkbitpos)) *cp |= ((BMUNIT)1) << row_bit_pos; } } } else { /* get packed raster */ /* fprintf(prot,"packed raster \n"); fflush(prot); */ rows_left = thechar->bmp.h; h_bit = thechar->bmp.w; pkrepcount = 0; word_weight = BITS_PER_BMUNIT; word = 0; while (rows_left > 0) { /* fprintf(prot,"rl %d ",rows_left); fflush(prot); */ count = pkpackednum(); /* fprintf(prot,"count %d \n",count); fflush(prot); */ while (count > 0) { /* fprintf(prot,"ct %d hb %d ww %d \n", count,h_bit,word_weight); fflush(prot); */ if (count < word_weight && count < h_bit) { h_bit -= count; word_weight -= count; if (paint_switch) word |= bit_masks[count] << word_weight; count = 0; } else if (count >= h_bit && h_bit <= word_weight) { if (paint_switch) word |= bit_masks[h_bit] << (word_weight - h_bit); *cp++ = word; /* "output" row(s) */ for (i = pkrepcount * bytes_wide / BYTES_PER_BMUNIT; i > 0; --i) { *cp = *SUB(cp, bytes_wide); ++cp; } rows_left -= pkrepcount + 1; pkrepcount = 0; word = 0; word_weight = BITS_PER_BMUNIT; count -= h_bit; h_bit = thechar->bmp.w; } else { if (paint_switch) word |= bit_masks[word_weight]; *cp++ = word; word = 0; count -= word_weight; h_bit -= word_weight; word_weight = BITS_PER_BMUNIT; } } paint_switch = 1 - paint_switch; } if (cp != (BMUNIT*) ((uchar*) thechar->bmp.bits + bytes_wide * thechar->bmp.h)){ pfprot("Wrong number of bits stored: char. %d, font %s", thechar->ch,pkfilen); exit(1); } if (rows_left != 0 || h_bit != thechar->bmp.w) { pfprot("Bad PKfile (%s), too many bits", pkfilen); exit(1); } } pkclose(); /* print_bitmap(&thechar->bmp); */ #ifdef DEBUGPK pfprot("... pkloadchar)"); #endif } /* pixel count stuff. sample is stolen from xdvi */ int bmu_wide; #define SETBMUW(a) bmu_wide=(a) int sample(BMUNIT* bits,int bitskip,int w, int h) { BMUNIT *p, *endp; register BMUNIT *cp; int bitsleft; register int n,bitshift,wid; p=bits+(bitskip>>BITS_LOG2); endp=bits+h*bmu_wide; bitsleft=w; bitshift=BITS_PER_BMUNIT- (bitskip & (BITS_PER_BMUNIT-1)); n=0; while(bitsleft) { wid=bitshift; if(wid>bitsleft) wid=bitsleft; if(wid>8) wid=8; bitshift-=wid; for(cp=p;cp> bitshift) & bit_masks[wid]]; if(bitshift==0) { bitshift=BITS_PER_BMUNIT; ++p; } bitsleft -= wid; } return n; } int samplerow(BMUNIT* bits,int bitskip,int w) { BMUNIT *p; int bitsleft; register int n,bitshift,wid; p=bits+(bitskip >> BITS_LOG2); bitsleft=w; bitshift=BITS_PER_BMUNIT- (bitskip & (BITS_PER_BMUNIT-1)); n=0; while(bitsleft) { wid=bitshift; if(wid>bitsleft) wid=bitsleft; if(wid>8) wid=8; bitshift-=wid; n+=bit_count[(*p >> bitshift) & bit_masks[wid]]; if(bitshift==0) { bitshift=BITS_PER_BMUNIT; ++p; } bitsleft -= wid; } return n; } int samplecol(BMUNIT* bits,int bitskip,int h) { BMUNIT *endp, mask; register BMUNIT *cp; register int n; mask=((BMUNIT)1 << (BITS_PER_BMUNIT-1)) >> (bitskip & (BITS_PER_BMUNIT -1)); endp=bits+h*bmu_wide; n=0; for(cp=bits+(bitskip >> BITS_LOG2);cp>BITS_LOG2)) & ((BMUNIT) 1 << (BITS_PER_BMUNIT-1)) >> ((x) & (BITS_PER_BMUNIT -1))) ? 1 : 0) /* ******************************************************** now there comes some bitmap shrinking stuff the first two are for integer shrinking factors only, and are stolen from xdvi. the second two work with float factors alwell as with faktors less than 1. but they are not too fast. ******************************************************** */ #if 0 void pkshrinkcharbw(chdesc* theChar) { int rowsleft, rows, colsleft, initcols; register int cols; int shrunkbuw,shrunkh; int ishrink; BMUNIT *oldp, *newp; register BMUNIT m,*cp; int blevel; /* fprintf(prot,"(pkshrinkgbw)\n"); */ freelrumem(&(theChar->bmp2.bits)); touchlrumem(&(theChar->bmp.bits)); ishrink=ROUND(fshrink); blevel=ishrink*ishrink/4; theChar->hof2=theChar->hof / ishrink; initcols=theChar->hof-theChar->hof2*ishrink; if(initcols <=0) initcols+=ishrink; else ++theChar->hof2; theChar->bmp2.w = theChar->hof2 + ROUNDUP(theChar->bmp.w - theChar->hof,ishrink); cols=theChar->vof +1; /* buffer cols */ theChar->vof2 = cols / ishrink; rows=cols-theChar->vof2*ishrink; if(rows <= 0) { rows+=ishrink; --theChar->vof2; } theChar->bmp2.h=shrunkh=theChar->vof2 + ROUNDUP(theChar->bmp.h-cols,ishrink) +1; theChar->bmp2.type=BLACKNWHITE; locklrumem(&theChar->bmp.bits); alloc_bitmapbw(&theChar->bmp2); unlocklrumem(&theChar->bmp.bits); oldp=theChar->bmp.bits; if(oldp==NULL) { pfprot("\nfatal error: memory management, cannot happen? sorry\n") exit(1); } newp=theChar->bmp2.bits; shrunkbuw=theChar->bmp2.bmu_wide; rowsleft=theChar->bmp.h; memset(newp,0,BYTES_PER_BMUNIT*shrunkbuw*shrunkh); while(rowsleft) { if(rows>rowsleft) rows=rowsleft; colsleft=theChar->bmp.w; m=(((BMUNIT)1) << (BITS_PER_BMUNIT -1)); cp=newp; cols=initcols; while(colsleft){ if(cols>colsleft) cols=colsleft; if(sample(oldp,theChar->bmp.bmu_wide,theChar->bmp.w-colsleft, cols,rows)>=blevel) *cp|=m; if(m==1) { m=(((BMUNIT)1) << (BITS_PER_BMUNIT -1)); ++cp; } else m >>=1; colsleft-=cols; cols=ishrink; } newp+=shrunkbuw; oldp+=rows*theChar->bmp.bmu_wide; rowsleft-=rows; rows=ishrink; } theChar->vof2=theChar->vof/ishrink; theChar->shrink=fshrink; /*print_bitmap(&(theChar->bmp)); */ /*print_bitmap(&(theChar->bmp2));*/ } #endif void pkshrinkchargs(chdesc* theChar) { int rowsleft, rows, colsleft, initcols; register int cols; int shrunkbuw,shrunkh, ishrink; BMUNIT *oldp, *newp; register BMUNIT m,*cp; #ifdef DEBUGPK pfprot("(pkshrinkchargs: fontdatptr %d char %d ...", theChar->fontdataptr,theChar->ch); #endif freelrumem(&(theChar->bmp2.bits)); touchlrumem(&(theChar->bmp.bits)); ishrink=ROUND(fshrink); /* fprintf(prot,"fshr %f ishr %d\n",fshrink,ishrink); */ theChar->hof2=theChar->hof / ishrink; initcols=theChar->hof-theChar->hof2*ishrink; if(initcols <=0) initcols+=ishrink; else ++theChar->hof2; theChar->bmp2.w = theChar->hof2 + ROUNDUP(theChar->bmp.w - theChar->hof,ishrink); cols=theChar->vof +1; /* buffer cols */ theChar->vof2 = cols / ishrink; rows=cols-theChar->vof2*ishrink; if(rows <= 0) { rows+=ishrink; --theChar->vof2; } theChar->bmp2.h=shrunkh=theChar->vof2 + ROUNDUP(theChar->bmp.h-cols,ishrink) +1; theChar->bmp2.type=GREYSCALE; locklrumem(&theChar->bmp.bits); alloc_bitmapgs(&theChar->bmp2); unlocklrumem(&theChar->bmp.bits); oldp=theChar->bmp.bits; if(oldp==NULL) { pfprot("\nfatal error: memory management, cannot happen? sorry\n"); exit(1); } newp=theChar->bmp2.bits; shrunkbuw=theChar->bmp2.bmu_wide; SETBMUW(theChar->bmp.bmu_wide); rowsleft=theChar->bmp.h; memset(newp,0,BYTES_PER_BMUNIT*shrunkbuw*shrunkh); #ifndef GREYINBMU while(rowsleft) { if(rows>rowsleft) rows=rowsleft; colsleft=theChar->bmp.w; m= BITS_PER_BMUNIT -GREYSCALE; cp=newp; cols=initcols; while(colsleft){ if(cols>colsleft) cols=colsleft; *cp |= ((BMUNIT)greytab[(sample(oldp,theChar->bmp.w-colsleft, cols,rows))]) << m; if(m) m-=GREYSCALE; else { m=BITS_PER_BMUNIT -colors; ++cp; }; colsleft-=cols; cols=ishrink; } newp+=shrunkbuw; oldp+=rows*theChar->bmp.bmu_wide; rowsleft-=rows; rows=ishrink; } #else /* that is ifdef GREYINBMU */ while(rowsleft) { if(rows>rowsleft) rows=rowsleft; colsleft=theChar->bmp.w; cp=newp; cols=initcols; while(colsleft){ if(cols>colsleft) cols=colsleft; *cp |= greytab[(sample(oldp,theChar->bmp.w-colsleft, cols,rows))]; cp++; colsleft-=cols; cols=ishrink; } newp+=shrunkbuw; oldp+=rows*theChar->bmp.bmu_wide; rowsleft-=rows; rows=ishrink; } #endif theChar->vof2=theChar->vof/ishrink; theChar->shrink=fshrink; /*print_bitmap(&(theChar->bmp)); */ /*print_bitmap(&(theChar->bmp2)); */ #ifdef DEBUGPK pfprot("... pkshrinkchargs)"); #endif } void pkshrinkcharazgs(chdesc* theChar) { int destbmuw, srcbmuw, j,i; int rows,cols,firstcols,firstrows,srcrow,srccol,sam; int mrows,mcols; BMUNIT m; BMUNIT *cp,*destptr,*srcptr; #ifdef DEBUGPK pfprot("(pkshrinkazgs: fontdataptr %d char %d ...", theChar->fontdataptr,theChar->ch); #endif /* fshrink >=1 expected !! */ if(fabs(fshrink-ROUND(fshrink))<.01) {pkshrinkchargs(theChar); return;} freelrumem(&(theChar->bmp2.bits)); touchlrumem(&(theChar->bmp.bits)); theChar->shrink=fshrink; theChar->hof2= CEIL(theChar->hof / fshrink); firstcols=theChar->hof-ROUND((theChar->hof2-1)*fshrink); if(firstcols == 0) { firstcols=MAX(ROUND(fshrink),1); --theChar->hof2; } if(firstcols>=theChar->bmp.w) firstcols=theChar->bmp.w; theChar->vof2= CEIL((theChar->vof+1) / fshrink); firstrows=theChar->vof+1-ROUND((theChar->vof2-1)*fshrink); if(firstrows == 0) { firstrows=MAX(ROUND(fshrink),1); --theChar->vof2; } --theChar->vof2; if(firstrows>=theChar->bmp.h) firstrows=theChar->bmp.h; theChar->bmp2.w = CEIL(theChar->bmp.w / fshrink) +2; theChar->bmp2.h = CEIL(theChar->bmp.h / fshrink) +2; if(firstrows<=0 || firstcols<=0) pfprot("IMPORTANT DEBUGINFORMATION break with fro %d fco %d fshr %f hof %d vof %d hof2 %d vof2 %d\n",firstrows,firstcols, fshrink,theChar->hof,theChar->vof,theChar->hof2,theChar->vof2); theChar->bmp2.type=GREYSCALE; locklrumem(&theChar->bmp.bits); alloc_bitmapgs(&theChar->bmp2); unlocklrumem(&theChar->bmp.bits); destptr=theChar->bmp2.bits; destbmuw=theChar->bmp2.bmu_wide; memset(destptr,0,BYTES_PER_BMUNIT*destbmuw*theChar->bmp2.h); srcptr=theChar->bmp.bits; srcbmuw=theChar->bmp.bmu_wide; SETBMUW(srcbmuw); if(srcptr==NULL) { pfprot("\nfatal error: memory management, cannot happen? sorry\n"); exit(1); } /* pfprot("srcw %d srch %d destw %d desth %d \n", theChar->bmp.w,theChar->bmp.h,theChar->bmp2.w,theChar->bmp2.h); */ /* #ifndef GREYINBMU */ rows=firstrows; srcrow=0; i=theChar->vof2+1; mrows=ROUND(i*fshrink)-ROUND((i-1)*fshrink); while(rows>0) { m= BITS_PER_BMUNIT -GREYSCALE; cp=destptr; srccol=0; cols=firstcols; /*pfprot("col:: i %d srcrow %d rows %d mrows %d \n",i,srcrow,rows,mrows);*/ j= -theChar->hof2; mcols=ROUND((j+1)*fshrink)-ROUND(j*fshrink); while(cols>0) { sam=sample(srcptr, srccol, cols,rows); /* pfprot(" j %d srccol %d cols %d mcols %d sam %d\n", j,srccol,cols,mcols,sam);*/ if(sam!=0) *cp |= (BMUNIT)((COLORS_PER_GREY-1)*sam/(float)(mcols*mrows)) << m; /* *cp |= (BMUNIT)(greytab[sam]) << m; */ if(m) m-=GREYSCALE; else { m=BITS_PER_BMUNIT - GREYSCALE; ++cp; }; j++; srccol+=cols; mcols=ROUND((j+1)*fshrink)-ROUND(j*fshrink); cols=MIN(mcols,theChar->bmp.w-srccol); } /* pfprot("did row\n");*/ i--; destptr+=destbmuw; srcrow+=rows; mrows=ROUND(i*fshrink)-ROUND((i-1)*fshrink); rows=MIN(mrows,theChar->bmp.h-srcrow); srcptr=theChar->bmp.bits+srcrow*srcbmuw; } /* #else that is ifdef GREYINBMU */ /* #endif */ /*print_bitmap(&(theChar->bmp));*/ /*print_bitmap(&(theChar->bmp2)); */ #ifdef DEBUGPK pfprot(" ...pkshrinkazgs)"); #endif } void pkshrinkcharazprecgs(chdesc* theChar) { int destbmuw, srcbmuw, j,i; int ox,oy,ix,iy,ow,oh,iw,ih; float fi,fj,frows,fcols,fsam,topweight,botweight,leftweight,rightweight; BMUNIT m; BMUNIT *cp,*destptr,*srcptroy,*srcptroyb,*srcptriy,*srcptriyb; #ifdef DEBUGPK pfprot("(pkshrinkprecazgs: fontdptr %d char %d ...", theChar->fontdataptr,theChar->ch); #endif /* fshrink >=1 expected !! */ if(fabs(fshrink-ROUND(fshrink))<.01) {pkshrinkchargs(theChar); return;} freelrumem(&(theChar->bmp2.bits)); touchlrumem(&(theChar->bmp.bits)); theChar->shrink=fshrink; theChar->hof2= CEIL(theChar->hof / fshrink); theChar->vof2= CEIL((theChar->vof+1) / fshrink) -1; theChar->bmp2.w = CEIL(theChar->bmp.w / fshrink) +2; theChar->bmp2.h = CEIL(theChar->bmp.h / fshrink) +2; theChar->bmp2.type=GREYSCALE; locklrumem(&theChar->bmp.bits); alloc_bitmapgs(&theChar->bmp2); unlocklrumem(&theChar->bmp.bits); destptr=theChar->bmp2.bits; destbmuw=theChar->bmp2.bmu_wide; memset(destptr,0,BYTES_PER_BMUNIT*destbmuw*theChar->bmp2.h); srcbmuw=theChar->bmp.bmu_wide; SETBMUW(srcbmuw); if(theChar->bmp.bits==NULL) { pfprot("\nfatal error: memory management, cannot happen? sorry\n"); exit(1); } /*pfprot("DEBUG fshr %f hof %d vof %d hof2 %d vof2 %d\n", fshrink, theChar->hof,theChar->vof,theChar->hof2,theChar->vof2); pfprot("srcw %d srch %d destw %d desth %d \n", theChar->bmp.w,theChar->bmp.h,theChar->bmp2.w,theChar->bmp2.h); */ /* #ifndef GREYINBMU */ i=theChar->vof2+1; fi=(float)(theChar->vof+1); frows=MIN(fi-fshrink*(i-1),theChar->bmp.h); while(1) { oy=theChar->vof+1-CEIL(fi); if(oy>=theChar->bmp.h) break; /* loop end is here */ oh=MIN(CEIL(fi)-FLOOR(fi-frows),theChar->bmp.h-oy); iy=MIN(theChar->vof+1-FLOOR(fi),theChar->bmp.h); ih=MAX(0,MIN(FLOOR(fi)-CEIL(fi-frows),theChar->bmp.h-iy)); srcptroy= theChar->bmp.bits+oy*srcbmuw; srcptriy= theChar->bmp.bits+iy*srcbmuw; srcptriyb=theChar->bmp.bits+(iy+ih-1)*srcbmuw; srcptroyb=theChar->bmp.bits+(oy+oh-1)*srcbmuw; topweight=1-(CEIL(fi)-fi); botweight=1-((fi-frows)-FLOOR(fi-frows)); /* pfprot("\nrow info at fi %f fr %f tw %f bw %f oy %d oh %d iy %d ih %d\n", fi,frows,topweight,botweight,oy,oh,iy,ih); */ m= BITS_PER_BMUNIT -GREYSCALE; cp=destptr; j= -theChar->hof2; fj=(float)(-theChar->hof); fcols=MIN(fshrink*(j+1)-fj,theChar->bmp.w); while(1) { ox=FLOOR(fj)+theChar->hof; if(ox>=theChar->bmp.w) break; /* loop end is here */ ow=MIN(CEIL(fj+fcols)-FLOOR(fj),theChar->bmp.w-ox); ix=MIN(CEIL(fj)+theChar->hof,theChar->bmp.w); iw=MAX(0,MIN(FLOOR(fj+fcols)-CEIL(fj),theChar->bmp.w-ix)); /*pfprot(" col info at fj %f fc %f ox %d ow %d ix %d iw %d\n",fj,fcols,ox,ow,ix,iw);*/ leftweight=1-(fj-FLOOR(fj)); rightweight=1-(CEIL(fj+fcols)-fj-fcols); fsam=0; /* count inner part */ if(iw!=0 && ih!=0){ if(iw==1 && ih==1) fsam+=TESTBIT(srcptriy,ix); else fsam+=sample(srcptriy, ix, iw,ih); } /* count top and bottom row */ if(iy==oy+1 && iw!=0) fsam+=topweight*samplerow(srcptroy,ix, iw); if(iy+ih+1==oy+oh && iw!=0) fsam+=botweight*samplerow(srcptroyb,ix, iw); /* count left and right row and the edjes*/ if(ox+1==ix) { if(ih!=0) fsam+=leftweight*samplecol(srcptriy, ox,ih); if(iy==oy+1) fsam+=leftweight*topweight*TESTBIT(srcptroy,ox); if(iy+ih+1==oy+oh) fsam+=leftweight*botweight*TESTBIT(srcptroyb,ox); } if(ox+ow==ix+iw+1) { if(ih!=0) fsam+=rightweight*samplecol(srcptriy, ox+ow-1,ih); if(iy==oy+1) fsam+=rightweight*topweight*TESTBIT(srcptroy,ox+ow-1); if(iy+ih+1==oy+oh) fsam+=rightweight*botweight*TESTBIT(srcptroyb,ox+ow-1); } /* pfprot(" j %d srccol %d cols %d mcols %d fsam %f\n", j,srccol,cols,mcols,fsam);*/ if(cp-destptr>=destbmuw) pfprot("DEBUG INFORMATION pkshrinkprecazgs cp > h-border !!\n"); if(destptr-theChar->bmp2.bits>=theChar->bmp2.h*destbmuw) pfprot("DEBUG INFORMATION pkshrinkprecazgs cp > v-border !!\n"); if(fsam!=0) *cp |= (LROUND((COLORS_PER_GREY-1)*fsam/(fshrink*fshrink)) << m); if(m) m-=GREYSCALE; else { m=BITS_PER_BMUNIT - GREYSCALE; ++cp; }; j++; fj=j*fshrink; fcols=MIN(fshrink,-theChar->hof-fj+theChar->bmp.w); } /*pfprot("did row\n");*/ i--; destptr+=destbmuw; fi=i*fshrink; frows=MIN(fshrink,fi-theChar->vof+1+theChar->bmp.h); } /* #else that is ifdef GREYINBMU */ /* #endif */ /*print_bitmap(&(theChar->bmp)); */ /*print_bitmap(&(theChar->bmp2));*/ #ifdef DEBUGPK pfprot("... pkshrinkprecazgs)"); #endif } #define BLEVEL 0.25 void pkshrinkcharazbw(chdesc* theChar) { int destbmuw, srcbmuw, j,i; int rows,cols,firstcols,firstrows,srcrow,srccol,sam; int mcols,mrows; BMUNIT m; BMUNIT *cp,*destptr,*srcptr; /* pfprot("(pkshrinkgazgs ...\n"); */ freelrumem(&(theChar->bmp2.bits)); touchlrumem(&(theChar->bmp.bits)); theChar->shrink=fshrink; theChar->hof2= CEIL(theChar->hof / fshrink); if(fshrink<1) firstcols=1; else { firstcols=theChar->hof-ROUND((theChar->hof2-1)*fshrink); if(firstcols == 0) { firstcols=MAX(ROUND(fshrink),1); --theChar->hof2; } } if(firstcols>=theChar->bmp.w) firstcols=theChar->bmp.w; theChar->vof2= CEIL((theChar->vof+1) / fshrink); if(fshrink<1) firstrows=1; else { firstrows=theChar->vof+1-ROUND((theChar->vof2-1)*fshrink); if(firstrows == 0) { firstrows=ROUND(fshrink); --theChar->vof2; } } --theChar->vof2; if(firstrows>=theChar->bmp.h) firstrows=theChar->bmp.h; theChar->bmp2.w = CEIL(theChar->bmp.w / fshrink) +2; theChar->bmp2.h = CEIL(theChar->bmp.h / fshrink) +2; if(firstrows<=0 || firstcols<=0) pfprot("IMPORTANT DEBUGINFORMATION break with fro %d fco %d fshr %f hof %d vof %d hof2 %d vof2 %d\n",firstrows,firstcols, fshrink, theChar->hof,theChar->vof,theChar->hof2,theChar->vof2); theChar->bmp2.w = CEIL(theChar->bmp.w / fshrink) +2; theChar->bmp2.h = CEIL(theChar->bmp.h / fshrink) +2; theChar->bmp2.type=BLACKNWHITE; locklrumem(&theChar->bmp.bits); alloc_bitmapgs(&theChar->bmp2); unlocklrumem(&theChar->bmp.bits); destptr=theChar->bmp2.bits; destbmuw=theChar->bmp2.bmu_wide; memset(destptr,0,BYTES_PER_BMUNIT*destbmuw*theChar->bmp2.h); srcptr=theChar->bmp.bits; srcbmuw=theChar->bmp.bmu_wide; SETBMUW(srcbmuw); if(srcptr==NULL) { pfprot("\nfatal error: memory management, cannot happen? sorry\n"); exit(1); } rows=firstrows; srcrow=0; i=theChar->vof2+1; mrows=MAX(1,ROUND(i*fshrink)-ROUND((i-1)*fshrink)); while(rows>0) { m=(((BMUNIT)1) << (BITS_PER_BMUNIT -1)); cp=destptr; srccol=0; cols=firstcols; j=-theChar->hof2; mcols=MAX(1,ROUND((j+1)*fshrink)-ROUND(j*fshrink)); while(cols>0) { if(cols==1 && rows==1) sam=TESTBIT(srcptr,srccol); else sam=sample(srcptr, srccol, cols,rows); if(sam) if(sam >= ROUND(mcols*mrows*BLEVEL)) *cp|=m; if(m==1) { m=((BMUNIT)1 << (BITS_PER_BMUNIT -1)); ++cp; } else m >>=1; j++; if(fshrink <1) { srccol=FLOOR((j+0.5)*fshrink)+theChar->hof; mcols=1; } else { srccol=ROUND(j*fshrink)+theChar->hof; mcols=ROUND((j+1)*fshrink)-ROUND(j*fshrink); } cols=MIN(mcols,theChar->bmp.w-srccol); } /* pfprot("did row\n");*/ i--; destptr+=destbmuw; if(fshrink <1) { srcrow= (theChar->vof+1)-CEIL((i-0.5)*fshrink); mrows=1; } else { srcrow= (theChar->vof+1)-ROUND(i*fshrink); mrows=ROUND(i*fshrink)-ROUND((i-1)*fshrink); } rows=MIN(mrows,theChar->bmp.h-srcrow); srcptr=theChar->bmp.bits+srcrow*srcbmuw; } /* print_bitmap(&(theChar->bmp)); print_bitmap(&(theChar->bmp2));*/ /* pfprot(".. did it\n"); */ } /* **************************************************** More on shrink: cheap shrinking of bitmats for gscript: here, the origin is indeed the origin and only integer shrinks 2 and 4 (macro: GSGREY) are considered. **************************************************** */ void cheapshrinkgs(bitmap* bmp, bitmap* bmp2){ int rowsleft, colsleft, sum; int newbuw, oldbuw, m, rshift, lshift; BMUNIT *oldp, *newp, *dp, *sp, *op; uchar tabgs[GSGREY*GSGREY+1]; #ifdef DEBUGPK pfprot("( cheapshrinkgs fontdatptr...)"); #endif locklrumem(&bmp->bits); alloc_bitmapgs(bmp2); unlocklrumem(&bmp->bits); oldp=bmp->bits; if(oldp==NULL) { pfprot("\nfatal error: memory management, cannot happen? sorry\n"); exit(1); } if(bmp2->w*GSGREY != bmp->w || bmp2->h*GSGREY != bmp->h){ pfprot("\nfatal error: cheapshrinkgs with incompatible bitmaps. sorry\n"); exit(1); } for(m=0;m<=GSGREY*GSGREY;m++) tabgs[m]=ROUNDUP(m*(COLORS_PER_GREY-1),GSGREY*GSGREY); newp=bmp2->bits; newbuw=bmp2->bmu_wide; oldbuw=bmp->bmu_wide; rowsleft=bmp2->h; /*memset(newp,0,BYTES_PER_BMUNIT*newbuw*bmp2->h); done in alloc*/ #ifndef GREYINBMU while(rowsleft) { dp=newp; sp=oldp; colsleft=bmp2->w; lshift=BITS_PER_BMUNIT-GREYSCALE; rshift=BITS_PER_BMUNIT-GSGREY; while(colsleft){ op=sp; #if GSGREY==2 sum= bit_count[(((*op)>>rshift) & ((1L<>rshift) & ((1L<>rshift)&((1L<>rshift) & ((1L<>rshift) & ((1L<>rshift) & ((1L< 127) n -= 256; for (i = 2; i <= b; i++) n = (n << 8) | fofbyte(); return n; } #ifdef KPATHSEA /* kpathsea variant */ int tfmfind(char *ffpath,char *fontname,char *fftotal) { int foundfile; char *kpsename=NULL; kpsename=kpse_find_tfm(fontname); foundfile = (kpsename!=NULL); if(kpsename){ strncpy(fftotal, kpsename,MAXPATHSTR-1); fftotal[MAXPATHSTR-1]=0; freemem(&kpsename); } #else /* without kpathsea */ int tfmfind(char *ffpath,char *fontname,char *fftotal) { char ffname[MAXPATHSTR]; int foundfile; sprintf(ffname, "%s.tfm", fontname); foundfile = msearch(ffpath,ffname,fftotal); #endif /* tail of tfmfind */ if(!foundfile){ pfprot(" - no TFMfile "); return(0); } pfprot(" - TFMfile "); pfverb("%s ", fftotal); return(1); } int tfmdef(char *fftotal,int fdb,long chksum) { short ll, lh, bc, ec, nw, nh, nd, i,j; uchar b1, b2; short FORLIM; char encstr[41]; float designsize; long dummy[256]; long fofchk; fofile = fopen(fftotal, "rb"); if (fofile==0) return(0); /*this cant happen */ ll = fofint(2); lh = fofint(2); bc = fofint(2); ec = fofint(2); nw = fofint(2); nh = fofint(2); nd = fofint(2); fseek(fofile, 0L, 2); if (ll * 4 > ftell(fofile) || ll < lh + ec - bc + nw + nh + nd + 7) { pfprot(" - not a TFMfile "); fclose(fofile); return(0); } if(FD(fdb)->mch < ec) FD(fdb)->mch = ec; if (ec>=MAXCHARS) { pfprot(" - to many chars "); fclose(fofile); return(0); } fseek(fofile, 24L, 0); fofchk = fofint(4); if (chksum != 0) if (fofchk != 0) if (chksum != fofchk) pfverb(" - wrong checksum "); designsize=fofint(4)*exp(-20*log(2)); /* fprintf(prot,"(designsize: %5.2f)", designsize);fflush(prot); */ i=fofbyte(); for(j=0;jencoding=encodings[i]; if(FD(fdb)->encoding) pfverb(": known "); else { for(i=0;iencoding=encodings[i], j=i; if(FD(fdb)->encoding) pfverb(": assuming %s ",encodingnames[j]); } fseek(fofile, (lh + ec - bc + 7L) * 4, 0); FORLIM = nw + nh + nd; for (i = 0; i < FORLIM; i++) dummy[i] = scaled(fofint(4), FD(fdb)->foscf); fseek(fofile, lh * 4L + 24, 0); for (i = bc; i <= ec; i++) { b1 = fofbyte(); b2 = fofbyte(); fofbyte(); fofbyte(); FD(fdb)->chv[i].fontdataptr=fdb; FD(fdb)->chv[i].ch=i; FD(fdb)->chv[i].tfmtfw = dummy[b1]; FD(fdb)->chv[i].tfmtfh = dummy[nw + (b2 >> 4)]; FD(fdb)->chv[i].tfmtfd = dummy[nw + nh + (b2 & 15)]; FD(fdb)->chv[i].fty |= TFMTYPE; } fclose(fofile); pfverb(" - TFMfile ok "); return(1); } tmview/src/subs.c0100644000175000017500000005643207250444702013401 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ #include "defs.h" #include #ifdef __unix__ #include #include #include #endif #ifdef DOSFILES #include #endif /* #define DEBUGMEM */ /* #define DEBUGMEMUSAGE */ /* #define DEBUGKILLLRU */ /* #define DEBUGBITMAPS */ /* #define DEBUGFILE */ void pfprot(char* fmt, ... ) { va_list args; va_start(args, fmt); vfprintf(stdout,fmt,args); fflush(stdout); va_end(args); } void pfverb(char* fmt, ... ) { va_list args; if(!verbose) return; va_start(args, fmt); vfprintf(stdout,fmt,args); fflush(stdout); va_end(args); } long scaled(long w, long z) { long s; ulong t=w, u=z; /* should return w * z / 2**20 */ s = ( ( (((t & 65535L) * (u & 65535L)) >> 16) + (t & 65535L) * (u >> 16) + (t >> 16) * (u & 65535L) ) >> 4) + ( ( (t >> 16) * (u >> 16) ) << 12); if (w < 0) s -= z << 12; return s; } /*******************************************************/ /* one day here will be a kind of memorymenagement ! */ /* */ #define MEM(ap) (*((char**)(ap))) #define REF(ap) ((char***)(ap)) #define NEXT(ap) (((char**)(ap))+1) #define PREV(ap) (((char**)(ap))+2) #define SIZE(ap) (long*)(((char**)(ap))+3) #define LOCK(ap) (char*)(((char**)(ap))+4) #define USER(ap) (char*)(((char**)(ap))+5) #define BASE(up) (char*)(((char**)(up))-5) /* within memory it looks as follows: char*** REF pointer to the users pointer to his memory char** NEXT pointer to next lrumem-element char** PREV pointer to previous lrumem-element long SIZE size of this element char LOCK lock flag to disable killing char users data, here points the users pointer to char even more users data char and so on .... The user has exactly one pointer to his data and operates on it as usual. From our point of view, we have a linked list of memory areas. The users data is preceeded by our data. As we keep a reference on the users only pointer, we will set this to NULL if we kill his data. Thus, he will know. */ static char* firstlru=NULL; static char* lastlru=NULL; static long totallrumem=0; void printlrumem(void) { char* iptr; char* before; int count; iptr=firstlru; count=0; pfprot("\nLRU MEM LIST:\n"); while(iptr!=NULL) { if(iptr==firstlru && *PREV(iptr) != NULL) pfprot("*** LINK ERROR ***\n"); if(iptr==lastlru && *NEXT(iptr) != NULL) pfprot("*** LINK ERROR ***\n"); if(**REF(iptr)!=iptr+20) /* test fails ==> seg fault BEFOR warning :-( */ pfprot("*** REF ERROR ***\n"); count++; pfprot("mem at 0x%x *rev 0x%x size %d lock %d prev 0x%x next 0x%x \n", iptr,**REF(iptr),*SIZE(iptr),*LOCK(iptr),*PREV(iptr),*NEXT(iptr)); before=iptr; iptr=*NEXT(iptr); if(iptr!=NULL) if(*PREV(iptr)!=before) pfprot("*** LINK ERROR ***\n"); } pfprot("\nTHATS IT, total bytes %d in %d blocks\n\n",totallrumem,count); } void Tptr(char* ap) { if(ap==NULL) {pfprot(" - not enough memory :-( \n"); exit(1);} } void Tptrlru(char* ap) { if(ap==NULL) {pfprot("\n\n - run out of LRU memory: adjust \"lrum\" in the startup-file? \n"); exit(1);} } int killlru(void){ char* killit; char** ptme1; char** ptme2; if(firstlru==NULL) return(0); #ifdef DEBUGKILLLRU pfprot("(mem: killlru)"); printlrumem(); #endif #ifdef DEBUGMEM pfprot("(mem: killlru 0x%x?)",firstlru+20); #endif killit=firstlru; while(*LOCK(killit)==1 && *NEXT(killit)!=NULL) killit= *(NEXT(killit)); if(*LOCK(killit)==1) return(0); ptme1=PREV(killit); ptme2=NEXT(killit); if(firstlru==lastlru) { firstlru=NULL; lastlru=NULL; } else { if(*ptme1!=NULL) *NEXT(*ptme1)=*ptme2; else firstlru=*ptme2; if(*ptme2!=NULL) *PREV(*ptme2)=*ptme1; else lastlru=*ptme1; } **REF(killit)=NULL; totallrumem-=*SIZE(killit); free(killit); #ifdef DEBUGKILLLRU printlrumem(); #endif return(1); } void locklrumem(void* ap) { Tptrlru(MEM(ap)); touchlrumem(ap); *LOCK(BASE(MEM(ap)))=1; } void unlocklrumem(void* ap) { if(MEM(ap)==NULL) return; /* no error here */ touchlrumem(ap); *LOCK(BASE(MEM(ap)))=0; } void alloclrumem(void* ap,long size) { char* res; char* me; #ifdef DEBUGMEM pfprot("(mem: alloclru 0x%x %d at ...",MEM(ap),size); #endif size=MAX(1,size); while(totallrumem+size>maxlrumem) if(!killlru()) Tptrlru(NULL); res = malloc(size+5*sizeof(char*)); Tptrlru(res); me=res; if(firstlru!= NULL) { *NEXT(lastlru)=me; *PREV(me)=lastlru; } else { *PREV(me)=NULL; firstlru=me; } lastlru=me; *REF(me)=ap; *NEXT(me)=NULL; *SIZE(me)=size; *LOCK(me)=0; MEM(ap)=USER(me); totallrumem+=size; #ifdef DEBUGMEMUSAGE pfprot("(%.1fk)",totallrumem/1024.); #endif #ifdef DEBUGMEM pfprot("... 0x%x)",USER(me)); #endif } void realloclrumem(void* ap, long size) { char *res; char** ptme1; char** ptme2; char* me; long oldsize; #ifdef DEBUGMEM pfprot("(mem: realloclru 0x%x %d at ...",MEM(ap),size); #endif if(MEM(ap)==NULL) {alloclrumem(ap,size);return;} size=MAX(1,size); oldsize=*SIZE(BASE(MEM(ap))); while(totallrumem+size-oldsize>maxlrumem) if(!killlru()) Tptrlru(NULL); Tptrlru(MEM(ap)); /* killed itself */ me=BASE(MEM(ap)); res=realloc(me,size+5*sizeof(char*)); Tptrlru(res); me=res; ptme1=PREV(me); ptme2=NEXT(me); if(*ptme1!=NULL) *NEXT(*ptme1)=me; else firstlru=me; if(*ptme2!=NULL) *PREV(*ptme2)=me; else lastlru=me; *SIZE(me)=size; MEM(ap)=USER(me); totallrumem+=size-oldsize; /* could do a touch */ #ifdef DEBUGMEMUSAGE pfprot("(%.1fk)",totallrumem/1024.); #endif #ifdef DEBUGMEM pfprot("... 0x%x)",MEM(ap)); #endif } void freelrumem(void* ap) { char** ptme1; char** ptme2; char* me; #ifdef DEBUGMEM pfprot("(mem: freelru 0x%x)",MEM(ap)); #endif if(MEM(ap)==NULL) return; me=BASE(MEM(ap)); ptme1=PREV(me); ptme2=NEXT(me); totallrumem-=*SIZE(me); if(firstlru==lastlru) { firstlru=NULL; lastlru=NULL; } else { if(*ptme1!=NULL) *NEXT(*ptme1)=*ptme2; else firstlru=*ptme2; if(*ptme2!=NULL) *PREV(*ptme2)=*ptme1; else lastlru=*ptme1; } free(me); MEM(ap)=NULL; #ifdef DEBUGMEMUSAGE pfprot("(%.1fk)",totallrumem/1024.); #endif } void touchlrumem(void* ap) { char** ptme1; char** ptme2; char* me; #ifdef DEBUGMEM pfprot("(mem: touchlru 0x%x)",MEM(ap)); #endif Tptrlru(MEM(ap)); if(firstlru==lastlru) return; me=BASE(MEM(ap)); if(me==lastlru) return; #ifdef DEBUGMEM pfprot("(mem: dotouch ..."); #endif ptme1=PREV(me); ptme2=NEXT(me); if(*ptme1!=NULL) *NEXT(*ptme1)=*ptme2; else firstlru=*ptme2; *PREV(*ptme2)=*ptme1; *NEXT(lastlru)=me; *PREV(me)=lastlru; *NEXT(me)=NULL; lastlru=me; #ifdef DEBUGMEM pfprot("...)"); #endif } /* in an early version we considered to free lrumem here ... */ /* which was a quite sick idea. So we do not do it anymore. */ void allocmem(void* ap,long anz) { char* res; #ifdef DEBUGMEM pfprot("(mem: alloc 0x%x %d at ...",MEM(ap),anz); #endif anz=MAX(1,anz); res = malloc(anz); #ifdef DEBUGMEM pfprot("(alloc at 0x%x)",res); #endif Tptr(res); MEM(ap)=res; } void reallocmem(void *ap, long anz) { char* res; #ifdef DEBUGMEM pfprot("(mem: realloc 0x%x %d)",MEM(ap),anz); #endif anz=MAX(1,anz); if(MEM(ap)==NULL) res=malloc(anz); else res = realloc(MEM(ap),anz); Tptr(res); MEM(ap)=res; } void freemem(void* ap) { #ifdef DEBUGMEM pfprot("(mem: free 0x%x)",MEM(ap)); #endif if(MEM(ap)==NULL) return; free(MEM(ap)); MEM(ap)=NULL; } char *stralloccpy(char** dest, char* src) { freemem(dest); if (! src) *dest = NULL; else { allocmem(dest,strlen(src) + 1); strcpy(*dest, src); } return *dest; } /* recursive directory searching ... ... and they're telling everyone that I, Thomas Moor, dont know too much about exaiming directories. And they are the reason of the very slow starting up. Workaround: name the directories to be scanned explicitetly, first, separeted by colons, followed by those, which are eventually to be scanned recursivly. To speed things up a little, now the directories in which some file was found, are kept in a history. And a trick was stolen from kpathsea. Karl Berry wrote in AUTHORS about this trick: The implementation of the link trick in pathsrch.c is taken from GNU find, implemented by David MacKenzie from Matthew Farwell's suggestion. */ #ifndef DOSFILES int checkapath(char* prepath,char* path) { int i,sep,pn,ppn; /* fprintf(prot,"\n chkapath %s =?= %s \n",prepath,path); */ pn=strlen(path); ppn=strlen(prepath); if(pn>=1) if(path[pn-1]=='/') path[pn--]=0; sep=-1; for(i=0;sep== -1 && i=1) if(prepath[pn-1]=='/') prepath[pn--]=0; if(strcmp(prepath,path)==0) return(1); else return(0); } if(sep > 0) { if(strncmp(prepath,path,sep)!=0) return(0); return(checkapath(prepath+sep,path+sep)); } if(sep==0) { if(ppn==2) return(1); if(path[0]=='/') { path++; pn--; } if(checkapath(prepath+2,path)) return(1); for(i=0;path[i]!='/' && i< pn;i++); if(i==pn) return(0); return(checkapath(prepath,path+i)); return(0); } pfprot("(checkapath: never reach this end!)"); return(1); } #define RSHIS 50 char* rshis[RSHIS]={NULL}; /* all NULL pointers now. */ void addrshis(char* thenew) { int i,l; if(thenew[0]==0) return; freemem(rshis+RSHIS-1); for(i=RSHIS-1;i>0;i--) rshis[i]=rshis[i-1]; l=strlen(thenew); allocmem(rshis,l+2); strcpy(rshis[0],thenew); if(l>0 && (rshis[0][l-1]) != '/') { (rshis[0])[l]='/'; (rshis[0])[l+1]=0; } /*fprintf(prot,"\naddrshis: "); for(i=0;i0;j--) rshis[j]=rshis[j-1]; rshis[0]=bu; return(1); } /*fclose(testfile); Bug removed by Richard Vosse, Thanks!*/ } } } return(0); } int rsearch(char* done,char* path,int dep) { FILE* testfile; DIR *thisdir, *testdir; struct dirent *thisentry; int i,dn,sep; struct stat stats; /* set sep to the position of next "//" in path or -1 if no such */ sep=-1; for(i=0;sep== -1 && path[i] != 0 ;i++) if(path[i]=='/' ) if (path[i+1]=='/') { sep=i; } dn=strlen(done); /* no more recursive ? fine, just look for the file */ if(sep==-1) { strcat(done,path); testfile = fopen(done,"rb"); if(testfile != NULL) { fclose(testfile); done[dn]=0; addrshis(done); strcat(done,path); return(1); } return(0); } /* more recursive, but with some non-recursive dirs before */ if(sep > 0) { strncat(done,path,sep); return(rsearch(done,path+sep,0)); } /* recursive just now, part 1: cant do it, no more subdirs */ if(sep==0) { if(stat(done, &stats) == 0) if(S_ISDIR(stats.st_mode) && stats.st_nlink<=2) return(rsearch(done,path+1,0)); } /* recursive just now, part 2: try it, should find more subdirs */ if(sep==0 && dep < MAXPATHDEP) { if(rsearch(done,path+1,dep)) return(1); done[dn]=0; if ((thisdir=opendir(done))==NULL) return(0); while((thisentry=readdir(thisdir))) if( (strcmp(thisentry->d_name,".") != 0) && (strcmp(thisentry->d_name,"..") != 0) && (strlen(thisentry->d_name)+dn+2 < MAXPATHSTR) ){ done[dn]='/'; strcpy(done+dn+1,thisentry->d_name); if((testdir=opendir(done))!= NULL) { closedir(testdir); if(rsearch(done,path,dep+1)) { closedir(thisdir); return(1); } } done[dn]=0; } closedir(thisdir); return(0); } return(0); } int msearch(char* mpath,char* filename,char* result) { int mpnpo, pnpo,hopo, found; char pn[MAXPATHSTR]; char* homedir; homedir = getenv("HOME"); if(homedir == NULL) homedir="/home_not_def"; if(strlen(homedir) + strlen(mpath) + 1 >MAXPATHSTR) return(0); mpnpo=0; while (mpath[mpnpo]== ':') mpnpo++; found=0; while(mpath[mpnpo] != 0) { pnpo=0; if(mpath[mpnpo] == '~' && (mpath[mpnpo+1]==':' || mpath[mpnpo+1]=='/' || mpath[mpnpo+1]==0)) { for(hopo=0;homedir[hopo] != 0;hopo++) pn[pnpo++]=homedir[hopo]; mpnpo++; if(pn[pnpo-1]=='/' && mpath[mpnpo]=='/') mpnpo++; } while((mpath[mpnpo] != ':') && (mpath[mpnpo] != 0)) pn[pnpo++]=mpath[mpnpo++]; while (mpath[mpnpo]== ':') mpnpo++; if(pnpo>0){ if(pn[pnpo-1] != '/') pn[pnpo++]='/'; pn[pnpo]=0; if(chkrshis(result,pn,filename)) { /* fprintf(prot,"\n rshis hit \n"); */ return(1); } /* fprintf(prot,"\n rshis no hit \n"); */ strcat(pn,filename); result[0]=0; if(rsearch(result,pn,0)) return(1); } } return(0); } int completefile(char* total, int which) { char npath[MAXPATHSTR], name[MAXPATHSTR]; DIR *thisdir, *testdir; struct dirent *thisentry; int plen,nlen,tlen; char* homedir; int found,i,j; #ifdef DEBUGFILE pfprot("(completefile %s ",total); #endif tlen=strlen(total); if(tlen>MAXPATHSTR) return(0); strcpy(npath,total); if(npath[0] == '~') { homedir = getenv("HOME"); if(homedir != NULL) { if(tlen+strlen(homedir) +1 < MAXPATHSTR) { strcpy(npath,homedir); strcat(npath,total+1); } } } j=-1; for(i=0;npath[i]!=0;i++) if(npath[i]=='/') j=i; if(j > -1) { strcpy(name,npath+j+1); npath[j+1]=0; } else { strcpy(name,npath); strcpy(npath,"./"); } nlen=strlen(name); plen=strlen(npath); #ifdef DEBUGFILE pfprot("path %s name %s ",npath,name); #endif if((thisdir=opendir(npath))==NULL) return(0); found=0; while((thisentry=readdir(thisdir))) if( (strncmp(thisentry->d_name,name,nlen) ==0) && (strlen(thisentry->d_name)+plen+2 < MAXPATHSTR) ){ found++; if(found==1) strcpy(name,thisentry->d_name); for(i=0;thisentry->d_name[i]==name[i] && name[i]!=0;i++); name[i]=0; if(found==which) strcat(npath,thisentry->d_name); } closedir(thisdir); if(which==0 || which > found) strcat(npath,name); nlen=strlen(npath); if((testdir=opendir(npath))!= NULL) { closedir(testdir); if(npath[nlen-1] != '/' && found == 1) strcat(npath,"/"); } strcpy(total,npath); #ifdef DEBUGFILE pfprot("found %d)",found); #endif return(found); } void setworkdir(void) { #ifndef GNU_GETCWD /* dirty hack, since getcwd is not allways gnu-c ... */ char* buptr; allocmem(&buptr,2048); buptr=getcwd(buptr, 2047); buptr[2047]=0; /*Bug removed by Richard Vosse, Thanks!*/ workdir=NULL; stralloccpy(&workdir, buptr); freemem(&buptr); #else /* correct version: linux or gnu-c resp. ... */ workdir=getcwd(NULL, 0); if(workdir==NULL) {pfprot("\nfatal error: memory .. getcwd ??\n");exit(1);} #endif } int dvistandard(char** dst,char* src) { /* may be src==filename */ char rbu[4]; FILE* file; char s[MAXPATHSTR+1]; char ss[MAXPATHSTR+1]; int slen,i,lastsep; #ifdef DEBUGFILE pfprot("(dvistandard 1.<%s> ",src); #endif if(src[0]!=DIRSEPCHAR) { if(strlen(workdir)+1+strlen(src)>MAXPATHSTR) {pfprot("\nfatal error: memory .. stddvi ??\n");exit(1);} strcpy(ss,workdir); strcat(ss,DIRSEPSTR); strcat(ss,src); } else strcpy(ss,src); #ifdef DEBUGFILE pfprot(" 2.<%s> ",ss); #endif slen=strlen(ss); for(i=0;i ",ss); #endif for(i=0;i ",ss); #endif for(i=0;i ",ss); #endif slen=strlen(ss); strcpy(s, ss); if(s[MAX(0,slen-1)] == '.') strcat(s,"dvi"); else { if(STRCASECMP(s+MAX(0,slen-4),".dvi")!=0) strcat(s,".dvi"); } #ifdef DEBUGFILE pfprot(" 6.<%s> ",s); #endif file = fopen(s, "rb"); if(file == NULL) { strcpy(s,ss); #ifdef DEBUGFILE pfprot(" 7.<%s> ",s); #endif file= fopen(s, "rb"); if(file == NULL) { stralloccpy(dst,s); return(0); } } stralloccpy(dst,s); #ifdef DEBUGFILE pfprot(" found file..."); #endif if(fseek(file, 0L, 0) !=0) {fclose(file); return(0);} if(fread(rbu,1,1,file) == 0) {fclose(file); return(0);} if(rbu[0] != (char) 247) {fclose(file); return(0);} fclose(file); #ifdef DEBUGFILE pfprot("...standarddvi)"); #endif return(1); } #else /*********************************************ifdef DOSFILES */ int msearch(char* mpath,char* filename,char* result) { int mpnpo, pnpo,hopo; char ch; FILE* test; #ifdef DEBUGFILE pfprot("(msearch path %s name %s ...",mpath,filename); #endif if(strlen(mpath) + 1 >MAXPATHSTR) return(0); mpnpo=0; while (mpath[mpnpo]== ';') mpnpo++; while(mpath[mpnpo] != 0) { pnpo=0; while((mpath[mpnpo] != ';') && (mpath[mpnpo] != 0)) result[pnpo++]=mpath[mpnpo++]; while (mpath[mpnpo]== ';') mpnpo++; if(pnpo>0){ if(result[pnpo-1] != '\\') result[pnpo++]='\\'; result[pnpo]=0; strcat(result,filename); /* pfprot("(msea: %s)",result); */ if((test=fopen(result,"rb")) != NULL) { fclose(test); #ifdef DEBUGFILE pfprot("found %s)",result); #endif return(1); } } } strcpy(result,"c:\\gibsnich"); #ifdef DEBUGFILE pfprot("not found %s)",result); #endif return(0); } int completefile(char* total, int which) { #ifdef DEBUGFILE pfprot("(completefile %s disabled on dosfilesystems. sorry)",total); #endif return(0); } void setworkdir(void){ int i; _nls_init(); /* hack: do this here ... */ workdir=_getcwd2(NULL,0); if(workdir==NULL) {pfprot("\nfatal error: memory .. getcwd ??\n");exit(1);} for(i=strlen(workdir)-1;i>=0;i--) if(workdir[i]=='/') workdir[i]= DIRSEPCHAR; /* translate back */ #ifdef DEBUGFILE pfprot("(setworkdir <%s> )",workdir); #endif } int dvistandard(char** dst,char* src) { /* may be src==filename */ uchar o; int adw; char rbu[4]; FILE* file; char s[MAXPATHSTR+1]; char ss[MAXPATHSTR+1]; int slen,i,lastsep; #ifdef DEBUGFILE pfprot("(dvistandard 1.<%s> ",src); #endif adw=0; slen=strlen(src); if(slen<2) adw=1; else if(src[1]!=':') adw=1; if(adw) { if(strlen(workdir)+slen>MAXPATHSTR) {pfprot("\nfatal error: memory .. stddvi ??\n");exit(1);} strcpy(ss,workdir); strcat(ss,DIRSEPSTR); strcat(ss,src); } else strcpy(ss,src); #ifdef DEBUGFILE pfprot(" 2.<%s> ",ss); #endif slen=strlen(ss); for(i=0;i ",ss); #endif for(i=0;i ",ss); #endif for(i=0;i ",ss); #endif _nls_strlwr(ss); #ifdef DEBUGFILE pfprot(" 5.5.<%s> ",ss); #endif slen=strlen(ss); strcpy(s, ss); if(s[MAX(0,slen-1)] == '.') strcat(s,"dvi"); else { if(strcmp(s+MAX(0,slen-4),".dvi")!=0) strcat(s,".dvi"); } #ifdef DEBUGFILE pfprot(" 6.<%s> ",s); #endif file = fopen(s, "rb"); if(file == NULL) { strcpy(s,ss); #ifdef DEBUGFILE pfprot(" 7.<%s> ",s); #endif file= fopen(s, "rb"); if(file == NULL) { stralloccpy(dst,s); return(0); } } stralloccpy(dst,s); #ifdef DEBUGFILE pfprot(" found file..."); #endif if(fseek(file, 0L, 0) !=0) {fclose(file); return(0);} if(fread(rbu,1,1,file) == 0) {fclose(file); return(0);} if(rbu[0] != (char) 247) {fclose(file); return(0);} fclose(file); #ifdef DEBUGFILE pfprot("...standarddvi)"); #endif return(1); } #endif /* end ********************+************************* dosfiles */ void pathoffile(char* fullfilename, char* path){ int pathend; char* ffi; ffi=fullfilename; pathend=-1; while(*ffi!=0){ if(*ffi==DIRSEPCHAR) pathend=ffi-fullfilename; ffi++; } if(pathend==-1) { path[0]='.'; path[1]='\0'; } else { if(pathend>=MAXPATHSTR-1){ pfprot("\nfatal error: memory .. pathoffile ??\n");exit(1); } strcpy(path,visfmk->dvifilename); path[pathend]='\0'; } } void alloc_bitmapbw(bitmap* bmp) { unsigned long size; bmp->bmu_wide = ROUNDUP(bmp->w, BITS_PER_BMUNIT); size = ((long)bmp->bmu_wide)* BYTES_PER_BMUNIT * bmp->h + 1; /* bit blitting needs on extra*/ alloclrumem(&(bmp->bits),MAX(size,1)); memset(bmp->bits,0,size); /* pfverb("*"); */ } void alloc_bitmapgs(bitmap* bmp) { unsigned long size; bmp->bmu_wide = ROUNDUP(bmp->w * bmp->type, BITS_PER_BMUNIT); size = ((long) bmp->bmu_wide)*BYTES_PER_BMUNIT * bmp->h +1; /* bit blitting needs on extra*/; alloclrumem(&(bmp->bits),MAX(size,1)); memset(bmp->bits,0,size); /*pfverb("*");*/ } void clear_bitmap(bitmap* bmp) { memset((char*) bmp->bits,0,(long)(bmp->bmu_wide)*BYTES_PER_BMUNIT * bmp->h); } /* for debugging only */ #ifdef DEBUGBITMAPS void print_bitmap(bitmap *bmp) { BMUNIT *pt = (BMUNIT *) bmp->bits; int x, y, i; if (pt == NULL) return; pfprot("(printbitmap at 0x%x: \n",pt); for (y = 0; y < bmp->h; ++y) { pfprot("[",y); for (x = bmp->bmu_wide; x > 0; x--) { for (i = BITS_PER_BMUNIT - bmp->type; i >= 0;i-=bmp->type) pfprot("%c",' '+((*pt >> i) & ((1<type)-1))); ++pt; } pfprot("]\n"); } pfprot("sizes: type = %d, w = %d, h = %d, bmu wide = %d)\n", bmp->type,bmp->w, bmp->h, bmp->bmu_wide); } #endif tmview/src/tmview.c0100644000175000017500000023140007250444702013726 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor Once this was ... (C)opyright 1994 Wolfgang R. Mueller, Computing Centre, Heinrich-Heine-University Duesseldorf, Germany, wolfgang@uni-duesseldorf.de, +49-211-311-3905. ... but this is some months ago, and only a very view lines of the original code are left. This program may be used without any warranty. It may be modified and distributed without any restictions. */ #include "defs.h" #include "help.h" /*#define DEBUGCOM */ /****************************************************************************/ /* edit numberarg ***********************************************************/ /****************************************************************************/ void comdoresize(void); /* forward */ /* globals used for numberarg editing */ #define NASTART 0 #define NAINT 1 #define NAINTE 2 #define NAFRAC 3 #define NAFRACE 4 #define NAONLYE 5 #define NAMAXARG 20 /* now extern static char numberargstr[MAXARGSTR+1]; */ static double numberarg[NAMAXARG]; static int numberargcount; static int numberargmode; /* now extern static int numberargstrlen;*/ void numberarginit(void) { /* fprintf(prot,"(numberarginit)"); */ numberargstrlen=0; numberargcount=0; numberargmode=NASTART; memset(numberargstr,0,MAXARGSTR+1); } int numberargsub(int); /* forward */ int numberargadd(char ch) { if(ch==127) return(numberargsub(1)); if(numberargstrlen==MAXARGSTR) return(1); switch (numberargmode) { case NASTART: if(ch=='.' || ch=='+' || ch=='-' || ch=='*' || ch=='#' || (ch>='0' && ch<='9')) { numberargstr[numberargstrlen++]=ch; if(ch=='.') numberargmode=NAFRAC; if(ch=='*' || ch=='#') numberargmode=NAONLYE; if(ch >=0 && ch <= '9') numberargmode=NAINTE; if(ch=='+' || ch=='-') numberargmode=NAINT; return(0); } return(1); case NAINT: if(ch=='.' || (ch>='0' && ch<='9')) { numberargstr[numberargstrlen++]=ch; if(ch=='.') numberargmode=NAFRAC; else numberargmode=NAINTE; return(0); } return(1); case NAINTE: if(ch=='.' || ch==';' || ch==',' || (ch>='0' && ch<='9')) { numberargstr[numberargstrlen++]=ch; if(ch=='.') numberargmode=NAFRACE; if(ch==';'|| ch==',') numberargmode=NASTART; return(0); } return(1); case NAFRAC: if(ch>='0' && ch<='9') { numberargstr[numberargstrlen++]=ch; numberargmode=NAFRACE; return(0); } return(1); case NAFRACE: if(ch==';' || ch==','|| (ch>='0' && ch<='9')) { numberargstr[numberargstrlen++]=ch; if(ch==';' || ch==',') numberargmode=NASTART; return(0); } return(1); case NAONLYE: if(ch==';' || ch==',') { numberargstr[numberargstrlen++]=ch; numberargmode=NASTART; return(0); } return(1); default: } pfprot("(numberargadd: parsing error)"); return(1); } int numberargsub(int count) { char argsave[MAXARGSTR+1]; int newlen; if(numberargstrlen-count < 0 || count <0) return(1); newlen=numberargstrlen-count; strncpy(argsave,numberargstr,newlen); numberarginit(); for(count=0;count -- len %d ...\n", numberargstr,numberargstrlen); */ numberargcount=0; if(numberargstrlen==0) return(1); strncpy(mas,numberargstr,numberargstrlen+1); while(pos NAMAXARG) {numberargcount=0; return(1);} /* fprintf(prot,"<%s> -atof- %f ###",mas+pos,atof(mas+pos)); */ if(mas[pos]!='*' && mas[pos]!='#') numberarg[numberargcount-1]=atof(mas+pos); else numberarg[numberargcount-1]=PGMAGIC; pos+=len+1; } /* fprintf(prot,"\n count %d o.k.)\n",numberargcount); */ return(1); } int numberargedit(int line,int pos, const char* defa) { uchar o; int count; int allesfrisch=1; numberarginit(); for(count=0;count0;i--) stringarghis[i]=stringarghis[i-1]; stringarghis[0]=NULL; if(defa!=NULL) stralloccpy(stringarghis,defa); else stralloccpy(stringarghis,""); hispos=-1; PRINTHIS; o=KEYUP; do{ if(' '<=o && o<127){ if(allesfrisch){ allesfrisch=0; len=0; editstr[0]=0; } if(len0 && o==127) { allesfrisch=0; editstr[--len]=0; drawsr(editstr,line,pos,vgastatuslen-pos); vgaupdatestatus(); } if(o==KEYUP || o==KEYDOWN) { if(0<= hispos && hispos < STRARGHIS) { /* ask for (not) startup */ stralloccpy(stringarghis+hispos,editstr); allesfrisch=0; } if(o==KEYUP) hispos++; else hispos--; hispos=MAX(0,MIN(STRARGHIS-1,hispos)); while(hispos>0 && stringarghis[hispos]==NULL) hispos--; PRINTHIS; strcpy(editstr,stringarghis[hispos]); editstr[MAXARGSTR]=0; len=strlen(editstr); drawsr(editstr,line,pos,vgastatuslen-pos); vgaupdatestatus(); } if(o==KEYESC) return(1); if(o==KEYRESIZE) { comdoresize(); return(1); } if(o==KEYRET){ strcpy(stringarg,editstr); stralloccpy(stringarghis,editstr); if(stringarghis[1]!=NULL) if(strcmp(stringarghis[0],stringarghis[1])==0) { for(i=0;idvifilename); else strcpy(editstr,""); editstr[MAXARGSTR]=0; drawsr(editstr,line,pos,vgastatuslen-pos); vgaupdatestatus(); while(1) { o=vgagetchar(1); if(' '<=o && o<127){ if(allesfrisch){ allesfrisch=0; len=0; editstr[0]=0; } if(len0 && o==127) { allesfrisch=0; editstr[--len]=0; drawsr(editstr,line,pos,vgastatuslen-pos); vgaupdatestatus(); } if(o==KEYUP || o==KEYDOWN) { if(o==KEYDOWN) rolldownfilemk(); if(o==KEYUP) rollupfilemk(); if(curfmk!=NULL) { allesfrisch=1; strcpy(editstr,curfmk->dvifilename); editstr[MAXARGSTR]=0; len=strlen(editstr); drawsr(editstr,line,pos,vgastatuslen-pos); vgaupdatestatus(); } } if(o==KEYTAB) { strcpy(comstr,editstr); if(completefile(comstr,0)>=1) if(strlen(comstr)",0,vgastatuslen-11,11); vgaupdatestatus(); do { o=vgagetchar(1); if(o==KEYRET) return(0); if(o==KEYESC) return(1); if(o==KEYRESIZE) { comdoresize(); return(1); } } while(1); } int canclethis(char* message) { uchar o; drawsl(message,0,0,vgastatuslen); drawsr("PRESS /",0,vgastatuslen-11,11); vgaupdatestatus(); do { o=vgagetchar(1); if(o==KEYRET) return(0); if(o==KEYESC) return(1); if(o==KEYRESIZE) { comdoresize(); return(1); } } while(1); } void ignorethis(const char* message) { if(vgastatuslines!=1) drawstatusline(); drawsl(message,0,0,vgastatuslen); drawsr(">>",0,vgastatuslen-2,2); vgaupdatestatus(); statusforce=1; } int proceedthis(char* message) { uchar o; drawsr(message,0,vgastatuslen-strlen(message),vgastatuslen); drawsr(message,0,vgastatuslen-strlen(message),vgastatuslen); vgaupdatestatus(); o=vgagetchar(0); if(o==KEYESC) return(1); return(0); } int helpline=0; int helppos=0; void help(void) { uchar o; int h,w,i,j,k,l,dline,dpos; do{ vgasetstatuslines(vgamaxstatuslines); h=vgastatuslines-3; w=vgastatuslen; dline=helpline; dpos=helppos; drawsl("",h,0,w); drawsl("",h+1,0,w); drawsl("",h+2,0,w); drawsr("PRESS /// TO MOVE OR TO EXIT",h+2,w-46,46); do { if(w>HELPWIDTH) dpos=-(w-HELPWIDTH)/2; helppos=dpos; for(i=0,j=0; helpstr[i]!=0;i++) { if(j==dline) break; if(helpstr[i]==10) j++; } if(j==dline) helpline=dline; for(i=0,j=0; helpstr[i]!=0;i++) { if(j==helpline) break; if(helpstr[i]==10) j++; } for(;helpstr[i]!=0 && j",pos,val); */ /* deb */ if(posstrlen(title)+ 40) drawsr("PRESS //// OR ", 0,strlen(title),vgastatuslen); else if(vgastatuslen>strlen(title)+ 13) drawsr("EXIT BY ",0,strlen(title),vgastatuslen); } val=cboxwhere(cbmenue[y]); drawsl(cbmenue[y],1,0,vgastatuslen); vgaupdatestatus(); do { o=vgagetchar(1); switch(o){ case 'H': case 'h': case KEYLEFT: CBOXSET(cbmenue[y],--val); break; case 'J': case 'j': case KEYRIGHT: CBOXSET(cbmenue[y],++val); break; case 'U': case 'u': case KEYUP: case KEYPREV: --y; if(y<0) { while(cbmenue[++y]!=NULL); y--; } break; case 'N': case 'n': case KEYDOWN: case KEYNEXT: if(cbmenue[++y]==NULL) y=0; break; case KEYRESIZE: comdoresize(); needrefresh=1; break; case KEYRET: case KEYESC: break; default: o=KEYNOP; } } while(o==KEYNOP); } while(o!=KEYESC && o!=KEYRET); drawstatusline(); if(o==KEYRET) return(y); else return(-1); } /****************************************************************************/ /* commandprocessing ********************************************************/ /****************************************************************************/ /********* globals for commandprocessing ... */ static int papxpxl, papypxl; static int pagemovedef; static int moveoffdef; static int centhis; static float zoomfinedef; static float zoomdef; static double gotodef[10]; static char gotodefstr[MAXARGSTR+1]; static char movedefstr[MAXARGSTR+1]; static char zoomfinedefstr[MAXARGSTR+1]; static bookmarklist backbmks={0,0}; static int backbmksdate=0; static char* searchstring=NULL; static int searchpage=-1; static int searchanc=-1; static long searchpos=-1; static int pptype; #define PT_NONE 0 #define PT_NEXT 1 #define PT_PREV 2 #define PT_RIGHT 3 #define PT_LEFT 4 static int theunit; static char* unitnames[]= {"MM", "CM", "IN", "BP", "PT", "PC", "CC", "DD" }; static int unitcommas[]= { 1, 2, 2, 1, 1, 2, 2, 1 }; static float tommfactors[]= { 1.0, 10.0, 25.4, .353, .351, 4.22, 4.51, .376 }; #define NUMBEROFUNITS 8 void setunit(int unitnumber) { theunit=MAX(0,MIN(NUMBEROFUNITS-1,unitnumber)); unitstar=theunit; unitomm=tommfactors[theunit]; mmtounit=1/unitomm; unitcomma=unitcommas[theunit]; unitname= unitnames[theunit]; } /************* often needed makros ? ... */ #define CATCHX(dpx) (\ pptype==PT_RIGHT ? (MAX(-vgaxdim/2 - 0*papxpxl,MIN(2*papxpxl-vgaxdim/2,dpx))) : ( \ pptype==PT_LEFT ? (MAX(-vgaxdim/2,MIN(2*papxpxl-vgaxdim/2,dpx))) : ( \ /* else */ (MAX(-vgaxdim/2,MIN(papxpxl-vgaxdim/2,dpx)))))) #define CATCHY(dpx) (MAX(-vgaydim/2-3,MIN(papypxl-vgaydim/2+3,dpx))) #define CATCHXDVI(dpx) (CATCHX(dpx+MMTOPXL(visfmk->hoffmm))-MMTOPXL(visfmk->hoffmm)) #define CATCHYDVI(dpx) (CATCHY(dpx+MMTOPXL(visfmk->voffmm))-MMTOPXL(visfmk->voffmm)) #define SETMOVEOFFDEFPZ(pz) moveoffdef=MAX(1,vgaxdim*MIN(pz/100,0.9)) #define SETMOVEOFFDEFPX(px) moveoffdef=MAX(1,MIN(px,0.9*vgaxdim)) #define SETMOVEDEFSTR sprintf(movedefstr,"%.1f", 100.0*moveoffdef/vgaxdim) /********* reset search and other cheap stuff ... */ void resetsearch(void) { searchpage=-1; searchpos=-1; searchanc=-1; freemem(&searchstring); if(texton==1) { drawhideallmarks(); texton=0; drawshowallmarks(); } updatelist(); } /*********** commandprocessing part 1: dont need anything setup, i.e. cpage, visfmk */ int setcpage(short pn, float fshr, uchar col, uchar dps, int dth, int force){ int i,ishr; #ifdef DEBUGCOM pfprot("(setcpage ..."); #endif pn=MIN(pageanz-1,pn); pn=MAX(0,pn); if(cpage!=pagelist+pn) { force=1; if(ppagemode==0) freelrumem(&(cpage->drawlist)); } if(force==1){ if(!testdvi()){ pfprot("(dvifile changed/disappeared? reloading ... "); killdvi(); initdvi(); if(!testdvi()) dvibad("failed!)"); else pfprot("reloading: done)"); } } cpage=pagelist+pn; fshr=MAX(MINSHRINK,MIN(MAXSHRINK,fshr)); if(ishrinkonly) fshr=MAX(1,LROUND(fshr)); else fshr=(ROUND(100*fshr)/100.0); if(fshr != fshrink || col != colors || dps!=doeps || dth != dimmthresh) { force=1; killgscript();/* this requires killing the drawlists since ... */ initgscript();/* ... they might hold pointers to gse. See below */ for(i=0;idrawlist!=NULL) if(fshr != cpage->fshr || col != cpage->col || dps!=cpage->dps) freelrumem(&(cpage->drawlist)); cpage->fshr=fshr; cpage->col=col; cpage->dps=dps; cpage->dth=dimmthresh; cpage->xoffset=0; cpage->yoffset=0; #ifdef DEBUGCOM pfprot("... setcpage)"); #endif return(force); } int setppage(void){ /* needs dviypos, doesn't need dvixpos */ pagelistelement* pold; #ifdef DEBUGCOM pfprot("(setpppage: papypxl %d dviypos %d vgaydim %d", papypxl,dviypos,vgaydim); #endif pold=ppage; ppage=NULL; pptype=PT_NONE; pagemovedef=1; if(ppagemode>0){ if(cpage->num+1voffmm) > 0){ ppage=cpage+1; ppage->xoffset=0; ppage->yoffset=papypxl+2; pptype=PT_NEXT; } if(cpage->num > 0 && ppagemode==1 && moveoverpages==1 && vgaydimvoffmm)<= 0){ ppage=cpage-1; ppage->xoffset=0; ppage->yoffset=-papypxl-2; pptype=PT_PREV; } if((vgaydim>=papypxl && vgaxdim>=2*papxpxl) || ppagemode==2){ if(cpage->num>0 && cpage->num+1num % 2==1){ ppage=cpage+1; ppage->xoffset=papxpxl+2; ppage->yoffset=0; pptype=PT_RIGHT; pagemovedef=2; } if(cpage->num>0 && cpage->num+1num % 2==0){ ppage=cpage-1; cpage->xoffset=papxpxl+2; ppage->yoffset=0; pptype=PT_LEFT; pagemovedef=2; } } } if(ppage!=NULL) { if(ppage->drawlist!=NULL) if(cpage->fshr != ppage->fshr || cpage->col != ppage->col || cpage->dps!=ppage->dps) freelrumem(&(ppage->drawlist)); ppage->fshr=cpage->fshr; ppage->col=cpage->col; ppage->dps=cpage->dps; } #ifdef DEBUGCOM pfprot(")"); #endif return(pold!=ppage); } void comdoresize(void) { vgasetstatuslines(1); /* sets vgaxdim ydim !! */ drawstatusline(); setppage(); drawupdatepage(); } void comdomarks(int x, int y); /*forward*/ void comdoposit(int dpn, int dxp, int dyp, float dfs, int force) { #ifdef DEBUGCOM pfprot("(comdoposit pn %d dxp %d dyp %d fsh %1.2f ...", dpn,dxp,dyp,dfs); #endif force=setcpage(dpn,dfs,colors,doeps,dimmthresh,force); /* take care -- but why */ papxpxl=MMTOPXL(visfmk->papxmm); /* required after comdofile */ papypxl=MMTOPXL(visfmk->papymm); /* ... makes CATCH & setppage work! */ dviypos=CATCHYDVI(dyp); /* myorder: 1. set dviypos */ setppage(); /* myorder: 2. set ppage */ dvixpos=CATCHXDVI(dxp); /* myorder: 3. set xpos */ drawstatusline(); drawupdatepage(); updatefilemk(); #ifdef DEBUGCOM pfprot(" done)"); #endif } int comdofile(char* fname) { char *bustr=NULL; char bustr2[MAXPATHSTR+80]; if(fname==NULL) return(0); #ifdef DEBUGCOM pfprot("(comdofile %s ...?) ",fname); #endif stralloccpy(&bustr,fname); dvistandard(&bustr,fname); if(visfmk!=NULL && !dvierrorflag) if(strcmp(bustr,visfmk->dvifilename)==0) { freemem(&bustr); return(0); } sprintf(bustr2,"LOADING FILE <%s> ..." ,bustr); drawsl(bustr2,0,0,vgastatuslen); vgaupdatestatus(); updatefilemk(); confwrite(); killdvi(); killgscript(); if(!findrolldownfilemk(bustr)) allocnewfilemk(bustr); visfmk=curfmk; visbmks=curbmks; initdvi(); initgscript(); freemem(&bustr); #ifdef DEBUGCOM pfprot(" ... comdofile done)"); #endif return(1); } void comfile(int mode) { char* bustr=NULL; uchar o; switch(mode) { case COMDO: drawsl("SELECT: LOAD FILE OR KILL FILE OR ESCAPE",0,0,vgastatuslen); drawsr("//",0,vgastatuslen-13,13); vgaupdatestatus(); do { o=vgagetchar(1); if(o<='Z' && 'A' <= o) o=o+('a'-'A'); } while(o!='l' && o!='k' && o!= KEYESC && o != KEYRESIZE); switch(o) { case KEYESC: break; case KEYRESIZE: break; case 'l': drawsl("LOAD FILE:",0,0,vgastatuslen); if(fileargedit(0,11)) break; comdofile(filearg); comdoposit(visfmk->lastpos.pagenum, visfmk->lastpos.dvixpos, visfmk->lastpos.dviypos, visfmk->lastpos.fshrink,1); break; case 'k': if(visfmk==NULL) break; drawsl("KILL FILE:",0,0,vgastatuslen); if(fileargedit(0,11)) break; dvistandard(&bustr,filearg); if(strcmp(bustr,visfmk->dvifilename)==0) { rolldownfilemk(); if(curfmk!=visfmk) { comdofile(curfmk->dvifilename); comdoposit(visfmk->lastpos.pagenum, visfmk->lastpos.dvixpos, visfmk->lastpos.dviypos, visfmk->lastpos.fshrink,1); } else { killdvi(); killgscript(); } } freefilemkname(bustr); freemem(&bustr); if(visfmk==NULL) dvierrorflag=1; break; } resetsearch(); drawstatusline(); break; case COMDEF: if(!canclethis(" LOAD/KILL FILE")) comfile(COMDO); break; default: } } void comredraw(int mode){ int pn; switch(mode) { case COMDO: if(visfmk==NULL) return; drawsl("RE-READING CURRENT DVI-FILE ...",0,0,vgastatuslen); updatefilemk(); vgaupdatestatus(); pn=cpage->num; killdvi(); if(numberargcount==1 && numberarg[0]==PGMAGIC) { killgscript(); killfontdatabase(); initfontdatabase(); initgscript(); } initdvi(); comdoposit(pn,dvixpos,dviypos,fshrink,1); resetsearch(); numberarginit(); break; case COMDEF: if(!canclethis(" RE-READ THE DVI-FILE")) comredraw(COMDO); else drawstatusline(); } } void comhelp(int mode) { switch(mode){ case COMDO: drawsr("PRESS ANY KEY FOR A SHORT DESCRIPTION", 0,0,vgastatuslen); vgaupdatestatus(); break; case COMDEF: help(); break; statusforce=1; break; } } /*********** commandprocessing part 2: do need anything setup, i.e. cpage, visfmk */ #define MAXBACKBMKS 50 void comdokilloldbackbmk(void) { int i; for(i=backbmks.n-1; i>0;i--) if(backbmks.d[i]->name>backbmks.d[0]->name) freebookmknumber(&backbmks,i); if(backbmks.n>0) backbmksdate=backbmks.d[0]->name; } void comdosetbackbmk(void) { if(amiatbookmkqm(&backbmks,0)) return; comdokilloldbackbmk(); if(backbmks.n>=MAXBACKBMKS) freebookmknumber(&backbmks,backbmks.n-1); addbookmk(&backbmks,1); backbmks.d[0]->name= ++backbmksdate; } void comsetbookmk(int mode){ int name,i; char bustr[80]; switch(mode) { case COMDO: #ifdef DEBUGCOM pfprot("(comsetbookmk.."); #endif if((i=existsbookmkqm(visbmks))>=0) { freebookmknumber(visbmks,i); while((i=existsbookmkqm(visbmks))>=0) freebookmknumber(visbmks,i); ignorethis("UNDEFINED MANUAL-BOOKMARK"); } else { name=1; if(numberargcount==1 && numberarg[0]!=PGMAGIC && numberarg[0]>0 && numberarg[0]==LROUND(numberarg[0])) name=MIN(MAXMKS-1,LROUND(numberarg[0])); for(;nameMAXMKS) { for(name=1;named[0]->name=name; sprintf(bustr,"DEFINED MANUAL-BOOKMARK (%d)",name); ignorethis(bustr); } break; case COMDEF: if(!shorthelp( " (UN)DEFINE MANUAL-BOOKMARK", "OPTIONAL ARGUMENT NAME","") ) comsetbookmk(COMDO); else drawstatusline(); } } void comgobackbookmk(int mode) { bookmark *thebmk; int i,max,maxi,ddf,total; char bustr[80], bustr2[MAXPATHSTR+80]; switch(mode) { case COMDO: if(numberargcount==1 && numberarg[0]!=PGMAGIC && numberarg[0]>=0) { total=LROUND(fabs(numberarg[0])); if(backbmks.n>total) { max=-1;maxi=-1; for(i=0;iname>max) { max=backbmks.d[i]->name; maxi=i; } for(i=0;i0;i--) freebookmknumber(&backbmks,backbmks.n-1); for(i=0;iname=backbmks.n-i; } backbmksdate=backbmks.n; sprintf(bustr,"BACK-BMK: TOTAL %d",backbmks.n); ignorethis(bustr); break; } updatefilemk(); if(backbmks.n>0) { thebmk=backbmks.d[0]; rolldownbookmk(&backbmks); resetsearch(); ddf=comdofile(thebmk->dvifilename); comdoposit(thebmk->pagenum, thebmk->dvixpos, thebmk->dviypos, thebmk->fshrink,ddf); comdomarks(thebmk->marksxpxl,thebmk->marksypxl); vgasetmouse(marksxpxl,marksypxl); sprintf(bustr,"BACK-BMK (%d/%d)",thebmk->name,backbmks.n); sprintf(bustr2,"%s IN %s",bustr, visfmk->dvifilename); ignorethis(bustr2); } break; case COMDEF: if(!shorthelp( "<^> MOVE TO BACK-BOOKMARK", "OPTIONAL ARGUMENT: TOTAL","") ) comgobackbookmk(COMDO); else drawstatusline(); break; default: } } void comgoprevbookmk(int mode) { bookmark *thebmk=NULL; int name, found,ddf; char bustr[80], bustr2[MAXPATHSTR+80]; switch(mode) { case COMDO: /* toggle mode ? ****************************************/ if(numberargcount==1 && numberarg[0]==PGMAGIC) { if(bookmkmode==FILETYP) { bookmkmode=MANTYP; ignorethis("SET TO MANUAL-BOOKMARKS"); } else { if(bookmkmode==MANTYP) { bookmkmode=FILETYP; ignorethis("SET TO FILE-BOOKMARKS"); }} return; } updatefilemk(); found=0; /* find by name ?*******************************************/ if(numberargcount==1 && numberarg[0]!=PGMAGIC && numberarg[0]>0 && numberarg[0]==LROUND(numberarg[0])) { name=MIN(MAXMKS-1,LROUND(numberarg[0])); if(!(findrolldownbookmk(visbmks,name))) { sprintf(bustr,"NO BOOKMARK (%d) DEFINED",name); ignorethis(bustr); } else { thebmk=visbmks->d[0]; found=MANTYP; } } else { /* find by bookmkmode ?****************************/ if(bookmkmode==FILETYP) { rolldownfilemk(); thebmk=&(curfmk->lastpos); found=FILETYP; } if(bookmkmode==MANTYP) { rolldownbookmk(visbmks); if(visbmks->n>0) { thebmk=visbmks->d[0]; found=MANTYP; } } } if(found != 0) { resetsearch(); comdosetbackbmk(); ddf=comdofile(thebmk->dvifilename); comdoposit(thebmk->pagenum, thebmk->dvixpos, thebmk->dviypos, thebmk->fshrink,ddf); if(found == FILETYP) strcpy(bustr,"FILE-BMK"); if(found == MANTYP) sprintf(bustr,"MANUAL-BMK (%d)",thebmk->name); sprintf(bustr2,"%s IN %s",bustr, visfmk->dvifilename); ignorethis(bustr2); } break; case COMDEF: if(!shorthelp( " MOVE TO BOOKMARK", "OPTIONAL ARGUMENT: NAME","") ) comgoprevbookmk(COMDO); else drawstatusline(); break; default: } } void comstatus(int mode){ switch(mode) { case COMDO: ++statustype; if(statustype==STATUSTYPES) statustype=0; numberarginit(); drawstatusline(); break; case COMDEF: if(!canclethis(" SELECT STATUSLINE INFORMATION")) comstatus(COMDO); else drawstatusline(); break; } } void comdounit(void){ char bustr[4*NUMBEROFUNITS+10]; int newunit,i,needrefresh; uchar o; bustr[0]=' '; bustr[1]=0; for(i=0;i SELECT THE UNIT OF MEASURE",0,0,vgastatuslen); if(vgastatuslen>4*NUMBEROFUNITS+ 32) drawsr("PRESS // OR ",1,0,vgastatuslen); } drawsn(bustr,1,0); drawsn("[",1,newunit*4); drawsn("]",1,newunit*4+3); vgaupdatestatus(); do { o=vgagetchar(1); switch(o){ case 'H': case 'h': case KEYLEFT: --newunit; break; case 'J': case 'j': case KEYRIGHT: ++newunit; break; case KEYRESIZE: comdoresize(); needrefresh=1; break; case KEYRET: case KEYESC: break; default: o=KEYNOP; } } while(o==KEYNOP); if(newunit < 0) newunit=NUMBEROFUNITS-1; if(newunit >= NUMBEROFUNITS) newunit=0; } while(o!=KEYESC && o!=KEYRET); if(o==KEYRET) setunit(newunit); } void comunit(int mode){ switch(mode) { case COMDO: comdounit(); drawstatusline(); break; case COMDEF: comunit(COMDO); break; } } int comdoprintpage(int dpg, int gotop) { int dodr; dodr=setcpage(dpg,fshrink,colors,doeps,dimmthresh,0); if(gotop==1) { if(dviypos != MMTOPXL(visfmk->centerymm-visfmk->voffmm)-vgaydim/2) dodr=1; if(dvixpos != MMTOPXL(visfmk->centerxmm-visfmk->hoffmm)-vgaxdim/2) dodr=1; dviypos= MMTOPXL(visfmk->centerymm-visfmk->voffmm)-vgaydim/2; dvixpos= MMTOPXL(visfmk->centerxmm-visfmk->hoffmm)-vgaxdim/2; } if(!dodr) return(0); setppage(); resetsearch(); drawstatuspage(); drawstatusmarks(); drawupdatepage(); return(1); } void comprintpage(int mode, int lm){ int n; switch(mode) { case COMDO: if(numberargcount==1 && numberarg[0]==PGMAGIC) { pagemovetop=1-pagemovetop; if(pagemovetop==1) ignorethis("MOVE-TOP-OF-PAGE TURNED ON"); if(pagemovetop==0) ignorethis("MOVE-TOP-OF-PAGE TURNED OFF"); } else { n=pagemovedef; if(numberargcount==1 && numberarg[0]>0 && numberarg[0]<100) n= numberarg[0]; comdoprintpage(cpage->num+lm*n,pagemovetop); } break; case COMDEF: if(!shorthelp( "/ SELECT A PAGE, W.R.T. THE CURRENT PAGE", "AMOUNT OF MOVEMENT (PAGES)","1") ) comprintpage(COMDO,lm); drawstatusline(); break; default: } } void comgoto(int mode) { short i; switch(mode) { case COMDO: if(numberargcount!=0) { for(i=0;inum),pagemovetop); break; case COMDEF: if(! shorthelp(" SELECT A PAGE, W.R.T. TeX PAGE-COUNTERS", "COUNT0; ...; COUNT9",gotodefstr) ) comgoto(COMDO); drawstatusline(); break; default: } } void comdomoveright(int off){ int n,d; n=CATCHXDVI(dvixpos+off); d=n-dvixpos; if(d<=0) return; drawhidefixedmarksonly(); /*might reset vgascreen */ dvixpos=n; #if CURSORSNOTONSCREEN || SCROLLONSCREEN /* so scrolling is on screen */ updatelist(); vgascreen(1); #endif vgaxscroll(-d); #if SCROLLONSCREEN vgascreen(0); #endif drawstatusmarks(); drawshowfixedmarksonly(); drawpage(vgaxdim-d,0,vgaxdim-1,vgaydim-1,1); updateall(); } void comdomoveleft(int off) { int n,d; n=CATCHXDVI(dvixpos-off); d=dvixpos-n; if(d<=0) return; drawhidefixedmarksonly(); dvixpos=n; #if CURSORSNOTONSCREEN || SCROLLONSCREEN /* so scrolling is on screen */ updatelist(); vgascreen(1); #endif vgaxscroll(d); #if SCROLLONSCREEN vgascreen(0); #endif drawstatusmarks(); drawshowfixedmarksonly(); drawpage(0,0,d-1,vgaydim-1,1); updateall(); } void comdomovedown(int off,int over) { int n,d,ro=0; pagelistelement* bpage; n=CATCHYDVI(dviypos+off); d=n-dviypos; if(d<=0 && over==0) return; /* cought while over disabled */ if(d!=off && over==1 && (pptype != PT_NEXT || !testdvi())){ /* cought while partner doesnt suit or change*/ n=dviypos; dviypos=CATCHYDVI(-vgaydim-MMTOPXL(visfmk->voffmm)); if(!comdoprintpage(cpage->num+pagemovedef,0)) dviypos=n; return; } if(d!=off && over==1 && pptype == PT_NEXT){ /* cought while partner suits */ ro=1; drawhideallmarksandrect(); /* 0. hide stuff */ bpage=ppage; cpage=ppage; ppage=bpage; /* 1. swap */ ppage->yoffset= -cpage->yoffset; /* 2. mirror y offset */ dviypos=dviypos+cpage->yoffset; cpage->yoffset= 0; pptype=PT_PREV; /* 3. keep track of type */ n=CATCHYDVI(dviypos+off); d=n-dviypos; if(d<=0) {pfverb("(ERROR comdomovedown)"); return;} /* doesnt happen ?*/ resetsearch(); drawstatuspage(); } else drawhidefixedmarksonly(); dviypos=n; setppage(); #if CURSORSNOTONSCREEN || SCROLLONSCREEN /* so scrolling is on screen */ updatelist(); vgascreen(1); #endif vgayscroll(-d); #if SCROLLONSCREEN vgascreen(0); #endif drawstatusmarks(); if(!ro) drawshowfixedmarksonly(); else { drawshowallmarks(); drawshowrect(); } drawpage(0,vgaydim-d,vgaxdim-1,vgaydim-1,1); updateall(); } void comdomoveup(int off, int over) { int n,d,ro=0; pagelistelement* bpage; n=CATCHYDVI(dviypos-off); d=dviypos-n; if(d<=0 && over==0) return; /* cought while over disabled */ if(d!=off && over==1 && (pptype != PT_PREV || !testdvi())){ /* cought while partner doesnt suit or change */ n=dviypos; dviypos=CATCHYDVI(papypxl-MMTOPXL(visfmk->voffmm)); if(!comdoprintpage(cpage->num-pagemovedef,0)) dviypos=n; return; } if(d!=off && over==1 && pptype==PT_PREV){/* cought while partner suits */ ro=1; drawhideallmarksandrect(); /* 0. hide stuff */ bpage=ppage; cpage=ppage; ppage=bpage; /* 1. swap */ ppage->yoffset= -cpage->yoffset; /* 2. mirror y offset */ dviypos=dviypos+cpage->yoffset; cpage->yoffset= 0; pptype=PT_NEXT; /* 3. keep track of type */ n=CATCHYDVI(dviypos-off); d=dviypos-n; if(d<=0) {pfverb("(ERROR comdomoveup)"); return;} /* doesnt happen ?*/ resetsearch(); drawstatuspage(); } else drawhidefixedmarksonly(); dviypos=n; setppage(); #if CURSORSNOTONSCREEN || SCROLLONSCREEN /* so scrolling is on screen */ updatelist(); vgascreen(1); #endif vgayscroll(d); #if SCROLLONSCREEN vgascreen(0); #endif drawstatusmarks(); if(!ro) drawshowfixedmarksonly(); else { drawshowallmarks(); drawshowrect(); } drawpage(0,0,vgaxdim-1,d-1,1); updateall(); } void comdomarks(int x, int y) { int xx,yy; if(markon==0 && hypon==0) return; xx=x; yy=y; if(xx<0) { comdomoveleft(-x); xx=0; } if(xx>vgaxdim-1) { comdomoveright(x-vgaxdim+1); xx=vgaxdim-1; } if(yy<0){ comdomoveup(-y,moveoverpages); yy=0; } if(yy>vgaydim-1) { comdomovedown(y-vgaydim+1,moveoverpages); yy=vgaydim-1; } if(xx!=marksxpxl || yy!=marksypxl) { drawhidefixedmarksonly(); marksxpxl=xx; marksypxl=yy; /* was: setmouse */ drawshowfixedmarksonly(); drawstatusmarks(); } else if(x!=xx || y!=yy) drawstatusmarks(); updatelist(); } void commoveright(int mode) { switch(mode) { case COMDO: if(numberargcount==1 && numberarg[0]!= PGMAGIC) SETMOVEOFFDEFPZ(numberarg[0]); #ifndef HASMOUSE if(markon || hypon) comdomarks(marksxpxl+moveoffdef,marksypxl); else #endif comdomoveright(moveoffdef); break; case COMDEF: SETMOVEDEFSTR; if(!shorthelp( "/// SCROLL THE VISABLE AREA", "AMOUNT OF MOVEMENT (%)" ,movedefstr) ) commoveright(COMDO); drawstatusline(); break; default: } } void commoveleft(int mode) { switch(mode) { case COMDO: if(numberargcount==1 && numberarg[0]!= PGMAGIC) SETMOVEOFFDEFPZ(numberarg[0]); #ifndef HASMOUSE if(markon || hypon) comdomarks(marksxpxl-moveoffdef,marksypxl); else #endif comdomoveleft(moveoffdef); break; case COMDEF: SETMOVEDEFSTR; if(!shorthelp( "/// SCROLL THE VISABLE AREA", "AMOUNT OF MOVEMENT (%)" ,movedefstr) ) commoveleft(COMDO); drawstatusline(); break; default: } } void commovedown(int mode) { switch(mode) { case COMDO: if(numberargcount==1 && numberarg[0]==PGMAGIC) { moveoverpages=1-moveoverpages; comdoposit(cpage->num,dvixpos,dviypos,fshrink,1); if(moveoverpages==1) ignorethis("MOVE-OVER-PAGES TURNED ON"); else ignorethis("MOVE-OVER-PAGES TURNED OFF"); /* comdoposit(cpage->num,dvixpos,dviypos,fshrink,1); */ } else { if(numberargcount==1 && numberarg[0]!=PGMAGIC) SETMOVEOFFDEFPZ(numberarg[0]); #ifndef HASMOUSE if(markon || hypon) comdomarks(marksxpxl,marksypxl+moveoffdef); else #endif comdomovedown(moveoffdef,moveoverpages); } break; case COMDEF: SETMOVEDEFSTR; if(!shorthelp( "/// SCROLL THE VISABLE AREA", "AMOUNT OF MOVEMENT (%)" ,movedefstr) ) commovedown(COMDO); drawstatusline(); break; default: } } void commoveup(int mode) { switch(mode) { case COMDO: if(numberargcount==1 && numberarg[0]==PGMAGIC) { moveoverpages=1-moveoverpages; comdoposit(cpage->num,dvixpos,dviypos,fshrink,1); if(moveoverpages==1) ignorethis("MOVE-OVER-PAGES TURNED ON"); else ignorethis("MOVE-OVER-PAGES TURNED OFF"); /* comdoposit(cpage->num,dvixpos,dviypos,fshrink,1); */ } else { if(numberargcount==1 && numberarg[0]!=PGMAGIC) SETMOVEOFFDEFPZ(numberarg[0]); #ifndef HASMOUSE if(markon || hypon) comdomarks(marksxpxl,marksypxl-moveoffdef); else #endif comdomoveup(moveoffdef,moveoverpages); } break; case COMDEF: SETMOVEDEFSTR; if(!shorthelp( "/// SCROLL THE VISABLE AREA", "AMOUNT OF MOVEMENT (%)" ,movedefstr) ) commoveup(COMDO); drawstatusline(); break; default: } } void comcenter(int mode, int flag) { char bustr1[40], bustr2[MAXARGSTR]; int d, cxpxl,cypxl; /*fprintf(prot,"(comcenter %d...)",centhis);*/ switch(mode) { case COMDO: if(!flag && numberargcount==1 && numberarg[0]==PGMAGIC) { if(markon) { visfmk->centerxmm=PXLTOMM(dvixpos+marksxpxl)+visfmk->hoffmm; visfmk->centerymm=PXLTOMM(dviypos+marksypxl)+visfmk->voffmm; } else { visfmk->centerymm=PXLTOMM(dviypos+vgaydim/2)+visfmk->hoffmm; visfmk->centerxmm=PXLTOMM(dvixpos+vgaxdim/2)+visfmk->voffmm; } } if(numberargcount==2 && numberarg[0]!=PGMAGIC && numberarg[1]!=PGMAGIC) { visfmk->centerxmm=numberarg[0]; visfmk->centerymm=numberarg[1]; } if(flag){ /* try smart true center */ visfmk->centerymm=visfmk->papymm/2; visfmk->centerxmm=visfmk->papxmm/2; if(pptype==PT_RIGHT) visfmk->centerxmm=visfmk->papxmm; if(pptype==PT_LEFT) visfmk->centerxmm=visfmk->papxmm; } visfmk->centerxmm=MAX(0,MIN(visfmk->papxmm,visfmk->centerxmm)); visfmk->centerymm=MAX(0,MIN(visfmk->papymm,visfmk->centerymm)); cxpxl=MMTOPXL(visfmk->centerxmm-visfmk->hoffmm); cypxl=MMTOPXL(visfmk->centerymm-visfmk->voffmm); switch(centhis) { case 0: d=-dvixpos+cxpxl-vgaxdim/2; if(d>0) comdomoveright(d); else comdomoveleft(-d); break; case 1: d= -dviypos+cypxl-vgaydim/2; if(d>0) comdomovedown(d,0); else comdomoveup(-d,0); break; default: } centhis++; if(centhis==2) centhis=1; break; case COMDEF: sprintf(bustr1,"%%.%df;%%.%df", unitcomma,unitcomma); sprintf(bustr2,bustr1, mmtounit*visfmk->centerxmm,mmtounit*visfmk->centerymm); if(!shorthelp( " CENTER THE VISABLE AREA", "CENTERPOINT", bustr2)) comcenter(COMDO,0); drawstatusline(); break; default: } } void comfine(int mode, int lm) { char bustr[80]; switch(mode) { case COMDO: if(lm==-1) SETMOVEOFFDEFPX(MIN(moveoffdef/FINE,moveoffdef-1)); if(lm==+1) SETMOVEOFFDEFPX(MAX(moveoffdef*FINE,moveoffdef+1)); sprintf(bustr,"CURRENT MOVEOFFSET: %.1f%%",100.0*moveoffdef/vgaxdim); ignorethis(bustr); break; case COMDEF: if(!canclethis( "/ MAKE SCROLLING THE VISABLE AREA MORE FINE/COARSE")) comfine(COMDO,lm); drawstatusline(); break; default: } } void comdozoom(float newfshrink) { float oldshrink; oldshrink=fshrink; if(!setcpage(cpage->num,newfshrink,colors,doeps,dimmthresh,0)) return; resetsearch(); papxpxl=MMTOPXL(visfmk->papxmm); papypxl=MMTOPXL(visfmk->papymm); if(markon) { dvixpos=ROUND(oldshrink/ fshrink*(dvixpos+marksxpxl)-marksxpxl); dviypos=ROUND(oldshrink/ fshrink*(dviypos+marksypxl)-marksypxl); } else { dvixpos=ROUND(oldshrink/ fshrink*(dvixpos+vgaxdim/2)-vgaxdim/2); dviypos=ROUND(oldshrink/ fshrink*(dviypos+vgaydim/2)-vgaydim/2); } /* if(texton) { textx1pxl=LFLOOR(oldshrink/ fshrink*textx1pxl); texty1pxl=LFLOOR(oldshrink/ fshrink*texty1pxl); textx2pxl=LCEIL(oldshrink/ fshrink*textx2pxl); texty2pxl=LCEIL(oldshrink/ fshrink*texty2pxl); textx3pxl=LFLOOR(oldshrink/ fshrink*textx3pxl); texty3pxl=LFLOOR(oldshrink/ fshrink*texty3pxl); textx4pxl=LCEIL(oldshrink/ fshrink*textx4pxl); texty4pxl=LCEIL(oldshrink/ fshrink*texty4pxl); } */ dviypos=CATCHYDVI(dviypos); setppage(); dvixpos=CATCHXDVI(dvixpos); drawupdatepage(); } void comzoomfine(int mode, int lm) { char bustr[80]; switch(mode) { case COMDO: if(numberargcount==1 && numberarg[0]!= PGMAGIC) { ishrinkonly=0; zoomfinedef=1.0+MAX(0.01,MIN(2.0,numberarg[0]/100.0)); sprintf(zoomfinedefstr,"%.1f", MAX(10,MIN(200,numberarg[0]))); } if(ishrinkonly) comdozoom(fshrink-lm); else{ if(lm== -1) comdozoom(fshrink*zoomfinedef); if(lm== +1) comdozoom(fshrink/zoomfinedef); } zoomdef=1/fshrink; sprintf(bustr,"CURRENT ZOOMFACTOR: %.3f",1.0/fshrink); ignorethis(bustr); break; case COMDEF: if(!shorthelp( "<+>/<-> ZOOMING IN/OUT", "DECREMENT RESP. INCREMENT (%)" ,zoomfinedefstr) ) comzoomfine(COMDO,lm); else drawstatusline(); break; default: } } void comzoomset(int mode) { char bustr1[MAXARGSTR],bustr2[MAXARGSTR]; switch(mode) { case COMDO: if(numberargcount==1 && numberarg[0]!=PGMAGIC) { zoomdef=numberarg[0]; ishrinkonly=0; } if(numberargcount==1 && numberarg[0]==PGMAGIC) { if(ppagemode!=2) zoomdef=1/fshrink*(float)(vgaxdim)/ ((float)papxpxl-MMTOPXL(visfmk->lrandmm+visfmk->rrandmm)); else zoomdef=1/fshrink*(float)(vgaxdim)/ (2*(float)papxpxl-MMTOPXL(visfmk->lrandmm+visfmk->rrandmm)); ishrinkonly=0; } zoomdef=MIN(1/MINSHRINK,MAX(1/MAXSHRINK,zoomdef)); comdozoom(1/zoomdef); zoomdef=1/fshrink; if(numberargcount==1 && numberarg[0]==PGMAGIC) { centhis=0; comcenter(COMDO,1); } if(ishrinkonly==0) strcpy(bustr2,"ARBYTRARY-MODE"); else strcpy(bustr2,"INTEGER-MODE"); sprintf(bustr1,"CURRENT ZOOMFACTOR (%s): %.3f",bustr2,1.0/fshrink); ignorethis(bustr1); break; case COMDEF: sprintf(bustr1,"%.3f", zoomdef); sprintf(bustr2,"(CURRENTLY %.3f)", 1/fshrink); if(!shorthelp( " SET THE ZOOMFACTOR", bustr2 ,bustr1) ) comzoomset(COMDO); else drawstatusline(); break; default: } } void comframe(int mode) { char bustr1[50], bustr2[50], bustr3[MAXARGSTR]; switch(mode) { case COMDO: if(numberargcount==4 && numberarg[0]!= PGMAGIC && numberarg[1]!= PGMAGIC && numberarg[2]!= PGMAGIC && numberarg[3]!= PGMAGIC) { visfmk->lrandmm=unitomm*numberarg[0]; visfmk->rrandmm=unitomm*numberarg[1]; visfmk->orandmm=unitomm*numberarg[2]; visfmk->urandmm=unitomm*numberarg[3]; frameon=0; /* go on soon */ } if(numberargcount==1 && numberarg[0]!= PGMAGIC){ visfmk->lrandmm=unitomm*numberarg[0]; visfmk->rrandmm=unitomm*numberarg[0]; visfmk->orandmm=unitomm*numberarg[0]; visfmk->urandmm=unitomm*numberarg[0]; frameon=0; /* go on soon */ } if(numberargcount==1 && numberarg[0]==PGMAGIC) { if(markon) { visfmk->lrandmm= MIN(markdxmm,PXLTOMM(dvixpos+marksxpxl)+visfmk->hoffmm); visfmk->rrandmm= visfmk->papxmm- MAX(markdxmm,PXLTOMM(dvixpos+marksxpxl)+visfmk->hoffmm); visfmk->orandmm= MIN(markdymm,PXLTOMM(dviypos+marksypxl)+visfmk->voffmm); visfmk->urandmm= visfmk->papymm- MAX(markdymm,PXLTOMM(dviypos+marksypxl)+visfmk->voffmm); } else { visfmk->urandmm=fmkstar.urandmm; visfmk->lrandmm=fmkstar.lrandmm; visfmk->rrandmm=fmkstar.rrandmm; visfmk->orandmm=fmkstar.orandmm; } frameon=0; /* go on soon */ } frameon=1-frameon; setppage(); drawupdatepage(); break; case COMDEF: sprintf(bustr1,"MARGINS (%s) LEFT; RIGHT; TOP; BOTTOM",unitnames[theunit]); sprintf(bustr2,"%%.%df;%%.%df;%%.%df;%%.%df", unitcomma,unitcomma,unitcomma,unitcomma); sprintf(bustr3,bustr2, mmtounit*visfmk->lrandmm,mmtounit*visfmk->rrandmm, mmtounit*visfmk->orandmm,mmtounit*visfmk->urandmm); if(!shorthelp("

SHOW/HIDE THE PRINTABLE AREA",bustr1, bustr3)) comframe(COMDO); drawstatusline(); break; default: } } void compaper(int mode) { char bustr1[50], bustr2[50], bustr3[MAXARGSTR]; float nho,nvo,npx,npy,dx,dy; switch(mode) { case COMDO: if(numberargcount==4 && numberarg[0]!= PGMAGIC && numberarg[1]!= PGMAGIC && numberarg[2]!= PGMAGIC && numberarg[3]!= PGMAGIC) { nho=unitomm*numberarg[0]; nvo=unitomm*numberarg[1]; npx=unitomm*numberarg[2]; npy=unitomm*numberarg[3]; } else { if(numberargcount==2 && numberarg[0]!= PGMAGIC && numberarg[1]!= PGMAGIC) { nho=fmkstar.hoffmm; nvo=fmkstar.voffmm; npx=unitomm*numberarg[0]; npy=unitomm*numberarg[1]; } else { if(numberargcount==1 && numberarg[0]==PGMAGIC) { if(markon) { nho= -MIN(markdxmm-visfmk->hoffmm,PXLTOMM(dvixpos+marksxpxl)); nvo= -MIN(markdymm-visfmk->voffmm,PXLTOMM(dviypos+marksypxl)); npx= MAX(markdxmm-visfmk->hoffmm,PXLTOMM(dvixpos+marksxpxl)) +nho; npy= MAX(markdymm-visfmk->voffmm,PXLTOMM(dviypos+marksypxl)) +nvo; } else { nho=fmkstar.hoffmm; nvo=fmkstar.voffmm; npx=fmkstar.papxmm; npy=fmkstar.papymm; } } else break;}} dx=nho-visfmk->hoffmm; dy=nvo-visfmk->voffmm; markdxmm+=dx; markdymm+=dy; rectxmm+=dx; rectymm+=dy; visfmk->centerxmm+=dx; visfmk->centerymm+=dx; visfmk->hoffmm=nho; visfmk->voffmm=nvo; visfmk->papxmm=npx; visfmk->papymm=npy; papxpxl=MMTOPXL(npx); papypxl=MMTOPXL(npy); dviypos=CATCHYDVI(dviypos); setppage(); dvixpos=CATCHXDVI(dvixpos); resetsearch(); drawupdatepage(); break; case COMDEF: sprintf(bustr1,"OFFSET+SIZE (%s) HOFF; VOFF; WIDTH; HEIGHT",unitnames[theunit]); sprintf(bustr2,"%%.%df;%%.%df;%%.%df;%%.%df", unitcomma,unitcomma,unitcomma,unitcomma); sprintf(bustr3,bustr2, mmtounit*visfmk->hoffmm,mmtounit*visfmk->voffmm, mmtounit*visfmk->papxmm,mmtounit*visfmk->papymm); if(!shorthelp(" PAPERSIZE AND OFFSET",bustr1, bustr3)) compaper(COMDO); drawstatusline(); break; default: } } void comrect(int mode) { float rxmm,rymm,rwmm,rhmm; char bustr1[50], bustr2[50], bustr3[MAXARGSTR]; switch(mode) { case COMDO: if(markon && recton) /* dont flicker */ if( !MMTOPXL(rectxmm-MIN(markdxmm,PXLTOMM(dvixpos+marksxpxl)+visfmk->hoffmm)) && !MMTOPXL(rectwmm-fabs(markdxmm-PXLTOMM(dvixpos+marksxpxl)-visfmk->hoffmm)) && !MMTOPXL(rectymm-MIN(markdymm,PXLTOMM(dviypos+marksypxl)+visfmk->voffmm)) && !MMTOPXL(recthmm-fabs(markdymm-PXLTOMM(dviypos+marksypxl)-visfmk->voffmm)) ) break; if(markon) { drawhiderect(); rectxmm=MIN(markdxmm,PXLTOMM(dvixpos+marksxpxl)+visfmk->hoffmm); rectwmm=fabs(markdxmm-PXLTOMM(dvixpos+marksxpxl)-visfmk->hoffmm); rectymm=MIN(markdymm,PXLTOMM(dviypos+marksypxl)+visfmk->voffmm); recthmm=fabs(markdymm-PXLTOMM(dviypos+marksypxl)-visfmk->voffmm); recton=0; /* go on soon */ } if(numberargcount==4 && numberarg[0]!= PGMAGIC && numberarg[1]!= PGMAGIC && numberarg[2]!= PGMAGIC && numberarg[3]!= PGMAGIC) { drawhiderect(); rectxmm=unitomm*numberarg[0]; rectymm=unitomm*numberarg[1]; rectwmm=unitomm*numberarg[2]; recthmm=unitomm*numberarg[3]; recton=0; /* go on soon */ } if(recton==1) { drawhiderect(); recton=0; } else { recton=1; drawshowrect(); } updatelist(); break; case COMDEF: rxmm=rectxmm; rwmm=rectwmm; rymm=rectymm; rhmm=rectymm; if(markon) { rxmm=MIN(markdxmm,PXLTOMM(dvixpos+marksxpxl)+visfmk->hoffmm); rwmm=fabs(markdxmm-PXLTOMM(dvixpos+marksxpxl)-visfmk->hoffmm); rymm=MIN(markdymm,PXLTOMM(dviypos+marksypxl)+visfmk->voffmm); rhmm=fabs(markdymm-PXLTOMM(dviypos+marksypxl)-visfmk->voffmm); } sprintf(bustr1,"OFFSET+SIZE (%s) LEFT; TOP; WIDTH; HIGHT",unitnames[theunit]); sprintf(bustr2,"%%.%df;%%.%df;%%.%df;%%.%df", unitcomma,unitcomma,unitcomma,unitcomma); sprintf(bustr3,bustr2, mmtounit*rxmm,mmtounit*rymm,mmtounit*rwmm,mmtounit*rhmm); if(!shorthelp(" SHOW/HIDE MARKED RECTANGLE",bustr1, bustr3)) comrect(COMDO); drawstatusline(); break; default: } } void commark(int mode) { char bustr1[50], bustr2[50], bustr3[MAXARGSTR]; switch(mode) { case COMDO: if(hypon) { hypon=0; drawupdatepage(); markon=0; /* go on soon (is 0 anyway) */ } if(numberargcount==2 && numberarg[0]!= PGMAGIC && numberarg[1]!= PGMAGIC) { if(markon!=0) { drawhideallmarks(); markon=0; /* go on soon */ } markdxmm=unitomm*numberarg[0]; markdymm=unitomm*numberarg[1]; } if(markon==1) { drawhideallmarks(); markon=0; drawshowallmarks(); if(recton==1) { recton=0; drawupdatepage(); } } else { markon=1; drawshowallmarks(); #ifndef HASWINDOWS vgasetmouse(marksxpxl,marksypxl); #endif } updatelist(); resetsearch(); break; case COMDEF: sprintf(bustr1,"PAGEMARK-POSITION (%s) PM_X; PM_Y",unitnames[theunit]); sprintf(bustr2,"%%.%df;%%.%df",unitcomma,unitcomma); sprintf(bustr3,bustr2,mmtounit*markdxmm,mmtounit*markdymm); if(!shorthelp(" SHOW/HIDE PAGEMARK AND SCREENMARK",bustr1,bustr3)) commark(COMDO); drawstatusline(); break; default: } } void comdomarkfollow(void) { if(markon==0) return; drawhideallmarks(); markdxmm =PXLTOMM(marksxpxl+dvixpos)+visfmk->hoffmm; markdymm =PXLTOMM(marksypxl+dviypos)+visfmk->voffmm; drawshowallmarks(); drawstatusmarks(); updatelist(); } void commarkfollow(int mode) { switch(mode) { case COMDO: comdomarkfollow(); break; case COMDEF: if(!canclethis(" SET PAGEMARK AT SCREENMARK")) commarkfollow(COMDO); drawstatusline(); break; default: } } void comhyp(int mode) { switch(mode) { case COMDO: if(markon) { drawhideallmarks(); hypon=0; markon=0; /* go on soon */ if(recton==1) recton=0; } if(hypon==1) hypon=0; else { hypon=1; #ifndef HASWINDOWS vgasetmouse(marksxpxl,marksypxl); #endif } drawupdatepage(); resetsearch(); break; case COMDEF: if(!canclethis(" HYPERDVI ON/OFF")) comhyp(COMDO); drawstatusline(); break; default: } } void comdohypfollow(void) { char* href=NULL; int xpxl, ypxl, pn; int dodr, nxp,nyp; if(hypon) if(!htex_clickmouse(cpage,marksxpxl+dvixpos, marksypxl+dviypos, &href)) if(ppage!=NULL) htex_clickmouse(ppage,marksxpxl+dvixpos-ppage->xoffset, marksypxl+dviypos-ppage->yoffset, &href); if(!hypon && !markon && texton) { htex_clickmouse(cpage,LROUND(0.5*(textx2pxl+textx1pxl)), LROUND(0.5*(texty2pxl+texty1pxl)),&href); } if(href==NULL) return; resetsearch(); pn=cpage->num; if(!searchhref(href,&pn, &xpxl, &ypxl)) {drawstatusline(); return;} comdosetbackbmk(); dodr=0; nxp=MAX(xpxl-vgaxdim,MIN(xpxl,dvixpos)); nyp=MAX(ypxl-0.8*vgaydim,MIN(ypxl-0.2*vgaydim,dviypos)); if(nxp!=dvixpos || nyp !=dviypos) { dvixpos=nxp; dviypos=nyp; dodr=1; } if(setcpage(pn,fshrink,colors,doeps,dimmthresh,0)) dodr=1; if(setppage()) dodr=1; if(dodr) drawupdatepage(); comdomarks(xpxl-dvixpos,ypxl-dviypos); drawstatusline(); vgasetmouse(marksxpxl,marksypxl); comdosetbackbmk(); } void comdohypnext(void) { int xpxl, ypxl; int dodr, nxp,nyp; int found; found=0; drawhideallmarks(); texton=0; nxp=nyp=0; if(hypon) { xpxl=marksxpxl+dvixpos; ypxl=marksypxl+dviypos; found=htex_findnearanchor(cpage,&xpxl,&ypxl); nxp=MAX(xpxl-vgaxdim,MIN(xpxl,dvixpos)); nyp=MAX(ypxl-0.8*vgaydim,MIN(ypxl-0.2*vgaydim,dviypos)); } if(!markon && !hypon) { found=htex_findnumberanchor(cpage,&searchanc); nxp=MAX(textx2pxl-vgaxdim,MIN(textx1pxl,dvixpos)); nyp=MAX(texty2pxl-0.8*vgaydim,MIN(texty1pxl-0.2*vgaydim,dviypos)); } if(found) { dodr=0; if(nxp!=dvixpos || nyp !=dviypos) { dvixpos=nxp; dviypos=nyp; dodr=1; } if(setcpage(cpage->num,fshrink,colors,doeps,dimmthresh,0)) dodr=1; if(setppage()) dodr=1; if(dodr) drawupdatepage(); else drawshowallmarks(); if(hypon) { comdomarks(xpxl-dvixpos,ypxl-dviypos); vgasetmouse(marksxpxl,marksypxl); } else { texton=1; drawshowallmarks(); } } else { /* not found */ resetsearch(); drawshowallmarks(); } updatelist(); } void comhypnext(int mode) { switch(mode) { case COMDO: comdohypnext(); break; case COMDEF: if(!canclethis(" GOTO NEXT HREF")) comhypnext(COMDO); drawstatusline(); break; default: } } void comdisp(int mode) { float oldshrink,newshrink; uchar col, dps, ishr; int dth,y; char* cbdisplayoptions[]={NULL,NULL,NULL,NULL,NULL,NULL}; char **cbd; switch(mode) { case COMDO: stralloccpy(cbdisplayoptions+0,"DOUBLE-PAGE: ON AUTO OFF "); stralloccpy(cbdisplayoptions+1,"EPS-RENDERING: ON OFF "); stralloccpy(cbdisplayoptions+2,"GREYSCALES: ON OFF "); stralloccpy(cbdisplayoptions+3,"ZOOMING: ARBITRARY INTEGER "); stralloccpy(cbdisplayoptions+4,"COLORS: BLACK ========= WHITE "); cbdisplayoptions[5]=NULL; cboxset(cbdisplayoptions[0],2-ppagemode); cboxset(cbdisplayoptions[1],doeps==0?1:0); cboxset(cbdisplayoptions[2],colors==BLACKNWHITE?1:0); cboxset(cbdisplayoptions[3],ishrinkonly==1?1:0); cboxset(cbdisplayoptions[4],dimmthresh); if((y=comdocheckboxes(cbdisplayoptions,dispos," SET DISPLAY OPTIONS "))!=-1){ dispos=y; resetsearch(); ppagemode= 2-cboxwhere(cbdisplayoptions[0]); dps= cboxwhere(cbdisplayoptions[1])==1? 0:1; col= cboxwhere(cbdisplayoptions[2])==1? BLACKNWHITE:GREYSCALE; ishr= cboxwhere(cbdisplayoptions[3])==1? 1:0; dth= cboxwhere(cbdisplayoptions[4]); oldshrink=fshrink; newshrink=fshrink; if(ishr==1 && ishrinkonly==0){ newshrink=MAX(1,ROUND(fshrink)); } ishrinkonly=ishr; setcpage(cpage->num,newshrink,col,dps,dth,0); dvixpos=ROUND(oldshrink/ fshrink*(dvixpos+vgaxdim/2)-vgaxdim/2); dviypos=ROUND(oldshrink/ fshrink*(dviypos+vgaydim/2)-vgaydim/2); papxpxl=MMTOPXL(visfmk->papxmm); papypxl=MMTOPXL(visfmk->papymm); dviypos=CATCHYDVI(dviypos); setppage(); dvixpos=CATCHXDVI(dvixpos); } drawupdatepage(); for(cbd=cbdisplayoptions; *cbd!=NULL; freemem(cbd++)); break; case COMDEF: comdisp(COMDO); break; default: } } void comsearch(int mode) { int dodr; const char* restr; int nxp,nyp; char bustr1[80], bustr2[MAXARGSTR+80]; switch(mode) { case COMDO: drawsl("SEARCH:",0,0,vgastatuslen); if(stringargedit(0,8,NULL)) { drawstatusline(); return;} if(searchstring!=NULL) if(strcmp(searchstring,stringarg)!=0) resetsearch(); stralloccpy(&searchstring,stringarg); drawhideallmarks(); texton=0; if(searchpage==-1) searchpage=cpage->num; searchpos++; sprintf(bustr2,"SEARCHING <%s> ...",stringarg); drawsl(bustr2,0,0,vgastatuslen); vgaupdatestatus(); restr=searchdvi(stringarg,&searchpage,&searchpos); if(restr==NULL) { /*found*/ comdosetbackbmk(); dodr=0; nxp=MAX(textx2pxl-vgaxdim,MIN(textx1pxl,dvixpos)); nyp=MAX(texty2pxl-0.8*vgaydim,MIN(texty1pxl-0.2*vgaydim,dviypos)); if(nxp!=dvixpos || nyp !=dviypos) { dvixpos=nxp; dviypos=nyp; dodr=1; } if(setcpage(searchpage,fshrink,colors,doeps,dimmthresh,0)) dodr=1; if(setppage()) dodr=1; if(dodr) drawupdatepage(); if(markon || hypon) { comdomarks(textx1pxl-dvixpos,texty2pxl-dviypos); vgasetmouse(marksxpxl,marksypxl); } else { texton=1; drawshowallmarks(); } sprintf(bustr1,"FOUND <%%s> ON PAGE [%%d] AT (%%.%df,%%.%df) [%s]", unitcomma,unitcomma,unitname); sprintf(bustr2,bustr1,stringarg,searchpage, PXLTOMM(textx1pxl),PXLTOMM(texty2pxl)); ignorethis(bustr2); comdosetbackbmk(); } else { /* not found */ if(searchpage==0) { resetsearch(); drawshowallmarks(); } else { texton=0; drawshowallmarks(); searchpage=0; searchpos=0; } ignorethis(restr); } updatelist(); break; case COMDEF: /* ignorethis(" SEARCH TEXT"); */ comsearch(COMDO); break; default: } } int main(int argc, char **argv) { uchar o, wasnum, inpanic=0; int comode; char *parm; char *filename=NULL; int i,j,k; #ifdef HASMOUSE int mousex, mousey, mouseleft, mouseright; int ox,oy,ol,or; #endif pfprot("This is some kind of a DVIewer, %s\n",MYVERSION); pfprot("(C)opyright 1995 Thomas Moor\n\n"); /* check some arcitecture dependant stuff ... better be configured */ if(BYTES_PER_BMUNIT !=sizeof(BMUNIT)){ pfprot("This message addresses the administrator rather than the user:\n"); pfprot("the compiletime option BMLONG64/BMLONG32 seems not to meet your\n"); pfprot("machines architecture. Please check the non-i386 section in the\n"); pfprot("README and re-compile. Sorry.\n\n"); exit(1); } if(sizeof(void*)> i) & 1; bit_count[j++]=k; } setworkdir(); /* set compiletime defaults */ newmag = 0; stralloccpy(&fontprefix,PKDIR); stralloccpy(&fontformat,PKNAME); stralloccpy(&tfmprefix,TFMDIR); stralloccpy(&vfprefix,VFDIR); /* env=getenv("DVIDRVFONTS"); if(env!=NULL) stralloccpy(fontprefix,env); env=getenv("TEXTFM"); if(env!=NULL) strcpy(tfmprefix,env); */ vgaxdim=VGAXDIM; vgaydim=VGAYDIM; memset(&fmkstar,0,sizeof(filemark)); /* ptrs all NULL */ fmkstar.hoffmm = HOFFMM; fmkstar.voffmm= HOFFMM; fmkstar.papxmm=PAPXMM; fmkstar.papymm=PAPYMM; fmkstar.lrandmm=LRANDMM; fmkstar.rrandmm=RRANDMM; fmkstar.orandmm=ORANDMM; fmkstar.urandmm=URANDMM; fmkstar.centerxmm=fmkstar.papxmm/2; fmkstar.centerymm=fmkstar.papymm/2; xres=XRES; yres=YRES; verbose = VERBOSE; maxlrumem=1024.*1024.*MAXLRUPOOL; maxlinmem= maxlrumem*MAXLINMEMFRAC; filemksinit(); initfontdatabase(); ishrinkonly=ISHRINKONLY; fshrink=SHRINK; colors=PCOLORS; doeps=PDOEPS; ppagemode=PPAGEMODE; unitstar=UNIT; markon=MARKON; hypon=HYPON; texton=0; frameon=0; recton=0; rectxmm=0; rectymm=0; recthmm=0; rectwmm=0; gotodef[0]=1.0; for(i=1;i<10;i++) gotodef[i]=PGMAGIC; strcpy(gotodefstr,"1;*;*;"); pagemovedef=1; pagemovetop=PAGEMOVETOP; moveoverpages=MOVEOVERPAGES; bookmkmode=FILETYP; marksxpxl=0; marksypxl=0; markdxmm=0; markdymm=0; allocmem(&numberargstr,MAXARGSTR+1); numberarginit(); stringarginit(); /* overwrite compiletime defaults with systemwide startupfile */ stralloccpy(&startupfilename,SYSTEMSTARTUPFILENAME); confread(); /* overwrite systemwide startupfile defaults by user startupfile */ stralloccpy(&startupfilename,STARTUPFILENAME); savestartup=SAVESTARTUP; for(j = 1; j < argc; j++) { parm = argv[j]; if(parm[0] != '-') continue; if(parm[1] != 's' && parm[1] != 'S') continue; stralloccpy(&startupfilename, parm+2); break; } if(confread()) savestartup=1; /* force saving if file didnt exist*/ /* overwrite user startuptfile defaults by commandline args */ for (j = 1; j < argc; j++) { parm = argv[j]; if (parm[0] != '-') { stralloccpy(&filename, parm); } else { switch (parm[1]) { case 'f': case 'F': stralloccpy(&fontprefix, parm+2); break; case 'n': case 'N': stralloccpy(&fontformat, parm+2); break; case 't': case 'T': stralloccpy(&tfmprefix, parm+2); break; case 'q': case 'Q': stralloccpy(&vfprefix, parm+2); break; case 'm': case 'M': sscanf(parm+2, "%ld", &newmag); break; case 'h': case 'H': sscanf(parm+2, "%f", &fmkstar.hoffmm); break; case 'v': case 'V': sscanf(parm+2, "%f", &fmkstar.voffmm); break; case 'd': case 'D': sscanf(parm+2, "%dx%d", &vgaxdim,&vgaydim); break; case 'p': case 'P': sscanf(parm+2, "%fx%f", &fmkstar.papxmm,&fmkstar.papymm); break; case 'r': case 'R': sscanf(parm+2, "%dx%d", &xres,&yres); break; case 'k': case 'K': sscanf(parm+2, "%f,%f,%f,%f", &fmkstar.lrandmm,&fmkstar.rrandmm, &fmkstar.orandmm,&fmkstar.urandmm); break; case 'g': /* now, this does not fit in my concept ...*/ if(strncasecmp(parm+1,"geometry",8)==0){ if(strlen(parm+1)>8) { stralloccpy(&cmlgeometry,parm+9); } else { if(j+1 < argc) { j++; parm = argv[j]; stralloccpy(&cmlgeometry,parm); } } } else stralloccpy(&cmlgeometry,parm+2); break; case '?': pfprot( "use with dvifilename and optional parameters\n"); pfprot( " -h (default: %5.1f mm)\n", fmkstar.hoffmm); pfprot( " -v (default: %5.1f mm)\n", fmkstar.voffmm); pfprot( " -px (default: %5.1fx%5.1f mm**2)\n", fmkstar.papxmm,fmkstar.papymm); pfprot( " -rx (default: %dx%d dpi**2)\n", xres,yres); #ifndef KPATHSEA pfprot( " -f (default: %s)\n", fontprefix); pfprot( " -n (default: %s)\n", fontformat); pfprot( " -t (default: %s)\n", tfmprefix); pfprot( " -q (default: %s)\n", vfprefix); #else pfprot( " -f/-n/-t/-q ignored by compiletime option, using kpathsea\n"); #endif pfprot( " -dx(default: %dx%d pxl**2)\n", vgaxdim,vgaydim); pfprot( " -m (default: from DVIfile)\n"); pfprot( " -k,,, (default: %2.1f,%2.1f,%2.1f,%2.1f mm)\n", fmkstar.lrandmm,fmkstar.rrandmm,fmkstar.orandmm,fmkstar.urandmm); pfprot( " -s (default: %s)\n", startupfilename); exit(0); }}} #ifdef KPATHSEAOLDSTYLE pfprot("initializing kpathsea, old style: "); kpse_set_progname (argv[0]); kpse_init_prog ("TMVIEW", xres,KPATHMODE,KPATHMAKE,KPATHDEFF); pfprot("ok\n"); #endif #ifdef KPATHSEANEWSTYLE pfprot("initializing kpathsea, new style: "); kpse_set_program_name(argv[0],"tmview"); kpse_init_prog("TMVIEW", xres,KPATHMODE,KPATHDEFF); kpse_set_program_enabled(kpse_pk_format, KPATHMAKE, kpse_src_compile); pfprot("ok\n"); #endif vgagraph(); /* open a window part 2*/ vgasetstatuslines(1); /* sets vgaxdim ydim !! */ #if NOTHINGONSCREEN || SCROLLONSCREEN vgascreen(0); #else vgascreen(1); #endif setunit(unitstar); moveoffdef=vgaxdim/PMOVEOFF; sprintf(movedefstr,"%f.1",(float) PMOVEOFF); zoomfinedef=1.+PZOOMFINE/100.; sprintf(zoomfinedefstr,"%f.1",zoomfinedef); zoomdef=1/fshrink; dvierrorflag=1; if(filename!=NULL) comdofile(filename); else if(curfmk!=NULL) comdofile(curfmk->dvifilename); if(!dvierrorflag) { comdoposit(visfmk->lastpos.pagenum,visfmk->lastpos.dvixpos, visfmk->lastpos.dviypos,visfmk->lastpos.fshrink,1); } drawsl("TMVIEW",0,0,vgastatuslen); drawsl(MYVERSION,0,7,vgastatuslen); drawsr("PRESS TWICE FOR HELP",0,vgastatuslen-25,25); vgaupdatestatus(); #ifdef HASMOUSE if(markon || hypon) vgasetmouse(marksxpxl,marksypxl); else vgasetmouse(vgaxdim/2,vgaydim/2); vgagetmouse(&ox,&oy,&ol,&or); #endif centhis=0; comode=COMDO; statustype= 0; statusforce= 1; do{ if(dvierrorflag && !inpanic) { drawsl("DVI PANIC",0,0,vgastatuslen-31); drawsr(" FILE RE-READ QUIT",0,vgastatuslen-31,31); vgaupdatestatus(); statusforce=0; inpanic=1; } o=vgagetchar(1); wasnum=0; if('A' <= o && o<= 'Z') { o+='a'-'A'; comode=COMDEF; } if(inpanic) { if(dvierrorflag && o!='r' && o!='d' && o!='q'&& o!=KEYRESIZE) { o=KEYNOP; statusforce=0; } if(!dvierrorflag || o!=KEYNOP) { inpanic=0; statusforce=1; } } switch(o) { case 'b': comsetbookmk(comode); break; case 'w': comgoprevbookmk(comode); break; case '^': comgobackbookmk(comode); break; case 'r': comredraw(comode); break; case 'd': comfile(comode); break; case 'e': compaper(comode); break; case 'x': comstatus(comode); break; case 't': comunit(comode); break; case 'f': comfine(comode,-1); break; case 'c': comfine(comode,+1); break; case 'g': comgoto(comode); break; case 'p': comframe(comode); break; case 'a': comrect(comode); break; case 'l': commark(comode); break; case 'k': comhyp(comode); break; case 'y': commarkfollow(comode);break; case 'z': comcenter(comode,0); break; case 'o': comdisp(comode); break; case 'v': comzoomset(comode); break; case '+': comzoomfine(comode,+1); break; case '-': comzoomfine(comode,-1); break; case 's': comsearch(comode); break; case 'm': case KEYNEXT: comprintpage(comode,+1); break; case 'i': case KEYPREV: comprintpage(comode,-1); break; case 'u': case KEYUP: commoveup(comode); break; case 'n': case KEYDOWN: commovedown(comode); break; case 'h': case KEYLEFT: commoveleft(comode); break; case 'j': case KEYRIGHT: commoveright(comode); break; case KEYHOME: comdoprintpage(0,pagemovetop); break; case KEYEND: comdoprintpage(9999, pagemovetop); break; case KEYRESIZE: comdoresize(); break; case '?': comhelp(comode); if(comode==COMDO) comode=COMDEF; else comode=COMDO; break; case 127: case ';': case ',': case '.': case '*': case '#': case '0': case '1': case '2': case '3': case '4': /* +/- not used here */ case '5': case '6': case '7': case '8': case '9': if(comode==COMDEF) ignorethis("-<9>/<;>/<,>/<.>/<*>/ ENTER ARGUMENTS "); else { if(numberargadd(o)) numberarginit(); numberargread(); wasnum=1; } break; case ' ': if(comode==COMDEF) ignorethis("HIT THE SPACE-BAR AGAIN TO KICK OFF THIS MESSAGE"); else if(statusforce==1) drawstatusline(); break; case KEYESC: if(comode==COMDEF) ignorethis(" ESCAPE FROM SOME DIALOGS "); else if(statusforce==1)drawstatusline(); break; case KEYRET: if(comode==COMDEF) ignorethis(" MOVE TO THE NEXT HREF"); else { if(statusforce==1) drawstatusline(); if(comode==COMDO) comdohypfollow(); } break; case KEYTAB: comhypnext(comode); break; case 'q': if(comode==COMDEF) ignorethis(" QUIT TMVIEW "); else o='Q'; break; default: if(comode==COMDEF && o!= KEYNOP) ignorethis("THE PREVIOUS PRESSED KEY PERFORMS ALMOST NO OPERATION"); o=KEYNOP; } /* end switch o */ #ifdef HASMOUSE /* now mouse actions ... */ if(!dvierrorflag){ /* if not in error */ vgagetmouse(&mousex,&mousey,&mouseleft,&mouseright); #ifndef HASWINDOWS if(markon || hypon) vgasetmouse(MAX(0,MIN(vgaxdim-1,mousex)),MAX(0,MIN(vgaydim-1,mousey))); else vgasetmouse(vgaxdim/2,vgaydim/2); #else if(!(markon || hypon) && (mouseleft || mouseright)) { mousex=MAX(MIN(mousex,vgaxdim-1),0); if(mousex<50) ox=mousex+(50-mousex)/5; if(mousex>vgaxdim-1-50) ox=(vgaxdim-1-50)+(mousex-(vgaxdim-1-50))/5; ox=2*mousex-ox; /* reversve motion in windows systems: more intuitive ? */ mousey=MAX(MIN(mousey,vgaydim-1),0); if(mousey<50) oy=mousey+(50-mousey)/5; if(mousey>vgaydim-1-50) oy=(vgaydim-1-50)+(mousey-(vgaydim-1-50))/5; oy=2*mousey-oy; /* reversve motion in windows systems: more intuitive ? */ } if(!(markon || hypon)){ /* reset, for the case we miss an event */ if(!mouseleft) ox=mousex; if(!mouseright) oy=mousey; } if( (markon || hypon) && (mouseleft || mouseright)) { if(mousex<0) mousex=mousex/10-1; if(mousex>vgaxdim-1) mousex=vgaxdim+(mousex-(vgaxdim-1))/10; if(mousey<0) mousey=mousey/10-1; if(mousey>vgaydim-1) mousey=vgaydim+(mousey-(vgaydim-1))/10; } #endif if(markon) { /* markon */ if(!mouseright && !mouseleft) { mousex=MAX(0,MIN(vgaxdim-1,mousex)); mousey=MAX(0,MIN(vgaydim-1,mousey)); } comdomarks(mousex,mousey); /* ifnowin setmouse ? */ if(mouseright) comrect(COMDO); if(mouseleft) comdomarkfollow(); } else { if(hypon) { /* hypon ************/ if(!mouseright && !(mouseleft /* && !ol*/)) { mousex=MAX(0,MIN(vgaxdim-1,mousex)); mousey=MAX(0,MIN(vgaydim-1,mousey)); } comdomarks(mousex,mousey); if(mouseleft && !ol) comdohypfollow(); } else { /* alloff *************/ if(mouseleft) { if(mousex>ox) comdomoveright(mousex-ox); if(mousexoy) comdomovedown(mousey-oy,moveoverpages); if(mouseyanchorsdone==DONE) return; #ifdef DEBUGHYP pfprot("(htex: beginpage %d",page->num); #endif HTeXcpage->anchorsdone=DOING; HTeXcpage->anchorlist=NULL; HTeXcpage->nanchors =0; HTeXcpage->maxanchors=0; HTeXAnestlevel = 0; /* Start with zero nesting level for a page */ HTeXreflevel = 0; cur_anchor_on_page = -1; #ifdef DEBUGHYP pfprot(")"); #endif } void htex_endpage(void) { /* This page has been completed */ HTeX_Anchor *HTeXAp; if(HTeXcpage->anchorsdone!=DOING) return; #ifdef DEBUGHYP pfprot("(htex: endpage %d)",HTeXcpage->num); #endif /* Finish off boxes for nested anchors not done on this page */ while (HTeXAnestlevel > 0) { HTeXAnestlevel--; HTeXAp = HTeXcpage->anchorlist + HTeXAnest[HTeXAnestlevel]; if (HTeXAp->llx > HTeXh) HTeXAp->llx = HTeXh; if (HTeXAp->urx < HTeXh) HTeXAp->urx = HTeXh; if (HTeXAp->lly < HTeXv) HTeXAp->lly = HTeXv; if (HTeXAp->ury > HTeXv) HTeXAp->ury = HTeXv; } if(HTeXcpage->maxanchors!=HTeXcpage->nanchors) { reallocmem(&(HTeXcpage->anchorlist), HTeXcpage->nanchors *sizeof(HTeX_Anchor)); HTeXcpage->maxanchors=HTeXcpage->nanchors; } HTeXcpage->anchorsdone = DONE; } /* A character or something was written: record position for current anchor */ /* x,y are pixel positions on current page, nonshrunken !! */ void htex_recordbits(long x, long y, long w, long h) { HTeX_Anchor *HTeXAp; long dvix, dviy, dvix2, dviy2; if(HTeXcpage->anchorsdone!=DOING) return; if(HTeXAnestlevel==0) return; dvix = x; dviy = y; dvix2 = x+w; dviy2 = y+h; HTeXAp = HTeXcpage->anchorlist + HTeXAnest[HTeXAnestlevel-1]; if (HTeXAp->llx > dvix) HTeXAp->llx = dvix; if (HTeXAp->lly < dviy2) HTeXAp->lly = dviy2; if (HTeXAp->urx < dvix2) HTeXAp->urx = dvix2; if (HTeXAp->ury > dviy) HTeXAp->ury = dviy; #ifdef DEBUGHYP /* pfprot("(htex: record: New box for anchor %d, level %d: %d %d %d %d)", HTeXAnest[HTeXAnestlevel-1], HTeXAnestlevel, HTeXAp->llx, HTeXAp->lly, HTeXAp->urx, HTeXAp->ury);*/ #endif } /****************************************************************************/ /* parsing the html specials */ /****************************************************************************/ /* Parses cp containing 'ref="string"more', returning pointer to "more" */ char *refscan(char* name, char** ref, char** 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; } /* Following parses the stuff after the '<' in the html tag */ /* Only understands name and href in anchor */ /* html: */ /* html: type |= HTeX_A_HREF; stralloccpy(&(anchor->href), str); } else if (STRCASECMP(ref, "name") == 0) { anchor->type |= HTeX_A_NAME; stralloccpy(&(anchor->name), str); } } } /* Basically just want to parse the line... */ /* Should use WWW library stuff ? */ void htex_anchor(int beginend, char* cp) { int oldllx, oldlly, oldurx, oldury; HTeX_Anchor *HTeXAp=NULL; if (beginend == END) { HTeXAnestlevel--; if (HTeXAnestlevel < 0) { HTeXAnestlevel = 0; /* Ignore Extra 's? */ } else { HTeXAp = HTeXcpage->anchorlist + HTeXAnest[HTeXAnestlevel]; if (HTeXAp->llx > HTeXh) HTeXAp->llx = HTeXh; if (HTeXAp->urx < HTeXh) HTeXAp->urx = HTeXh; if (HTeXAp->lly < HTeXv) HTeXAp->lly = HTeXv; if (HTeXAp->ury > HTeXv) HTeXAp->ury = HTeXv; oldllx = HTeXAp->llx; oldlly = HTeXAp->lly; oldurx = HTeXAp->urx; oldury = HTeXAp->ury; #ifdef DDEBUGHYP pfprot("(htex: Added anchor %d, level %d, )", HTeXAnest[HTeXAnestlevel], HTeXAnestlevel); if (HTeXAp->type&HTeX_A_HREF) pfprot("href = %s ", HTeXAp->href); if (HTeXAp->type&HTeX_A_NAME) pfprot("name = %s ", HTeXAp->name); pfprot("box %d %d %d %d)", HTeXAp->llx, HTeXAp->lly, HTeXAp->urx, HTeXAp->ury); #endif if (HTeXAnestlevel > 0) { HTeXAp = HTeXcpage->anchorlist + 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 { /* its a BEGIN */ if (HTeXcpage->nanchors==HTeXcpage->maxanchors) { HTeXcpage->maxanchors += HTeX_AnchorSTEP; reallocmem(&(HTeXcpage->anchorlist), HTeXcpage->maxanchors *sizeof(HTeX_Anchor)); } HTeXAp = HTeXcpage->anchorlist + HTeXcpage->nanchors; /* Set type, and the name, href */ htex_parseanchor(cp, HTeXAp); if (HTeXAp->type != 0) { cur_anchor_on_page++; /* Increment the count of anchors here */ HTeXAp->urx = HTeXAp->llx = HTeXh; /* Current horiz pos.*/ HTeXAp->ury = HTeXAp->lly = HTeXv; /* Current vert. pos. */ if (HTeXAnestlevel >= HTeX_NSTACK) { pfprot("(warning: htex: too many nested anchors)"); } else { HTeXAnest[HTeXAnestlevel++] = HTeXcpage->nanchors; } HTeXcpage->nanchors++; } } if (beginend == END) { if (HTeXreflevel > 0) HTeXreflevel--; } else { if (HTeXAp->type&HTeX_A_HREF) HTeXreflevel++; } } /* Arthurs's hypertex format: */ /* only a subset implemented in tmview */ void htex_handletag(char* cp) { int beginend=BEGIN; if (HTeXcpage->anchorsdone!=DOING) return; #ifdef DEBUGHYP pfprot("(htex: handletag <%s> ...)",cp); #endif 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); break; case 'b': /* Base name? */ htex_base(beginend, cp); break; case 'i': /* Included images? */ htex_img(beginend, cp); break; default: /* Tag not implemented yet */ break; } } /* Dave Oliver's hypertex format: */ /* Only understand my (=Arthur's) version of anchors so far */ /* ie.: his TYPE=text for hrefs, frag for names */ void hy_handletag(char* cp) { int beginend=BEGIN; if (HTeXcpage->anchorsdone!=DOING) return; #ifdef DEBUGHYP pfprot("(htex: handletag (OLIVER) <%s> ...)",cp); #endif while (isspace(*cp)) cp++; if (!STRNCASECMP(cp, "END", 3)) { beginend = END; cp += 3; } /* Leave the parsing to htex_anchor! */ htex_anchor(beginend, cp); } /* this is to be called from the dvi-reader when a special occures */ int checkndoHyperTeX(char *cp,int h, int v) { int htexfound = 0; /* if (HTeXcpage->anchorsdone!=DOING) return(0); */ #ifdef DEBUGHYP pfprot("\n(htex: checkndo <%s> ...)\n",cp); #endif HTeXh=h; HTeXv=v; if (STRNCASECMP(cp, "html:", 5) == 0) { cp += 5; while (isspace(*cp)) cp++; htexfound = 1; htex_handletag(cp); } else if(STRNCASECMP(cp, "hyp", 3) == 0) { /* Dave Oliver's HyperTeX */ htexfound = 1; cp += 4; hy_handletag(cp); } #ifdef DEBUGHYP if(!htexfound) pfprot("(htex: checkndo <%s> ignored)",cp); #endif return htexfound; } /****************************************************************************/ /* search for an anchor or test if whithin an anchor ... user-interaction */ /****************************************************************************/ #ifdef DEBUGHYP /* list all anchor on a page */ htex_listpage(pagelistelement* page) { int ia; HTeX_Anchor *HTeXAp; char astr[256]; pfprot("\nanchors on page %d\n",page->num); if(page->anchorsdone != DONE) { pfprot("not done\n"); return; } if(page->anchorlist==NULL || page->nanchors==0) { pfprot("empty\n"); return; } HTeXAp = page->anchorlist; for (ia=0; ia < page->nanchors; ia++, HTeXAp++) { if ((HTeXAp->type&HTeX_A_NAME) == 0) continue; pfprot("(%s)",HTeXAp->name); } pfprot("\n"); } #endif /* find the anchor on a page */ int htex_findonpage(char* href, pagelistelement* page) { int ia; HTeX_Anchor *HTeXAp; char *cp; if (href == NULL) return(-1); /* shouldn't happen? */ #ifdef DEBUGHYP htex_listpage(page); #endif cp = href; while (*cp == '#') cp++; if(page->anchorsdone != DONE) return(-1); HTeXAp = page->anchorlist; if(page->anchorlist==NULL) return(-1); for (ia=0; ia < page->nanchors; ia++, HTeXAp++) { if ((HTeXAp->type&HTeX_A_NAME) == 0) continue; if (!strcmp(HTeXAp->name, cp)) break; } if(ia==page->nanchors) return(-1); return(ia); } /* find the anchor on any page done */ void htex_findondonepage(char* href, int* ip, int* ia) { *ip=-1; *ia=-1; if (href == NULL) return; /* shouldn't happen? */ for (*ip = 0; *ip < pageanz; (*ip)++) { *ia =htex_findonpage(href,pagelist+ *ip); if(*ia != -1) break; } if(*ia==-1) *ip=-1; #ifdef DEBUGHYP pfprot("(htex: foundondonepage page %d anchor %d",*ip,*ia); #endif } /* Is this a *href an url ? */ int htex_is_url(char *href){ char *cp; int ret = 0; cp = href; /* Be flexible on local files: */ if (STRNCASECMP(href, "file:", 5) == 0) { ret = 1; } else if(!strncmp(cp,"news:",5)) { ret = 1; } else if(!strncmp(cp,"news\\:",6)) { ret = 1; } else if(!strncmp(cp,"mailto:",7)) { ret = 1; } else if(!strncmp(cp,"mailto\\:",8)) { ret = 1; } else if(!strstr(cp+3,":/")) { ret = 0; } else if(!strncmp(cp,"http",4)) { ret = 1; } else if(!strncmp(cp,"gopher",6)) { ret = 1; } else if(!strncmp(cp,"ftp",3)) { ret = 1; } else if(!strncmp(cp,"wais",4)) { ret = 1; } else if(!strncmp(cp,"telnet",6)) { ret = 1; } else if(!strncmp(cp,"tn3270",6)) { ret = 1; } else if(!strncmp(cp,"rlogin",6)) { ret = 1; } else if(!strncmp(cp,"afs",3)) { ret = 1; } else if(!strncmp(cp,"prospero",8)) { ret = 1; } else { ret = 0; } return ret; } /* static char resultstr[600]; */ /* What happens when mouse moves on screen: */ int htex_withinanchor(pagelistelement* page,int x, int y, char** res) /* x,y coordinates of mouse position wrt dvi-origin, but in pxl*/ { /* char namestr[256]; char hrefstr[256]; */ HTeX_Anchor *HTeXAp; int i, afound; *res=NULL; if (page == NULL) return(0); if (page->anchorsdone != DONE) return(0); /* Find anchor that fits current position: */ afound=-1; HTeXAp = page->anchorlist + page->nanchors - 1; for (i=page->nanchors - 1; i >= 0; i--, HTeXAp--) { if (!(HTeXAp->type & HTeX_A_HREF)) continue; /* tmview: only hrefs */ if (HTeXAp->x1pxl > x) continue; if (HTeXAp->y1pxl > y) continue; if (HTeXAp->x2pxl < x) continue; if (HTeXAp->y2pxl < y) continue; #ifdef DEBUGHYP pfprot("(htexwithinanchor ? #%d ...)", i); #endif afound=i; } if(afound==-1) { *res=NULL; return(0); } *res = page->anchorlist[afound].href; /************************ reply NAMEs too ? not now, tmview ******** ... namestr[0]=0; hrefstr[0]=0; if (HTeXAp->type & HTeX_A_NAME) sprintf(namestr, "NAME=%s", HTeXAp->name); if (HTeXAp->type & HTeX_A_HREF) sprintf(hrefstr, "HREF=%s", HTeXAp->href); sprintf(resultstr, "%s %s",namestr, hrefstr); *res=resultstr; *********************************************************************/ #ifdef DEBUGHYP pfprot("%s found done within)", *res); #endif return(1); } int htex_clickmouse(pagelistelement* page,int x, int y, char** res) { HTeX_Anchor *HTeXAp; int i, afound; *res=NULL; if (page == NULL) return(0); if (page->anchorsdone != DONE) return(0); /* Find anchor that fits current position: same as above ... */ /* ... but above may change */ afound=-1; HTeXAp = page->anchorlist + page->nanchors - 1; for (i=page->nanchors - 1; i >= 0; i--, HTeXAp--) { if (!(HTeXAp->type & HTeX_A_HREF)) continue; if (HTeXAp->x1pxl > x) continue; if (HTeXAp->y1pxl > y) continue; if (HTeXAp->x2pxl < x) continue; if (HTeXAp->y2pxl < y) continue; #ifdef DEBUGHYP pfprot("(htex: click at anchor #%d ...", i); #endif afound=i; } if(afound==-1) return(0); *res=page->anchorlist[afound].href; return(1); } int htex_findnearanchor(pagelistelement* page,int *x, int *y) { HTeX_Anchor *HTeXAp; int i, afound; long dist,d; if (page == NULL) return(0); if (page->anchorsdone != DONE) return(0); /* Find anchor that is near the current position */ #ifdef DEBUGHYP pfprot("(htex: search nearanchor at %d %d ...",*x,*y); #endif afound=-1; dist=1<<30; HTeXAp = page->anchorlist + page->nanchors - 1; for (i=page->nanchors - 1; i >= 0; i--, HTeXAp--) { if (!(HTeXAp->type & HTeX_A_HREF)) continue; d= ((long)(HTeXAp->x1pxl - *x))*(HTeXAp->x1pxl - *x) +((long)(HTeXAp->y2pxl - *y))*(HTeXAp->y2pxl - *y); if(d>dist) continue; afound=i; dist=d; } if(afound==-1) return(0); #ifdef DEBUGHYP pfprot(" ... no (near)anchor) "); #endif HTeXAp = page->anchorlist + afound; for (i=afound; i < page->nanchors; i++, HTeXAp++) { if (!(HTeXAp->type & HTeX_A_HREF)) continue; if (HTeXAp->x1pxl <= *x && HTeXAp->y1pxl <= *y && HTeXAp->x2pxl >= *x && HTeXAp->y2pxl >= *y) continue; break; } if(i>= page->nanchors) { HTeXAp = page->anchorlist; for (i=0; i < page->nanchors; i++, HTeXAp++) { if (!(HTeXAp->type & HTeX_A_HREF)) continue; break; } } if(i>= page->nanchors) return(0); /* cant happen here */ #ifdef DEBUGHYP pfprot("(htex: nearanchor #%d)", i); #endif *x=HTeXAp->x1pxl; *y=HTeXAp->y2pxl; return(1); } int htex_findnumberanchor(pagelistelement* page,int* num){ HTeX_Anchor *HTeXAp; int i; if (page == NULL) return(0); if (page->anchorsdone != DONE) return(0); /* Find anchor by number */ #ifdef DEBUGHYP pfprot("(htex: search anchor %d)",*num); #endif HTeXAp = page->anchorlist + *num + 1; for (i= *num+1; i < page->nanchors; i++, HTeXAp++) if (HTeXAp->type & HTeX_A_HREF) break; if(i>= page->nanchors) { HTeXAp = page->anchorlist; for (i=0; i < page->nanchors; i++, HTeXAp++) if (HTeXAp->type & HTeX_A_HREF) break; if(i>= page->nanchors) return(0); } #ifdef DEBUGHYP pfprot("(htex: found anchor %d at %d %d)",i,HTeXAp->x1pxl,HTeXAp->y2pxl); #endif *num=i; textx1pxl= HTeXAp->x1pxl; texty1pxl= HTeXAp->y1pxl; textx2pxl= HTeXAp->x2pxl; texty2pxl= HTeXAp->y2pxl; textx3pxl= HTeXAp->x1pxl; texty3pxl= HTeXAp->y1pxl; textx4pxl= HTeXAp->x1pxl; texty4pxl= HTeXAp->y1pxl; return(1); } /* calculate boxes (in pixels) around the anchor positions */ void htex_scalebox(double sch, double scv) { HTeX_Anchor *HTeXAp; int i; int x1, y1, x2, y2; HTeXAp = HTeXcpage->anchorlist; for (i=0; i < HTeXcpage->nanchors; i++, HTeXAp++) { if ((HTeXAp->type&HTeX_A_HREF) == 0) continue; /* Only box hrefs */ x1 = LFLOOR(sch*HTeXAp->llx)-1; /* -1 to look better */ y1 = LFLOOR(scv*HTeXAp->ury); x2 = LCEIL(sch*HTeXAp->urx); y2 = LCEIL(scv*HTeXAp->lly)+1; /* +1 to look better */ HTeXAp->x1pxl=x1; HTeXAp->x2pxl=x2; HTeXAp->y1pxl=y1; HTeXAp->y2pxl=y2; } } /****************************************************************************/ /*dummys for things tmview cant do ... */ /****************************************************************************/ void htex_base(int beginend, 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'; stralloccpy(&URLbase, str); /* Change base */ pfprot("(htex: ignored)", URLbase); } } } void htex_img(int beginend, char* cp) { char *ref, *str; char fullpathname[1024]; if (beginend == END) return; 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) ... then there is an Error ... */ pfprot("(htex: ignored)", fullpathname); } } } tmview/src/bookmks.c0100644000175000017500000001745207250444702014071 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ #include "defs.h" /* #define DEBUGBMK */ int iiiii; #define LISTFILES pfprot("\nlistf\n"); for(iiiii=0;iiiiidvifilename,filemks[iiiii]->lastpos.dvifilename) #define LISTBOOKS pfprot("\nlistb\n"); for(iiiii=0;iiiiin;iiiii++) pfprot("n %d p %d x %d y %d\n",curbmks->d[iiiii]->name,curbmks->d[iiiii]->pagenum,curbmks->d[iiiii]->dvixpos,curbmks->d[iiiii]->dviypos) void bookmksinit(bookmarklist* bookmks) { if(bookmks==NULL) return; bookmks->n=0; bookmks->d=NULL; } void bookmkskill(bookmarklist* bookmks) { int i; if(bookmks==NULL) return; for(i=0;in;i++) { freemem(&(bookmks->d[i]->dvifilename)); freemem(bookmks->d+i); } freemem(&(bookmks->d)); } void rolldownbookmk(bookmarklist* bookmks) { int i; bookmark* bbu; if(bookmks==NULL) return; if(bookmks->n <=0) return; bbu=bookmks->d[0]; for(i=0;in-1;i++) bookmks->d[i]=bookmks->d[i+1]; bookmks->d[i]=bbu; } int findrolldownbookmk(bookmarklist* bookmks,int name) { int i; if(bookmks==NULL) return(0); for(i=0;in;i++) if(bookmks->d[i]->name == name) break; if(i>=bookmks->n) return(0); for(;i>0;i--) rolldownbookmk(bookmks); return(1); } int checkbookmk(bookmarklist* bookmks,int name) { int i; if(bookmks==NULL) return(0); #ifdef DEBUGBMK pfprot("(checkbkm..)"); #endif for(i=0;in;i++) if(bookmks->d[i]->name ==name) break; if(i>=bookmks->n) return(0); return(1); } void freebookmknumber(bookmarklist* bookmks,int i) { if(bookmks==NULL) return; if(bookmks->n<=i) return; freemem(&(bookmks->d[i]->dvifilename)); freemem(bookmks->d+i); for(;in-1;i++) bookmks->d[i]=bookmks->d[i+1]; bookmks->n--; reallocmem(&(bookmks->d),sizeof(bookmark*)*bookmks->n); } void freebookmk(bookmarklist* bookmks) { freebookmknumber(bookmks,0); } void allocnewbookmk(bookmarklist* bookmks) { int i; if(bookmks==NULL) return; #ifdef DEBUGBMK pfprot("(allocbookmk .."); #endif reallocmem(&(bookmks->d),sizeof(bookmark*)*(bookmks->n+1)); for(i=bookmks->n;i>0;i--) bookmks->d[i]=bookmks->d[i-1]; allocmem(bookmks->d,sizeof(bookmark)); bookmks->d[0]->dvifilename=NULL; bookmks->d[0]->name=-1; bookmks->n++; #ifdef DEBUGBMK pfprot(" allocbookmk done)"); #endif } int amiatbookmkqm(bookmarklist* bookmks,int i) { bookmark *thebmk; if(bookmks==NULL) return(0); if(bookmks->n<=i) return(0); #ifdef DEBUGBMK pfprot("(amiatbookmk .."); #endif thebmk=bookmks->d[i]; if(thebmk->dvixpos!=dvixpos) return(0); if(thebmk->dviypos!=dviypos) return(0); if(thebmk->marksxpxl!=marksxpxl) return(0); if(thebmk->marksypxl!=marksypxl) return(0); if(thebmk->pagenum!=cpage->num) return(0); if(fabs(thebmk->fshrink-fshrink)>0.005) return(0); if(thebmk->dvifilename==NULL) return(1); if(strcmp(thebmk->dvifilename,visfmk->dvifilename)!=0) return(0); #ifdef DEBUGBMK pfprot(" yes)"); #endif return(1); } int existsbookmkqm(bookmarklist* bookmks) { bookmark *thebmk; int i; if(bookmks==NULL) return(-1); #ifdef DEBUGBMK pfprot("(exbookmk .."); #endif for(i=0;in;i++) { thebmk=bookmks->d[i]; if(thebmk->dvixpos!=dvixpos) continue; if(thebmk->dviypos!=dviypos) continue; if(thebmk->pagenum!=cpage->num) continue; if(fabs(thebmk->fshrink-fshrink)>0.005) continue; if(thebmk->dvifilename==NULL) break; if(strcmp(thebmk->dvifilename,visfmk->dvifilename)!=0) continue; break; } #ifdef DEBUGBMK pfprot(" done xbookmk %d)",i); #endif if(in) return(i); return(-1); } void setbookmk(bookmark* thebmk, int doname) { if(thebmk==NULL) return; #ifdef DEBUGBMK pfprot("(setbookmk ... "); #endif if(doname) stralloccpy(&(thebmk->dvifilename),visfmk->dvifilename); thebmk->pagenum=cpage->num; thebmk->dvixpos=dvixpos; thebmk->dviypos=dviypos; thebmk->fshrink=fshrink; thebmk->marksxpxl=marksxpxl; thebmk->marksypxl=marksypxl; #ifdef DEBUGBMK pfprot(" done)"); #endif } void addbookmk(bookmarklist* bookmks, int doname) { bookmark *thebmk; if(bookmks==NULL) return; #ifdef DEBUGBMK pfprot("(addbookmk .."); #endif allocnewbookmk(bookmks); thebmk=bookmks->d[0]; setbookmk(thebmk,doname); } void filemksinit(void) { nfilemks=0; filemks=NULL; curfmk=NULL; curbmks=NULL; visfmk=NULL; visbmks=NULL; } void filemkskill(void) { int i; for(i=0;idvifilename)); bookmkskill(&(filemks[i]->bookmks)); } freemem(&filemks); curfmk=NULL; curbmks=NULL; visbmks=NULL; visfmk=NULL; } void rolldownfilemk(void) { int i, maxloop; char *bustr=NULL; filemark *bbu; #ifdef DEBUGBMK pfprot("(rolldownfile... )"); #endif if(nfilemks<=0) return; maxloop=nfilemks; /* put a -1 here if deleting stuff ? */ while(maxloop>0) { maxloop--; bbu=filemks[0]; for(i=0;ilastpos.dvifilename)) break; /* loop nominal ends here */ /* freefilemknumber(0); ... no, we dont delete these things! */ }; freemem(&bustr); curfmk=filemks[0]; curbmks=&(curfmk->bookmks); } void rollupfilemk(void) { int i; filemark* bbu; #ifdef DEBUGBMK pfprot("(rollupfile... )"); #endif if(nfilemks<=0) return; bbu=filemks[nfilemks-1]; for(i=nfilemks-1;i>0;i--) filemks[i]=filemks[i-1]; filemks[0]=bbu; curfmk=filemks[0]; curbmks=&(curfmk->bookmks); } int findrolldownfilemk(char* fname) { int i; #ifdef DEBUGBMK pfprot("(findfile. %s in %d.. )",fname,nfilemks); #endif for(i=0;idvifilename,fname)==0) break; if(i>=nfilemks) return(0); #ifdef DEBUGBMK pfprot("..found-)"); #endif for(;i>0;i--) rolldownfilemk(); curfmk=filemks[0]; curbmks=&(curfmk->bookmks); return(1); } void freefilemknumber(int i) { #ifdef DEBUGBMK pfprot("(freefilei... )"); #endif if(nfilemks<=i) return; if(visfmk==filemks[i]) {visfmk=NULL; visbmks=NULL;} freemem(&(filemks[i]->dvifilename)); bookmkskill(&(filemks[i]->bookmks)); freemem(filemks+i); for(;i0) { curfmk=filemks[0]; curbmks=&(curfmk->bookmks); } else { curfmk=NULL; curbmks=NULL; visbmks=NULL; visfmk=NULL; } } void freefilemk(void) { freefilemknumber(0); } void freefilemkname(char* fname) { int i; #ifdef DEBUGBMK pfprot("(freefilename... )"); #endif for(i=0;idvifilename,fname)!=0) continue; freefilemknumber(i); i--; } } void allocnewfilemk(char* name) { int i; #ifdef DEBUGBMK pfprot("(allocfile... "); #endif if(name==NULL) return; /* shoild not happen ! */ reallocmem(&filemks,sizeof(filemark*)*(nfilemks+1)); for(i=nfilemks;i>0;i--) filemks[i]=filemks[i-1]; nfilemks++; allocmem(filemks,sizeof(filemark)); curfmk=filemks[0]; memcpy(curfmk,&fmkstar,sizeof(filemark)); /* all ptrs NULL, : init lastpos*/ stralloccpy(&(curfmk->dvifilename),name); curfmk->lastpos.dvixpos= (MMTOPXL(curfmk->papxmm)-vgaxdim)/2-MMTOPXL(curfmk->hoffmm); curfmk->lastpos.dviypos= -INSIDEPXL - MMTOPXL(curfmk->voffmm); curfmk->lastpos.fshrink= fshrink; curbmks=&(curfmk->bookmks); bookmksinit(curbmks); #ifdef DEBUGBMK LISTFILES; pfprot("done)"); #endif } void updatefilemk(void) { if(visfmk==NULL) return; #ifdef DEBUGBMK pfprot("(updatefile. "); #endif setbookmk(&(visfmk->lastpos),1); #ifdef DEBUGBMK LISTFILES; pfprot("done"); #endif } tmview/src/rwconf.c0100644000175000017500000003001207250444702013705 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ #include "defs.h" /* #define DEBUGCON */ void conferror(char* mess) { pfprot("\nfatal error: startupfile %s: %s\n",startupfilename,mess); exit(1); } FILE *conffile; int confopen(int mode) { /* 0=read 1=write*/ char* bustr=NULL; char* homedir; homedir = getenv("HOME"); if(startupfilename[0]=='~' && homedir!=NULL){ stralloccpy(&bustr,startupfilename); freemem(&startupfilename); allocmem(&startupfilename,strlen(bustr)+strlen(homedir)+1); strcpy(startupfilename,homedir); strcat(startupfilename,bustr+1); freemem(&bustr); } conffile=NULL; if(mode==1) conffile=fopen(startupfilename,"w"); if(mode==0) conffile=fopen(startupfilename,"r"); return(conffile==NULL); } void confclose(void) { fclose(conffile); } void writebmk(bookmark* thebmk){ fprintf(conffile,"%d ",thebmk->name); fprintf(conffile,"%d ",thebmk->pagenum); fprintf(conffile,"%d ",thebmk->dvixpos); fprintf(conffile,"%d ",thebmk->dviypos); fprintf(conffile,"%6.3f ",thebmk->fshrink); } void confwrite(void) { int i,j; if(!savestartup) { pfprot("\nwarning: writing startupfile disabled\n"); return; } confopen(1); if(conffile==NULL) { pfprot("\nwarning: cant write startupfile %s\n",startupfilename); return; } pfprot("\nwriting startupfile %s\n",startupfilename); fprintf(conffile,"# **** this is a startupfile of tmview %s *****\n\n", MYVERSION); fprintf(conffile,"\n#save the startupfile ?\n"); fprintf(conffile,"sufp \"%s\"\n",startupfilename); fprintf(conffile,"#be verbose ?\n"); fprintf(conffile,"verb %d\n",verbose); fprintf(conffile,"#maximum lru buffer in megabytes\n"); fprintf(conffile,"lrum %.2f\n",((float)(maxlrumem))/1024./1024.); fprintf(conffile,"\n#commandline options\n"); fprintf(conffile,"hoff %6.2f\nvoff %6.2f\n",fmkstar.hoffmm,fmkstar.voffmm); fprintf(conffile,"papx %6.2f\npapy %6.2f\n",fmkstar.papxmm,fmkstar.papymm); fprintf(conffile,"xres %d\nyres %d\n",xres,yres); fprintf(conffile,"tfmp \"%s\"\n",tfmprefix); fprintf(conffile,"vffp \"%s\"\n",vfprefix); fprintf(conffile,"ffor \"%s\"\n",fontformat); fprintf(conffile,"fntp \"%s\"\n",fontprefix); #ifndef PORTRAIT fprintf(conffile,"disx %d\ndisy %d\n",truevgaxdim,truevgaydim); #else fprintf(conffile,"disx %d\ndisy %d\n",truevgaydim,truevgaxdim); #endif fprintf(conffile,"geom \"%s\"\n",cmlgeometry); fprintf(conffile,"nmag %ld\n",newmag); fprintf(conffile,"lrnd %6.2f\nrrnd %6.2f\nornd %6.2f\nurnd %6.2f\n", fmkstar.lrandmm,fmkstar.rrandmm,fmkstar.orandmm,fmkstar.urandmm); fprintf(conffile,"\n#other defaults\n"); fprintf(conffile,"fshk %5.3f\n",fshrink); fprintf(conffile,"ison %d\n",ishrinkonly); fprintf(conffile,"colo %d\n",colors); fprintf(conffile,"deps %d\n",doeps); fprintf(conffile,"ppmo %d\n",ppagemode); fprintf(conffile,"dimt %d\n",dimmthresh); fprintf(conffile,"dpos %d\n",dispos); fprintf(conffile,"mkon %d\n",markon); fprintf(conffile,"hyon %d\n",hypon); fprintf(conffile,"unit %d\n",unitstar); fprintf(conffile,"mvpt %d\n",pagemovetop); fprintf(conffile,"mvop %d\n",moveoverpages); fprintf(conffile,"\n#filemarks and bookmarks\n\n"); for(i=0;idvifilename); pfverb("\n writing fmk %s ",curfmk->dvifilename); fprintf(conffile,"%6.2f ",curfmk->papxmm); fprintf(conffile,"%6.2f ",curfmk->papymm); fprintf(conffile,"%6.2f ",curfmk->hoffmm); fprintf(conffile,"%6.2f ",curfmk->voffmm); fprintf(conffile,"%6.2f ",curfmk->centerxmm); fprintf(conffile,"%6.2f ",curfmk->centerymm); fprintf(conffile,"%6.2f ",curfmk->lrandmm); fprintf(conffile,"%6.2f ",curfmk->rrandmm); fprintf(conffile,"%6.2f ",curfmk->orandmm); fprintf(conffile,"%6.2f ",curfmk->urandmm); writebmk(&(curfmk->lastpos)); fprintf(conffile,"\n"); for(j=curbmks->n-1;j>=0;j--) { fprintf(conffile,"bmk "); writebmk(curbmks->d[j]); fprintf(conffile,"\n"); } pfverb("and %d related manual-bmks",curbmks->n); fprintf(conffile,"\n\n"); } fprintf(conffile,"\n# end of startup-file\n"); confclose(); pfverb("\n"); pfverb("... done\n"); } #define LEXNUM 256 #define LEXSTR 257 #define LEXNAM 258 #define LEXEOF 259 char* lexstr; int nlexstr; double lexnum; int lexline, lexpos; pagelistelement bupale; void initlex(void) { nlexstr=1; allocmem(&lexstr,nlexstr+1); lexline=1; lexpos=0; cpage=&bupale; } void killlex(void) { freemem(&lexstr); } int mygetch(void) { int c; c=fgetc(conffile); if(c=='\n') {lexline++; lexpos=0;} lexpos++; return(c); } void myungetch(int ch){ ungetc(ch,conffile); } void lexerror(char* mes) { pfprot("\nfatal error in startup-file (%s line %d pos %d): %s\n\n", startupfilename,lexline,lexpos,mes); pfprot("To recover edit your startup-file:\nkeep only the lines related to paths, delete all the other stuff.\nAlternative method: totaly delete your startup-file. A new one will\nbe generated when you start tmview the next time. Finally, font paths\nare to be adjusted by commandline arguments.\n"); exit(1); } int lexskip(void){ int c; do c=mygetch(); while(c!=EOF && c != '\n'); return(c); } int lex(void) { int c,i; c=mygetch(); while(c=='#' || c==' ' || c=='\t' || c=='\n'){ if(c==' ' || c=='\t' || c=='\n') c=mygetch(); if(c=='#') c=lexskip(); } if (c == EOF) return LEXEOF; /* Char starts a number => parse the number. */ if(c == '.' || isdigit (c) || c=='-' || c=='+'){ myungetch(c); fscanf(conffile,"%lf",&lexnum); #ifdef DEBUGCON pfprot("*%f*",lexnum); #endif return LEXNUM; } /* Char starts an identifier => read the name. */ if(isalpha (c)) { i = 0; do{ if(i >= nlexstr){ nlexstr*= 2; reallocmem(&lexstr, nlexstr+ 1); } lexstr[i++] = c; c = mygetch(); } while (c != EOF && isalnum (c)); myungetch(c); lexstr[i] = '\0'; return LEXNAM; } /* Char starts an string => read the string. */ if(c == '"') { i = 0; do{ c=mygetch(); if(c==EOF) break; if(c=='"'){ c=mygetch(); if(c!='"') break; } if(i >= nlexstr){ nlexstr*= 2; reallocmem (&lexstr, nlexstr+ 1); } lexstr[i++] = c; } while(1); myungetch(c); lexstr[i] = '\0'; #ifdef DEBUGCON pfprot("*%s*",lexstr); #endif return LEXSTR; } /* Any other character is a token by itself. */ return c; } double readdouble(void){ if(lex()!=LEXNUM) lexerror("float expected"); return lexnum; } int readint(void){ if(lex()!=LEXNUM) lexerror("no number while integer expected"); if(lexnum!=LROUND(lexnum)) lexerror("float while integer expected"); return LROUND(lexnum); } void readstring(char** dst){ if(lex()!=LEXSTR) lexerror("string expected"); stralloccpy(dst,lexstr); } void readbmk(bookmark* thebmk){ thebmk->name=readint(); thebmk->pagenum=readint(); thebmk->dvixpos=readint(); thebmk->dviypos=readint(); thebmk->fshrink=readdouble(); } int confread(void) { int lexres; char* bustr=NULL; confopen(0); if(conffile==NULL) { pfprot("warning: cant read startupfile %s\n",startupfilename); return(1); } pfprot("\nreading startupfile %s\n",startupfilename); initlex(); while((lexres=lex())!=LEXEOF) { if(lexres!=LEXNAM) lexerror("symbol expected"); if(strcmp(lexstr,"fmk")==0) { readstring(&bustr); allocnewfilemk(bustr); pfverb("(fmk %s)",curfmk->dvifilename); curfmk->papxmm=readdouble(); curfmk->papymm=readdouble(); curfmk->hoffmm=readdouble(); curfmk->voffmm=readdouble(); curfmk->centerxmm=readdouble(); curfmk->centerymm=readdouble(); curfmk->lrandmm=readdouble(); curfmk->rrandmm=readdouble(); curfmk->orandmm=readdouble(); curfmk->urandmm=readdouble(); readbmk(&(curfmk->lastpos)); stralloccpy(&(curfmk->lastpos.dvifilename),curfmk->dvifilename); continue; } if(strcmp(lexstr,"bmk")==0) { if(curbmks==NULL) lexerror("no fmk set"); pfverb("(bmk)"); allocnewbookmk(curbmks); readbmk(curbmks->d[0]); continue; } if(strcmp(lexstr,"sufp")==0) { readstring(&startupfilename); pfverb("\nwarning: found ""sufp"" %s\n",startupfilename); pfverb( " will write startupfile\n"); savestartup=1; continue; } pfverb("(%s)",lexstr); if(strcmp(lexstr,"hoff")==0) { fmkstar.hoffmm=readdouble(); continue; } if(strcmp(lexstr,"voff")==0) { fmkstar.voffmm=readdouble(); continue; } if(strcmp(lexstr,"voff")==0) { fmkstar.voffmm=readdouble(); continue; } if(strcmp(lexstr,"papx")==0) { fmkstar.papxmm=readdouble(); continue; } if(strcmp(lexstr,"papy")==0) { fmkstar.papymm=readdouble(); continue; } if(strcmp(lexstr,"xres")==0) { xres=readint(); continue; } if(strcmp(lexstr,"yres")==0) { yres=readint(); continue; } if(strcmp(lexstr,"tfmp")==0) { readstring(&tfmprefix); continue; } if(strcmp(lexstr,"vffp")==0) { readstring(&vfprefix); continue; } if(strcmp(lexstr,"ffor")==0) { readstring(&fontformat); continue; } if(strcmp(lexstr,"fntp")==0) { readstring(&fontprefix); continue; } if(strcmp(lexstr,"disx")==0) { vgaxdim=readint(); continue; } if(strcmp(lexstr,"disy")==0) { vgaydim=readint(); continue; } if(strcmp(lexstr,"geom")==0) { readstring(&cmlgeometry); continue; } if(strcmp(lexstr,"nmag")==0) { newmag=readint(); continue; } if(strcmp(lexstr,"lrnd")==0) { fmkstar.lrandmm=readdouble(); continue; } if(strcmp(lexstr,"rrnd")==0) { fmkstar.rrandmm=readdouble(); continue; } if(strcmp(lexstr,"ornd")==0) { fmkstar.orandmm=readdouble(); continue; } if(strcmp(lexstr,"urnd")==0) { fmkstar.urandmm=readdouble(); continue; } if(strcmp(lexstr,"ison")==0) { ishrinkonly=readint(); continue; } if(strcmp(lexstr,"fshk")==0) { fshrink=readdouble(); continue; } if(strcmp(lexstr,"verb")==0) { verbose=readint(); continue; } if(strcmp(lexstr,"lrum")==0) { maxlrumem=readdouble()*1024.*1024.; if(maxlrumem<1024L*1024L) pfverb("\nwarning: maxlrumem below 1Mb, see ""lrum"" in the startup-file\n)"); maxlinmem=maxlrumem*MAXLINMEMFRAC; continue; } if(strcmp(lexstr,"colo")==0) { colors=readint(); continue; } if(strcmp(lexstr,"deps")==0) { doeps=readint(); #ifdef GSDEFOFF doeps=0; #endif continue; } if(strcmp(lexstr,"ppmo")==0) { ppagemode=readint(); continue; } if(strcmp(lexstr,"dimt")==0) { dimmthresh=readint(); continue; } if(strcmp(lexstr,"dpos")==0) { dispos=readint(); continue; } if(strcmp(lexstr,"mkon")==0) { markon=readint(); continue; } if(strcmp(lexstr,"hyon")==0) { hypon=readint(); continue; } if(strcmp(lexstr,"unit")==0) { unitstar=readint(); continue; } if(strcmp(lexstr,"mvpt")==0) { pagemovetop=readint(); continue; } if(strcmp(lexstr,"mvop")==0) { moveoverpages=readint(); continue; } lexskip(); pfprot("(warning: undefined symbol at line %d in startup-file %s)", lexline,startupfilename); /* lexerror("undefined symbol"); */ } killlex(); freemem(&bustr); confclose(); pfverb("\n ... done\n\n"); return(0); } tmview/src/readdvi.h0100644000175000017500000000130007250444702014030 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ void dvibad(char*); void initfontdatabase(void); void killfontdatabase(void); int searchfontdatabase(char* , char*, long, long, long); int allocfontdesc(char*, char*, long, long, long); int getintnr(long fontnr); void initdvi(void); void killdvi(void); int testdvi(void); void readpage(pagelistelement*); short gotocccpage(double*,short); const char* searchdvi(char* sstr, int* spage, long* spos); tmview/src/subs.h0100644000175000017500000000172107250444702013375 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ void pfprot(char*, ...); void pfverb(char*, ...); void allocmem(void*,long int); void reallocmem(void*, long); void freemem(void*); void alloclrumem(void*,long int); void realloclrumem(void*, long); void freelrumem(void*); void touchlrumem(void* ); void locklrumem(void* ); void unlocklrumem(void* ); char *stralloccpy(char**, char*); long scaled(long,long); void alloc_bitmapbw(bitmap*); void alloc_bitmapgs(bitmap*); void clear_bitmap(bitmap*); void print_bitmap(bitmap*); void draw_frame(bitmap*); int msearch(char*, char*, char*); int completefile(char*, int); int dvistandard(char**,char*); void setworkdir(void); void pathoffile(char* fullfilename, char* path); tmview/src/globals.h0100644000175000017500000000473307250444702014052 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ extern fontdescvect* fontvect; extern pagelistelement *pagelist; extern int pageanz; extern gslistelement* gslistfirst; extern gslistelement* gslistlast; extern int dvierrorflag; extern pagelistelement *cpage; extern pagelistelement *ppage; extern float fshrink; extern int ishrinkonly; extern uchar colors; extern uchar doeps; extern int dimmthresh; extern uchar *greytab; extern long dvimag; extern uchar dimmcolor; extern int verbose; extern char *cmlgeometry; extern int numberargstrlen; extern char *numberargstr; extern int vgaxdim, vgaydim; extern int directscreen; extern int vgastatuslen, vgastatushight, vgastatuslines, vgamaxstatuslines; extern int dvixpos, dviypos; extern int frameon, recton, texton; extern int markon, hypon, statustype, statusforce; extern int marksxpxl, marksypxl; extern float markdxmm, markdymm; extern int textx1pxl, texty1pxl, textx2pxl, texty2pxl; extern int textx3pxl, texty3pxl, textx4pxl, texty4pxl; extern float rectxmm, rectymm, rectwmm, recthmm; extern char *dviname; extern uchar ppagemode; extern int dispos; extern float unitomm,mmtounit; extern int unitcomma; extern char* unitname; extern long maxlrumem; extern long maxlinmem; extern BMUNIT *bit_masks; extern uchar *bit_count; extern char* workdir; extern char *tfmprefix; extern char *vfprefix; extern char *fontprefix; extern char *fontformat; extern char *startupfilename; extern int savestartup; extern long newmag; extern int xres,yres; extern int pagemovetop, moveoverpages, bookmkmode, unitstar; extern fontdesc* fontdatabase; extern filemark** filemks; extern int nfilemks; extern bookmarklist* curbmks; extern bookmarklist* visbmks; extern filemark* curfmk; extern filemark* visfmk; extern filemark fmkstar; extern int truevgaxdim,truevgaydim; extern int varColorspergrey; extern int varWhitecol; extern int varBlackcol; extern int varBordercol; extern int varTextcol; extern int varTextbackcol; extern int varFramecol; extern int varTfmcol; extern int varRectcol; extern int varBackcols; extern int varMarkscol; extern int varMarkhcol; extern int varFoundcol; extern int varHrefcol; extern int varMarkdcol; extern int varMixedcol; extern int varNumberofcolors; tmview/src/halfhyp.h0100644000175000017500000000173407250444702014060 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ void htex_init(void); void htex_kill(void); int checkndoHyperTeX(char*,int,int); void htex_recordbits(long x, long y, long w, long h); void htex_beginpage(pagelistelement*); void htex_endpage(void); void htex_scalebox(double,double); void htex_findondonepage(char* href, int* ip, int* ia); int htex_findonpage(char* href, pagelistelement* page); int htex_is_url(char*); int htex_withinanchor(pagelistelement*,int, int, char**); int searchhref(char* href, int* spage, int* xpxl, int* ypxl); int htex_clickmouse(pagelistelement*,int x, int y, char** res); int htex_findnearanchor(pagelistelement* page,int *x, int *y); int htex_findnumberanchor(pagelistelement* page,int* num); tmview/src/drawit.h0100644000175000017500000000232507250444702013714 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ drawlistdata* drawlistadd(selfdrawfunction* sdf); void drawlistinit(pagelistelement*); void drawlistfix(void); void updateall(void); void updatelist(void); void drawpage(int,int,int,int,int); void drawupdatepage(void); void drawshowallmarks(void); void drawshowfixedmarksonly(void); void drawhideallmarks(void); void drawhidefixedmarksonly(void); void drawhideallmarksandrect(void); void drawshowrect(void); void drawhiderect(void); void drawstatusline(void); void drawstatuspage(void); void drawstatusmarks(void); void drawstatusarg(void); void drawstatuszoom(void); void drawsr(const char*, int,int,int); void drawsl(const char*, int,int,int); void drawsn(const char*, int,int); void drawcharbmp(drawlistdata* arg); void drawcharbmp2bw(drawlistdata* arg); void drawcharbmp2gs(drawlistdata* arg); void drawrulebg(drawlistdata* arg); void drawruleor(drawlistdata* arg); void drawgscript(drawlistdata* arg); tmview/src/bookmks.h0100644000175000017500000000212607250444702014066 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ void filemkskill(void); void filemksinit(void); void rolldownfilemk(void); void rollupfilemk(void); int findrolldownfilemk(char*); void updatefilemk(void); void freefilemkname(char*); void allocnewfilemk(char*); void bookmksinit(bookmarklist*); void bookmkskill(bookmarklist*); void rolldownbookmk(bookmarklist*); int findrolldownbookmk(bookmarklist*,int); void addbookmk(bookmarklist* bookmks, int doname); void setbookmk(bookmark* thebmk, int doname); int existsbookmkqm(bookmarklist* bookmks); int amiatbookmkqm(bookmarklist* bookmks,int i); void allocnewbookmk(bookmarklist* bookmks); void freebookmknumber(bookmarklist* bookmks,int i); void freebookmk(bookmarklist* bookmks); int checkbookmk(bookmarklist* bookmks,int name); int findrolldownbookmk(bookmarklist* bookmks,int name); tmview/src/readtfm.h0100644000175000017500000000056007250444702014043 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ int tfmfind(char*, char*, char*); int tfmdef(char*,int,long); tmview/src/readpk.h0100644000175000017500000000114007250444702013662 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ int pkfind(char*, char*, float, char*); int pkdef(char*,int,long); void pkloadchar(chdesc*); void pkshrinkcharbw(chdesc*); void pkshrinkcharazbw(chdesc*); void pkshrinkchargs(chdesc*); void pkshrinkcharazgs(chdesc*); void pkshrinkcharazprecgs(chdesc*); void cheapshrinkgs(bitmap* bmp, bitmap* bmp2); tmview/src/rwconf.h0100644000175000017500000000053407250444702013720 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ int confread(void); void confwrite(void); tmview/src/readvf.c0100644000175000017500000002221107250444702013660 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions as far I'm concerned ... */ /* The code for reading vf-files is to some extent from vf.c of xdvi. */ #include "defs.h" /* #define DEBUGVF */ FILE* vffile; void vfopen(char* fname) { if((vffile = fopen(fname, "rb"))==0) { pfprot("\n fatal error: vf-file \"%s\" disapeard. \n",fname); exit(1); } } #define vfclose() fclose(vffile) #define vfskip(delta) fseek(vffile,(long) delta,1) #define vfposit(to) fseek(vffile,to,0) #define vftell() ftell(vffile) #define vfn1() (uchar) fgetc(vffile) unsigned short vfn2(void) { short b; b = vfn1(); return (b * 256 + vfn1()); } unsigned long vfn3(void) { long b; short c; b = vfn1(); c = vfn1(); return ((b * 256 + c) * 256 + vfn1()); } unsigned long vfn4(void) { unsigned long b,c,d; b = vfn1(); c = vfn1(); d = vfn1(); return (((b * 256 + c) * 256 +d)*256+ vfn1()); } short vfi1(void) { short b; b = vfn1(); if (b > 127) b -= 256; return b; } short vfi2(void) { short b; b = vfn1(); if (b > 127) b -= 256; return (b * 256 + vfn1()); } long vfi3(void) { long b; b = vfi1(); return (b * 65536L + vfn2()); } long vfi4(void) { long b; b = vfi2(); return (b * 65536L + vfn2()); } void vfbytes(char *s, uchar l) { if(l==0) return; s[0]=0; s[l] = '\0'; if(fread(s,1,(long) l,vffile)==0) pfprot("vf-file ends prematurely ! "); } long vfnum(uchar b) { uchar i; long n; uchar rbuf[4]={0,0,0,0}; if(fread(rbuf, b, 1, vffile)==0) pfprot("vf-file ends prematurely ! "); n = 0; for (i = 1; i <= b; i++) n = (n << 8) | (uchar) rbuf[i-1]; return n; } /* Since we are not that smart as the xdvi crew, we need to code */ /* fontdefinitions again. Bullshit. Why the hell did I start all this? */ int vfdef(char* fftuto,int fdb,long chksum, long vffontnr); /* forward */ /* this is the end, where a font is defined within some vf-font */ /* so fontnr is the w.r.t. the vf-file (rather than the dvi-file)*/ /* and vffdb refers to the vf-fonts database entry */ void vffontdef(long fontnr, int vffdb) { uchar p, q; int f,fdb; long dsz,scf,reldsz,relscf,chksum,vffp; float fontmag; char ffpath[MAXPATHSTR], fftuto[MAXPATHSTR]; char fontname[MAXPATHSTR]; if (fontnr < 0) { dvibad("vf-file: negative fontnumber"); return; } chksum = vfi4(); relscf = vfi4(); reldsz = vfi4(); scf= scaled(FD(vffdb)->foscf,relscf); dsz= ((double)reldsz / 0x10); p = vfn1(); q = vfn1(); vfbytes(fontname, q); if (p != 0) vfbytes(ffpath, p); fontmag = xres * (dvimag / 1000.0 * ((double)scf / dsz)); pfprot("\n prep. vffont: %8s at %6.1f ", fontname, fontmag); pfverb("(scf %d dsz %d) ",scf,dsz); fdb=-1; if(p==0) { if((fdb=searchfontdatabase(vfprefix,fontname,dvimag,scf,dsz))==-1) fdb=searchfontdatabase(fontprefix,fontname,dvimag,scf,dsz); } else { fdb=searchfontdatabase(ffpath,fontname,dvimag,scf,dsz); } if(fdb!=-1) { pfprot(" - fontdatabase"); if(FD(fdb)->vffile!=NULL){ /* look for involved pks/tfms */ vffp=vftell(); /* save where we are */ vfclose(); vflookuppk(fdb); vfopen(FD(vffdb)->vffile); vfposit(vffp); /* back where we've left it */ } } else { if (p==0) strcpy(ffpath, vfprefix); fdb=allocfontdesc(ffpath,fontname,dvimag,scf,dsz); /* this might reallocate fontdatabase!*/ allocmem(&(FD(fdb)->chv),(MAXCHARS+1) * sizeof(chdesc)); memset(FD(fdb)->chv,0,(MAXCHARS+1) * sizeof(chdesc)); /* unsused bitmaps=NULL */ /* unused fty 0 */ /* unused macros = 0*/ /* unused dimensions 0*/ if(tfmfind(tfmprefix,fontname,fftuto)) tfmdef(fftuto,fdb,chksum); /* vf's in vf's looks too dangerous ... still give it a try*/ if(vffind(ffpath,fontname,fftuto)) { vffp=vftell(); /* save where we are */ vfclose(); vfdef(fftuto,fdb,chksum,fontnr); vfopen(FD(vffdb)->vffile); vfposit(vffp); /* back where we've left it */ } else { if(p==0) strcpy(ffpath,fontprefix); if(pkfind(ffpath,fontname,fontmag,fftuto)) { pkdef(fftuto,fdb,chksum); stralloccpy(&(FD(fdb)->fopath),ffpath); } } reallocmem(&(FD(fdb)->chv),sizeof(chdesc)*(FD(fdb)->mch + 2)); } /* assign an internal font number, ie an index in vffontvec */ f = fontnr % VFMAXFONTS; if(FD(vffdb)->vffontvect[f].fontdataptr != -1){ if(FD(vffdb)->vffontvect[f].dfn == fontnr) dvibad("double fontnumber in vf"); for(f=VFMAXFONTS-1; f>=0; f--){ if(FD(vffdb)->vffontvect[f].fontdataptr == -1) break; if(FD(vffdb)->vffontvect[f].dfn == fontnr) dvibad("double fontnumber in vf"); } } if(f<0) dvibad("too many fonts in vf"); else { FD(fdb)->usecount++; FD(vffdb)->vffontvect[f].fontdataptr=fdb; FD(vffdb)->vffontvect[f].dfn = fontnr; } } void setvfname(char* fn, char* result) { *result=0; strcpy(result,fn); strcat(result,".vf"); } #ifdef KPATHSEA /* use kpathsea if wanted */ int vffind(char* ffpath,char* fontname,char* fftuto) { int foundfile; FILE* fofile; char* kpsename=NULL; kpsename=kpse_find_vf(fontname); foundfile = (kpsename!=NULL); if(kpsename){ strncpy(fftuto, kpsename,MAXPATHSTR-1); fftuto[MAXPATHSTR-1]=0; freemem(&kpsename); } #else /* use my own subs (slow) */ int vffind(char* ffpath,char* fontname,char* fftuto) { char ffname[MAXPATHSTR]; int foundfile; FILE* fofile; setvfname(fontname,ffname); foundfile=msearch(ffpath,ffname,fftuto); #endif /* tail of vffind */ if(foundfile==0) { return(0); } fofile=fopen(fftuto,"rb"); if ((fgetc(fofile)!=0xf7)||(fgetc(fofile)!=202)){ pfprot(" - error in VFfile "); fclose(fofile); return(0); } pfprot(" - VFfile "); pfverb("%s ",fftuto); fclose(fofile); return(1); } void vflookuppk(int fdb) { int i; long il,f; uchar o; #ifdef DEBUGVF pfprot("(vflookuppk: "); #endif vfopen(FD(fdb)->vffile); /* Read preamble.*/ vfposit(2); /* skip comment */ i=vfn1(); vfskip(i); il = vfi4(); vfskip(4); /* skip design size */ /* Read the fonts. */ #ifdef DEBUGVF pfprot(" %s -- lookup fonts: ",FD(fdb)->fonam); #endif for(i=0;ivffontvect[i].fontdataptr=-1; /* clear vffontvect */ while ((o = vfn1()) >= 243 && o <= 246) { f = vfnum(o - 242); vffontdef(f,fdb); } vfclose(); } /* this is the end where the a vf-font is defined within the dvi-file */ /* fdb is where it shall go in the database and vffontnr is its number in the dvi-file */ int vfdef(char* fftuto,int fdb,long chksum, long vffontnr) { long il,f; int mchvf, i; chdesc *achar; uchar o; #ifdef DEBUGVF pfprot("(vfdef: "); #endif allocmem(&(FD(fdb)->vffile),strlen(fftuto)+1); strcpy(FD(fdb)->vffile, fftuto); allocmem(&(FD(fdb)->vffontvect),VFMAXFONTS*sizeof(fontdescvect)); for(i=0;ivffontvect[i].fontdataptr=-1; /* Read preamble.*/ vfopen(fftuto); vfposit(2); /* skip comment */ i=vfn1(); vfskip(i); il = vfi4(); if (il !=0 && chksum !=0 && il != chksum ) pfverb(" - wrong checksum "); vfskip(4); /* skip design size */ /* Read the fonts. */ #ifdef DEBUGVF pfprot(" %s -- load fonts: ",FD(fdb)->fonam); #endif while ((o = vfn1()) >= 243 && o <= 246) { f = vfnum(o - 242); if(FD(fdb)->vffirst==-1) FD(fdb)->vffirst=f; /* tag the fist one as default */ /*printf("--%lu--",f);*/ vffontdef(f,fdb); } mchvf=-1; for (; o <= 242; o = vfn1()) { int len; unsigned long c; long fpwidth; if (o == 242) { /* long form packet */ len = vfn4(); c = vfn4(); fpwidth = vfn4(); if (c >= MAXCHARS) { pfprot(" - ignoring character %lu ",c); vfskip(len); continue; } } else { /* short form packet */ len = o; c = vfn1(); fpwidth = vfnum(3); } achar = FD(fdb)->chv+c; achar->fty |= VFTYPE; achar->fontdataptr = fdb; achar->ch = (uchar) c; achar->tfw = scaled(fpwidth,FD(fdb)->foscf); achar->addr = vftell(); achar->mlen = len; allocmem(&achar->macro,achar->mlen+1); vfbytes(achar->macro, achar->mlen); #ifdef DEBUGVF pfprot(" c %d data 0x%x len %u", c, achar->macro,achar->mlen); #endif /*vfskip(len);*/ if (mchvf < (int) c) mchvf = (int) c; } vfclose(); #ifdef DEBUGVF pfprot("... vfdef)"); #endif if (mchvf < 0 || o !=248) { pfprot(" - VFfile in error "); freemem(&(FD(fdb)->vffile)); return(0); } else pfverb(" - VFfile ok "); if (mchvf > FD(fdb)->mch) FD(fdb)->mch=mchvf; return(1); } tmview/src/readvf.h0100644000175000017500000000061407250444702013670 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ int vffind(char*, char*, char*); int vfdef(char*,int,long,long); void vflookuppk(int); tmview/src/epsfile.c0100644000175000017500000005152307250444702014050 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ /* The source in this file handles some aspects of the PSFile-special. At a first step, the arguments of the special are interpreted in order to draw a bounding box. At a second step, we try to call ghostscript to render the eps-file. This is done much less sophisticated than it is in xdvi. Still, part of the code is inspired by xdvi. */ #include "defs.h" /*#define DEBUGEPS *//* debug eps-file reading, rendering etc. */ /*#define DEBUGEPSS *//* parsing of special arguments */ /**********************************************************/ /* gscriptlist: array of espfiles within one dvifile */ /**********************************************************/ void initgscript(void){ #ifdef DEBUGEPS pfprot("(initgscript)"); #endif gslistfirst=NULL; gslistlast=NULL; }; void killgscript(void){ gslistelement* gse; #ifdef DEBUGEPS pfprot("(killgscript"); #endif gse=gslistfirst; while(gse!=NULL){ freemem(&(gse->gsfile)); freemem(&(gse->argfile)); freemem(&(gse->code)); freelrumem(&(gse->bmp2.bits)); freelrumem(&(gse->bmp.bits)); gse=gse->nextgse; } gslistfirst=NULL; gslistlast=NULL; #ifdef DEBUGEPS pfprot(")"); #endif } int testgse(gslistelement* gse){ gslistelement* igse; #ifdef DEBUGEPS pfprot("(testgse:"); #endif igse=gslistfirst; while(igse!=NULL){ if(igse==gse) break; igse=igse->nextgse; } if(igse!=gse || gse==NULL) { pfprot("(testgse: invalid pointer)"); return(0); } #ifdef DEBUGEPS pfprot(")"); #endif return(1); } gslistelement* allocgscript(char* gsfile, char* argfile, short w, short h, float res, char* code){ #ifdef DEBUGEPS pfprot("(allocgscript %s %d %d %.3f",gsfile, w, h, res); #endif if(gslistlast!=NULL){ allocmem(&(gslistlast->nextgse),sizeof(gslistelement)); gslistlast=gslistlast->nextgse; } else { allocmem(&gslistfirst,sizeof(gslistelement)); gslistlast=gslistfirst; } gslistlast->nextgse=NULL; gslistlast->gsfile=NULL; gslistlast->argfile=NULL; stralloccpy(&(gslistlast->gsfile), gsfile); stralloccpy(&(gslistlast->argfile), argfile); gslistlast->bmp2.w=w; gslistlast->bmp2.h=h; gslistlast->bmp2.bits=NULL; gslistlast->bmp2.type=GREYSCALE; gslistlast->bmp.w=w; gslistlast->bmp.h=h; gslistlast->bmp.bits=NULL; gslistlast->bmp.type=BLACKNWHITE; gslistlast->res=res; gslistlast->code=code; gslistlast->suspect=B_SUSPECT; #ifdef DEBUGEPS pfprot(")"); #endif return(gslistlast); } gslistelement* searchgscript(char* gsfile, short w, short h,float res, char* code){ gslistelement* gse; #ifdef DEBUGEPS pfprot("(searchgsciptlist %s %d %d %.3f ",gsfile, w, h, res); #endif gse=gslistfirst; while(gse!=NULL){ if(gse->bmp2.w==w){ if(gse->bmp2.h==h){ if(gse->res==res){ if(strcmp(gse->gsfile,gsfile)==0){ if(strcmp(gse->code,code)==0){ #ifdef DEBUGEPS pfprot(" found)"); #endif return(gse); }}}}} gse=gse->nextgse; } #ifdef DEBUGEPS pfprot(" not found)"); #endif return(NULL); } /****************************************************************************/ /* parsing the arguments of the PSFile-special */ /* this is to be called from the dvi-reader when a special occures */ /****************************************************************************/ double ox; #define GR 0.0174533 /* 2Pi/360 */ #define ROTATE(a,x,y) ox=x;x=x*cos(a*GR)-y*sin(a*GR);y=ox*sin(a*GR)+y*cos(a*GR) int checkndoEpsFile(char* specstr, long h, long v, double sconv, double svconv){ char argfile[MAXPATHSTR+1]; double argllx, arglly, argurx, argury; double argrwi, argrhi, argangle; int gotllx=0, gotlly=0, goturx=0, gotury=0; int gotrwi=0, gotrhi=0, gotangle=0, gotclip=0; char *cp_beg, *cp_end, *cp; char ch; char lfullfile[MAXPATHSTR+1]; char lpath[MAXPATHSTR+1]; char dvipath[MAXPATHSTR+1]; long width, height, lwidth, lheight; float resolution, vscale; short xpxl, ypxl; long needmem; double normllx, normlly, normurx, normury; double bboxAx, bboxAy, bboxBx, bboxBy; double bboxCx, bboxCy, bboxDx, bboxDy; char gscode1[MAXPATHSTR+GSARGLEN]; char gscode3b[GSARGLEN]; char gscode3c[GSARGLEN]; char gscode3e[GSARGLEN]; char gscode3f[GSARGLEN]; char* gscode=NULL; gslistelement* gse; drawlistdata* data; #ifndef LETSTRYGS return(0); #endif cp=specstr; if (STRNCASECMP(cp, "PSFile=", 7) != 0) return(0); #ifdef DEBUGEPS pfprot("(checkndoEpsFile: checkndo <%s> ...)",specstr); #endif /* PART 1: Get the filename ****************************/ cp += 7; ch=' '; if (*cp == '\'' || *cp == '"'){ ch=*cp; ++cp; } cp_beg=cp; while(*cp != '\0' && *cp != ch) ++cp; if (*cp=='\0') { pfverb("(epsfile: cant get filename in <%s>)",specstr); return(1); } cp_end=cp++; if(cp_end-cp_beg>MAXPATHSTR) {pfverb("\nfatal error: memory .. epsfile ??\n");exit(1);} strncpy(argfile,cp_beg,(int) (cp_end-cp_beg)); argfile[(int) (cp_end-cp_beg)]=0; pathoffile(visfmk->dvifilename,dvipath); sprintf(lpath,"./:%s%c%c",dvipath,DIRSEPCHAR,DIRSEPCHAR); #ifdef DEBUGEPS pfprot("(eps: msearch path <%s>)",lpath); #endif if(msearch(lpath,argfile,lfullfile)==0){ pfverb("(epsfile: <%s> not found)", argfile); return(1); } #ifdef DEBUGEPS pfverb("(eps: file <%s>)",lfullfile); #endif /* PART 2: Get other args ******************************/ argllx=arglly=argurx=argury=argangle=argrwi=argrhi=0; while(*cp != '\0') { while(isspace(*cp)) ++cp; cp_beg=cp; while (*cp != '=' && !isspace(*cp) && *cp != '\0') ++cp; cp_end=cp; if(*cp == '=') ++cp; if(STRNCASECMP(cp_beg,"clip",cp_end-cp_beg) == 0) { gotclip=1; #ifdef DEBUGEPSS pfprot("eps, mark 2: clip=\n"); #endif } else { if(STRNCASECMP(cp_beg,"llx",cp_end-cp_beg) == 0) { argllx=atof(cp); gotllx=1; #ifdef DEBUGEPSS pfprot("eps, mark 2: llx=<%.3f>\n",argllx); #endif } else { if(STRNCASECMP(cp_beg,"lly",cp_end-cp_beg) == 0) { arglly=atof(cp); gotlly=1; #ifdef DEBUGEPSS pfprot("eps, mark 2: lly=<%.3f>\n",arglly); #endif } else { if(STRNCASECMP(cp_beg,"urx",cp_end-cp_beg) == 0) { argurx=atof(cp); goturx=1; #ifdef DEBUGEPSS pfprot("eps, mark 2: urx=<%.3f>\n",argurx); #endif } else { if(STRNCASECMP(cp_beg,"ury",cp_end-cp_beg) == 0) { argury=atof(cp); gotury=1; #ifdef DEBUGEPSS pfprot("eps, mark 2: ury=<%.3f>\n",argury); #endif } else { if(STRNCASECMP(cp_beg,"rwi",cp_end-cp_beg) == 0) { argrwi=atof(cp); gotrwi=1; #ifdef DEBUGEPSS pfprot("eps, mark 2: rwi=<%.3f>\n",argrwi); #endif } else { if(STRNCASECMP(cp_beg,"rhi",cp_end-cp_beg) == 0) { argrhi=atof(cp); gotrhi=1; #ifdef DEBUGEPSS pfprot("eps, mark 2: rhi=<%.3f>\n",argrhi); #endif } else { if(STRNCASECMP(cp_beg,"angle",cp_end-cp_beg) == 0) { argangle=atof(cp); gotangle=1; #ifdef DEBUGEPSS pfprot("eps, mark 2: angle=<%.3f>\n",argangle); #endif } else { pfverb("(epsfile: unknown keyword at %d in <%s>)",(int) (cp_beg-specstr), specstr); }}}}}}}} while (!isspace(*cp) && *cp != '\0') ++cp; /* skip value ie float */ while (isspace(*cp)) ++cp; /* skip spces */ } /* PART 3: BoundingBox calculus ... ***********************/ /* PART 3A: Figure out actual dimensions and resolution **/ if( (gotrwi && gotllx && gotlly && goturx && gotury) || (gotrhi && gotllx && gotlly && goturx && gotury) ) { } else { pfverb("(epsfile: cannot figure out dimensions in <%s>)", specstr); return(1); } if((argury-arglly)<=0 || (argurx-argllx)<=0) { pfverb("(epsfile: nonpositive dimensions in <%s>)", specstr); return(1); } if(gotrwi==0) argrwi=argrhi * (argurx-argllx) / (argury-arglly); if(gotrhi==0) argrhi=argrwi * (argury-arglly) / (argurx-argllx); if(argrwi==0 || argrhi==0) { pfverb("(epsfile: nonpositive dimensions in <%s>)", specstr); return(1); } argrhi=argrhi/10; /* convert to 1/72in */ argrwi=argrwi/10; /* convert to 1/72in */ resolution= sconv * 0x10000L * 72.27 * argrwi/ (argurx-argllx); /* ??? 72.27 */ #ifdef DEBUGEPSS pfprot("eps, mark 3A: argll=(%.2f,%.2f) argur=(%.2f,%.2f) rwi=%.2f rhi=%.2f res=%.2f\n", argllx,arglly,argurx,argury,argrwi,argrhi,resolution); #endif /* PART 3B: translate to (-llx,-lly), */ normllx=0; normlly=0; normurx=argurx-argllx; normury=argury-arglly; #ifdef DEBUGEPSS pfprot("eps, mark 3B: normll=(%.2f,%.2f) normur=(%.2f,%.2f)\n", normllx,normlly,normurx,normury); #endif /* PART 3C: scale verticale if both rhi and rwi are given */ if(gotrhi & gotrwi){ vscale=argrhi / argrwi / (argury-arglly) * (argurx-argllx); normury*=vscale; } else { vscale=1; /* prevent rounding errors */ } #ifdef DEBUGEPSS pfprot("eps, mark 3C: normll=(%.2f,%.2f) normur=(%.2f,%.2f) vsc=%.2f\n", normllx,normlly,normurx,normury,vscale); #endif /* PART 3D: add extra pt; */ if(!gotclip){ normllx-=(GSEXTRAPT + 72. * GSEXTRAPXL/resolution); normlly-=(GSEXTRAPT + 72. * GSEXTRAPXL/resolution); normurx+=(GSEXTRAPT + 72. * GSEXTRAPXL/resolution); normury+=(GSEXTRAPT + 72. * GSEXTRAPXL/resolution); #ifdef DEBUGEPSS pfprot("eps, mark 3D: normll=(%.2f,%.2f) normur=(%.2f,%.2f)\n", normllx,normlly,normurx,normury); #endif } /* Part 3E: rotate */ if(gotangle){ bboxAx=normllx; bboxAy=normlly; bboxBx=normurx; bboxBy=normlly; bboxCx=normurx; bboxCy=normury; bboxDx=normllx; bboxDy=normury; ROTATE(argangle,bboxAx,bboxAy); ROTATE(argangle,bboxBx,bboxBy); ROTATE(argangle,bboxCx,bboxCy); ROTATE(argangle,bboxDx,bboxDy); normllx=MIN(bboxAx,MIN(bboxBx,MIN(bboxCx,bboxDx))); normurx=MAX(bboxAx,MAX(bboxBx,MAX(bboxCx,bboxDx))); normlly=MIN(bboxAy,MIN(bboxBy,MIN(bboxCy,bboxDy))); normury=MAX(bboxAy,MAX(bboxBy,MAX(bboxCy,bboxDy))); #ifdef DEBUGEPSS pfprot("eps, mark 3E: normll=(%.2f,%.2f) normur=(%.2f,%.2f) angle=%.1f\n", normllx,normlly,normurx,normury,argangle); #endif } /* Part 3F: convert this to pixels */ xpxl = LFLOOR(sconv * (h + 0x10000L* normllx*argrwi/(argurx-argllx))); ypxl = LCEIL(svconv* (v - 0x10000L* normlly*argrwi/(argurx-argllx))); /* re-convert, in order to prevent for rounding errors */ normllx= (((double) xpxl)/sconv -h)/ ((double)(0x10000L))/argrwi*(argurx-argllx); normlly=-(((double) ypxl)/svconv -v)/ ((double)(0x10000L))/argrwi*(argurx-argllx); width= LCEIL(sconv* 0x10000L*(normurx-normllx)*argrwi/(argurx-argllx)); height= LCEIL(svconv*0x10000L*(normury-normlly)*argrwi/(argurx-argllx)); #ifdef DEBUGEPSS pfprot("eps, mark 3F: normll=(%.2f,%.2f) pxl=(%d,%d) width=%d height=%d\n", normllx,normlly,xpxl,ypxl,width,height); #endif /* Part 3G: actual l(oad)width and lheight differs due to grey scaling */ lwidth=width; lheight=height; #if GSGREY != 1 if(colors!=BLACKNWHITE && fshrink>2.) { lwidth=GSGREY*width; lheight=GSGREY*height; } #endif if(lheight <= 0 || lwidth <=0 || lwidth > 0x7fff || lheight > 0x7fff) { pfprot("(epsfile: ignoring <%s>, too large)", specstr); return(1); } #ifdef DEBUGEPSS pfprot("eps, mark 3G: lwidth=%d lheight=%d\n",lwidth,lheight); #endif /* PART 4: Add gscommand to drawlist **************************/ needmem=0; if(doeps==DOEPS){ needmem=((long)lheight)*((long)ROUNDUP(lwidth,BITS_PER_BMUNIT)) *BYTES_PER_BMUNIT; if(needmem > maxlinmem) { /* try blacknwhit only */ lheight=height; lwidth=width; } needmem=((long)lheight)*((long)ROUNDUP(lwidth,BITS_PER_BMUNIT)) *BYTES_PER_BMUNIT; if(needmem > maxlinmem){ pfverb("(epsfile: ignoring <%s>, too large)", specstr); } else { sprintf(gscode1,GSCODEFILE,lfullfile); sprintf(gscode3b,GSCODETRANS,-argllx,-arglly); sprintf(gscode3c,GSCODESCALE,1.,vscale); if(gotangle) sprintf(gscode3e,GSCODEROTATE,argangle); else *gscode3e=0; sprintf(gscode3f,GSCODETRANS,-normllx,-normlly); allocmem(&gscode,40+strlen(gscode1)+strlen(gscode3b) +strlen(gscode3c)+strlen(gscode3e)+strlen(gscode3f)); sprintf(gscode,"%s\n %s\n %s\n %s\n %s\n", gscode3f,gscode3e,gscode3c,gscode3b,gscode1); #ifdef DEBUGEPSS pfprot("eps, mark 4: gscode=\n<%s>\n",gscode); #endif gse=searchgscript(lfullfile,width,height,resolution,gscode); if(gse==NULL){ gse=allocgscript(lfullfile,argfile,width,height,resolution,gscode); gse->bmp.w=lwidth; gse->bmp.h=lheight; } else { freemem(&gscode); } data=drawlistadd(*drawgscript); (*data).gscript.h=xpxl; (*data).gscript.v=ypxl-height; (*data).gscript.gse=gse; } } /* PART 4: Add frame to drawlist **************************/ #ifndef DEBUGEPS if(doeps==DONTEPS || needmem > maxlinmem){ #endif data=drawlistadd(*drawrulebg); (*data).rect.c=TFMCOL; (*data).rect.x=xpxl; (*data).rect.y=ypxl-height; (*data).rect.w=width; (*data).rect.h=1; data=drawlistadd(*drawrulebg); (*data).rect.c=TFMCOL; (*data).rect.x=xpxl; (*data).rect.y=ypxl-1; (*data).rect.w=width; (*data).rect.h=1; data=drawlistadd(*drawrulebg); (*data).rect.c=TFMCOL; (*data).rect.x=xpxl; (*data).rect.y=ypxl-height; (*data).rect.w=1; (*data).rect.h=height; data=drawlistadd(*drawrulebg); (*data).rect.c=TFMCOL; (*data).rect.x=xpxl+width-1; (*data).rect.y=ypxl-height; (*data).rect.w=1; (*data).rect.h=height; #ifndef DEBUGEPS } #endif #ifdef DEBUGEPS pfprot("(checkndoEpsFile: done)"); #endif return(1); } /******************************************************************************/ /* Lets load the bmps, i.e. run ghostscript */ /******************************************************************************/ #define GSPIPE_OUT_READ gspipeout[0] /* read bits from gs's output */ #define GSPIPE_OUT_WRITE gspipeout[1] #define GSPIPE_IN_READ gspipein[0] #define GSPIPE_IN_WRITE gspipein[1] /* write commands to gs's input */ /* if POSIX O_NONBLOCK is not available, use O_NDELAY */ #if !defined(O_NONBLOCK) && defined(O_NDELAY) #define O_NONBLOCK O_NDELAY #endif pid_t gspid; int gspipeout[2]; int gspipein[2]; int gsrunning; FILE* gs_out_read; FILE* gs_in_write; int startgs(char* epsname, short width, short height, float res, char* gscode) { char gsargsize[GSARGLEN]; char gsargres[GSARGLEN]; gsrunning=0; if(pipe(gspipeout) || pipe(gspipein)){ pfverb("(startgs: pipes failed)"); return(1); } sprintf(gsargsize,GSARGSIZE,width,height); sprintf(gsargres,GSARGRES,res,res); #ifdef DEBUGEPS pfprot("(startgs: args <%s %s>)",gsargsize,gsargres); #endif gspid=fork(); if(gspid == 0){ dup2(GSPIPE_IN_READ, STDIN_FILENO); dup2(GSPIPE_OUT_WRITE, STDOUT_FILENO); /*dup2(GSPIPE_OUT_WRITE, STDERR_FILENO);*/ close(GSPIPE_IN_READ); /* dont need this desc. in child */ close(GSPIPE_OUT_WRITE); close(GSPIPE_IN_WRITE); close(GSPIPE_OUT_READ); /* system(echo "HI") */ execlp(GSBIN, GSARG0,GSARG1,GSARG2,GSARG3,GSARG4,GSARG5,gsargsize,gsargres,GSARGLAST,NULL); exit(1); /*shall not happen !*/ } if(gspid < (pid_t) 0){ pfverb("(startgs: fork failed)"); return(1); } #ifdef DEBUGEPS pfprot("(startgs: gspid %d)",gspid); #endif /*sleep(5);*/ gs_in_write=(FILE*)fdopen(GSPIPE_IN_WRITE, "w"); /* guarantee gspid (and hence the pipes) to be alive */ if(gs_in_write!=NULL){ fputs(GSCODEINTRO,gs_in_write); fputs(gscode,gs_in_write); fputs(GSCODEQUIT,gs_in_write); fclose(gs_in_write); } /* dont need this desc. in parent */ close(GSPIPE_OUT_WRITE); close(GSPIPE_IN_READ); gsrunning=1; return(0); } #define TIMEOUT 2 int waitio(void){ fd_set set; struct timeval timeout; int sel; FD_ZERO(&set); FD_SET(GSPIPE_OUT_READ, &set); #ifdef VGAHASWAITIO /* select cares about keybord */ timeout.tv_sec = TIMEOUT; timeout.tv_usec = 0; #else /* select ignores keybord */ timeout.tv_sec = 0; timeout.tv_usec = 100000L; /* 0.1 sec */ #endif; #ifdef DEBUGEPS printf("<"); fflush(stdout); #endif sel=vgawaitio(&set, NULL, &timeout); #ifdef DEBUGEPS printf("%d>",sel); #endif return sel; } volatile sig_atomic_t timeout; void sigalarmhandler(int sig){ timeout=1; signal(sig, sigalarmhandler); } int readgs(bitmap *bmp2){ uchar buff[GSBLOCKLEN]; uchar *sp, *buffend; long bufflen; long count; long expected; uchar ukey; short jbit,jbm; long lshift; BMUNIT *dp; int returncode; /* set GSPIPE_OUT_READ to non-blocking I/O ... | O_NONBLOCK */ /* set GSPIPE_OUT_READ to generate SIGIO ... | O_ASYNC */ fcntl(GSPIPE_OUT_READ, F_SETFL, fcntl(GSPIPE_OUT_READ, F_GETFL, 0) | O_NONBLOCK); signal(SIGALRM, sigalarmhandler); gs_out_read=(FILE*)fdopen(GSPIPE_OUT_READ, "r"); if(gs_out_read==NULL || gsrunning==0) return(B_SUSPECT); #ifdef DEBUGEPS pfprot("(eps: start reading pipe ..."); #endif dp=bmp2->bits; jbit=0; jbm=0; lshift=BITS_PER_BMUNIT-8; count=0; expected=ROUNDUP(bmp2->w,8)*bmp2->h; expected=MIN(expected,bmp2->h*bmp2->bmu_wide*BYTES_PER_BMUNIT); ukey=KEYNOP; timeout=0; while( ukey==KEYNOP /* no user-interrupt so far */ && count < expected /* not all bytes yet read */ && (gsrunning==1 || returncode==0) /* runs or finished ok */ && timeout==0){ /* still in time */ ukey=vgagetchar(2); if(gspid==waitpid(gspid, &returncode, WNOHANG)) { gsrunning=0; returncode=WEXITSTATUS(returncode); alarm(TIMEOUT); /* prevent from hanging */ } bufflen=fread(buff,1L,GSBLOCKLEN,gs_out_read); #ifdef VGAHASWAITIO if(bufflen==0 && count==0) waitio(); #endif if(bufflen!=0 && count==0) pfverb("."); buffend=buff+bufflen; sp=buff; while(sp=bmp2->w) { jbit=0; jbm=0; lshift=BITS_PER_BMUNIT-8; dp+=bmp2->bmu_wide; } } /* while buff */ } #ifdef DEBUGEPS pfprot("... pipe done)"); #endif pfverb("."); alarm(0); fclose(gs_out_read); close(GSPIPE_OUT_READ); close(GSPIPE_IN_WRITE); if(gsrunning) { kill(gspid, SIGKILL); waitpid(gspid, &returncode, 0); returncode=WEXITSTATUS(returncode); gsrunning=0; } if(ukey==KEYESC) vgagetchar(1); /* flush */ if(returncode!=0) ukey=KEYESC; #ifdef DEBUGEPS pfprot("(eps: expected %d bytes, read %d bytes,returncode %d)", expected,count,returncode); #endif if(expected!=count && ukey==KEYNOP) pfverb(" error: expected %dbytes, read %dbytes, exitcode %d", expected,count,returncode); if(expected==count) return(B_OK); if(ukey==KEYESC) return(B_ESCAPE); if(ukey!=KEYNOP) return(B_SKIPONCE); return(B_SUSPECT); } void gsloadbmp(gslistelement* gse) { char mess[MAXPATHSTR]; #ifdef DEBUGEPS int i,j; pfprot("(gsloadbmp: 0x%x %s %d %d %.2f ...)", gse,gse->gsfile,gse->bmp2.w,gse->bmp2.h, gse->res); #endif if(!testgse(gse)) return; /* <<< remove this in future version */ if(gse->suspect==B_ESCAPE) return; /* user message, similar to ingorethis, */ sprintf(mess,"... RENDERING <%s> (%dx%d)",gse->argfile,gse->bmp.w,gse->bmp.h); if(vgastatuslines!=1) drawstatusline(); drawsr(mess,0,0,vgastatuslen); statusforce=0; drawstatuspage(); vgaupdatestatus(); statusforce=1; pfverb("(%s",gse->argfile); gse->bmp.type=BLACKNWHITE; freelrumem(&(gse->bmp.bits)); freelrumem(&(gse->bmp2.bits)); alloc_bitmapbw(&gse->bmp); /* alloclrumem + set bmu_wide */ #ifdef DEBUGEPS for(i=0;ibmp.h;i++) { for(j=0;jbmp.bmu_wide;j++) { gse->bmp.bits[j+ gse->bmp.bmu_wide*i] |= 1 << (i & (BITS_PER_BMUNIT-1)); } } #endif startgs(gse->gsfile, gse->bmp.w,gse->bmp.h, gse->res*gse->bmp.w/gse->bmp2.w, gse->code); gse->suspect=readgs(&gse->bmp); if(gse->suspect!=B_OK) freelrumem(&(gse->bmp.bits)); if(gse->suspect==B_ESCAPE){ sprintf(mess,"ERROR/INTERRUPT WHILE RENDERING <%s> (%dx%d)", gse->argfile,gse->bmp.w,gse->bmp.h); drawsr(mess,0,0,vgastatuslen); vgaupdatestatus(); /*sleep(2);*/ statusforce=2; /* Hack: 2<>keep once, then force */ } if(gse->bmp.w!=gse->bmp2.w && gse->suspect==B_OK){ #ifdef DEBUGEPS pfprot("(gsload: shrinking ...)"); #endif cheapshrinkgs(&gse->bmp,&gse->bmp2); freelrumem(&(gse->bmp.bits)); pfverb("."); } #ifdef DEBUGEPS pfprot("gsloadbmp: done)"); #endif pfverb(")"); } tmview/src/epsfile.h0100644000175000017500000000073207250444702014051 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ void initgscript(void); void killgscript(void); int checkndoEpsFile(char* specstr, long h, long v, double sconv, double svconv); void gsloadbmp(gslistelement* gse); tmview/src/defsgen.h0100644000175000017500000003600407250444702014036 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ /* generall defs for all versions of tmview */ /* these are be #included by "src/defs.h" */ #define MYVERSION "V01.03" /* *************************************************************************** general start up defaults *************************************************************************** */ /* set the default resulution in dpi (option -r) */ #define XRES 300 #define YRES 300 /* set the default papersize in mm (option -p)*/ #define PAPXMM 210.0 #define PAPYMM 297.0 /* define default printable area (option -k) */ #define LRANDMM 4.0 #define RRANDMM 4.0 #define ORANDMM 4.0 #define URANDMM 12.0 /* location of the top left corner from */ /* the dvifile on the page (options -h -v)*/ #define HOFFMM 25.4 #define VOFFMM 25.4 /* shrinkfactor corresponds to 1/zoomfactor */ /* so the following allows a zooming range from 0.05 to 2 */ #define MAXSHRINK 20.0 #define MINSHRINK 0.5 /* startup with zoomfactor 0.33 */ #define SHRINK 3.0 /* startup in the fast zooming mode, only integer-shrinkfactors */ #define ISHRINKONLY 1 /* startup in the slow zooming mode, arbitrary shrinkfactors */ /* #define ISHRINKONLY 0 */ /* startup with 10% movement on cursor keys */ #define PMOVEOFF 10. /* its a float ! */ /* startup with +/-18.92% zooming on <+>/<-> keys */ #define PZOOMFINE 18.92 /* its a float ! */ /* startup in the stay-where-you-are-page-moving-mode */ #define PAGEMOVETOP 0 /* startup in the do-a-center-after-page-moving-mode */ /* #define PAGEMOVETOP 1 */ /* startup in the scroll-over-pages-mode */ #define MOVEOVERPAGES 1 /* startup in the dont-scroll-over-pages-mode */ /* #define MOVEOVERPAGES 0 */ #define FINE 1.4142 /* faktor used with and */ #define PCOLORS GREYSCALE /* startup with greyscales */ /*#define PCOLORS GREYSCALE*/ /* startup with blacknwhite */ #define PDOEPS DOEPS /* startup with eps enabled */ /*#define PDOEPS DONTEPS*/ /* startup with eps disabled */ #define VERBOSE 0 /* do not be verbose */ #define SAVESTARTUP 0 /* dont save startup values */ /* set the default unit of measurement. you may change this, see */ /* UNIT has to be an integer between 0 and 7, defining: */ /* 0 -> MM, 1 -> CM, and so on ... IN, BP, PT, PC, CC, ... 7 -> DD */ #define UNIT 0 /* set default unit to MM */ /* set default double-page-mode: 0->off, 1->auto, 2->on */ #define PPAGEMODE 1 #define MARKON 0 /* dont show up with marks on */ #define HYPON 0 /* when MARKON is 1, HYPON 1 sets it to halfhyper */ #define MARKSIZE 30 /* size of neat square marks */ /* *************************************************************************** dvi-pk-etc.-file related defsinitions *************************************************************************** */ #define SMAX 300 /* dvi stack size: inc. vf and vf in vf */ #define MAXFONTS 256 /* max number of different fonts */ #define VFMAXFONTS 50 /* max number of fonts within a vf */ #define MAXCHARS 256 /* max number chars in a font. DONT CHANGE! */ /* for reasons of lazy programing the maximum stringlength of pathnames is restricted. this contains any recursivly searched paths. So if you set the searchpath for files to the (stupid ?) value of "//", you have to set MAXPATHSTR to the length of the longest path on your system. */ #define MAXPATHSTR 300 /* (not lazy but) because of safty the recursionlevel of recursiv path searchin is limited to. While the total number of subdirectories between all "//" within a searchstring might be imense, only up to MAXPATHDEP will be scanned. */ #define MAXPATHDEP 10 /* To speed things up a little, tmview keeps (1) drawing commands expanded from the dvi-file (2) glyphs from pk-files and (3) rendered eps-images within an LRU buffer. The follwing macros define upper limits to this buffer. Note that glyhs or rendered eps-images will only be drawn if they fit in the buffer. Similar limitations hold on pages with an extensive use of rules like epic figures. As only the actually required amount of buffermemory will be allocated, hight limits dont hurt. However, it makes not much sense to keep your machine swapping by some stupid buffer. On an old fasioned 4Mb laptop use about 1Mb as tmview's buffer ... and disable eps rendering or at least greyscaling when eps rendering. Example: using 300dpi pk-font-files at the giant size of 21x28cm (600x800pt) result in a maximum buffersize of 8,200,000 pixels. With greyscaling enabled this results in up to 4Mb per character, depending on the actual zooming. Restricting the maximum glyph size to 7.5x10cm gives a limit of 1Mb. Example: eps-files are rendered at (res*shrink)dpi, where res is the resolution and shrink is the inverse of the zoom factor (if greyscaling is enabled, multiply by GSGREY^2). Thus, a 21x28cm image at 300dpi zoomed at 0.333 requires appx. 100Kb (or 400Kb if greyscaling at GSGREY=2). Example: A rule requires appx 20 bytes in the buffer. An extensive epic-drawing with 10000 rules comes up to appx. 200Kb buffer memory. MAXLRUPOOL: upper limit for over all buffer in unit Mb MAXLINMEMFRAC: upper limit for buffering a sinle glygh as fraction of MAXLRUPOOL NOTE: the compiletime default may be overwriten by the startup-file parameter "lrum" */ #ifndef LETSTRYGS #define MAXLRUPOOL (1.5) /* 1.5 Mb: handle reasonable complex dvi/pk */ #else #define MAXLRUPOOL (1.5*GSGREY*GSGREY) /* 6Mb: handle reasonable size eps */ #endif #define MAXLINMEMFRAC (0.25) /* max 25% by individual objects, don't change */ /* use GAMMA to darken or lighten the displayed glyphs GAMMA \in(0,\infty), larger GAMMA -> darker drawings set GAMMA to 1 for neutral greyscales. Note: this is just "similar to" a gammacorrection */ #define GAMMA 1.3 /* Any color lighter than the DIMMTHRESHOLDDG will be represented by one of two greylevels rather than black. Any color lighter than the DIMMTHRESHOLDLG will be represented the lighter greylevel rather than black. So a higher value here gives a --potentially-- darker drawing. Range: 0<==>black ... 3<==>white. */ #define DIMMTHRESHOLDDG 0.3 #define DIMMTHRESHOLDLG 0.9 /* *************************************************************************** bitmaps *************************************************************************** */ #ifdef BMLONG64 #define BMUNIT unsigned long #define BITS_PER_BMUNIT 64 #define BITS_LOG2 6 #define BYTES_PER_BMUNIT 8 #endif #ifdef BMLONG32 #define BMUNIT unsigned long #define BITS_PER_BMUNIT 32 #define BITS_LOG2 5 #define BYTES_PER_BMUNIT 4 #endif #ifdef BMCHAR #define BMUNIT unsigned char #define BITS_PER_BMUNIT 8 #define BITS_LOG2 3 #define BYTES_PER_BMUNIT 1 #endif #define BLACKNWHITE 1 /* number of bits per pixel in blacknwhite */ #define BITS_PER_GREY 4 /* must be a divisor of BITS_PER_BMUNIT */ #define BITS_PER_GREY_LOG2 2 #ifdef GREYINBMU #define GREYSCALE BITS_PER_BMUNIT /* number of bits per pixel in greymodus */ #define GREYSCALE_LOG2 BITS_LOG2 #else #define GREYSCALE BITS_PER_GREY #define GREYSCALE_LOG2 BITS_PER_GREY_LOG2 #endif /* *************************************************************************** more or less private stuff: types, shortcuts ... better don't touch *************************************************************************** */ #define uchar unsigned char #define ushort unsigned short #define uint unsigned int #define ulong unsigned long #define ptr void * #ifdef DOSFILES #define DIRSEPSTR "\\" #define DIRSEPCHAR '\\' #else #define DIRSEPSTR "/" #define DIRSEPCHAR '/' #endif #define SUB(a, b) ((BMUNIT *) (((char *) a) - b)) #define MIN(a, b) ((a)<(b)?(a):(b)) #define MAX(a, b) ((a)>(b)?(a):(b)) #define MMTOPXL(a) ((long) floor(xres*(a)/25.4/fshrink + 0.5)) #define PXLTOMM(a) ((float)((a)*25.4/xres*fshrink)) #define PZTOPXL(pz) ((int) floor(MAX(0,MIN(vgaxdim-1,(pz)/100.0*vgaxdim+0.5)))) #define PXLTOPZ(pxl) ((float)(MAX(0,MIN(100,(pxl)*100.0/vgaxdim)))) #define INSIDEPXL (0.05* MIN(vgaxdim,vgaydim)) #define STRCASECMP(a,b) strcasecmp(a,b) #define STRNCASECMP(a,b,c) strncasecmp(a,b,c) #define CEIL(a) (ceil(a)) #define FLOOR(a) (floor(a)) #define ROUND(a) ( ((a)>=0 ? floor(a+0.5) : ceil(a-0.5)) ) #define LCEIL(a) ((long)(ceil(a))) #define LFLOOR(a) ((long)(floor(a))) #define LROUND(a) ( (long)((a)>=0 ? floor(a+0.5) : ceil(a-0.5)) ) #define ROUNDUP(x,y) (((x)+(y)-1)/(y)) #define ADD(a, b) ((BMUNIT *) (((char *) a) + b)) typedef struct bitmap { short w, h; /* width and height in pixels */ short bmu_wide; /* scan-line width in BMUNIT */ BMUNIT *bits; /* pointer to the bits */ char type; /* number of bits per pixel */ } bitmap; typedef struct chdesc { /* general inf*/ char fty; uchar ch; int fontdataptr; /* pk section*/ short hof, vof; bitmap bmp; long tfw, addr; uchar flag; /* pk shrunken*/ short hof2,vof2; bitmap bmp2; float shrink; /* tfm section*/ long tfmtfh, tfmtfw, tfmtfd; /* vf section*/ long mlen; uchar* macro; } chdesc; #define PKTYPE 1 #define TFMTYPE 2 #define VFTYPE 4 typedef struct fontdescvect { long dfn; /* font number within dvi (or vf) */ int fontdataptr; /* index to fontdatabase */ } fontdescvect; typedef struct fontdesc { chdesc *chv; /* array of chdesc */ short mch; /* length of chv */ char* fonam; /* font id: name */ char* fopath; /* ....... path */ long fodvimag; /* ....... load at mag */ long foscf; /* ....... scf */ long fodsz; /* ....... dsz */ char* pkfile; /* pointer to pkfile-name */ char* vffile; /* pointer to vffile-name */ char (* encoding)[5]; /* pointer to encoding */ fontdescvect *vffontvect;/* index of fonts within vf */ long vffirst; /* default vf fontnr */ short usecount; /* how often used */ } fontdesc; #define FD(a) (fontdatabase+a) #define B_OK 0 /* ok, bmp valid */ #define B_SUSPECT 1 /* must be & allocated & rendered */ #define B_ESCAPE 2 /* shall be ignored in furure */ #define B_SKIPONCE 3 /* shall be ignored once */ typedef struct gslistelement { char* gsfile; /* full file name */ char* argfile; /* short file name as in special */ float res; /* required gs-reolution w.r.t. shrink factor */ char* code; /* gs-code to execute, e.g. scaling */ int suspect; /* 0 <=> ok, bmp valid */ bitmap bmp; /* B&W source from gs */ bitmap bmp2; /* greyscaled, destination size */ void* nextgse; /* list */ } gslistelement; typedef union drawlistdata { struct { int h; int v; chdesc* chdp; uchar c; } chr; struct { int h; int v; gslistelement* gse; } gscript; struct { int x; int y; int w; int h; uchar c; } rect; } drawlistdata; typedef void (selfdrawfunction)(drawlistdata*); typedef struct drawlistelement { selfdrawfunction *drawmyself; union drawlistdata data; } drawlistelement; 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 */ long llx, lly, urx, ury; /* Box on page where anchor located */ long x1pxl, y1pxl, x2pxl, y2pxl; /* Box on page where anchor located */ } HTeX_Anchor; typedef struct{ uchar r; uchar g; uchar b; } color; #define NOTDONE 0 #define DOING 1 #define DONE 2 #define HTeX_A_NAME 1 #define HTeX_A_HREF 2 typedef struct pagelistelement { int num; /* number of page */ long addr; /* address in dvi-file */ long count[10]; /* tex counters */ drawlistelement* drawlist; /* drawlist */ long ndraws; /* number of drawlistelements */ long maxdraws; /* maximal number of drawlistelements */ float fshr; /* float shrink used for drawlist */ int col; /* colors used for drawlist (greyscaling) */ color* cstack; /* colorstack (color-specials) */ int cstackp; /* length of colorstack (color-specials) */ int dps; /* did or didi no eps when setting up drawlist */ int dth; /* threshold used for dimming. 0....8 */ int xoffset; /* offset w.r.t. top left corner of screen */ int yoffset; HTeX_Anchor* anchorlist; /* list of anchors on this page */ int nanchors; /* number of anchors in list */ int maxanchors; /* maximal number of anchors in list */ int anchorsdone; /* !=0 >> page parsed allready */ } pagelistelement; typedef struct { char *dvifilename; int name; int pagenum; int dvixpos, dviypos; uchar ppagemode; float fshrink; int marksxpxl, marksypxl; } bookmark; typedef struct { bookmark** d; int n; } bookmarklist; typedef struct { char *dvifilename; float papxmm, papymm, voffmm, hoffmm; float centerxmm, centerymm; float lrandmm, rrandmm, orandmm, urandmm; bookmark lastpos; bookmarklist bookmks; } filemark; #define MAXMKS 1000 /* must be addressable by int */ #define FILETYP 1 #define MANTYP 2 #define PGMAGIC 42.42e42 #define KEYNOP 128 #define KEYNEXT KEYNOP+1 #define KEYPREV KEYNOP+2 #define KEYUP KEYNOP+3 #define KEYDOWN KEYNOP+4 #define KEYRIGHT KEYNOP+5 #define KEYLEFT KEYNOP+6 #define KEYCENTER KEYNOP+7 #define KEYFIRST KEYNOP+8 #define KEYLAST KEYNOP+9 #define KEYHOME KEYNOP+10 #define KEYEND KEYNOP+11 #define KEYESC KEYNOP+12 #define KEYRET KEYNOP+13 #define KEYRESIZE KEYNOP+14 #define KEYTAB KEYNOP+15 #define KEYMOUSE KEYNOP+16 /* dummy */ #define VGAXDIMMIN 320 #define VGAYDIMMIN 200 #define MAXARGSTR 80 #define COMDO 0 #define COMDEF 1 #define STATUSTYPES 2 #define DOEPS 1 #define DONTEPS 0 #ifdef HASWINDOWS #define TRACKBALL 0 #endif #ifndef TRACKBALL #define TRACKBALL 0 #endif /* *************************************************************************** include all headers *************************************************************************** */ #include "globals.h" #include "writedis.h" #include "subs.h" #include "regex.h" #include "readdvi.h" #include "readtfm.h" #include "readpk.h" #include "readvf.h" #include "epsfile.h" #include "colors.h" #include "halfhyp.h" #include "bookmks.h" #include "drawit.h" #include "rwconf.h" #ifdef KPATHSEA #include #include #include #include #include #endif /* functions exproted by tmview.c */ int proceedthis(char* message); tmview/src/colors.h0100644000175000017500000000073007250444702013721 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ int checkndoColor(char* specstr); void initcolorstack(void); void killcolorstack(void); void savecolorstack(pagelistelement*); void loadcolorstack(pagelistelement*); tmview/src/colors.c0100644000175000017500000001243407250444702013720 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ /* The source in this file handles a tiny aspect of the Color-special: the aim is just to get black text not overdrawn by a >>black<< rule when there was a light grey (or whatever colored) box meant to be behind. While the below machinerie seem to be slightly oversized for our simple purpose there is room for future extensions ... */ #include "defs.h" /* #define DEBUGCOLOR */ /* debug color push/pop */ /* #define DEBUGCOLORP */ /* debug parseing */ #define COLORCHUNK 10 #define MAXCOL 1024 int cstp=0; int maxcol=0; color* colorstack=NULL; void killcolorstack(void){ #ifdef DEBUGCOLOR pfprot("(killcolorstack)"); #endif dimmcolor=0; cstp=0; } void initcolorstack(void){ #ifdef DEBUGCOLOR pfprot("(initcolorstack)"); #endif killcolorstack(); }; void savecolorstack(pagelistelement* apage){ apage->cstackp=cstp; if(cstp==0) apage->cstack=NULL; else { allocmem(&apage->cstack,sizeof(color)*cstp); memcpy(apage->cstack,colorstack,sizeof(color)*cstp); } #ifdef DEBUGCOLOR pfprot("(savecolorstack: page %d colors %d)",apage->num,cstp); #endif } void loadcolorstack(pagelistelement* apage){ cstp=apage->cstackp; if(cstp<0){ /* this shall never happen */ cstp=0; pfprot("(loadcolorstack: found invalide stack on page %d)",apage->num); } if(cstp>0) { if(cstp>=maxcol){ maxcol=cstp; reallocmem(&colorstack,maxcol*sizeof(color)); } memcpy(colorstack,apage->cstack,sizeof(color)*cstp); } #ifdef DEBUGCOLOR pfprot("(loadcolorstack: page %d colors %d)",apage->num,cstp); #endif } /* dimm=0,1,2 <===> not dimmned, a little dimmed, rather dimmended */ /* <===> black, dark grey, light grey */ /* dimm=3 <===> only black is black .. anything else is white */ /* dimmthresh 0...8: factor of thresholds, lower <=> blacker */ void setdimmcolor(void){ float gl; dimmcolor=0; if(cstp>0){ gl= colorstack[cstp-1].r/255. + colorstack[cstp-1].g/255. + colorstack[cstp-1].b/255.; if(dimmthresh<=4){ /* ***************** rather black */ if(gl > dimmthresh/4. * DIMMTHRESHOLDDG + (1.-dimmthresh/4.) * 3.) dimmcolor=1; if(gl > dimmthresh/4. * DIMMTHRESHOLDLG + (1.-dimmthresh/4.) * 3.) dimmcolor=2; } else { if(dimmthresh<8){ /* ***************** rather dimmned */ if(gl > (1.-(dimmthresh-4)/4.) * DIMMTHRESHOLDDG) dimmcolor=1; if(gl > (1.-(dimmthresh-4)/4.) * DIMMTHRESHOLDLG) dimmcolor=2; } else { /* *************** draw only true black */ if(gl>0) dimmcolor=3; }} } #ifdef DEBUGCOLOR if(dimmcolor==0) pfprot("(dimm off)"); if(dimmcolor==1) pfprot("(dimm dark)"); if(dimmcolor==2) pfprot("(dimm light)"); if(dimmcolor==3) pfprot("(dimm ignore)"); #endif } void pushcolor(float r, float g, float b){ #ifdef DEBUGCOLOR pfprot("(pushcolor)"); #endif if(cstp>MAXCOL){ pfprot("(color push: stack overflow)"); return; } if(cstp>=maxcol){ maxcol+=COLORCHUNK; reallocmem(&colorstack,maxcol*sizeof(color)); } colorstack[cstp].r=MAX(0,255*r); colorstack[cstp].g=MAX(0,255*g); colorstack[cstp].b=MAX(0,255*b); cstp++; setdimmcolor(); } void popcolor(void){ #ifdef DEBUGCOLOR pfprot("(popcolor)"); #endif cstp--; setdimmcolor(); if(cstp<0){ pfprot("(color pop: stack underflow)"); cstp=0; } } /****************************************************************************/ /* parsing the arguments of the color-special */ /* this is to be called from the dvi-reader when a special occures */ /****************************************************************************/ int checkndoColor(char* specstr){ char* cp; float r,g,b,gl,c,y,m,k; #ifndef LETSTRYCOLOR return(0); #endif cp=specstr; if(STRNCASECMP(cp,"color",5)!=0) return(0); cp += 5; #ifdef DEBUGCOLORP pfprot("(cndColor: <%s> ...)",cp); #endif while(isspace(*++cp)); if(STRNCASECMP(cp,"push",4)==0){ cp += 4; while(isspace(*++cp)); if(STRNCASECMP(cp,"Black",5)==0){ pushcolor(0,0,0); } else { if(STRNCASECMP(cp,"White",5)==0){ pushcolor(1,1,1); } else { if(STRNCASECMP(cp,"cmyk",4)==0){ cp += 4; if(sscanf(cp," %g%g%g%g",&c,&m,&y,&k)<4){ pfprot("(color push cmyk: parse error)"); } else { pushcolor(MAX(0,1-c-k),MAX(0,1-m-k),MAX(0,1-y-k)); } } else { if(STRNCASECMP(cp,"grey",4)==0 || STRNCASECMP(cp,"gray",4)==0 ){ cp += 4; if(sscanf(cp," %g",&gl)<1){ pfprot("(color push grey: parse error)"); } else { pushcolor(gl,gl,gl); } } else { if(STRNCASECMP(cp,"rgb",3)==0){ cp += 3; if(sscanf(cp," %g%g%g",&r,&g,&b)<3){ pfprot("(color push rgb: parse error)"); } else { pushcolor(r,g,b); } }}}}} } else { if(STRNCASECMP(cp,"pop",3)==0){ cp+=3; while(isspace(*++cp)); popcolor(); } else { pfverb("(cndColor: <%s> ingnored)",cp); }} #ifdef DEBUGCOLORP pfprot("(cndColor: done)"); #endif return(1); } tmview/svga/0040755000175000017500000000000007250444702012423 5ustar tmoortmoortmview/svga/font8x8.h0100644000175000017500000002204607250444702014113 0ustar tmoortmoor /* this is font8x8, as found in vgagl */ static unsigned char font8x8[] = { 0,0,0,0,0,0,0,0,126,129,165,129,189,129,126,0, /* 0 to 15 */ 126,255,219,255,195,255,126,0,54,127,127,127,62,28,8,0, /* 16 to 31 */ 8,28,62,127,62,28,8,0,28,28,8,107,127,107,8,28, /* 32 to 47 */ 8,28,62,127,62,8,28,62,0,0,24,60,60,24,0,0, /* 48 to 63 */ 255,255,231,195,195,231,255,255,0,60,102,66,66,102,60,0, /* 64 to 79 */ 255,195,153,189,189,153,195,255,15,7,13,60,102,102,102,60, /* 80 to 95 */ 60,102,102,102,60,24,126,24,48,56,60,54,52,112,240,224, /* 96 to 111 */ 127,99,127,99,99,103,230,192,24,219,126,102,102,126,219,24, /* 112 to 127*/ 64,112,124,127,124,112,64,0,1,7,31,127,31,7,1,0, /* 128 to 143 */ 24,60,126,24,24,126,60,24,102,102,102,102,102,0,102,0, /* 144 to 159 */ 63,122,122,58,10,10,10,0,30,51,28,54,54,28,102,60, /* 160 to 175 */ 0,0,0,0,126,126,126,0,24,60,126,24,126,60,24,126, /* 176 to 191 */ 24,60,126,24,24,24,24,0,24,24,24,24,126,60,24,0, /* 192 to 207 */ 0,12,14,127,14,12,0,0,0,24,56,127,56,24,0,0, /* 208 to 223 */ 0,0,96,96,96,127,0,0,0,36,102,255,102,36,0,0, /* 224 to 239 */ 0,24,60,126,255,255,0,0,0,255,255,126,60,24,0,0, /* 240 to 255 */ 0,0,0,0,0,0,0,0,24,24,24,24,24,0,24,0, /* 256 to 271 */ 102,102,102,0,0,0,0,0,108,108,254,108,254,108,108,0, /* 272 to 287 */ 16,124,208,124,22,124,16,0,0,198,204,24,48,102,198,0, /* 288 to 303 */ 56,108,56,118,220,204,118,0,24,24,48,0,0,0,0,0, /* 304 to 319 */ 12,24,48,48,48,24,12,0,48,24,12,12,12,24,48,0, /* 320 to 335 */ 0,108,56,254,56,108,0,0,0,24,24,126,24,24,0,0, /* 336 to 351 */ 0,0,0,0,0,24,24,48,0,0,0,126,0,0,0,0, /* 352 to 367 */ 0,0,0,0,0,48,48,0,0,6,12,24,48,96,192,0, /* 368 to 383 */ 60,102,110,126,118,102,60,0,12,28,60,12,12,12,12,0, /* 384 to 399 */ 60,102,6,28,48,96,126,0,60,102,6,28,6,102,60,0, /* 400 to 415 */ 28,60,108,204,254,12,12,0,126,96,96,124,6,102,60,0, /* 416 to 431 */ 60,96,96,124,102,102,60,0,126,6,6,12,24,48,48,0, /* 432 to 447 */ 60,102,102,60,102,102,60,0,60,102,102,62,6,6,60,0, /* 448 to 463 */ 0,48,48,0,0,48,48,0,0,24,24,0,0,24,24,48, /* 464 to 479 */ 12,24,48,96,48,24,12,0,0,0,126,0,0,126,0,0, /* 480 to 495 */ 48,24,12,6,12,24,48,0,60,102,6,12,24,0,24,0, /* 496 to 511 */ 60,102,110,110,108,96,60,0,24,60,102,102,126,102,102,0, /* 512 to 527 */ 124,102,102,124,102,102,124,0,60,102,96,96,96,102,60,0, /* 528 to 543 */ 124,102,102,102,102,102,124,0,126,96,96,124,96,96,126,0, /* 544 to 559 */ 126,96,96,124,96,96,96,0,60,102,96,110,102,102,60,0, /* 560 to 575 */ 102,102,102,126,102,102,102,0,60,24,24,24,24,24,60,0, /* 576 to 591 */ 6,6,6,6,102,102,60,0,102,108,120,112,120,108,102,0, /* 592 to 607 */ 96,96,96,96,96,96,126,0,198,238,254,214,198,198,198,0, /* 608 to 623 */ 102,118,126,110,102,102,102,0,60,102,102,102,102,102,60,0, /* 624 to 639 */ 124,102,102,124,96,96,96,0,60,102,102,102,102,110,60,6, /* 640 to 655 */ 124,102,102,124,102,102,102,0,60,102,96,60,6,102,60,0, /* 656 to 671 */ 126,24,24,24,24,24,24,0,102,102,102,102,102,102,60,0, /* 672 to 687 */ 102,102,102,102,102,60,24,0,198,198,198,214,254,238,198,0, /* 688 to 703 */ 102,102,60,24,60,102,102,0,102,102,102,60,24,24,24,0, /* 704 to 719 */ 126,6,12,24,48,96,126,0,60,48,48,48,48,48,60,0, /* 720 to 735 */ 0,192,96,48,24,12,6,0,60,12,12,12,12,12,60,0, /* 736 to 751 */ 24,60,102,0,0,0,0,0,0,0,0,0,0,0,0,255, /* 752 to 767 */ 24,24,12,0,0,0,0,0,0,0,60,6,62,102,62,0, /* 768 to 783 */ 96,96,96,124,102,102,124,0,0,0,60,102,96,102,60,0, /* 784 to 799 */ 6,6,6,62,102,102,62,0,0,0,60,102,126,96,62,0, /* 800 to 815 */ 28,54,48,124,48,48,48,0,0,0,62,102,102,62,6,60, /* 816 to 831 */ 96,96,124,102,102,102,102,0,24,0,24,24,24,24,24,0, /* 832 to 847 */ 12,0,12,12,12,12,108,56,96,96,102,108,120,108,102,0, /* 848 to 863 */ 48,48,48,48,48,48,24,0,0,0,236,254,214,214,198,0, /* 864 to 879 */ 0,0,124,102,102,102,102,0,0,0,60,102,102,102,60,0, /* 880 to 895 */ 0,0,124,102,102,124,96,96,0,0,62,102,102,62,6,6, /* 896 to 911 */ 0,0,124,102,96,96,96,0,0,0,62,96,60,6,124,0, /* 912 to 927 */ 48,48,124,48,48,54,28,0,0,0,102,102,102,102,62,0, /* 928 to 943 */ 0,0,102,102,102,60,24,0,0,0,198,214,254,238,68,0, /* 944 to 959 */ 0,0,102,60,24,60,102,0,0,0,102,102,102,62,6,60, /* 960 to 975 */ 0,0,126,12,24,48,126,0,28,48,48,96,48,48,28,0, /* 976 to 991 */ 24,24,24,24,24,24,24,0,56,12,12,6,12,12,56,0, /* 992 to 1007 */ 118,220,0,0,0,0,0,0,0,0,24,60,102,102,126,0, /* 1008 to 1023 */ 60,102,96,96,102,60,24,48,102,0,102,102,102,102,62,0, /* 1024 to 1039 */ 14,0,60,102,126,96,60,0,60,102,60,6,62,102,62,0, /* 1040 to 1055 */ 102,0,60,6,62,102,62,0,112,0,60,6,62,102,62,0, /* 1056 to 1071 */ 24,24,60,6,62,102,62,0,0,0,62,96,96,62,24,48, /* 1072 to 1087 */ 60,102,60,102,126,96,60,0,102,0,60,102,126,96,60,0, /* 1088 to 1103 */ 112,0,60,102,126,96,60,0,102,0,24,24,24,24,24,0, /* 1104 to 1119 */ 60,102,24,24,24,24,24,0,112,0,24,24,24,24,24,0, /* 1120 to 1135 */ 198,56,108,198,254,198,198,0,24,24,0,60,102,126,102,0, /* 1136 to 1151 */ 14,0,124,96,120,96,124,0,0,0,126,26,126,216,126,0, /* 1152 to 1167 */ 62,120,216,222,248,216,222,0,60,102,60,102,102,102,60,0, /* 1168 to 1183 */ 102,0,60,102,102,102,60,0,112,0,60,102,102,102,60,0, /* 1184 to 1199 */ 60,102,0,102,102,102,62,0,112,0,102,102,102,102,62,0, /* 1200 to 1215 */ 102,0,102,102,102,62,6,60,102,60,102,102,102,102,60,0, /* 1216 to 1231 */ 102,0,102,102,102,102,60,0,12,12,62,96,96,62,12,12, /* 1232 to 1247 */ 56,108,96,240,96,102,252,0,102,102,60,24,126,24,126,24, /* 1248 to 1263 */ 124,102,102,124,102,111,102,99,14,27,24,60,24,24,120,48, /* 1264 to 1279 */ 14,0,60,6,62,102,62,0,14,0,24,24,24,24,24,0, /* 1280 to 1295 */ 14,0,60,102,102,102,60,0,14,0,102,102,102,102,62,0, /* 1296 to 1311 */ 118,220,0,124,102,102,102,0,126,0,102,118,126,110,102,0, /* 1312 to 1327 */ 62,102,102,62,0,126,0,0,60,102,102,60,0,126,0,0, /* 1328 to 1343 */ 24,0,24,48,96,102,60,0,0,0,0,126,96,96,0,0, /* 1344 to 1359 */ 0,0,0,126,6,6,0,0,198,204,216,62,99,198,12,31, /* 1360 to 1375 */ 198,204,216,54,110,214,31,6,24,0,24,24,24,24,24,0, /* 1376 to 1391 */ 0,54,108,216,108,54,0,0,0,216,108,54,108,216,0,0, /* 1392 to 1407 */ 34,136,34,136,34,136,34,136,85,170,85,170,85,170,85,170, /* 1408 to 1423 */ 221,119,221,119,221,119,221,119,8,8,8,8,8,8,8,8, /* 1424 to 1439 */ 8,8,8,8,248,8,8,8,8,8,8,248,248,8,8,8, /* 1440 to 1455 */ 28,28,28,28,252,28,28,28,0,0,0,0,252,28,28,28, /* 1456 to 1471 */ 0,0,0,248,248,8,8,8,28,28,28,252,252,28,28,28, /* 1472 to 1487 */ 28,28,28,28,28,28,28,28,0,0,0,252,252,28,28,28, /* 1488 to 1503 */ 28,28,28,252,252,0,0,0,28,28,28,28,252,0,0,0, /* 1504 to 1519 */ 8,8,8,248,248,0,0,0,0,0,0,0,248,8,8,8, /* 1520 to 1535 */ 8,8,8,8,15,0,0,0,8,8,8,8,255,0,0,0, /* 1536 to 1551 */ 0,0,0,0,255,8,8,8,8,8,8,8,15,8,8,8, /* 1552 to 1567 */ 0,0,0,0,255,0,0,0,8,8,8,8,255,8,8,8, /* 1568 to 1583 */ 8,8,8,15,15,8,8,8,28,28,28,28,31,28,28,28, /* 1584 to 1599 */ 28,28,28,31,31,0,0,0,0,0,0,31,31,28,28,28, /* 1600 to 1615 */ 28,28,28,255,255,0,0,0,0,0,0,255,255,28,28,28, /* 1616 to 1631 */ 28,28,28,31,31,28,28,28,0,0,0,255,255,0,0,0, /* 1632 to 1647 */ 28,28,28,255,255,28,28,28,8,8,8,255,255,0,0,0, /* 1648 to 1663 */ 28,28,28,28,255,0,0,0,0,0,0,255,255,8,8,8, /* 1664 to 1679 */ 0,0,0,0,255,28,28,28,28,28,28,28,31,0,0,0, /* 1680 to 1695 */ 8,8,8,15,15,0,0,0,0,0,0,15,15,8,8,8, /* 1696 to 1711 */ 0,0,0,0,31,28,28,28,28,28,28,28,255,28,28,28, /* 1712 to 1727 */ 8,8,8,255,255,8,8,8,8,8,8,8,248,0,0,0, /* 1728 to 1743 */ 0,0,0,0,15,8,8,8,255,255,255,255,255,255,255,255, /* 1744 to 1759 */ 0,0,0,0,255,255,255,255,240,240,240,240,240,240,240,240, /* 1760 to 1775 */ 15,15,15,15,15,15,15,15,255,255,255,255,0,0,0,0, /* 1776 to 1791 */ 0,0,118,204,204,204,118,0,60,102,102,124,102,102,124,96, /* 1792 to 1807 */ 126,102,96,96,96,96,96,0,0,0,254,108,108,108,102,0, /* 1808 to 1823 */ 126,102,48,24,48,102,126,0,0,0,62,108,108,108,56,0, /* 1824 to 1839 */ 0,0,102,102,102,102,127,192,0,0,126,216,24,24,12,0, /* 1840 to 1855 */ 124,56,124,214,214,124,56,124,124,198,198,254,198,198,124,0, /*1856to1871*/ 124,198,198,198,108,108,238,0,30,48,24,60,102,102,60,0, /* 1872 to 1887 */ 0,0,126,219,219,126,0,0,3,6,62,107,115,62,96,192, /* 1888 to 1903 */ 30,48,96,126,96,48,30,0,124,198,198,198,198,198,198,0, /* 1904 to 1919 */ 0,126,0,126,0,126,0,0,24,24,126,24,24,0,126,0, /* 1920 to 1935 */ 48,24,12,24,48,0,126,0,12,24,48,24,12,0,126,0, /* 1936 to 1951 */ 14,27,27,24,24,24,24,24,24,24,24,24,24,216,216,112, /* 1952 to 1967 */ 24,24,0,126,0,24,24,0,0,118,220,0,118,220,0,0, /* 1968 to 1983 */ 60,102,102,60,0,0,0,0,0,0,0,24,24,0,0,0, /* 1984 to 1999 */ 0,0,0,0,24,0,0,0,30,24,24,24,24,216,120,56, /* 2000 to 2015 */ 120,108,108,108,108,0,0,0,56,12,24,48,60,0,0,0, /* 2016 to 2031 */ 0,0,60,60,60,60,0,0,0,0,0,0,0,0,0,0 /* 2032 to 2047 */ }; char* tmviewfont=font8x8; #define FONTH 8; #define FONTW 8; #define FONTS 2; tmview/svga/font9x16.h0100644000175000017500000012041307250444702014170 0ustar tmoortmoor/* this the font-file "default8x16" as a c-vektor */ /* done with "hexdump -v -e '"/ * 0x%.4_ax * / " 8 1 "0x%.2x,0, " "\n"' " */ char font9x16[]={ /* 0x0000 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0008 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0010 */ 0x00,0, 0x00,0, 0x7e,0, 0x81,0, 0xa5,0, 0x81,0, 0x81,0, 0xbd,0, /* 0x0018 */ 0x99,0, 0x81,0, 0x81,0, 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0020 */ 0x00,0, 0x00,0, 0x7e,0, 0xff,0, 0xdb,0, 0xff,0, 0xff,0, 0xc3,0, /* 0x0028 */ 0xe7,0, 0xff,0, 0xff,0, 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0030 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x6c,0, 0xfe,0, 0xfe,0, 0xfe,0, /* 0x0038 */ 0xfe,0, 0x7c,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0040 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x7c,0, 0xfe,0, /* 0x0048 */ 0x7c,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0050 */ 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x3c,0, 0x3c,0, 0xe7,0, 0xe7,0, /* 0x0058 */ 0xe7,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0060 */ 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x3c,0, 0x7e,0, 0xff,0, 0xff,0, /* 0x0068 */ 0x7e,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0070 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x3c,0, /* 0x0078 */ 0x3c,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0080 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xe7,0, 0xc3,0, /* 0x0088 */ 0xc3,0, 0xe7,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x0090 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x3c,0, 0x66,0, 0x42,0, /* 0x0098 */ 0x42,0, 0x66,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00a0 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xc3,0, 0x99,0, 0xbd,0, /* 0x00a8 */ 0xbd,0, 0x99,0, 0xc3,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x00b0 */ 0x00,0, 0x00,0, 0x1e,0, 0x0e,0, 0x1a,0, 0x32,0, 0x78,0, 0xcc,0, /* 0x00b8 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00c0 */ 0x00,0, 0x00,0, 0x3c,0, 0x66,0, 0x66,0, 0x66,0, 0x66,0, 0x3c,0, /* 0x00c8 */ 0x18,0, 0x7e,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00d0 */ 0x00,0, 0x00,0, 0x3f,0, 0x33,0, 0x3f,0, 0x30,0, 0x30,0, 0x30,0, /* 0x00d8 */ 0x30,0, 0x70,0, 0xf0,0, 0xe0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00e0 */ 0x00,0, 0x00,0, 0x7f,0, 0x63,0, 0x7f,0, 0x63,0, 0x63,0, 0x63,0, /* 0x00e8 */ 0x63,0, 0x67,0, 0xe7,0, 0xe6,0, 0xc0,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00f0 */ 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0xdb,0, 0x3c,0, 0xe7,0, /* 0x00f8 */ 0x3c,0, 0xdb,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0100 */ 0x00,0, 0x80,0, 0xc0,0, 0xe0,0, 0xf0,0, 0xf8,0, 0xfe,0, 0xf8,0, /* 0x0108 */ 0xf0,0, 0xe0,0, 0xc0,0, 0x80,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0110 */ 0x00,0, 0x02,0, 0x06,0, 0x0e,0, 0x1e,0, 0x3e,0, 0xfe,0, 0x3e,0, /* 0x0118 */ 0x1e,0, 0x0e,0, 0x06,0, 0x02,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0120 */ 0x00,0, 0x00,0, 0x18,0, 0x3c,0, 0x7e,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0128 */ 0x7e,0, 0x3c,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0130 */ 0x00,0, 0x00,0, 0x66,0, 0x66,0, 0x66,0, 0x66,0, 0x66,0, 0x66,0, /* 0x0138 */ 0x66,0, 0x00,0, 0x66,0, 0x66,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0140 */ 0x00,0, 0x00,0, 0x7f,0, 0xdb,0, 0xdb,0, 0xdb,0, 0x7b,0, 0x1b,0, /* 0x0148 */ 0x1b,0, 0x1b,0, 0x1b,0, 0x1b,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0150 */ 0x00,0, 0x7c,0, 0xc6,0, 0x60,0, 0x38,0, 0x6c,0, 0xc6,0, 0xc6,0, /* 0x0158 */ 0x6c,0, 0x38,0, 0x0c,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0160 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0168 */ 0xfe,0, 0xfe,0, 0xfe,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0170 */ 0x00,0, 0x00,0, 0x18,0, 0x3c,0, 0x7e,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0178 */ 0x7e,0, 0x3c,0, 0x18,0, 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0180 */ 0x00,0, 0x00,0, 0x18,0, 0x3c,0, 0x7e,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0188 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0190 */ 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0198 */ 0x18,0, 0x7e,0, 0x3c,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01a0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x0c,0, 0xfe,0, /* 0x01a8 */ 0x0c,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01b0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x30,0, 0x60,0, 0xfe,0, /* 0x01b8 */ 0x60,0, 0x30,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01c0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xc0,0, 0xc0,0, /* 0x01c8 */ 0xc0,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01d0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x24,0, 0x66,0, 0xff,0, /* 0x01d8 */ 0x66,0, 0x24,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01e0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x38,0, 0x7c,0, /* 0x01e8 */ 0x7c,0, 0xfe,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01f0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0xfe,0, 0x7c,0, 0x7c,0, /* 0x01f8 */ 0x38,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0200 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0208 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0210 */ 0x00,0, 0x00,0, 0x18,0, 0x3c,0, 0x3c,0, 0x3c,0, 0x18,0, 0x18,0, /* 0x0218 */ 0x18,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0220 */ 0x00,0, 0x66,0, 0x66,0, 0x66,0, 0x24,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0228 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0230 */ 0x00,0, 0x00,0, 0x00,0, 0x6c,0, 0x6c,0, 0xfe,0, 0x6c,0, 0x6c,0, /* 0x0238 */ 0x6c,0, 0xfe,0, 0x6c,0, 0x6c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0240 */ 0x18,0, 0x18,0, 0x7c,0, 0xc6,0, 0xc2,0, 0xc0,0, 0x7c,0, 0x06,0, /* 0x0248 */ 0x06,0, 0x86,0, 0xc6,0, 0x7c,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, /* 0x0250 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xc2,0, 0xc6,0, 0x0c,0, 0x18,0, /* 0x0258 */ 0x30,0, 0x60,0, 0xc6,0, 0x86,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0260 */ 0x00,0, 0x00,0, 0x38,0, 0x6c,0, 0x6c,0, 0x38,0, 0x76,0, 0xdc,0, /* 0x0268 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0270 */ 0x00,0, 0x30,0, 0x30,0, 0x30,0, 0x60,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0278 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0280 */ 0x00,0, 0x00,0, 0x0c,0, 0x18,0, 0x30,0, 0x30,0, 0x30,0, 0x30,0, /* 0x0288 */ 0x30,0, 0x30,0, 0x18,0, 0x0c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0290 */ 0x00,0, 0x00,0, 0x30,0, 0x18,0, 0x0c,0, 0x0c,0, 0x0c,0, 0x0c,0, /* 0x0298 */ 0x0c,0, 0x0c,0, 0x18,0, 0x30,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02a0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x66,0, 0x3c,0, 0xff,0, /* 0x02a8 */ 0x3c,0, 0x66,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02b0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x7e,0, /* 0x02b8 */ 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02c0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02c8 */ 0x00,0, 0x18,0, 0x18,0, 0x18,0, 0x30,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02d0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7e,0, /* 0x02d8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02e0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02e8 */ 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02f0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x02,0, 0x06,0, 0x0c,0, 0x18,0, /* 0x02f8 */ 0x30,0, 0x60,0, 0xc0,0, 0x80,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0300 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0xce,0, 0xde,0, 0xf6,0, /* 0x0308 */ 0xe6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0310 */ 0x00,0, 0x00,0, 0x18,0, 0x38,0, 0x78,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0318 */ 0x18,0, 0x18,0, 0x18,0, 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0320 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0x06,0, 0x0c,0, 0x18,0, 0x30,0, /* 0x0328 */ 0x60,0, 0xc0,0, 0xc6,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0330 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0x06,0, 0x06,0, 0x3c,0, 0x06,0, /* 0x0338 */ 0x06,0, 0x06,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0340 */ 0x00,0, 0x00,0, 0x0c,0, 0x1c,0, 0x3c,0, 0x6c,0, 0xcc,0, 0xfe,0, /* 0x0348 */ 0x0c,0, 0x0c,0, 0x0c,0, 0x1e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0350 */ 0x00,0, 0x00,0, 0xfe,0, 0xc0,0, 0xc0,0, 0xc0,0, 0xfc,0, 0x06,0, /* 0x0358 */ 0x06,0, 0x06,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0360 */ 0x00,0, 0x00,0, 0x38,0, 0x60,0, 0xc0,0, 0xc0,0, 0xfc,0, 0xc6,0, /* 0x0368 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0370 */ 0x00,0, 0x00,0, 0xfe,0, 0xc6,0, 0x06,0, 0x06,0, 0x0c,0, 0x18,0, /* 0x0378 */ 0x30,0, 0x30,0, 0x30,0, 0x30,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0380 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0xc6,0, /* 0x0388 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0390 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x7e,0, 0x06,0, /* 0x0398 */ 0x06,0, 0x06,0, 0x0c,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03a0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, /* 0x03a8 */ 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03b0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, /* 0x03b8 */ 0x00,0, 0x18,0, 0x18,0, 0x30,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03c0 */ 0x00,0, 0x00,0, 0x00,0, 0x06,0, 0x0c,0, 0x18,0, 0x30,0, 0x60,0, /* 0x03c8 */ 0x30,0, 0x18,0, 0x0c,0, 0x06,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03d0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7e,0, 0x00,0, 0x00,0, /* 0x03d8 */ 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03e0 */ 0x00,0, 0x00,0, 0x00,0, 0x60,0, 0x30,0, 0x18,0, 0x0c,0, 0x06,0, /* 0x03e8 */ 0x0c,0, 0x18,0, 0x30,0, 0x60,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03f0 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0x0c,0, 0x18,0, 0x18,0, /* 0x03f8 */ 0x18,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0400 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xde,0, 0xde,0, /* 0x0408 */ 0xde,0, 0xdc,0, 0xc0,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0410 */ 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x6c,0, 0xc6,0, 0xc6,0, 0xfe,0, /* 0x0418 */ 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0420 */ 0x00,0, 0x00,0, 0xfc,0, 0x66,0, 0x66,0, 0x66,0, 0x7c,0, 0x66,0, /* 0x0428 */ 0x66,0, 0x66,0, 0x66,0, 0xfc,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0430 */ 0x00,0, 0x00,0, 0x3c,0, 0x66,0, 0xc2,0, 0xc0,0, 0xc0,0, 0xc0,0, /* 0x0438 */ 0xc0,0, 0xc2,0, 0x66,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0440 */ 0x00,0, 0x00,0, 0xf8,0, 0x6c,0, 0x66,0, 0x66,0, 0x66,0, 0x66,0, /* 0x0448 */ 0x66,0, 0x66,0, 0x6c,0, 0xf8,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0450 */ 0x00,0, 0x00,0, 0xfe,0, 0x66,0, 0x62,0, 0x68,0, 0x78,0, 0x68,0, /* 0x0458 */ 0x60,0, 0x62,0, 0x66,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0460 */ 0x00,0, 0x00,0, 0xfe,0, 0x66,0, 0x62,0, 0x68,0, 0x78,0, 0x68,0, /* 0x0468 */ 0x60,0, 0x60,0, 0x60,0, 0xf0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0470 */ 0x00,0, 0x00,0, 0x3c,0, 0x66,0, 0xc2,0, 0xc0,0, 0xc0,0, 0xde,0, /* 0x0478 */ 0xc6,0, 0xc6,0, 0x66,0, 0x3a,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0480 */ 0x00,0, 0x00,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xfe,0, 0xc6,0, /* 0x0488 */ 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0490 */ 0x00,0, 0x00,0, 0x3c,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0498 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04a0 */ 0x00,0, 0x00,0, 0x1e,0, 0x0c,0, 0x0c,0, 0x0c,0, 0x0c,0, 0x0c,0, /* 0x04a8 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04b0 */ 0x00,0, 0x00,0, 0xe6,0, 0x66,0, 0x66,0, 0x6c,0, 0x78,0, 0x78,0, /* 0x04b8 */ 0x6c,0, 0x66,0, 0x66,0, 0xe6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04c0 */ 0x00,0, 0x00,0, 0xf0,0, 0x60,0, 0x60,0, 0x60,0, 0x60,0, 0x60,0, /* 0x04c8 */ 0x60,0, 0x62,0, 0x66,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04d0 */ 0x00,0, 0x00,0, 0xc3,0, 0xe7,0, 0xff,0, 0xff,0, 0xdb,0, 0xc3,0, /* 0x04d8 */ 0xc3,0, 0xc3,0, 0xc3,0, 0xc3,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04e0 */ 0x00,0, 0x00,0, 0xc6,0, 0xe6,0, 0xf6,0, 0xfe,0, 0xde,0, 0xce,0, /* 0x04e8 */ 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04f0 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, /* 0x04f8 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0500 */ 0x00,0, 0x00,0, 0xfc,0, 0x66,0, 0x66,0, 0x66,0, 0x7c,0, 0x60,0, /* 0x0508 */ 0x60,0, 0x60,0, 0x60,0, 0xf0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0510 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, /* 0x0518 */ 0xc6,0, 0xd6,0, 0xde,0, 0x7c,0, 0x0c,0, 0x0e,0, 0x00,0, 0x00,0, /* 0x0520 */ 0x00,0, 0x00,0, 0xfc,0, 0x66,0, 0x66,0, 0x66,0, 0x7c,0, 0x6c,0, /* 0x0528 */ 0x66,0, 0x66,0, 0x66,0, 0xe6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0530 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0x60,0, 0x38,0, 0x0c,0, /* 0x0538 */ 0x06,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0540 */ 0x00,0, 0x00,0, 0xff,0, 0xdb,0, 0x99,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0548 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0550 */ 0x00,0, 0x00,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, /* 0x0558 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0560 */ 0x00,0, 0x00,0, 0xc3,0, 0xc3,0, 0xc3,0, 0xc3,0, 0xc3,0, 0xc3,0, /* 0x0568 */ 0xc3,0, 0x66,0, 0x3c,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0570 */ 0x00,0, 0x00,0, 0xc3,0, 0xc3,0, 0xc3,0, 0xc3,0, 0xc3,0, 0xdb,0, /* 0x0578 */ 0xdb,0, 0xff,0, 0x66,0, 0x66,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0580 */ 0x00,0, 0x00,0, 0xc3,0, 0xc3,0, 0x66,0, 0x3c,0, 0x18,0, 0x18,0, /* 0x0588 */ 0x3c,0, 0x66,0, 0xc3,0, 0xc3,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0590 */ 0x00,0, 0x00,0, 0xc3,0, 0xc3,0, 0xc3,0, 0x66,0, 0x3c,0, 0x18,0, /* 0x0598 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05a0 */ 0x00,0, 0x00,0, 0xff,0, 0xc3,0, 0x86,0, 0x0c,0, 0x18,0, 0x30,0, /* 0x05a8 */ 0x60,0, 0xc1,0, 0xc3,0, 0xff,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05b0 */ 0x00,0, 0x00,0, 0x3c,0, 0x30,0, 0x30,0, 0x30,0, 0x30,0, 0x30,0, /* 0x05b8 */ 0x30,0, 0x30,0, 0x30,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05c0 */ 0x00,0, 0x00,0, 0x00,0, 0x80,0, 0xc0,0, 0xe0,0, 0x70,0, 0x38,0, /* 0x05c8 */ 0x1c,0, 0x0e,0, 0x06,0, 0x02,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05d0 */ 0x00,0, 0x00,0, 0x3c,0, 0x0c,0, 0x0c,0, 0x0c,0, 0x0c,0, 0x0c,0, /* 0x05d8 */ 0x0c,0, 0x0c,0, 0x0c,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05e0 */ 0x10,0, 0x38,0, 0x6c,0, 0xc6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05e8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05f0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05f8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, 0x00,0, 0x00,0, /* 0x0600 */ 0x30,0, 0x30,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0608 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0610 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x78,0, 0x0c,0, 0x7c,0, /* 0x0618 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0620 */ 0x00,0, 0x00,0, 0xe0,0, 0x60,0, 0x60,0, 0x78,0, 0x6c,0, 0x66,0, /* 0x0628 */ 0x66,0, 0x66,0, 0x66,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0630 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc0,0, /* 0x0638 */ 0xc0,0, 0xc0,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0640 */ 0x00,0, 0x00,0, 0x1c,0, 0x0c,0, 0x0c,0, 0x3c,0, 0x6c,0, 0xcc,0, /* 0x0648 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0650 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xfe,0, /* 0x0658 */ 0xc0,0, 0xc0,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0660 */ 0x00,0, 0x00,0, 0x38,0, 0x6c,0, 0x64,0, 0x60,0, 0xf0,0, 0x60,0, /* 0x0668 */ 0x60,0, 0x60,0, 0x60,0, 0xf0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0670 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x76,0, 0xcc,0, 0xcc,0, /* 0x0678 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x7c,0, 0x0c,0, 0xcc,0, 0x78,0, 0x00,0, /* 0x0680 */ 0x00,0, 0x00,0, 0xe0,0, 0x60,0, 0x60,0, 0x6c,0, 0x76,0, 0x66,0, /* 0x0688 */ 0x66,0, 0x66,0, 0x66,0, 0xe6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0690 */ 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x38,0, 0x18,0, 0x18,0, /* 0x0698 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06a0 */ 0x00,0, 0x00,0, 0x06,0, 0x06,0, 0x00,0, 0x0e,0, 0x06,0, 0x06,0, /* 0x06a8 */ 0x06,0, 0x06,0, 0x06,0, 0x06,0, 0x66,0, 0x66,0, 0x3c,0, 0x00,0, /* 0x06b0 */ 0x00,0, 0x00,0, 0xe0,0, 0x60,0, 0x60,0, 0x66,0, 0x6c,0, 0x78,0, /* 0x06b8 */ 0x78,0, 0x6c,0, 0x66,0, 0xe6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06c0 */ 0x00,0, 0x00,0, 0x38,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x06c8 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06d0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xe6,0, 0xff,0, 0xdb,0, /* 0x06d8 */ 0xdb,0, 0xdb,0, 0xdb,0, 0xdb,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06e0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xdc,0, 0x66,0, 0x66,0, /* 0x06e8 */ 0x66,0, 0x66,0, 0x66,0, 0x66,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06f0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, /* 0x06f8 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0700 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xdc,0, 0x66,0, 0x66,0, /* 0x0708 */ 0x66,0, 0x66,0, 0x66,0, 0x7c,0, 0x60,0, 0x60,0, 0xf0,0, 0x00,0, /* 0x0710 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x76,0, 0xcc,0, 0xcc,0, /* 0x0718 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x7c,0, 0x0c,0, 0x0c,0, 0x1e,0, 0x00,0, /* 0x0720 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xdc,0, 0x76,0, 0x66,0, /* 0x0728 */ 0x60,0, 0x60,0, 0x60,0, 0xf0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0730 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0x60,0, /* 0x0738 */ 0x38,0, 0x0c,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0740 */ 0x00,0, 0x00,0, 0x10,0, 0x30,0, 0x30,0, 0xfc,0, 0x30,0, 0x30,0, /* 0x0748 */ 0x30,0, 0x30,0, 0x36,0, 0x1c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0750 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xcc,0, 0xcc,0, 0xcc,0, /* 0x0758 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0760 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xc3,0, 0xc3,0, 0xc3,0, /* 0x0768 */ 0xc3,0, 0x66,0, 0x3c,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0770 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xc3,0, 0xc3,0, 0xc3,0, /* 0x0778 */ 0xdb,0, 0xdb,0, 0xff,0, 0x66,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0780 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xc3,0, 0x66,0, 0x3c,0, /* 0x0788 */ 0x18,0, 0x3c,0, 0x66,0, 0xc3,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0790 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xc6,0, 0xc6,0, 0xc6,0, /* 0x0798 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7e,0, 0x06,0, 0x0c,0, 0xf8,0, 0x00,0, /* 0x07a0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0xcc,0, 0x18,0, /* 0x07a8 */ 0x30,0, 0x60,0, 0xc6,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07b0 */ 0x00,0, 0x00,0, 0x0e,0, 0x18,0, 0x18,0, 0x18,0, 0x70,0, 0x18,0, /* 0x07b8 */ 0x18,0, 0x18,0, 0x18,0, 0x0e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07c0 */ 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x00,0, 0x18,0, /* 0x07c8 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07d0 */ 0x00,0, 0x00,0, 0x70,0, 0x18,0, 0x18,0, 0x18,0, 0x0e,0, 0x18,0, /* 0x07d8 */ 0x18,0, 0x18,0, 0x18,0, 0x70,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07e0 */ 0x00,0, 0x00,0, 0x76,0, 0xdc,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07e8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07f0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x6c,0, 0xc6,0, /* 0x07f8 */ 0xc6,0, 0xc6,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0800 */ 0x00,0, 0x00,0, 0x3c,0, 0x66,0, 0xc2,0, 0xc0,0, 0xc0,0, 0xc0,0, /* 0x0808 */ 0xc2,0, 0x66,0, 0x3c,0, 0x0c,0, 0x06,0, 0x7c,0, 0x00,0, 0x00,0, /* 0x0810 */ 0x00,0, 0x00,0, 0xcc,0, 0x00,0, 0x00,0, 0xcc,0, 0xcc,0, 0xcc,0, /* 0x0818 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0820 */ 0x00,0, 0x0c,0, 0x18,0, 0x30,0, 0x00,0, 0x7c,0, 0xc6,0, 0xfe,0, /* 0x0828 */ 0xc0,0, 0xc0,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0830 */ 0x00,0, 0x10,0, 0x38,0, 0x6c,0, 0x00,0, 0x78,0, 0x0c,0, 0x7c,0, /* 0x0838 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0840 */ 0x00,0, 0x00,0, 0xcc,0, 0x00,0, 0x00,0, 0x78,0, 0x0c,0, 0x7c,0, /* 0x0848 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0850 */ 0x00,0, 0x60,0, 0x30,0, 0x18,0, 0x00,0, 0x78,0, 0x0c,0, 0x7c,0, /* 0x0858 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0860 */ 0x00,0, 0x38,0, 0x6c,0, 0x38,0, 0x00,0, 0x78,0, 0x0c,0, 0x7c,0, /* 0x0868 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0870 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x3c,0, 0x66,0, 0x60,0, 0x60,0, /* 0x0878 */ 0x66,0, 0x3c,0, 0x0c,0, 0x06,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0880 */ 0x00,0, 0x10,0, 0x38,0, 0x6c,0, 0x00,0, 0x7c,0, 0xc6,0, 0xfe,0, /* 0x0888 */ 0xc0,0, 0xc0,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0890 */ 0x00,0, 0x00,0, 0xc6,0, 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xfe,0, /* 0x0898 */ 0xc0,0, 0xc0,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08a0 */ 0x00,0, 0x60,0, 0x30,0, 0x18,0, 0x00,0, 0x7c,0, 0xc6,0, 0xfe,0, /* 0x08a8 */ 0xc0,0, 0xc0,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08b0 */ 0x00,0, 0x00,0, 0x66,0, 0x00,0, 0x00,0, 0x38,0, 0x18,0, 0x18,0, /* 0x08b8 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08c0 */ 0x00,0, 0x18,0, 0x3c,0, 0x66,0, 0x00,0, 0x38,0, 0x18,0, 0x18,0, /* 0x08c8 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08d0 */ 0x00,0, 0x60,0, 0x30,0, 0x18,0, 0x00,0, 0x38,0, 0x18,0, 0x18,0, /* 0x08d8 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08e0 */ 0x00,0, 0xc6,0, 0x00,0, 0x10,0, 0x38,0, 0x6c,0, 0xc6,0, 0xc6,0, /* 0x08e8 */ 0xfe,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08f0 */ 0x38,0, 0x6c,0, 0x38,0, 0x00,0, 0x38,0, 0x6c,0, 0xc6,0, 0xc6,0, /* 0x08f8 */ 0xfe,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0900 */ 0x18,0, 0x30,0, 0x60,0, 0x00,0, 0xfe,0, 0x66,0, 0x60,0, 0x7c,0, /* 0x0908 */ 0x60,0, 0x60,0, 0x66,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0910 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x6e,0, 0x3b,0, 0x1b,0, /* 0x0918 */ 0x7e,0, 0xd8,0, 0xdc,0, 0x77,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0920 */ 0x00,0, 0x00,0, 0x3e,0, 0x6c,0, 0xcc,0, 0xcc,0, 0xfe,0, 0xcc,0, /* 0x0928 */ 0xcc,0, 0xcc,0, 0xcc,0, 0xce,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0930 */ 0x00,0, 0x10,0, 0x38,0, 0x6c,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, /* 0x0938 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0940 */ 0x00,0, 0x00,0, 0xc6,0, 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, /* 0x0948 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0950 */ 0x00,0, 0x60,0, 0x30,0, 0x18,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, /* 0x0958 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0960 */ 0x00,0, 0x30,0, 0x78,0, 0xcc,0, 0x00,0, 0xcc,0, 0xcc,0, 0xcc,0, /* 0x0968 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0970 */ 0x00,0, 0x60,0, 0x30,0, 0x18,0, 0x00,0, 0xcc,0, 0xcc,0, 0xcc,0, /* 0x0978 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0980 */ 0x00,0, 0x00,0, 0xc6,0, 0x00,0, 0x00,0, 0xc6,0, 0xc6,0, 0xc6,0, /* 0x0988 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7e,0, 0x06,0, 0x0c,0, 0x78,0, 0x00,0, /* 0x0990 */ 0x00,0, 0xc6,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, /* 0x0998 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x09a0 */ 0x00,0, 0xc6,0, 0x00,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, /* 0x09a8 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x09b0 */ 0x00,0, 0x18,0, 0x18,0, 0x7e,0, 0xc3,0, 0xc0,0, 0xc0,0, 0xc0,0, /* 0x09b8 */ 0xc3,0, 0x7e,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x09c0 */ 0x00,0, 0x38,0, 0x6c,0, 0x64,0, 0x60,0, 0xf0,0, 0x60,0, 0x60,0, /* 0x09c8 */ 0x60,0, 0x60,0, 0xe6,0, 0xfc,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x09d0 */ 0x00,0, 0x00,0, 0xc3,0, 0x66,0, 0x3c,0, 0x18,0, 0xff,0, 0x18,0, /* 0x09d8 */ 0xff,0, 0x18,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x09e0 */ 0x00,0, 0xfc,0, 0x66,0, 0x66,0, 0x7c,0, 0x62,0, 0x66,0, 0x6f,0, /* 0x09e8 */ 0x66,0, 0x66,0, 0x66,0, 0xf3,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x09f0 */ 0x00,0, 0x0e,0, 0x1b,0, 0x18,0, 0x18,0, 0x18,0, 0x7e,0, 0x18,0, /* 0x09f8 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xd8,0, 0x70,0, 0x00,0, 0x00,0, /* 0x0a00 */ 0x00,0, 0x18,0, 0x30,0, 0x60,0, 0x00,0, 0x78,0, 0x0c,0, 0x7c,0, /* 0x0a08 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a10 */ 0x00,0, 0x0c,0, 0x18,0, 0x30,0, 0x00,0, 0x38,0, 0x18,0, 0x18,0, /* 0x0a18 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a20 */ 0x00,0, 0x18,0, 0x30,0, 0x60,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, /* 0x0a28 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a30 */ 0x00,0, 0x18,0, 0x30,0, 0x60,0, 0x00,0, 0xcc,0, 0xcc,0, 0xcc,0, /* 0x0a38 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a40 */ 0x00,0, 0x00,0, 0x76,0, 0xdc,0, 0x00,0, 0xdc,0, 0x66,0, 0x66,0, /* 0x0a48 */ 0x66,0, 0x66,0, 0x66,0, 0x66,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a50 */ 0x76,0, 0xdc,0, 0x00,0, 0xc6,0, 0xe6,0, 0xf6,0, 0xfe,0, 0xde,0, /* 0x0a58 */ 0xce,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a60 */ 0x00,0, 0x3c,0, 0x6c,0, 0x6c,0, 0x3e,0, 0x00,0, 0x7e,0, 0x00,0, /* 0x0a68 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a70 */ 0x00,0, 0x38,0, 0x6c,0, 0x6c,0, 0x38,0, 0x00,0, 0x7c,0, 0x00,0, /* 0x0a78 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a80 */ 0x00,0, 0x00,0, 0x30,0, 0x30,0, 0x00,0, 0x30,0, 0x30,0, 0x60,0, /* 0x0a88 */ 0xc0,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a90 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0xc0,0, /* 0x0a98 */ 0xc0,0, 0xc0,0, 0xc0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0aa0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0x06,0, /* 0x0aa8 */ 0x06,0, 0x06,0, 0x06,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ab0 */ 0x00,0, 0xc0,0, 0xc0,0, 0xc2,0, 0xc6,0, 0xcc,0, 0x18,0, 0x30,0, /* 0x0ab8 */ 0x60,0, 0xce,0, 0x9b,0, 0x06,0, 0x0c,0, 0x1f,0, 0x00,0, 0x00,0, /* 0x0ac0 */ 0x00,0, 0xc0,0, 0xc0,0, 0xc2,0, 0xc6,0, 0xcc,0, 0x18,0, 0x30,0, /* 0x0ac8 */ 0x66,0, 0xce,0, 0x96,0, 0x3e,0, 0x06,0, 0x06,0, 0x00,0, 0x00,0, /* 0x0ad0 */ 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0ad8 */ 0x3c,0, 0x3c,0, 0x3c,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ae0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x36,0, 0x6c,0, 0xd8,0, /* 0x0ae8 */ 0x6c,0, 0x36,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0af0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xd8,0, 0x6c,0, 0x36,0, /* 0x0af8 */ 0x6c,0, 0xd8,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0b00 */ 0x11,0, 0x44,0, 0x11,0, 0x44,0, 0x11,0, 0x44,0, 0x11,0, 0x44,0, /* 0x0b08 */ 0x11,0, 0x44,0, 0x11,0, 0x44,0, 0x11,0, 0x44,0, 0x11,0, 0x44,0, /* 0x0b10 */ 0x55,0, 0xaa,0, 0x55,0, 0xaa,0, 0x55,0, 0xaa,0, 0x55,0, 0xaa,0, /* 0x0b18 */ 0x55,0, 0xaa,0, 0x55,0, 0xaa,0, 0x55,0, 0xaa,0, 0x55,0, 0xaa,0, /* 0x0b20 */ 0xdd,0, 0x77,0, 0xdd,0, 0x77,0, 0xdd,0, 0x77,0, 0xdd,0, 0x77,0, /* 0x0b28 */ 0xdd,0, 0x77,0, 0xdd,0, 0x77,0, 0xdd,0, 0x77,0, 0xdd,0, 0x77,0, /* 0x0b30 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0b38 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0b40 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xf8,0, /* 0x0b48 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0b50 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xf8,0, 0x18,0, 0xf8,0, /* 0x0b58 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0b60 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0xf6,0, /* 0x0b68 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0b70 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, /* 0x0b78 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0b80 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xf8,0, 0x18,0, 0xf8,0, /* 0x0b88 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0b90 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0xf6,0, 0x06,0, 0xf6,0, /* 0x0b98 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0ba0 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0ba8 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0bb0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0x06,0, 0xf6,0, /* 0x0bb8 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0bc0 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0xf6,0, 0x06,0, 0xfe,0, /* 0x0bc8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0bd0 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0xfe,0, /* 0x0bd8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0be0 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xf8,0, 0x18,0, 0xf8,0, /* 0x0be8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0bf0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xf8,0, /* 0x0bf8 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0c00 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x1f,0, /* 0x0c08 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c10 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xff,0, /* 0x0c18 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c20 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, /* 0x0c28 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0c30 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x1f,0, /* 0x0c38 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0c40 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, /* 0x0c48 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c50 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xff,0, /* 0x0c58 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0c60 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x1f,0, 0x18,0, 0x1f,0, /* 0x0c68 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0c70 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x37,0, /* 0x0c78 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0c80 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x37,0, 0x30,0, 0x3f,0, /* 0x0c88 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c90 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x3f,0, 0x30,0, 0x37,0, /* 0x0c98 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0ca0 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0xf7,0, 0x00,0, 0xff,0, /* 0x0ca8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0cb0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, 0x00,0, 0xf7,0, /* 0x0cb8 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0cc0 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x37,0, 0x30,0, 0x37,0, /* 0x0cc8 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0cd0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, 0x00,0, 0xff,0, /* 0x0cd8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ce0 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0xf7,0, 0x00,0, 0xf7,0, /* 0x0ce8 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0cf0 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xff,0, 0x00,0, 0xff,0, /* 0x0cf8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d00 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0xff,0, /* 0x0d08 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d10 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, 0x00,0, 0xff,0, /* 0x0d18 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0d20 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, /* 0x0d28 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0d30 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x3f,0, /* 0x0d38 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d40 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x1f,0, 0x18,0, 0x1f,0, /* 0x0d48 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d50 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x1f,0, 0x18,0, 0x1f,0, /* 0x0d58 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0d60 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x3f,0, /* 0x0d68 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0d70 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0xff,0, /* 0x0d78 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0d80 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xff,0, 0x18,0, 0xff,0, /* 0x0d88 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0d90 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xf8,0, /* 0x0d98 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0da0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x1f,0, /* 0x0da8 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0db0 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x0db8 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x0dc0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, /* 0x0dc8 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x0dd0 */ 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, /* 0x0dd8 */ 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, /* 0x0de0 */ 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, /* 0x0de8 */ 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, /* 0x0df0 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0x00,0, /* 0x0df8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e00 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x76,0, 0xdc,0, 0xd8,0, /* 0x0e08 */ 0xd8,0, 0xd8,0, 0xdc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e10 */ 0x00,0, 0x00,0, 0x78,0, 0xcc,0, 0xcc,0, 0xcc,0, 0xd8,0, 0xcc,0, /* 0x0e18 */ 0xc6,0, 0xc6,0, 0xc6,0, 0xcc,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e20 */ 0x00,0, 0x00,0, 0xfe,0, 0xc6,0, 0xc6,0, 0xc0,0, 0xc0,0, 0xc0,0, /* 0x0e28 */ 0xc0,0, 0xc0,0, 0xc0,0, 0xc0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e30 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0x6c,0, 0x6c,0, 0x6c,0, /* 0x0e38 */ 0x6c,0, 0x6c,0, 0x6c,0, 0x6c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e40 */ 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0xc6,0, 0x60,0, 0x30,0, 0x18,0, /* 0x0e48 */ 0x30,0, 0x60,0, 0xc6,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e50 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7e,0, 0xd8,0, 0xd8,0, /* 0x0e58 */ 0xd8,0, 0xd8,0, 0xd8,0, 0x70,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e60 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x66,0, 0x66,0, 0x66,0, 0x66,0, /* 0x0e68 */ 0x66,0, 0x7c,0, 0x60,0, 0x60,0, 0xc0,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e70 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x76,0, 0xdc,0, 0x18,0, 0x18,0, /* 0x0e78 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e80 */ 0x00,0, 0x00,0, 0x00,0, 0x7e,0, 0x18,0, 0x3c,0, 0x66,0, 0x66,0, /* 0x0e88 */ 0x66,0, 0x3c,0, 0x18,0, 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e90 */ 0x00,0, 0x00,0, 0x00,0, 0x38,0, 0x6c,0, 0xc6,0, 0xc6,0, 0xfe,0, /* 0x0e98 */ 0xc6,0, 0xc6,0, 0x6c,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ea0 */ 0x00,0, 0x00,0, 0x38,0, 0x6c,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x6c,0, /* 0x0ea8 */ 0x6c,0, 0x6c,0, 0x6c,0, 0xee,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0eb0 */ 0x00,0, 0x00,0, 0x1e,0, 0x30,0, 0x18,0, 0x0c,0, 0x3e,0, 0x66,0, /* 0x0eb8 */ 0x66,0, 0x66,0, 0x66,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ec0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7e,0, 0xdb,0, 0xdb,0, /* 0x0ec8 */ 0xdb,0, 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ed0 */ 0x00,0, 0x00,0, 0x00,0, 0x03,0, 0x06,0, 0x7e,0, 0xdb,0, 0xdb,0, /* 0x0ed8 */ 0xf3,0, 0x7e,0, 0x60,0, 0xc0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ee0 */ 0x00,0, 0x00,0, 0x1c,0, 0x30,0, 0x60,0, 0x60,0, 0x7c,0, 0x60,0, /* 0x0ee8 */ 0x60,0, 0x60,0, 0x30,0, 0x1c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ef0 */ 0x00,0, 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, /* 0x0ef8 */ 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f00 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0x00,0, 0x00,0, 0xfe,0, /* 0x0f08 */ 0x00,0, 0x00,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f10 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x7e,0, 0x18,0, /* 0x0f18 */ 0x18,0, 0x00,0, 0x00,0, 0xff,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f20 */ 0x00,0, 0x00,0, 0x00,0, 0x30,0, 0x18,0, 0x0c,0, 0x06,0, 0x0c,0, /* 0x0f28 */ 0x18,0, 0x30,0, 0x00,0, 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f30 */ 0x00,0, 0x00,0, 0x00,0, 0x0c,0, 0x18,0, 0x30,0, 0x60,0, 0x30,0, /* 0x0f38 */ 0x18,0, 0x0c,0, 0x00,0, 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f40 */ 0x00,0, 0x00,0, 0x0e,0, 0x1b,0, 0x1b,0, 0x1b,0, 0x18,0, 0x18,0, /* 0x0f48 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0f50 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0f58 */ 0xd8,0, 0xd8,0, 0xd8,0, 0x70,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f60 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x7e,0, /* 0x0f68 */ 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f70 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x76,0, 0xdc,0, 0x00,0, /* 0x0f78 */ 0x76,0, 0xdc,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f80 */ 0x00,0, 0x38,0, 0x6c,0, 0x6c,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f88 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f90 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, /* 0x0f98 */ 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0fa0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0fa8 */ 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0fb0 */ 0x00,0, 0x0f,0, 0x0c,0, 0x0c,0, 0x0c,0, 0x0c,0, 0x0c,0, 0xec,0, /* 0x0fb8 */ 0x6c,0, 0x6c,0, 0x3c,0, 0x1c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0fc0 */ 0x00,0, 0xd8,0, 0x6c,0, 0x6c,0, 0x6c,0, 0x6c,0, 0x6c,0, 0x00,0, /* 0x0fc8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0fd0 */ 0x00,0, 0x70,0, 0xd8,0, 0x30,0, 0x60,0, 0xc8,0, 0xf8,0, 0x00,0, /* 0x0fd8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0fe0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7c,0, 0x7c,0, 0x7c,0, 0x7c,0, /* 0x0fe8 */ 0x7c,0, 0x7c,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ff0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ff8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, }; char* tmviewfont=font9x16; #define FONTH 16; #define FONTW 9; #define FONTS 0; tmview/svga/writevga.c0100644000175000017500000006134607250444702014426 0ustar tmoortmoor#/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ #include "../src/defs.h" #include #include #include /* option MECK indicates 16-color mode */ int MECK; /* globals used by my painting stuff */ static GraphicsContext offscreen, physicalscreen; static uchar *offscreenmem, *ptorigin; static int enablebackground; static int ofscx1, ofscy1, ofscx2, ofscy2; static int thegraphmode, oldgraphmode; static int fontw, fonth, fonts; /* Function prototypes for ugly font-scaling */ void preparefont(void); void closefont(void); char* expandedfont=NULL; int (*flip)(void)=vga_flip; /* #define DEBUGVGA */ /* debugging makros to report pixel warnings (does not go with PORTRAIT) */ /* #define DEBUGPIXEL */ #ifdef DEBUGPIXEL #define CPT(apt,mess) \ if(apt=VBUF+vgaxdim*vgaydim ) \ {pfprot("(ctp %s)\n",mess); exit(1);} #define CXY(mess) \ if(x2<=x1 || y2<=y1) \ {pfprot("(cxy %s)\n",mess);} #define CXW(mess) \ if(w<0 || h<0) \ {pfprot("(cxw %s)\n",mess);}\ #else /* no debugging */ #define CPT(apt,mess) #define CXW(mess) #define CXY(mess) #endif void vgaclose(void) { vga_setmode(oldgraphmode); closefont(); gl_freecontext(&offscreen); /* does not hurt if not allocated ? */ if(!MECK) gl_freecontext(&physicalscreen); /* does not hurt if not allocated ? */ #ifndef VGAHASWAITIO #ifdef LETSTRYGS pfprot("\n\ warning: display: use polling when rendering eps-figures due to a compiletime-option. If your svgalib is above version 1.2.10, recompiling with \"VGAHASWAITIO\" defined may speed up rendering.\n\n"); #endif #endif } void vgaerror(char* mssg) { pfprot("\nfatal error: display: %s\n",mssg); vgaclose(); exit(1); } void vgaopen(void) { vga_init(); enablebackground=0; /* The svgalib doc marks the background stuff as "may work" */ /* Actually, I dont use the "GOTOBACK" feature. But I've only */ /* tested with svgalib versions which do support it. */ /* Anyway, in case of problems disable the backgound by */ /* undefining LETSTRYBG */ #ifdef LETSTRYBG #ifdef VGA_GOTOBACK if(vga_runinbackground_version()==1) enablebackground=1; #endif #endif } void setpalette(void) { int i,gl; /* grey levels for antialising */ for(i=0;ivgaxdim-1) x2=vgaxdim-1; if(y2>vgaydim-1) y2=vgaydim-1; if(x2truevgaxdim-1) x2=truevgaxdim-1; if(y2>truevgaydim-1) y2=truevgaydim-1; if(x2>3, truevgaxdim>>3, x2-x1+1, y2-y1+1); } } #else /* portrait displays the other way around ... no MECK !! */ void myupdate(int x1, int y1, int x2, int y2) { if(x1<0) x1=0; if(y1<0) y1=0; if(x2>truevgaxdim-1) x2=truevgaxdim-1; if(y2>truevgaydim-1) y2=truevgaydim-1; if(x2= vgaxdim) return; if(dx<0) gl_copybox(-dx,0,vgaxdim+dx,vgaydim,0,0); else gl_copybox(0,0,vgaxdim-dx,vgaydim, dx,0); } void vgayscroll(short dy) { if(abs(dy) >= vgaydim) return; if(dy<0) gl_copybox(0,-dy,vgaxdim,vgaydim+dy,0,0); else gl_copybox(0,0,vgaxdim, vgaydim-dy, 0,dy); } #else /* portrait modus scrolls the other way round */ void vgayscroll(short dy) { if(abs(dy) >= vgaydim) return; if(dy<0) gl_copybox(-dy,0,vgaydim+dy,vgaxdim,0,0); else gl_copybox(0,0,vgaydim-dy,vgaxdim, dy,0); } void vgaxscroll(short dx) { if(abs(dx) >= vgaxdim) return; if(dx>0) gl_copybox(0,dx,vgaydim,vgaxdim-dx,0,0); else gl_copybox(0,0,vgaydim, vgaxdim+dx, 0,-dx); } #endif /**************************************************************************/ /* keys and mice .. */ /* */ /* mini key queue, holds at most one key */ int mode2char=-1; int vgawaitio(fd_set * fdsetin, fd_set * fdsetout, struct timeval *timeout) { #ifdef VGAHASWAITIO int sel; if(mode2char>=0) return(VGA_KEYEVENT); sel=vga_waitevent(VGA_KEYEVENT | VGA_MOUSEEVENT, fdsetin, fdsetout, NULL, timeout); return(sel); #else return(select(FD_SETSIZE,fdsetin, fdsetout,NULL, timeout)); #endif } uchar vgagetchar(int mode) { /* mode==0: get next key, dont block mode==1: get next key, wait mode==2: peek next key, dont block */ uchar input,next1,next2,next3; uchar com=KEYNOP; if(mode2char>=0){ com=mode2char; if(mode!=2) mode2char=-1; return(com); } #ifdef VGAHASWAITIO if(mode==1){ /* hang until event occurs */ vga_waitevent(VGA_KEYEVENT | VGA_MOUSEEVENT, NULL, NULL, NULL, NULL); } #endif input = vga_getkey(); if(input >= ' ' && input < 128) com= input; else switch(input) { case 9: com=KEYTAB; break; case 10: com=KEYRET; break; case 27: /* escape */ next1=0; next2=0; next3=0; next1=vga_getkey(); switch(next1) { case 91: next2=vga_getkey(); switch(next2) { case '6': com= KEYNEXT; break; case '5': com= KEYPREV; break; case 'A': com= KEYUP; break; case 'B': com= KEYDOWN; break; case 'D': com= KEYLEFT; break; case 'C': com= KEYRIGHT; break; case 'G': com= KEYCENTER; break; case '1': com= KEYHOME; break; case '4': com= KEYEND; break; } break; case 0: case 27: com= KEYESC; break; /* allow wild escape abuse */ default: } break; } /*if(input !=0 && input != 255) fprintf(prot,"(vgacommeand: %d %d %d %d)",input,next1,next2,next3);*/ while(input !=0 && input != 255) input=vga_getkey(); if(mode==2 && com!=KEYNOP) mode2char=com; return(com); } int omx, omy; void vgasetmouse(int x, int y) { omx=x; omy=y; #ifdef HASMOUSE mouse_setposition(x,y); #endif } void vgagetmouse(int *x, int *y, int *left, int* right) { #ifdef HASMOUSE int button,nmx,nmy; mouse_update(); nmx = mouse_getx(); nmy = mouse_gety(); if(abs(nmx-omx) > MOUSESPEED) *x=omx+MOUSESPEED*(nmx-omx); else *x=nmx; if(abs(nmy-omy) > MOUSESPEED) *y=omy+MOUSESPEED*(nmy-omy); else *y=nmy; vgasetmouse(*x,*y); button = mouse_getbutton(); *left= (button & MOUSE_LEFTBUTTON); *right=(button & MOUSE_RIGHTBUTTON); #endif #ifndef HASMOUSE *x=omx; *y=omy; *left=0; *right=0; #endif } void vgascreen(int son) { } /**************************************************************************/ /* now the pixel copy stuff. destination is allways the offscreen context */ int mydimm(int color, int dimm) { return(color>>dimm); } void mycopybitsbw(int tx, int ty, int sw, int sh, void* src, int c) { /* this is with self made clipping. no good ? */ /* but it will do for all kind of BMUNIT */ int j,i,supi,supj,mini,minj,sx, skip; BMUNIT *srow, *sbmu; BMUNIT premask, firstpremask; register BMUNIT data, mask; short sbmu_wide; char *ydest, *xdest; uchar blackc; /*fprintf(prot,"(vgacopybitmap1 : tx %d ty %d sw %d sh %d, ...\n", tx,ty,sw, sh); */ mini=minj=0; if(ty> BITS_LOG2; premask = 1 << (BITS_PER_BMUNIT-1); firstpremask = premask >> skip; srow=((BMUNIT*)src)+mini*sbmu_wide+sx; for (i = mini;i>= 1; xdest+=PTDELTAH; } srow+=sbmu_wide; sbmu=srow; ydest+=PTDELTAV; } } void mycopybitsgs(int tx, int ty, int sw, int sh, void* src, int c) { /* this is with self made clipping. no good ? */ /* but it will do for all kind of BMUNIT */ /* compatible to gl_putbox */ int j,i,supi,supj,mini,minj,sx, skip; BMUNIT *srow, *sbmu; BMUNIT premask, firstpremask; BMUNIT data, mask; short sbmu_wide; int rs, firstrs; char *ydest, *xdest; char paintc, sourcec; #ifdef DEBUGVGA pfprot("(mycopybitsgs : ptr 0x%x tx %d ty %d sw %d sh %d, ...", src,tx,ty,sw, sh); pfprot(" clipping : %d %d %d %d, ...\n", ofscx1,ofscy1,ofscx2,ofscy2); #endif mini=minj=0; if(ty>GREYSCALE_LOG2)-1); sx= minj >> (BITS_LOG2-GREYSCALE_LOG2); premask = ((1<> (skip<< GREYSCALE_LOG2); firstrs = BITS_PER_BMUNIT-GREYSCALE - skip*GREYSCALE; srow=((BMUNIT*)src)+mini*sbmu_wide+sx; for (i = mini;i>rs)); */ #ifndef LETSTRYCOLOR (*xdest) |= ((data & mask) >> rs); /* sleezy but fast ..(rs+c)*/ #else if((paintc=(data & mask) >> (rs+c))){ if((sourcec=(*xdest) & (COLORS_PER_GREY-1))){ if((paintc+=sourcec)>COLORS_PER_GREY-1) paintc=COLORS_PER_GREY-1; (*xdest) &= ~(COLORS_PER_GREY-1); } (*xdest) |=paintc; } #endif mask >>= GREYSCALE; rs-=GREYSCALE; xdest+=PTDELTAH; } srow+=sbmu_wide; sbmu=srow; ydest+=PTDELTAV; } #ifdef DEBUGVGA pfprot("done)"); #endif } void mycopybits88(int tx, int ty, int sw, int sh, char* src) { /* this is with self made clipping. no good ? */ /* copy bytes to bytes */ /* compatible to gl_putbox */ int j,i,supi,supj,mini,minj; char *srow, *sbmu; char *ydest, *xdest; mini=minj=0; if(tyofscy2+1) h=ofscy2+1-ty; if(tx+w>ofscx2+1) w=ofscx2+1-tx; if(w <= 0 || h<= 0 || c==0) { /*fprintf(prot,"clipped all away or white. no drawings)\n"); */ return; } CXW("rector"); ydest=ptorigin+ty*PTDELTAV+tx*PTDELTAH; /* fprintf(prot,"clipped or box: tx %d ty %d w %d h %d \n", tx,ty,w,h); */ paintc=0; for (;h>0;h--) { xdest=ydest; for (i=w;i>0;i--) { CPT(xdest,"rector") #ifndef LETSTRYCOLOR (*xdest)|=c; /* sleezy but fast */ #else if((sourcec=(*xdest) & (COLORS_PER_GREY-1))){ if((paintc =c+sourcec)>COLORS_PER_GREY-1) paintc=COLORS_PER_GREY-1; (*xdest) &= ~(COLORS_PER_GREY-1); (*xdest) |=paintc; } else { (*xdest) |=c; } #endif xdest+=PTDELTAH; } ydest+=PTDELTAV; } } void myfillboxbg(int tx, int ty, int w, int h, int c) { char *ydest; int i; register char *xdest; register char xdc; /* fprintf(prot,"(vgafillboxor : tx %d ty %d w %d h %d, ...\n", tx,ty,w,h); */ if(tyofscy2+1) h=ofscy2+1-ty; if(tx+w>ofscx2+1) w=ofscx2+1-tx; if(tx+w>vgaxdim) w=vgaxdim-tx; if(w <= 0 || h<= 0) { /*fprintf(prot,"clipped all away. no drawings)\n"); */ return; } CXW("rectbg"); ydest=ptorigin+ty*PTDELTAV+tx*PTDELTAH; /* fprintf(prot,"clipped bgbox : tx %d ty %d w %d h %d \n", tx,ty,w,h); */ for (;h>0;h--) { xdest=ydest; for (i=w;i>0;i--) { CPT(xdest,"rectbg") xdc=*xdest; if(xdc) { /*if(xdc>c) *xdest=c;*/ /* transparent modus */ if(xdc>BACKCOLS && xdc!= c) *xdest=MIXEDCOL; /* mixing modus */ } else *xdest=c; xdest+=PTDELTAH; } ydest+=PTDELTAV; } } void myfillbox(int tx, int ty, int w, int h, int c) { char *ydest; int i; register char *xdest; /* fprintf(prot,"(vgafillbox : tx %d ty %d w %d h %d, ...\n", tx,ty,w,h); */ if(tyofscy2+1) h=ofscy2+1-ty; if(tx+w>ofscx2+1) w=ofscx2+1-tx; if(tx+w>vgaxdim) w=vgaxdim-tx; if(w <= 0 || h<= 0) { /*fprintf(prot,"clipped all away. no drawings)\n"); */ return; } CXW("rectbg"); ydest=ptorigin+ty*PTDELTAV+tx*PTDELTAH; /* pfprot("clipped box : tx %d ty %d w %d h %d \n", tx,ty,w,h); */ for (;h>0;h--) { xdest=ydest; for (i=w;i>0;i--) { CPT(xdest,"rectbg") (*(xdest))=c; xdest+=PTDELTAH; } ydest+=PTDELTAV; } } int vgasetstatuslines(int n) { /* pfprot("(setstatus %d ... \n",n); */ vgastatuslines=MAX(0,MIN(vgamaxstatuslines,n)); vgaydim= truevgaydim- vgastatuslines* vgastatushight; vgaxdim= truevgaxdim; mysetclipof(); /* not clipped !! */ if(vgastatuslines!=vgamaxstatuslines) myfillbox(0,vgaydim,truevgaxdim,vgastatuslines*vgastatushight,TEXTBACKCOL); else myfillbox(0,0,truevgaxdim,truevgaydim,TEXTBACKCOL); myupdate(0,0,vgaxdim-1,truevgaydim-1); mysetclip(0,0,vgaxdim-1,vgaydim-1); return(vgastatuslines); /* pfprot("... done setstatus)\n"); */ } void vgaupdatestatus(void) { mysetclipof(); myupdate(0, vgaydim,truevgaxdim-1,truevgaydim-1); mysetclip(0,0,vgaxdim-1,vgaydim-1); } void vgadrawstatus(char chr, int line, int pos) { if(line>=vgastatuslines || line <0) return; if(pos>=vgastatuslen || pos <0) return; mysetclipof(); /* chr=(line&0x0f)*16 + (pos&0x0f); *//* test charset */ mycopybits88(pos*fontw+1, vgaydim+(line+1)* vgastatushight-fonth, fontw, fonth, expandedfont + (unsigned char) chr *fonth*fontw); mysetclip(0,0,vgaxdim-1,vgaydim-1); /* pfprot("(vgadrawstatus [%c] l %d p %d )",chr,line,pos); */ } void (*vgaupdate)(int, int, int, int) = myupdate; void (*vgasetclip)(int, int, int, int) = mysetclip; void (*vgadrawrect)(int x, int y, int w, int h, int c) = myfillbox; void (*vgadrawrector)(int x, int y, int w, int h, int c) = myfillboxor; void (*vgadrawrectbg)(int x, int y, int w, int h, int c) = myfillboxbg; int (*vgadimm)(int, int) = mydimm; void (*vgacopybitmapgs)(int x,int y,int w,int h,void* src,int c)=mycopybitsgs; void (*vgacopybitmapbw)(int x,int y,int w,int h,void* src,int c)=mycopybitsbw; /***************************************************************************/ /* now the font stuff ... */ /* #include "9x14thin.h" */ /* #include "gekl9x16.h" */ #include "font9x16.h" /* now the pronounced ugly fontscaling code: */ void preparefont(void) { long i; fonth=FONTH; fontw=FONTW; fonts=FONTS; allocmem(&expandedfont,256L*fontw*fonth); gl_expandfont(fontw,fonth,TEXTCOL,tmviewfont,expandedfont); for(i=0;i<256L*fontw*fonth;i++) if(expandedfont[i]==0) expandedfont[i]=TEXTBACKCOL; } void closefont(void) { freemem(&expandedfont); } tmview/svga/defssvga.h0100644000175000017500000003053707250444702014403 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ /* defs for the svga version of tmview */ /* will be copyed to "src/defs.h" */ /* includes "src/defsgen.h" */ /* essential for I/O primitives and signalhandling: don't use pure posix, use either BSD- or GNU-extensions. */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include /* *************************************************************************** startup values, commandline default: here only those which tend to be deveice/platform dependant. see "src/defsgen.h" for more options *************************************************************************** */ /* set the default displaysize (option -d) */ /* only svgamodes 5, 10, 11 and 12 ! */ /* if set, $GSVGAMODE is ignored ! */ /* Example 1: ignore $GSVGAMODE, use mode 10 always as default*/ /* #define VGAXDIM 640 */ /* #define VGAYDIM 480 */ /* Example 2: use $GSVGAMODE as default . must be set to 5,10,11 or 12 therefore */ #define VGAXDIM 0 #define VGAYDIM 0 /* Portrait modus: */ /* This is ment for people running a standard monitor */ /* with a standard svga-card, but turning the monitor */ /* physicaly to be in portrait-format. Those freaks need */ /* the screen image shown by tmview turned by 90 degree */ /* too. This results in portrait-format viewing without */ /* bying expensive hardware. It results in kernel-hacking */ /* too, because the console has to be turned aswell, to */ /* avoid getting tiered by turning the screen everey 5 */ /* minutes. Note: VGAXDIM and VGAYDIM are w.r.t. the */ /* screen before beeing turned. Note: portrait does not */ /* go with 10color mode. */ /* All in all this results in: */ /* Realy nice for freaks, not usable for others. */ /* #define PORTRAIT */ /* set defaults for the options -t, -f, -g and -n */ #define TFMDIR "./:/usr/lib/texmf/fonts//:/usr/local/teTeX/texmf/fonts//" #define PKDIR "./:/usr/lib/texmf/fonts//:/usr/local/teTeX/texmf/fonts//" #define VFDIR "./:/usr/lib/texmf/fonts//:/usr/local/teTeX/texmf/fonts//" #define PKNAME "@N.@Mpk" /* set defaults for the option -s */ /* and fallback systemwide startupfile */ #ifndef PORTRAIT #define STARTUPFILENAME "~/.dvisvga" #define SYSTEMSTARTUPFILENAME "/etc/dvisvga" #else #define STARTUPFILENAME "~/.dviport" #define SYSTEMSTARTUPFILENAME "/etc/dviport" #endif /* Users kept asking about using kpathsea ... so: */ /* to use kpathsea, define KPATHSEA below. to use tmviews built in */ /* font searching, don't define KPATHSEA. */ /* Since I'm not distributing KPATHSEA, you'll have to get the library*/ /* from somewhere. See CTAN. I did test with the library which comes */ /* with dviljk-2.5. Note: it makes not much sense to use a kpathsea */ /* different from the one of the rest of your TeX-installation. E.g. */ /* teTeX users best use the kpathsea from the teTeX sources. After all*/ /* configuring tmview to go with kpathsea requires some knowhow ... */ /* */ /* I've located two different kinds of initializing kpathsea, */ /* depending on which kpathsea is used (actually I've got this info */ /* from the diff-file of debian/slink) Below exactly one of */ /* KPATHSEAOLDSTYLE and KPATHSEANEWSTYLE need to be defined to set up */ /* tmview to go with your kpathsea. To figure out the right choice, */ /* visit your /usr//include/kpathsea/proginit.h: if it defines the */ /* function kpse_init_prog to have 5 arguments by "P5H", then its */ /* KPATHSEAOLDSTYLE. Probably, you will go into details and check the */ /* meaning of these arguments. See also "./tmview/src/tmview.c". */ /* However, if kpse_init_prog is defined to have 4 arguments ("P4H"),*/ /* its KPATHSEANEWSTYLE. */ /* */ /* Running MakeTeXPK by kpathsea within dvisvga may be enabled below, */ /* but is not recommended: console switching will pause MakeTeXPK, */ /* you will have to wait for MakeTeXPK while viewing the empty screen.*/ /* Thus, running once in a while "./missfont.log" manualy seems more */ /* "comfortable" to me. For svgalib>=1.3.0 and kernel=>2.0 there */ /* might be a solution on this topic. See below LETSTRYBG. */ /* #define KPATHSEA */ #ifdef KPATHSEA #define KPATHMODE NULL /* put f.e. "cx" here, to consist on cx fonts */ #define KPATHMAKE 0 /* put 1 here, to make kpathsea run MakeTeXPK,*/ #define KPATHDEFF "cmr10" /* fallback font */ #define KPATHSEANEWSTYLE /* new=fine for teTeX from debian(see above)*/ /*#define KPATHSEAOLDSTYLE*//* old=fine for NTeX from Slakware */ #endif /* support for eps-figurs by calling ghostscript */ #define LETSTRYGS /* disable gs as startup-default. enable by command */ /* #define GSDEFOFF */ /*#define GSBIN "/usr/bin/gs" *//* absolute path of binary */ #define GSBIN "gs" /* name of binary, use $PATH to locate it */ /* extra pixel to avoid clipping .. */ #define GSEXTRAPXL 3 /* plus 3 pxl on screen */ #define GSEXTRAPT 3 /* plus 3 1/72 in epsfile */ /* greyscaling for eps-files */ /*#define GSGREY 1 *//* 1x1 pxl <> turned off */ #define GSGREY 2 /* 2x2 pxl <> cheap */ /*#define GSGREY 4 *//* 4x4 pxl <> expensive */ /* bufferlength for reading from gs */ #define GSBLOCKLEN 8192L /* arguments for calling gs */ #define GSARGLEN 40 /* max length og args */ #define GSARG0 "gs" #define GSARG1 "-sDEVICE=bit" #define GSARG2 "-sOutputFile=-" #define GSARG3 "-dNOPAUSE" #define GSARG4 "-dSAFER" #define GSARG5 "-q" #define GSARGPATH "-I%s" #define GSARGSIZE "-g%dx%d" #define GSARGRES "-r%.2fx%.2f" #define GSARGLAST "-" #define GSCODEINTRO " /SDict 200 dict def SDict begin /showpage { } def " #define GSCODESCALE " %.5f %.5f scale " #define GSCODETRANS " %.2f %.2f translate " #define GSCODEROTATE " %.2f rotate " #define GSCODEFILE " (%s) run " #define GSCODEQUIT " end showpage quit " /* a little support for color specials */ #define LETSTRYCOLOR /* *************************************************************************** more internal stuff, make tmview go with svgalib *************************************************************************** */ /* be careful with storge types !!! */ #define BMLONG32 /* for architectures where "long int" has 32bits, e.g. i386 */ /* #define BMLONG64 *//* for architectures where "long int" has 64bits, e.g. alpha */ /* #define GREYINBMU *//* waste memory. may be a bit faster */ /* if DOSFILES is defined, a dosfilesystem is expected, */ /* incl. ugly naming conventions, like drive-letters and "\" instead ob "/". */ /* Dont use this with unix sytems */ /* #define DOSFILES */ /* yes, gnu does support the gnu-extensions to getcwd() ..*/ #define GNU_GETCWD /* waiting for IO available: dont do polling */ /* This requires svgalib>=1.2.11 and it IS DEFINED in the MakeSVGA. */ /* To undefine, edit MakeSVGA */ /* #define VGAHASWAITIO */ /* svgalib>=1.2.11 with linux kernels>=2.0.? support running in backround.*/ /* I tested this with svgalib 1.3.0. Its fine, as using the background */ /* option means that eps-rendering by gs and font-generation by kpathsea */ /* will not be paused by switching virtual console. Thats what we want. */ /* However, it may sometimes cause problems and therefore needs to be */ /* enabled by defining LETSTRYBG. Anyway, background running is not */ /* supported in the 16-color mode, the former MECK option. */ /* #define LETSTRYBG */ #define HASMOUSE /* do this to have a little mousesoupport */ /* #define HASWINDOWS *//* svgalib is no window system */ #define MOUSESPEED 3 /* speed of mousemotion */ /* #define TRACKBALL 1 *//* scrolling by mouse only if button pressed */ /* the following sets the way things go on the screen resp. window. tmview allways keeps the screen/windows contents in an internal buffer. You must define exactly one of the below options. To provide flickering, you may define NOTHINGONSCREEN, making tmview updating the screen from the buffer when the drawings are compleeted. On some Systems this will result in the best performance, depending on the screen driver. Set ALLONSCREEN, to make tmview drawing allways directly to the screen/window. This might result in higher performance, at the cost of some flickering. Set CURSORSNOTONSCREEEN to get a mixture of the above: when only cursormovement is to be drawn, use the buffer. If more than that is to be drawn, dont use the buffer. Set SCROLLONSCREEN to get a mixture of the above: when scrolling is to be done, use an XRequest directly. Anything else is done in the buffer. */ #define ALLONSCREEN 0 #define NOTHINGONSCREEN 1 #define CURSORSNOTONSCREEN 0 #define SCROLLONSCREEN 0 /* ************************************************************************ now there will be some colorstuff. colors are changable here. but it's the best to leave this untouched ... ************************************************************************* */ /* The below definitions replace color makros by variables. They only depend on the former MECK compile-time option, which became a runtime option in version 99.06. So they still are sort of constants but need to be set in vgaopen() and vgagraph(). This doesnt look good, but it should work out fine. */ #define COLORS_PER_GREY varColorspergrey #define WHITECOL varWhitecol #define BLACKCOL varBlackcol #define BORDERCOL varBordercol #define TEXTCOL varTextcol #define TEXTBACKCOL varTextbackcol #define FRAMECOL varFramecol #define TFMCOL varTfmcol #define RECTCOL varRectcol #define BACKCOLS varBackcols #define MARKSCOL varMarkscol #define MARKHCOL varMarkhcol #define FOUNDCOL varFoundcol #define HREFCOL varHrefcol #define MARKDCOL varMarkdcol #define MIXEDCOL varMixedcol #define NUMBER_OF_COLORS varNumberofcolors /* definition of some rgb triples, 6-bit-per-componente */ /* to make green more blue, edit here. */ #define PALWHITE 63,63,63 /* white */ #define PALLGREY 55,55,55 /* light grey */ #define PALBLACK 0,0,0 /* black */ #define PALDRED 40,10,5 /* dark red */ #define PALDGREEN 0,40,10 /* dark green */ #define PALDBLUE 3,10,40 /* dark blue */ #define PALLRED 63,50,43 /* light red */ #define PALLGREEN 40,63,50 /* light green */ #define PALLBLUE 43,50,63 /* light blue */ /* definition of colors when in 256-color-mode */ /* this determines the colors on the display */ /* the following may be changed without any (?) restictions.*/ /* setting */ /* #define SETPALFRAMECOL FRAMECOL,0,63,0 */ /* results in having a bright green as framecolor */ /* BUT: this will not affect the 16-color-mode as this */ /* is hardwired. */ #define SETPALTEXTCOL TEXTCOL,PALBLACK #define SETPALTEXTBACKCOL TEXTBACKCOL,PALLGREY #define SETPALFRAMECOL FRAMECOL,PALDRED #define SETPALBORDERCOL BORDERCOL,PALDGREEN #define SETPALTFMCOL TFMCOL,PALDBLUE #define SETPALRECTCOL RECTCOL,PALDBLUE #define SETPALMARKSCOL MARKSCOL,PALLBLUE #define SETPALMARKHCOL MARKHCOL,PALLGREEN #define SETPALFOUNDCOL FOUNDCOL,PALLGREEN #define SETPALHREFCOL HREFCOL,PALLBLUE #define SETPALMARKDCOL MARKDCOL,PALLRED #define SETPALMIXEDCOL MIXEDCOL,PALLGREY /* *************************************************************************** include general topics *************************************************************************** */ #include "defsgen.h" tmview/svga/writevga.h0100644000175000017500000000205507250444702014423 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ void vgaopen(void); void vgagraph(void); void vgaxscroll(short); void vgayscroll(short); void vgaclose(void); unsigned char vgagetchar(int); void vgasetmouse(int, int); void vgagetmouse(int*, int*, int*, int*); int vgawaitio(fd_set * fdsetin, fd_set * fdsetout, struct timeval *timeout); void (*vgasetclip)(int, int, int, int); void (*vgaupdate)(int, int, int, int); void (*vgadrawrect)(int, int, int, int, int); void (*vgadrawrector)(int, int, int, int, int); void (*vgadrawrectbg)(int, int, int, int, int); void (*vgacopybitmapgs)(int, int, int, int, void*, int); void (*vgacopybitmapbw)(int, int, int, int, void*, int); int (*vgadimm)(int, int); void vgascreen(int); void vgadrawstatus(char, int, int); void vgaupdatestatus(void); int vgasetstatuslines(int); tmview/svga/9x14thin.h0100644000175000017500000011137207250444702014166 0ustar tmoortmoor/* this the font-file "8x14thin" as a c-vektor */ /* done with "hexdump -v -e '"/* 0x%.4_ax * / " 7 1 "0x%.2x,0, " "\n"' " */ char thin9x14[]={ /* 0x0000 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0007 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x000e */ 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x82,0, 0xaa,0, 0x82,0, /* 0x0015 */ 0xaa,0, 0xba,0, 0x44,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x001c */ 0x00,0, 0x00,0, 0x38,0, 0x7c,0, 0xfe,0, 0xd6,0, 0xfe,0, /* 0x0023 */ 0xba,0, 0xc6,0, 0x7c,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x002a */ 0x00,0, 0x00,0, 0x44,0, 0xee,0, 0xee,0, 0xfe,0, 0x7c,0, /* 0x0031 */ 0x7c,0, 0x38,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0038 */ 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x38,0, 0x7c,0, 0xfe,0, /* 0x003f */ 0x7c,0, 0x38,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0046 */ 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x38,0, 0x10,0, 0xfe,0, /* 0x004d */ 0xee,0, 0x54,0, 0x10,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0054 */ 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x7c,0, 0xfe,0, 0xfe,0, /* 0x005b */ 0xee,0, 0x54,0, 0x10,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0062 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x38,0, /* 0x0069 */ 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0070 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xe7,0, 0xc3,0, /* 0x0077 */ 0xc3,0, 0xe7,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x007e */ 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x24,0, 0x42,0, 0x42,0, /* 0x0085 */ 0x42,0, 0x24,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x008c */ 0xff,0, 0xff,0, 0xff,0, 0xe7,0, 0xdb,0, 0xbd,0, 0xbd,0, /* 0x0093 */ 0xbd,0, 0xdb,0, 0xe7,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x009a */ 0x00,0, 0x00,0, 0x00,0, 0x0e,0, 0x06,0, 0x0a,0, 0x70,0, /* 0x00a1 */ 0x88,0, 0x88,0, 0x88,0, 0x70,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00a8 */ 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x44,0, 0x44,0, 0x38,0, /* 0x00af */ 0x10,0, 0x10,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00b6 */ 0x00,0, 0x00,0, 0x18,0, 0x1c,0, 0x14,0, 0x14,0, 0x10,0, /* 0x00bd */ 0x10,0, 0x30,0, 0x70,0, 0x60,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00c4 */ 0x00,0, 0x00,0, 0x30,0, 0x38,0, 0x2c,0, 0x66,0, 0xe2,0, /* 0x00cb */ 0xc2,0, 0x06,0, 0x0e,0, 0x0c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00d2 */ 0x00,0, 0x00,0, 0x10,0, 0x54,0, 0x38,0, 0x44,0, 0xc6,0, /* 0x00d9 */ 0x44,0, 0x38,0, 0x54,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00e0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xc0,0, 0xf8,0, 0xfe,0, /* 0x00e7 */ 0xf8,0, 0xc0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00ee */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x06,0, 0x3e,0, 0xfe,0, /* 0x00f5 */ 0x3e,0, 0x06,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00fc */ 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x7c,0, 0x10,0, 0x10,0, /* 0x0103 */ 0x7c,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x010a */ 0x00,0, 0x00,0, 0x44,0, 0x44,0, 0x44,0, 0x44,0, 0x44,0, /* 0x0111 */ 0x44,0, 0x00,0, 0x00,0, 0x44,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0118 */ 0x00,0, 0x00,0, 0x7e,0, 0x8a,0, 0x8a,0, 0x8a,0, 0x7a,0, /* 0x011f */ 0x0a,0, 0x0a,0, 0x0a,0, 0x0a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0126 */ 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x40,0, 0x30,0, 0x28,0, /* 0x012d */ 0x18,0, 0x04,0, 0x44,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0134 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, /* 0x013b */ 0xfe,0, 0xfe,0, 0xfe,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0142 */ 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x7c,0, 0x10,0, 0x10,0, /* 0x0149 */ 0x7c,0, 0x38,0, 0x10,0, 0x00,0, 0xfe,0, 0x00,0, 0x00,0, /* 0x0150 */ 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x7c,0, 0x10,0, 0x10,0, /* 0x0157 */ 0x10,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x015e */ 0x00,0, 0x00,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, /* 0x0165 */ 0x7c,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x016c */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x08,0, 0x0c,0, 0xfe,0, /* 0x0173 */ 0x0c,0, 0x08,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x017a */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x20,0, 0x60,0, 0xfe,0, /* 0x0181 */ 0x60,0, 0x20,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0188 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x80,0, 0x80,0, 0x80,0, /* 0x018f */ 0x80,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0196 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x28,0, 0x6c,0, 0xfe,0, /* 0x019d */ 0x6c,0, 0x28,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01a4 */ 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x38,0, 0x7c,0, /* 0x01ab */ 0x7c,0, 0xfe,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01b2 */ 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0xfe,0, 0x7c,0, 0x7c,0, /* 0x01b9 */ 0x38,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01c0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01c7 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01ce */ 0x00,0, 0x00,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, /* 0x01d5 */ 0x10,0, 0x00,0, 0x00,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01dc */ 0x00,0, 0x00,0, 0x28,0, 0x28,0, 0x28,0, 0x00,0, 0x00,0, /* 0x01e3 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01ea */ 0x00,0, 0x00,0, 0x28,0, 0x28,0, 0xfe,0, 0x28,0, 0x28,0, /* 0x01f1 */ 0x28,0, 0xfe,0, 0x28,0, 0x28,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01f8 */ 0x00,0, 0x00,0, 0x10,0, 0x7c,0, 0x92,0, 0x90,0, 0x7c,0, /* 0x01ff */ 0x12,0, 0x92,0, 0x7c,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0206 */ 0x00,0, 0x00,0, 0x40,0, 0xa2,0, 0xa4,0, 0x48,0, 0x10,0, /* 0x020d */ 0x24,0, 0x4a,0, 0x8a,0, 0x04,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0214 */ 0x00,0, 0x00,0, 0x30,0, 0x48,0, 0x48,0, 0x30,0, 0x50,0, /* 0x021b */ 0x8a,0, 0x84,0, 0x84,0, 0x7a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0222 */ 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x08,0, 0x10,0, 0x00,0, /* 0x0229 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0230 */ 0x00,0, 0x00,0, 0x08,0, 0x10,0, 0x20,0, 0x20,0, 0x20,0, /* 0x0237 */ 0x20,0, 0x20,0, 0x10,0, 0x08,0, 0x00,0, 0x00,0, 0x00,0, /* 0x023e */ 0x00,0, 0x00,0, 0x20,0, 0x10,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0245 */ 0x08,0, 0x08,0, 0x10,0, 0x20,0, 0x00,0, 0x00,0, 0x00,0, /* 0x024c */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x28,0, 0x10,0, 0x7c,0, /* 0x0253 */ 0x10,0, 0x28,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x025a */ 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x10,0, 0x10,0, 0xfe,0, /* 0x0261 */ 0x10,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0268 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x026f */ 0x00,0, 0x00,0, 0x30,0, 0x30,0, 0x10,0, 0x20,0, 0x00,0, /* 0x0276 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, /* 0x027d */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0284 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x028b */ 0x00,0, 0x00,0, 0x30,0, 0x30,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0292 */ 0x00,0, 0x00,0, 0x00,0, 0x02,0, 0x04,0, 0x08,0, 0x10,0, /* 0x0299 */ 0x20,0, 0x40,0, 0x80,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02a0 */ 0x00,0, 0x00,0, 0x78,0, 0x84,0, 0x8c,0, 0x94,0, 0xa4,0, /* 0x02a7 */ 0xc4,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02ae */ 0x00,0, 0x00,0, 0x10,0, 0x30,0, 0x50,0, 0x10,0, 0x10,0, /* 0x02b5 */ 0x10,0, 0x10,0, 0x10,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02bc */ 0x00,0, 0x00,0, 0x78,0, 0x84,0, 0x04,0, 0x08,0, 0x30,0, /* 0x02c3 */ 0x40,0, 0x80,0, 0x80,0, 0xfc,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02ca */ 0x00,0, 0x00,0, 0x78,0, 0x84,0, 0x04,0, 0x04,0, 0x38,0, /* 0x02d1 */ 0x04,0, 0x04,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02d8 */ 0x00,0, 0x00,0, 0x08,0, 0x18,0, 0x28,0, 0x48,0, 0x88,0, /* 0x02df */ 0x88,0, 0xfe,0, 0x08,0, 0x08,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02e6 */ 0x00,0, 0x00,0, 0xfc,0, 0x80,0, 0x80,0, 0x80,0, 0xf8,0, /* 0x02ed */ 0x04,0, 0x04,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02f4 */ 0x00,0, 0x00,0, 0x78,0, 0x84,0, 0x80,0, 0x80,0, 0xf8,0, /* 0x02fb */ 0x84,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0302 */ 0x00,0, 0x00,0, 0xfc,0, 0x04,0, 0x04,0, 0x08,0, 0x10,0, /* 0x0309 */ 0x20,0, 0x20,0, 0x20,0, 0x20,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0310 */ 0x00,0, 0x00,0, 0x78,0, 0x84,0, 0x84,0, 0x84,0, 0x78,0, /* 0x0317 */ 0x84,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x031e */ 0x00,0, 0x00,0, 0x78,0, 0x84,0, 0x84,0, 0x84,0, 0x7c,0, /* 0x0325 */ 0x04,0, 0x04,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x032c */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x18,0, /* 0x0333 */ 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, /* 0x033a */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x18,0, /* 0x0341 */ 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x08,0, 0x10,0, 0x00,0, /* 0x0348 */ 0x00,0, 0x00,0, 0x02,0, 0x04,0, 0x08,0, 0x10,0, 0x20,0, /* 0x034f */ 0x10,0, 0x08,0, 0x04,0, 0x02,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0356 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0x00,0, /* 0x035d */ 0x00,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0364 */ 0x00,0, 0x00,0, 0x20,0, 0x10,0, 0x08,0, 0x04,0, 0x02,0, /* 0x036b */ 0x04,0, 0x08,0, 0x10,0, 0x20,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0372 */ 0x00,0, 0x00,0, 0x7c,0, 0x82,0, 0x82,0, 0x02,0, 0x0c,0, /* 0x0379 */ 0x10,0, 0x10,0, 0x00,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0380 */ 0x00,0, 0x00,0, 0x3c,0, 0x42,0, 0x9a,0, 0xa6,0, 0xa6,0, /* 0x0387 */ 0x9a,0, 0x80,0, 0x42,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x038e */ 0x00,0, 0x00,0, 0x10,0, 0x28,0, 0x44,0, 0x82,0, 0x82,0, /* 0x0395 */ 0xfe,0, 0x82,0, 0x82,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x039c */ 0x00,0, 0x00,0, 0xfc,0, 0x42,0, 0x42,0, 0x42,0, 0x7c,0, /* 0x03a3 */ 0x42,0, 0x42,0, 0x42,0, 0xfc,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03aa */ 0x00,0, 0x00,0, 0x3c,0, 0x42,0, 0x80,0, 0x80,0, 0x80,0, /* 0x03b1 */ 0x80,0, 0x80,0, 0x42,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03b8 */ 0x00,0, 0x00,0, 0xf8,0, 0x44,0, 0x42,0, 0x42,0, 0x42,0, /* 0x03bf */ 0x42,0, 0x42,0, 0x44,0, 0xf8,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03c6 */ 0x00,0, 0x00,0, 0xfe,0, 0x80,0, 0x80,0, 0x80,0, 0xf8,0, /* 0x03cd */ 0x80,0, 0x80,0, 0x80,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03d4 */ 0x00,0, 0x00,0, 0xfe,0, 0x80,0, 0x80,0, 0x80,0, 0xf8,0, /* 0x03db */ 0x80,0, 0x80,0, 0x80,0, 0x80,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03e2 */ 0x00,0, 0x00,0, 0x3c,0, 0x42,0, 0x80,0, 0x80,0, 0x8e,0, /* 0x03e9 */ 0x82,0, 0x82,0, 0x42,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03f0 */ 0x00,0, 0x00,0, 0x82,0, 0x82,0, 0x82,0, 0x82,0, 0xfe,0, /* 0x03f7 */ 0x82,0, 0x82,0, 0x82,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03fe */ 0x00,0, 0x00,0, 0x7c,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, /* 0x0405 */ 0x10,0, 0x10,0, 0x10,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x040c */ 0x00,0, 0x00,0, 0x3e,0, 0x04,0, 0x04,0, 0x04,0, 0x04,0, /* 0x0413 */ 0x04,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x041a */ 0x00,0, 0x00,0, 0x82,0, 0x84,0, 0x88,0, 0x90,0, 0xe0,0, /* 0x0421 */ 0x90,0, 0x88,0, 0x84,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0428 */ 0x00,0, 0x00,0, 0x80,0, 0x80,0, 0x80,0, 0x80,0, 0x80,0, /* 0x042f */ 0x80,0, 0x80,0, 0x80,0, 0xfc,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0436 */ 0x00,0, 0x00,0, 0x82,0, 0xc6,0, 0xaa,0, 0x92,0, 0x92,0, /* 0x043d */ 0x82,0, 0x82,0, 0x82,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0444 */ 0x00,0, 0x00,0, 0x82,0, 0x82,0, 0xc2,0, 0xa2,0, 0x92,0, /* 0x044b */ 0x8a,0, 0x86,0, 0x82,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0452 */ 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x82,0, 0x82,0, 0x82,0, /* 0x0459 */ 0x82,0, 0x82,0, 0x44,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0460 */ 0x00,0, 0x00,0, 0xfc,0, 0x82,0, 0x82,0, 0x82,0, 0xfc,0, /* 0x0467 */ 0x80,0, 0x80,0, 0x80,0, 0x80,0, 0x00,0, 0x00,0, 0x00,0, /* 0x046e */ 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x82,0, 0x82,0, 0x82,0, /* 0x0475 */ 0x92,0, 0x8a,0, 0x44,0, 0x3a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x047c */ 0x00,0, 0x00,0, 0xfc,0, 0x82,0, 0x82,0, 0x82,0, 0xfc,0, /* 0x0483 */ 0x90,0, 0x88,0, 0x84,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x048a */ 0x00,0, 0x00,0, 0x7c,0, 0x82,0, 0x80,0, 0x80,0, 0x7c,0, /* 0x0491 */ 0x02,0, 0x02,0, 0x82,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0498 */ 0x00,0, 0x00,0, 0xfe,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, /* 0x049f */ 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04a6 */ 0x00,0, 0x00,0, 0x82,0, 0x82,0, 0x82,0, 0x82,0, 0x82,0, /* 0x04ad */ 0x82,0, 0x82,0, 0x44,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04b4 */ 0x00,0, 0x00,0, 0x82,0, 0x82,0, 0x82,0, 0x44,0, 0x44,0, /* 0x04bb */ 0x28,0, 0x28,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04c2 */ 0x00,0, 0x00,0, 0x82,0, 0x82,0, 0x82,0, 0x82,0, 0x92,0, /* 0x04c9 */ 0x92,0, 0x92,0, 0xaa,0, 0x44,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04d0 */ 0x00,0, 0x00,0, 0x82,0, 0x82,0, 0x44,0, 0x28,0, 0x10,0, /* 0x04d7 */ 0x28,0, 0x44,0, 0x82,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04de */ 0x00,0, 0x00,0, 0x82,0, 0x82,0, 0x44,0, 0x28,0, 0x10,0, /* 0x04e5 */ 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04ec */ 0x00,0, 0x00,0, 0xfe,0, 0x02,0, 0x04,0, 0x08,0, 0x10,0, /* 0x04f3 */ 0x20,0, 0x40,0, 0x80,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04fa */ 0x00,0, 0x00,0, 0x3c,0, 0x20,0, 0x20,0, 0x20,0, 0x20,0, /* 0x0501 */ 0x20,0, 0x20,0, 0x20,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0508 */ 0x00,0, 0x00,0, 0x00,0, 0x80,0, 0x40,0, 0x20,0, 0x10,0, /* 0x050f */ 0x08,0, 0x04,0, 0x02,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0516 */ 0x00,0, 0x00,0, 0x3c,0, 0x04,0, 0x04,0, 0x04,0, 0x04,0, /* 0x051d */ 0x04,0, 0x04,0, 0x04,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0524 */ 0x00,0, 0x10,0, 0x28,0, 0x44,0, 0x00,0, 0x00,0, 0x00,0, /* 0x052b */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0532 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0539 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0x00,0, /* 0x0540 */ 0x00,0, 0x00,0, 0x08,0, 0x10,0, 0x18,0, 0x18,0, 0x00,0, /* 0x0547 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x054e */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x78,0, 0x04,0, /* 0x0555 */ 0x7c,0, 0x84,0, 0x84,0, 0x7a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x055c */ 0x00,0, 0x00,0, 0x80,0, 0x80,0, 0x80,0, 0xb8,0, 0xc4,0, /* 0x0563 */ 0x84,0, 0x84,0, 0xc4,0, 0xb8,0, 0x00,0, 0x00,0, 0x00,0, /* 0x056a */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0571 */ 0x80,0, 0x80,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0578 */ 0x00,0, 0x00,0, 0x04,0, 0x04,0, 0x04,0, 0x74,0, 0x8c,0, /* 0x057f */ 0x84,0, 0x84,0, 0x8c,0, 0x74,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0586 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x78,0, 0x84,0, /* 0x058d */ 0xfc,0, 0x80,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0594 */ 0x00,0, 0x00,0, 0x18,0, 0x24,0, 0x20,0, 0xf8,0, 0x20,0, /* 0x059b */ 0x20,0, 0x20,0, 0x20,0, 0x20,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05a2 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x74,0, 0x8c,0, /* 0x05a9 */ 0x8c,0, 0x8c,0, 0x74,0, 0x04,0, 0x84,0, 0x78,0, 0x00,0, /* 0x05b0 */ 0x00,0, 0x00,0, 0x80,0, 0x80,0, 0x80,0, 0xb8,0, 0xc4,0, /* 0x05b7 */ 0x84,0, 0x84,0, 0x84,0, 0x84,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05be */ 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x00,0, 0x30,0, 0x10,0, /* 0x05c5 */ 0x10,0, 0x10,0, 0x10,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05cc */ 0x00,0, 0x00,0, 0x00,0, 0x08,0, 0x00,0, 0x38,0, 0x08,0, /* 0x05d3 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x88,0, 0x70,0, 0x00,0, /* 0x05da */ 0x00,0, 0x00,0, 0x80,0, 0x80,0, 0x84,0, 0x88,0, 0x90,0, /* 0x05e1 */ 0xa0,0, 0xd0,0, 0x88,0, 0x84,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05e8 */ 0x00,0, 0x00,0, 0x30,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, /* 0x05ef */ 0x10,0, 0x10,0, 0x10,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05f6 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xec,0, 0x92,0, /* 0x05fd */ 0x92,0, 0x92,0, 0x92,0, 0x92,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0604 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xb8,0, 0xc4,0, /* 0x060b */ 0x84,0, 0x84,0, 0x84,0, 0x84,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0612 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0619 */ 0x84,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0620 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xb8,0, 0xc4,0, /* 0x0627 */ 0x84,0, 0xc4,0, 0xb8,0, 0x80,0, 0x80,0, 0x80,0, 0x00,0, /* 0x062e */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x74,0, 0x8c,0, /* 0x0635 */ 0x84,0, 0x8c,0, 0x74,0, 0x04,0, 0x04,0, 0x04,0, 0x00,0, /* 0x063c */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xb8,0, 0xc4,0, /* 0x0643 */ 0x80,0, 0x80,0, 0x80,0, 0x80,0, 0x00,0, 0x00,0, 0x00,0, /* 0x064a */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0651 */ 0x60,0, 0x18,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0658 */ 0x00,0, 0x00,0, 0x00,0, 0x20,0, 0x20,0, 0xf8,0, 0x20,0, /* 0x065f */ 0x20,0, 0x20,0, 0x24,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0666 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x84,0, 0x84,0, /* 0x066d */ 0x84,0, 0x84,0, 0x8c,0, 0x74,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0674 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x82,0, 0x82,0, /* 0x067b */ 0x44,0, 0x44,0, 0x28,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0682 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x82,0, 0x82,0, /* 0x0689 */ 0x92,0, 0x92,0, 0xaa,0, 0x44,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0690 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x84,0, 0x48,0, /* 0x0697 */ 0x30,0, 0x30,0, 0x48,0, 0x84,0, 0x00,0, 0x00,0, 0x00,0, /* 0x069e */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x84,0, 0x84,0, /* 0x06a5 */ 0x84,0, 0x8c,0, 0x74,0, 0x04,0, 0x84,0, 0x78,0, 0x00,0, /* 0x06ac */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfc,0, 0x08,0, /* 0x06b3 */ 0x10,0, 0x20,0, 0x40,0, 0xfc,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06ba */ 0x00,0, 0x00,0, 0x0c,0, 0x10,0, 0x10,0, 0x10,0, 0x20,0, /* 0x06c1 */ 0x10,0, 0x10,0, 0x10,0, 0x0c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06c8 */ 0x00,0, 0x00,0, 0x10,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, /* 0x06cf */ 0x00,0, 0x10,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06d6 */ 0x00,0, 0x00,0, 0x30,0, 0x08,0, 0x08,0, 0x08,0, 0x04,0, /* 0x06dd */ 0x08,0, 0x08,0, 0x08,0, 0x30,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06e4 */ 0x00,0, 0x00,0, 0x64,0, 0x98,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06eb */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06f2 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x28,0, /* 0x06f9 */ 0x44,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0700 */ 0x00,0, 0x00,0, 0x3c,0, 0x42,0, 0x80,0, 0x80,0, 0x80,0, /* 0x0707 */ 0x80,0, 0x80,0, 0x42,0, 0x3c,0, 0x04,0, 0x38,0, 0x00,0, /* 0x070e */ 0x00,0, 0x00,0, 0x00,0, 0x48,0, 0x00,0, 0x84,0, 0x84,0, /* 0x0715 */ 0x84,0, 0x84,0, 0x8c,0, 0x74,0, 0x00,0, 0x00,0, 0x00,0, /* 0x071c */ 0x00,0, 0x00,0, 0x0c,0, 0x10,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0723 */ 0xfc,0, 0x80,0, 0x80,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x072a */ 0x00,0, 0x10,0, 0x28,0, 0x44,0, 0x00,0, 0x78,0, 0x04,0, /* 0x0731 */ 0x7c,0, 0x84,0, 0x84,0, 0x7a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0738 */ 0x00,0, 0x00,0, 0x00,0, 0x48,0, 0x00,0, 0x78,0, 0x04,0, /* 0x073f */ 0x7c,0, 0x84,0, 0x84,0, 0x7a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0746 */ 0x00,0, 0x00,0, 0x30,0, 0x08,0, 0x00,0, 0x78,0, 0x04,0, /* 0x074d */ 0x7c,0, 0x84,0, 0x84,0, 0x7a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0754 */ 0x00,0, 0x10,0, 0x28,0, 0x10,0, 0x00,0, 0x78,0, 0x04,0, /* 0x075b */ 0x7c,0, 0x84,0, 0x84,0, 0x7a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0762 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0769 */ 0x80,0, 0x80,0, 0x84,0, 0x78,0, 0x08,0, 0x70,0, 0x00,0, /* 0x0770 */ 0x00,0, 0x30,0, 0x48,0, 0x84,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0777 */ 0xfc,0, 0x80,0, 0x80,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x077e */ 0x00,0, 0x00,0, 0x00,0, 0x48,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0785 */ 0xfc,0, 0x80,0, 0x80,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x078c */ 0x00,0, 0x00,0, 0x60,0, 0x10,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0793 */ 0xfc,0, 0x80,0, 0x80,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x079a */ 0x00,0, 0x00,0, 0x00,0, 0x48,0, 0x00,0, 0x30,0, 0x10,0, /* 0x07a1 */ 0x10,0, 0x10,0, 0x10,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07a8 */ 0x00,0, 0x10,0, 0x28,0, 0x44,0, 0x00,0, 0x30,0, 0x10,0, /* 0x07af */ 0x10,0, 0x10,0, 0x10,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07b6 */ 0x00,0, 0x00,0, 0x60,0, 0x10,0, 0x00,0, 0x30,0, 0x10,0, /* 0x07bd */ 0x10,0, 0x10,0, 0x10,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07c4 */ 0x00,0, 0x00,0, 0x44,0, 0x00,0, 0x10,0, 0x28,0, 0x44,0, /* 0x07cb */ 0x82,0, 0xfe,0, 0x82,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07d2 */ 0x10,0, 0x28,0, 0x10,0, 0x00,0, 0x10,0, 0x28,0, 0x44,0, /* 0x07d9 */ 0x82,0, 0xfe,0, 0x82,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07e0 */ 0x00,0, 0x18,0, 0x20,0, 0x00,0, 0xfc,0, 0x80,0, 0x80,0, /* 0x07e7 */ 0xf0,0, 0x80,0, 0x80,0, 0xfc,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07ee */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xec,0, 0x12,0, /* 0x07f5 */ 0x7c,0, 0x90,0, 0x90,0, 0x6e,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07fc */ 0x00,0, 0x00,0, 0x1e,0, 0x30,0, 0x50,0, 0x90,0, 0x9e,0, /* 0x0803 */ 0xf0,0, 0x90,0, 0x90,0, 0x9e,0, 0x00,0, 0x00,0, 0x00,0, /* 0x080a */ 0x00,0, 0x30,0, 0x48,0, 0x84,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0811 */ 0x84,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0818 */ 0x00,0, 0x00,0, 0x00,0, 0x48,0, 0x00,0, 0x78,0, 0x84,0, /* 0x081f */ 0x84,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0826 */ 0x00,0, 0x00,0, 0x60,0, 0x10,0, 0x00,0, 0x78,0, 0x84,0, /* 0x082d */ 0x84,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0834 */ 0x00,0, 0x30,0, 0x48,0, 0x84,0, 0x00,0, 0x84,0, 0x84,0, /* 0x083b */ 0x84,0, 0x84,0, 0x8c,0, 0x74,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0842 */ 0x00,0, 0x00,0, 0x60,0, 0x10,0, 0x00,0, 0x84,0, 0x84,0, /* 0x0849 */ 0x84,0, 0x84,0, 0x8c,0, 0x74,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0850 */ 0x00,0, 0x00,0, 0x00,0, 0x48,0, 0x00,0, 0x84,0, 0x84,0, /* 0x0857 */ 0x84,0, 0x8c,0, 0x74,0, 0x04,0, 0x84,0, 0x78,0, 0x00,0, /* 0x085e */ 0x00,0, 0x00,0, 0x44,0, 0x00,0, 0x38,0, 0x44,0, 0x82,0, /* 0x0865 */ 0x82,0, 0x82,0, 0x44,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x086c */ 0x00,0, 0x00,0, 0x44,0, 0x00,0, 0x82,0, 0x82,0, 0x82,0, /* 0x0873 */ 0x82,0, 0x82,0, 0x44,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x087a */ 0x00,0, 0x00,0, 0x10,0, 0x10,0, 0x78,0, 0x84,0, 0x80,0, /* 0x0881 */ 0x80,0, 0x84,0, 0x78,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, /* 0x0888 */ 0x00,0, 0x00,0, 0x78,0, 0x84,0, 0x80,0, 0x40,0, 0xf8,0, /* 0x088f */ 0x20,0, 0x20,0, 0x62,0, 0x9c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0896 */ 0x00,0, 0x00,0, 0x82,0, 0x44,0, 0x28,0, 0x10,0, 0x7c,0, /* 0x089d */ 0x10,0, 0x7c,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08a4 */ 0x00,0, 0x00,0, 0xf0,0, 0x88,0, 0x88,0, 0xf0,0, 0x88,0, /* 0x08ab */ 0x9c,0, 0x88,0, 0x88,0, 0x08,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08b2 */ 0x00,0, 0x00,0, 0x18,0, 0x24,0, 0x20,0, 0x20,0, 0x78,0, /* 0x08b9 */ 0x20,0, 0x20,0, 0x20,0, 0x20,0, 0x20,0, 0xc0,0, 0x00,0, /* 0x08c0 */ 0x00,0, 0x00,0, 0x18,0, 0x20,0, 0x00,0, 0x78,0, 0x04,0, /* 0x08c7 */ 0x7c,0, 0x84,0, 0x84,0, 0x7a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08ce */ 0x00,0, 0x00,0, 0x18,0, 0x20,0, 0x00,0, 0x30,0, 0x10,0, /* 0x08d5 */ 0x10,0, 0x10,0, 0x10,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08dc */ 0x00,0, 0x00,0, 0x18,0, 0x20,0, 0x00,0, 0x78,0, 0x84,0, /* 0x08e3 */ 0x84,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08ea */ 0x00,0, 0x00,0, 0x18,0, 0x20,0, 0x00,0, 0x84,0, 0x84,0, /* 0x08f1 */ 0x84,0, 0x84,0, 0x8c,0, 0x74,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08f8 */ 0x00,0, 0x00,0, 0x64,0, 0x98,0, 0x00,0, 0xb8,0, 0xc4,0, /* 0x08ff */ 0x84,0, 0x84,0, 0x84,0, 0x84,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0906 */ 0x00,0, 0x00,0, 0x32,0, 0x4c,0, 0x82,0, 0xc2,0, 0xa2,0, /* 0x090d */ 0x92,0, 0x8a,0, 0x86,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0914 */ 0x00,0, 0x00,0, 0x70,0, 0x08,0, 0x38,0, 0x48,0, 0x34,0, /* 0x091b */ 0x00,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0922 */ 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x44,0, 0x44,0, 0x38,0, /* 0x0929 */ 0x00,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0930 */ 0x00,0, 0x00,0, 0x10,0, 0x00,0, 0x10,0, 0x10,0, 0x60,0, /* 0x0937 */ 0x80,0, 0x82,0, 0x82,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x093e */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0945 */ 0xfe,0, 0x80,0, 0x80,0, 0x80,0, 0x00,0, 0x00,0, 0x00,0, /* 0x094c */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0953 */ 0xfe,0, 0x02,0, 0x02,0, 0x02,0, 0x00,0, 0x00,0, 0x00,0, /* 0x095a */ 0x00,0, 0x00,0, 0x40,0, 0xc0,0, 0x48,0, 0x50,0, 0x20,0, /* 0x0961 */ 0x5c,0, 0x04,0, 0x08,0, 0x1c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0968 */ 0x00,0, 0x00,0, 0x40,0, 0xc0,0, 0x48,0, 0x50,0, 0x20,0, /* 0x096f */ 0x54,0, 0x14,0, 0x1e,0, 0x04,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0976 */ 0x00,0, 0x00,0, 0x10,0, 0x00,0, 0x00,0, 0x10,0, 0x10,0, /* 0x097d */ 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0984 */ 0x00,0, 0x00,0, 0x00,0, 0x12,0, 0x24,0, 0x48,0, 0x90,0, /* 0x098b */ 0x48,0, 0x24,0, 0x12,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0992 */ 0x00,0, 0x00,0, 0x00,0, 0x90,0, 0x48,0, 0x24,0, 0x12,0, /* 0x0999 */ 0x24,0, 0x48,0, 0x90,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x09a0 */ 0x88,0, 0x22,0, 0x88,0, 0x22,0, 0x88,0, 0x22,0, 0x88,0, /* 0x09a7 */ 0x22,0, 0x88,0, 0x22,0, 0x88,0, 0x22,0, 0x88,0, 0x22,0, /* 0x09ae */ 0xaa,0, 0x54,0, 0xaa,0, 0x54,0, 0xaa,0, 0x54,0, 0xaa,0, /* 0x09b5 */ 0x54,0, 0xaa,0, 0x54,0, 0xaa,0, 0x54,0, 0xaa,0, 0x54,0, /* 0x09bc */ 0x76,0, 0xdc,0, 0x76,0, 0xdc,0, 0x76,0, 0xdc,0, 0x76,0, /* 0x09c3 */ 0xdc,0, 0x76,0, 0xdc,0, 0x76,0, 0xdc,0, 0x76,0, 0xdc,0, /* 0x09ca */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x09d1 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x09d8 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x09df */ 0xf8,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x09e6 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0xf8,0, 0x08,0, /* 0x09ed */ 0xf8,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x09f4 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x09fb */ 0xf4,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0a02 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a09 */ 0xfc,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0a10 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xf8,0, 0x08,0, /* 0x0a17 */ 0xf8,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0a1e */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0xf4,0, 0x04,0, /* 0x0a25 */ 0xf4,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0a2c */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0a33 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0a3a */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfc,0, 0x04,0, /* 0x0a41 */ 0xf4,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0a48 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0xf4,0, 0x04,0, /* 0x0a4f */ 0xfc,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a56 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0a5d */ 0xfc,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a64 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0xf8,0, 0x08,0, /* 0x0a6b */ 0xf8,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a72 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a79 */ 0xf8,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0a80 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0a87 */ 0x0f,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a8e */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0a95 */ 0xff,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a9c */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0aa3 */ 0xff,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0aaa */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0ab1 */ 0x0f,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0ab8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0abf */ 0xff,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ac6 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0acd */ 0xff,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0ad4 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x0f,0, 0x08,0, /* 0x0adb */ 0x0f,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0ae2 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0ae9 */ 0x17,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0af0 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x17,0, 0x10,0, /* 0x0af7 */ 0x1f,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0afe */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x1f,0, 0x10,0, /* 0x0b05 */ 0x17,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0b0c */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0xf7,0, 0x00,0, /* 0x0b13 */ 0xff,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0b1a */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, 0x00,0, /* 0x0b21 */ 0xf7,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0b28 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x17,0, 0x14,0, /* 0x0b2f */ 0x17,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0b36 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, 0x00,0, /* 0x0b3d */ 0xff,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0b44 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0xf7,0, 0x00,0, /* 0x0b4b */ 0xf7,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0b52 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0xff,0, 0x00,0, /* 0x0b59 */ 0xff,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0b60 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0b67 */ 0xff,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0b6e */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, 0x00,0, /* 0x0b75 */ 0xff,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0b7c */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0b83 */ 0xff,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0b8a */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0b91 */ 0x1f,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0b98 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x0f,0, 0x08,0, /* 0x0b9f */ 0x0f,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ba6 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x0f,0, 0x08,0, /* 0x0bad */ 0x0f,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0bb4 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0bbb */ 0x1f,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0bc2 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0bc9 */ 0xff,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0bd0 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0xff,0, 0x08,0, /* 0x0bd7 */ 0xff,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0bde */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0be5 */ 0xf8,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0bec */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0bf3 */ 0x0f,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0bfa */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x0c01 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x0c08 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c0f */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x0c16 */ 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, /* 0x0c1d */ 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, /* 0x0c24 */ 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, /* 0x0c2b */ 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, /* 0x0c32 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x0c39 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c40 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x6e,0, 0x90,0, /* 0x0c47 */ 0x90,0, 0x6e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c4e */ 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x84,0, 0xb8,0, 0x88,0, /* 0x0c55 */ 0x84,0, 0x84,0, 0xa4,0, 0x98,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c5c */ 0x00,0, 0x00,0, 0xfe,0, 0x82,0, 0x82,0, 0x80,0, 0x80,0, /* 0x0c63 */ 0x80,0, 0x80,0, 0x80,0, 0x80,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c6a */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7e,0, 0xa4,0, /* 0x0c71 */ 0x24,0, 0x24,0, 0x24,0, 0x24,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c78 */ 0x00,0, 0x00,0, 0xfc,0, 0x42,0, 0x20,0, 0x10,0, 0x08,0, /* 0x0c7f */ 0x10,0, 0x20,0, 0x42,0, 0xfc,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c86 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7e,0, 0x88,0, /* 0x0c8d */ 0x88,0, 0x88,0, 0x88,0, 0x70,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c94 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x42,0, 0x42,0, 0x42,0, /* 0x0c9b */ 0x42,0, 0x7c,0, 0x40,0, 0x40,0, 0x80,0, 0x00,0, 0x00,0, /* 0x0ca2 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7c,0, 0xa0,0, /* 0x0ca9 */ 0x20,0, 0x20,0, 0x28,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0cb0 */ 0x00,0, 0x00,0, 0x38,0, 0x10,0, 0x7c,0, 0x92,0, 0x92,0, /* 0x0cb7 */ 0x92,0, 0x7c,0, 0x10,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0cbe */ 0x00,0, 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x82,0, 0xfe,0, /* 0x0cc5 */ 0x82,0, 0x44,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ccc */ 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x82,0, 0x82,0, 0x82,0, /* 0x0cd3 */ 0x44,0, 0x28,0, 0xaa,0, 0xee,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0cda */ 0x00,0, 0x00,0, 0x38,0, 0x24,0, 0x10,0, 0x78,0, 0x88,0, /* 0x0ce1 */ 0x88,0, 0x88,0, 0x88,0, 0x70,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ce8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x6c,0, 0x92,0, /* 0x0cef */ 0x92,0, 0x6c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0cf6 */ 0x00,0, 0x00,0, 0x00,0, 0xb8,0, 0x44,0, 0xa2,0, 0x92,0, /* 0x0cfd */ 0x8a,0, 0x44,0, 0x3a,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d04 */ 0x00,0, 0x00,0, 0x00,0, 0x3e,0, 0x40,0, 0x80,0, 0xfe,0, /* 0x0d0b */ 0x80,0, 0x40,0, 0x3e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d12 */ 0x00,0, 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x82,0, 0x82,0, /* 0x0d19 */ 0x82,0, 0x82,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d20 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0x00,0, 0xfe,0, /* 0x0d27 */ 0x00,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d2e */ 0x00,0, 0x00,0, 0x10,0, 0x10,0, 0x10,0, 0xfe,0, 0x10,0, /* 0x0d35 */ 0x10,0, 0x10,0, 0x00,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d3c */ 0x00,0, 0x00,0, 0x20,0, 0x10,0, 0x08,0, 0x04,0, 0x08,0, /* 0x0d43 */ 0x10,0, 0x20,0, 0x00,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d4a */ 0x00,0, 0x00,0, 0x08,0, 0x10,0, 0x20,0, 0x40,0, 0x20,0, /* 0x0d51 */ 0x10,0, 0x08,0, 0x00,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d58 */ 0x00,0, 0x00,0, 0x0c,0, 0x12,0, 0x16,0, 0x10,0, 0x10,0, /* 0x0d5f */ 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, /* 0x0d66 */ 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, /* 0x0d6d */ 0x10,0, 0xd0,0, 0x90,0, 0x60,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d74 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x00,0, 0xfe,0, /* 0x0d7b */ 0x00,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d82 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x64,0, 0x98,0, 0x00,0, /* 0x0d89 */ 0x64,0, 0x98,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d90 */ 0x00,0, 0x00,0, 0x30,0, 0x48,0, 0x48,0, 0x30,0, 0x00,0, /* 0x0d97 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d9e */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, /* 0x0da5 */ 0x3c,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0dac */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0db3 */ 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0dba */ 0x00,0, 0x1e,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x90,0, /* 0x0dc1 */ 0x50,0, 0x30,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0dc8 */ 0x00,0, 0x58,0, 0x24,0, 0x24,0, 0x24,0, 0x24,0, 0x00,0, /* 0x0dcf */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0dd6 */ 0x00,0, 0x18,0, 0x24,0, 0x08,0, 0x10,0, 0x3c,0, 0x00,0, /* 0x0ddd */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0de4 */ 0x00,0, 0x00,0, 0x7c,0, 0x7c,0, 0x7c,0, 0x7c,0, 0x7c,0, /* 0x0deb */ 0x7c,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0df2 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0df9 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, }; char* tmviewfont=thin9x14; #define FONTH 14 #define FONTW 9 #define FONTS 0 tmview/fb/0040755000175000017500000000000007250444702012052 5ustar tmoortmoortmview/fb/font8x8.h0100644000175000017500000002204607250444702013542 0ustar tmoortmoor /* this is font8x8, as found in vgagl */ static unsigned char font8x8[] = { 0,0,0,0,0,0,0,0,126,129,165,129,189,129,126,0, /* 0 to 15 */ 126,255,219,255,195,255,126,0,54,127,127,127,62,28,8,0, /* 16 to 31 */ 8,28,62,127,62,28,8,0,28,28,8,107,127,107,8,28, /* 32 to 47 */ 8,28,62,127,62,8,28,62,0,0,24,60,60,24,0,0, /* 48 to 63 */ 255,255,231,195,195,231,255,255,0,60,102,66,66,102,60,0, /* 64 to 79 */ 255,195,153,189,189,153,195,255,15,7,13,60,102,102,102,60, /* 80 to 95 */ 60,102,102,102,60,24,126,24,48,56,60,54,52,112,240,224, /* 96 to 111 */ 127,99,127,99,99,103,230,192,24,219,126,102,102,126,219,24, /* 112 to 127*/ 64,112,124,127,124,112,64,0,1,7,31,127,31,7,1,0, /* 128 to 143 */ 24,60,126,24,24,126,60,24,102,102,102,102,102,0,102,0, /* 144 to 159 */ 63,122,122,58,10,10,10,0,30,51,28,54,54,28,102,60, /* 160 to 175 */ 0,0,0,0,126,126,126,0,24,60,126,24,126,60,24,126, /* 176 to 191 */ 24,60,126,24,24,24,24,0,24,24,24,24,126,60,24,0, /* 192 to 207 */ 0,12,14,127,14,12,0,0,0,24,56,127,56,24,0,0, /* 208 to 223 */ 0,0,96,96,96,127,0,0,0,36,102,255,102,36,0,0, /* 224 to 239 */ 0,24,60,126,255,255,0,0,0,255,255,126,60,24,0,0, /* 240 to 255 */ 0,0,0,0,0,0,0,0,24,24,24,24,24,0,24,0, /* 256 to 271 */ 102,102,102,0,0,0,0,0,108,108,254,108,254,108,108,0, /* 272 to 287 */ 16,124,208,124,22,124,16,0,0,198,204,24,48,102,198,0, /* 288 to 303 */ 56,108,56,118,220,204,118,0,24,24,48,0,0,0,0,0, /* 304 to 319 */ 12,24,48,48,48,24,12,0,48,24,12,12,12,24,48,0, /* 320 to 335 */ 0,108,56,254,56,108,0,0,0,24,24,126,24,24,0,0, /* 336 to 351 */ 0,0,0,0,0,24,24,48,0,0,0,126,0,0,0,0, /* 352 to 367 */ 0,0,0,0,0,48,48,0,0,6,12,24,48,96,192,0, /* 368 to 383 */ 60,102,110,126,118,102,60,0,12,28,60,12,12,12,12,0, /* 384 to 399 */ 60,102,6,28,48,96,126,0,60,102,6,28,6,102,60,0, /* 400 to 415 */ 28,60,108,204,254,12,12,0,126,96,96,124,6,102,60,0, /* 416 to 431 */ 60,96,96,124,102,102,60,0,126,6,6,12,24,48,48,0, /* 432 to 447 */ 60,102,102,60,102,102,60,0,60,102,102,62,6,6,60,0, /* 448 to 463 */ 0,48,48,0,0,48,48,0,0,24,24,0,0,24,24,48, /* 464 to 479 */ 12,24,48,96,48,24,12,0,0,0,126,0,0,126,0,0, /* 480 to 495 */ 48,24,12,6,12,24,48,0,60,102,6,12,24,0,24,0, /* 496 to 511 */ 60,102,110,110,108,96,60,0,24,60,102,102,126,102,102,0, /* 512 to 527 */ 124,102,102,124,102,102,124,0,60,102,96,96,96,102,60,0, /* 528 to 543 */ 124,102,102,102,102,102,124,0,126,96,96,124,96,96,126,0, /* 544 to 559 */ 126,96,96,124,96,96,96,0,60,102,96,110,102,102,60,0, /* 560 to 575 */ 102,102,102,126,102,102,102,0,60,24,24,24,24,24,60,0, /* 576 to 591 */ 6,6,6,6,102,102,60,0,102,108,120,112,120,108,102,0, /* 592 to 607 */ 96,96,96,96,96,96,126,0,198,238,254,214,198,198,198,0, /* 608 to 623 */ 102,118,126,110,102,102,102,0,60,102,102,102,102,102,60,0, /* 624 to 639 */ 124,102,102,124,96,96,96,0,60,102,102,102,102,110,60,6, /* 640 to 655 */ 124,102,102,124,102,102,102,0,60,102,96,60,6,102,60,0, /* 656 to 671 */ 126,24,24,24,24,24,24,0,102,102,102,102,102,102,60,0, /* 672 to 687 */ 102,102,102,102,102,60,24,0,198,198,198,214,254,238,198,0, /* 688 to 703 */ 102,102,60,24,60,102,102,0,102,102,102,60,24,24,24,0, /* 704 to 719 */ 126,6,12,24,48,96,126,0,60,48,48,48,48,48,60,0, /* 720 to 735 */ 0,192,96,48,24,12,6,0,60,12,12,12,12,12,60,0, /* 736 to 751 */ 24,60,102,0,0,0,0,0,0,0,0,0,0,0,0,255, /* 752 to 767 */ 24,24,12,0,0,0,0,0,0,0,60,6,62,102,62,0, /* 768 to 783 */ 96,96,96,124,102,102,124,0,0,0,60,102,96,102,60,0, /* 784 to 799 */ 6,6,6,62,102,102,62,0,0,0,60,102,126,96,62,0, /* 800 to 815 */ 28,54,48,124,48,48,48,0,0,0,62,102,102,62,6,60, /* 816 to 831 */ 96,96,124,102,102,102,102,0,24,0,24,24,24,24,24,0, /* 832 to 847 */ 12,0,12,12,12,12,108,56,96,96,102,108,120,108,102,0, /* 848 to 863 */ 48,48,48,48,48,48,24,0,0,0,236,254,214,214,198,0, /* 864 to 879 */ 0,0,124,102,102,102,102,0,0,0,60,102,102,102,60,0, /* 880 to 895 */ 0,0,124,102,102,124,96,96,0,0,62,102,102,62,6,6, /* 896 to 911 */ 0,0,124,102,96,96,96,0,0,0,62,96,60,6,124,0, /* 912 to 927 */ 48,48,124,48,48,54,28,0,0,0,102,102,102,102,62,0, /* 928 to 943 */ 0,0,102,102,102,60,24,0,0,0,198,214,254,238,68,0, /* 944 to 959 */ 0,0,102,60,24,60,102,0,0,0,102,102,102,62,6,60, /* 960 to 975 */ 0,0,126,12,24,48,126,0,28,48,48,96,48,48,28,0, /* 976 to 991 */ 24,24,24,24,24,24,24,0,56,12,12,6,12,12,56,0, /* 992 to 1007 */ 118,220,0,0,0,0,0,0,0,0,24,60,102,102,126,0, /* 1008 to 1023 */ 60,102,96,96,102,60,24,48,102,0,102,102,102,102,62,0, /* 1024 to 1039 */ 14,0,60,102,126,96,60,0,60,102,60,6,62,102,62,0, /* 1040 to 1055 */ 102,0,60,6,62,102,62,0,112,0,60,6,62,102,62,0, /* 1056 to 1071 */ 24,24,60,6,62,102,62,0,0,0,62,96,96,62,24,48, /* 1072 to 1087 */ 60,102,60,102,126,96,60,0,102,0,60,102,126,96,60,0, /* 1088 to 1103 */ 112,0,60,102,126,96,60,0,102,0,24,24,24,24,24,0, /* 1104 to 1119 */ 60,102,24,24,24,24,24,0,112,0,24,24,24,24,24,0, /* 1120 to 1135 */ 198,56,108,198,254,198,198,0,24,24,0,60,102,126,102,0, /* 1136 to 1151 */ 14,0,124,96,120,96,124,0,0,0,126,26,126,216,126,0, /* 1152 to 1167 */ 62,120,216,222,248,216,222,0,60,102,60,102,102,102,60,0, /* 1168 to 1183 */ 102,0,60,102,102,102,60,0,112,0,60,102,102,102,60,0, /* 1184 to 1199 */ 60,102,0,102,102,102,62,0,112,0,102,102,102,102,62,0, /* 1200 to 1215 */ 102,0,102,102,102,62,6,60,102,60,102,102,102,102,60,0, /* 1216 to 1231 */ 102,0,102,102,102,102,60,0,12,12,62,96,96,62,12,12, /* 1232 to 1247 */ 56,108,96,240,96,102,252,0,102,102,60,24,126,24,126,24, /* 1248 to 1263 */ 124,102,102,124,102,111,102,99,14,27,24,60,24,24,120,48, /* 1264 to 1279 */ 14,0,60,6,62,102,62,0,14,0,24,24,24,24,24,0, /* 1280 to 1295 */ 14,0,60,102,102,102,60,0,14,0,102,102,102,102,62,0, /* 1296 to 1311 */ 118,220,0,124,102,102,102,0,126,0,102,118,126,110,102,0, /* 1312 to 1327 */ 62,102,102,62,0,126,0,0,60,102,102,60,0,126,0,0, /* 1328 to 1343 */ 24,0,24,48,96,102,60,0,0,0,0,126,96,96,0,0, /* 1344 to 1359 */ 0,0,0,126,6,6,0,0,198,204,216,62,99,198,12,31, /* 1360 to 1375 */ 198,204,216,54,110,214,31,6,24,0,24,24,24,24,24,0, /* 1376 to 1391 */ 0,54,108,216,108,54,0,0,0,216,108,54,108,216,0,0, /* 1392 to 1407 */ 34,136,34,136,34,136,34,136,85,170,85,170,85,170,85,170, /* 1408 to 1423 */ 221,119,221,119,221,119,221,119,8,8,8,8,8,8,8,8, /* 1424 to 1439 */ 8,8,8,8,248,8,8,8,8,8,8,248,248,8,8,8, /* 1440 to 1455 */ 28,28,28,28,252,28,28,28,0,0,0,0,252,28,28,28, /* 1456 to 1471 */ 0,0,0,248,248,8,8,8,28,28,28,252,252,28,28,28, /* 1472 to 1487 */ 28,28,28,28,28,28,28,28,0,0,0,252,252,28,28,28, /* 1488 to 1503 */ 28,28,28,252,252,0,0,0,28,28,28,28,252,0,0,0, /* 1504 to 1519 */ 8,8,8,248,248,0,0,0,0,0,0,0,248,8,8,8, /* 1520 to 1535 */ 8,8,8,8,15,0,0,0,8,8,8,8,255,0,0,0, /* 1536 to 1551 */ 0,0,0,0,255,8,8,8,8,8,8,8,15,8,8,8, /* 1552 to 1567 */ 0,0,0,0,255,0,0,0,8,8,8,8,255,8,8,8, /* 1568 to 1583 */ 8,8,8,15,15,8,8,8,28,28,28,28,31,28,28,28, /* 1584 to 1599 */ 28,28,28,31,31,0,0,0,0,0,0,31,31,28,28,28, /* 1600 to 1615 */ 28,28,28,255,255,0,0,0,0,0,0,255,255,28,28,28, /* 1616 to 1631 */ 28,28,28,31,31,28,28,28,0,0,0,255,255,0,0,0, /* 1632 to 1647 */ 28,28,28,255,255,28,28,28,8,8,8,255,255,0,0,0, /* 1648 to 1663 */ 28,28,28,28,255,0,0,0,0,0,0,255,255,8,8,8, /* 1664 to 1679 */ 0,0,0,0,255,28,28,28,28,28,28,28,31,0,0,0, /* 1680 to 1695 */ 8,8,8,15,15,0,0,0,0,0,0,15,15,8,8,8, /* 1696 to 1711 */ 0,0,0,0,31,28,28,28,28,28,28,28,255,28,28,28, /* 1712 to 1727 */ 8,8,8,255,255,8,8,8,8,8,8,8,248,0,0,0, /* 1728 to 1743 */ 0,0,0,0,15,8,8,8,255,255,255,255,255,255,255,255, /* 1744 to 1759 */ 0,0,0,0,255,255,255,255,240,240,240,240,240,240,240,240, /* 1760 to 1775 */ 15,15,15,15,15,15,15,15,255,255,255,255,0,0,0,0, /* 1776 to 1791 */ 0,0,118,204,204,204,118,0,60,102,102,124,102,102,124,96, /* 1792 to 1807 */ 126,102,96,96,96,96,96,0,0,0,254,108,108,108,102,0, /* 1808 to 1823 */ 126,102,48,24,48,102,126,0,0,0,62,108,108,108,56,0, /* 1824 to 1839 */ 0,0,102,102,102,102,127,192,0,0,126,216,24,24,12,0, /* 1840 to 1855 */ 124,56,124,214,214,124,56,124,124,198,198,254,198,198,124,0, /*1856to1871*/ 124,198,198,198,108,108,238,0,30,48,24,60,102,102,60,0, /* 1872 to 1887 */ 0,0,126,219,219,126,0,0,3,6,62,107,115,62,96,192, /* 1888 to 1903 */ 30,48,96,126,96,48,30,0,124,198,198,198,198,198,198,0, /* 1904 to 1919 */ 0,126,0,126,0,126,0,0,24,24,126,24,24,0,126,0, /* 1920 to 1935 */ 48,24,12,24,48,0,126,0,12,24,48,24,12,0,126,0, /* 1936 to 1951 */ 14,27,27,24,24,24,24,24,24,24,24,24,24,216,216,112, /* 1952 to 1967 */ 24,24,0,126,0,24,24,0,0,118,220,0,118,220,0,0, /* 1968 to 1983 */ 60,102,102,60,0,0,0,0,0,0,0,24,24,0,0,0, /* 1984 to 1999 */ 0,0,0,0,24,0,0,0,30,24,24,24,24,216,120,56, /* 2000 to 2015 */ 120,108,108,108,108,0,0,0,56,12,24,48,60,0,0,0, /* 2016 to 2031 */ 0,0,60,60,60,60,0,0,0,0,0,0,0,0,0,0 /* 2032 to 2047 */ }; char* tmviewfont=font8x8; #define FONTH 8; #define FONTW 8; #define FONTS 2; tmview/fb/font9x16.h0100644000175000017500000012041307250444702013617 0ustar tmoortmoor/* this the font-file "default8x16" as a c-vektor */ /* done with "hexdump -v -e '"/ * 0x%.4_ax * / " 8 1 "0x%.2x,0, " "\n"' " */ char font9x16[]={ /* 0x0000 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0008 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0010 */ 0x00,0, 0x00,0, 0x7e,0, 0x81,0, 0xa5,0, 0x81,0, 0x81,0, 0xbd,0, /* 0x0018 */ 0x99,0, 0x81,0, 0x81,0, 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0020 */ 0x00,0, 0x00,0, 0x7e,0, 0xff,0, 0xdb,0, 0xff,0, 0xff,0, 0xc3,0, /* 0x0028 */ 0xe7,0, 0xff,0, 0xff,0, 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0030 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x6c,0, 0xfe,0, 0xfe,0, 0xfe,0, /* 0x0038 */ 0xfe,0, 0x7c,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0040 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x7c,0, 0xfe,0, /* 0x0048 */ 0x7c,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0050 */ 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x3c,0, 0x3c,0, 0xe7,0, 0xe7,0, /* 0x0058 */ 0xe7,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0060 */ 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x3c,0, 0x7e,0, 0xff,0, 0xff,0, /* 0x0068 */ 0x7e,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0070 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x3c,0, /* 0x0078 */ 0x3c,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0080 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xe7,0, 0xc3,0, /* 0x0088 */ 0xc3,0, 0xe7,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x0090 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x3c,0, 0x66,0, 0x42,0, /* 0x0098 */ 0x42,0, 0x66,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00a0 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xc3,0, 0x99,0, 0xbd,0, /* 0x00a8 */ 0xbd,0, 0x99,0, 0xc3,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x00b0 */ 0x00,0, 0x00,0, 0x1e,0, 0x0e,0, 0x1a,0, 0x32,0, 0x78,0, 0xcc,0, /* 0x00b8 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00c0 */ 0x00,0, 0x00,0, 0x3c,0, 0x66,0, 0x66,0, 0x66,0, 0x66,0, 0x3c,0, /* 0x00c8 */ 0x18,0, 0x7e,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00d0 */ 0x00,0, 0x00,0, 0x3f,0, 0x33,0, 0x3f,0, 0x30,0, 0x30,0, 0x30,0, /* 0x00d8 */ 0x30,0, 0x70,0, 0xf0,0, 0xe0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00e0 */ 0x00,0, 0x00,0, 0x7f,0, 0x63,0, 0x7f,0, 0x63,0, 0x63,0, 0x63,0, /* 0x00e8 */ 0x63,0, 0x67,0, 0xe7,0, 0xe6,0, 0xc0,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00f0 */ 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0xdb,0, 0x3c,0, 0xe7,0, /* 0x00f8 */ 0x3c,0, 0xdb,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0100 */ 0x00,0, 0x80,0, 0xc0,0, 0xe0,0, 0xf0,0, 0xf8,0, 0xfe,0, 0xf8,0, /* 0x0108 */ 0xf0,0, 0xe0,0, 0xc0,0, 0x80,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0110 */ 0x00,0, 0x02,0, 0x06,0, 0x0e,0, 0x1e,0, 0x3e,0, 0xfe,0, 0x3e,0, /* 0x0118 */ 0x1e,0, 0x0e,0, 0x06,0, 0x02,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0120 */ 0x00,0, 0x00,0, 0x18,0, 0x3c,0, 0x7e,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0128 */ 0x7e,0, 0x3c,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0130 */ 0x00,0, 0x00,0, 0x66,0, 0x66,0, 0x66,0, 0x66,0, 0x66,0, 0x66,0, /* 0x0138 */ 0x66,0, 0x00,0, 0x66,0, 0x66,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0140 */ 0x00,0, 0x00,0, 0x7f,0, 0xdb,0, 0xdb,0, 0xdb,0, 0x7b,0, 0x1b,0, /* 0x0148 */ 0x1b,0, 0x1b,0, 0x1b,0, 0x1b,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0150 */ 0x00,0, 0x7c,0, 0xc6,0, 0x60,0, 0x38,0, 0x6c,0, 0xc6,0, 0xc6,0, /* 0x0158 */ 0x6c,0, 0x38,0, 0x0c,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0160 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0168 */ 0xfe,0, 0xfe,0, 0xfe,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0170 */ 0x00,0, 0x00,0, 0x18,0, 0x3c,0, 0x7e,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0178 */ 0x7e,0, 0x3c,0, 0x18,0, 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0180 */ 0x00,0, 0x00,0, 0x18,0, 0x3c,0, 0x7e,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0188 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0190 */ 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0198 */ 0x18,0, 0x7e,0, 0x3c,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01a0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x0c,0, 0xfe,0, /* 0x01a8 */ 0x0c,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01b0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x30,0, 0x60,0, 0xfe,0, /* 0x01b8 */ 0x60,0, 0x30,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01c0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xc0,0, 0xc0,0, /* 0x01c8 */ 0xc0,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01d0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x24,0, 0x66,0, 0xff,0, /* 0x01d8 */ 0x66,0, 0x24,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01e0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x38,0, 0x7c,0, /* 0x01e8 */ 0x7c,0, 0xfe,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01f0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0xfe,0, 0x7c,0, 0x7c,0, /* 0x01f8 */ 0x38,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0200 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0208 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0210 */ 0x00,0, 0x00,0, 0x18,0, 0x3c,0, 0x3c,0, 0x3c,0, 0x18,0, 0x18,0, /* 0x0218 */ 0x18,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0220 */ 0x00,0, 0x66,0, 0x66,0, 0x66,0, 0x24,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0228 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0230 */ 0x00,0, 0x00,0, 0x00,0, 0x6c,0, 0x6c,0, 0xfe,0, 0x6c,0, 0x6c,0, /* 0x0238 */ 0x6c,0, 0xfe,0, 0x6c,0, 0x6c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0240 */ 0x18,0, 0x18,0, 0x7c,0, 0xc6,0, 0xc2,0, 0xc0,0, 0x7c,0, 0x06,0, /* 0x0248 */ 0x06,0, 0x86,0, 0xc6,0, 0x7c,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, /* 0x0250 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xc2,0, 0xc6,0, 0x0c,0, 0x18,0, /* 0x0258 */ 0x30,0, 0x60,0, 0xc6,0, 0x86,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0260 */ 0x00,0, 0x00,0, 0x38,0, 0x6c,0, 0x6c,0, 0x38,0, 0x76,0, 0xdc,0, /* 0x0268 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0270 */ 0x00,0, 0x30,0, 0x30,0, 0x30,0, 0x60,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0278 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0280 */ 0x00,0, 0x00,0, 0x0c,0, 0x18,0, 0x30,0, 0x30,0, 0x30,0, 0x30,0, /* 0x0288 */ 0x30,0, 0x30,0, 0x18,0, 0x0c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0290 */ 0x00,0, 0x00,0, 0x30,0, 0x18,0, 0x0c,0, 0x0c,0, 0x0c,0, 0x0c,0, /* 0x0298 */ 0x0c,0, 0x0c,0, 0x18,0, 0x30,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02a0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x66,0, 0x3c,0, 0xff,0, /* 0x02a8 */ 0x3c,0, 0x66,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02b0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x7e,0, /* 0x02b8 */ 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02c0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02c8 */ 0x00,0, 0x18,0, 0x18,0, 0x18,0, 0x30,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02d0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7e,0, /* 0x02d8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02e0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02e8 */ 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02f0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x02,0, 0x06,0, 0x0c,0, 0x18,0, /* 0x02f8 */ 0x30,0, 0x60,0, 0xc0,0, 0x80,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0300 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0xce,0, 0xde,0, 0xf6,0, /* 0x0308 */ 0xe6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0310 */ 0x00,0, 0x00,0, 0x18,0, 0x38,0, 0x78,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0318 */ 0x18,0, 0x18,0, 0x18,0, 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0320 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0x06,0, 0x0c,0, 0x18,0, 0x30,0, /* 0x0328 */ 0x60,0, 0xc0,0, 0xc6,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0330 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0x06,0, 0x06,0, 0x3c,0, 0x06,0, /* 0x0338 */ 0x06,0, 0x06,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0340 */ 0x00,0, 0x00,0, 0x0c,0, 0x1c,0, 0x3c,0, 0x6c,0, 0xcc,0, 0xfe,0, /* 0x0348 */ 0x0c,0, 0x0c,0, 0x0c,0, 0x1e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0350 */ 0x00,0, 0x00,0, 0xfe,0, 0xc0,0, 0xc0,0, 0xc0,0, 0xfc,0, 0x06,0, /* 0x0358 */ 0x06,0, 0x06,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0360 */ 0x00,0, 0x00,0, 0x38,0, 0x60,0, 0xc0,0, 0xc0,0, 0xfc,0, 0xc6,0, /* 0x0368 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0370 */ 0x00,0, 0x00,0, 0xfe,0, 0xc6,0, 0x06,0, 0x06,0, 0x0c,0, 0x18,0, /* 0x0378 */ 0x30,0, 0x30,0, 0x30,0, 0x30,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0380 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0xc6,0, /* 0x0388 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0390 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x7e,0, 0x06,0, /* 0x0398 */ 0x06,0, 0x06,0, 0x0c,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03a0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, /* 0x03a8 */ 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03b0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, /* 0x03b8 */ 0x00,0, 0x18,0, 0x18,0, 0x30,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03c0 */ 0x00,0, 0x00,0, 0x00,0, 0x06,0, 0x0c,0, 0x18,0, 0x30,0, 0x60,0, /* 0x03c8 */ 0x30,0, 0x18,0, 0x0c,0, 0x06,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03d0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7e,0, 0x00,0, 0x00,0, /* 0x03d8 */ 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03e0 */ 0x00,0, 0x00,0, 0x00,0, 0x60,0, 0x30,0, 0x18,0, 0x0c,0, 0x06,0, /* 0x03e8 */ 0x0c,0, 0x18,0, 0x30,0, 0x60,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03f0 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0x0c,0, 0x18,0, 0x18,0, /* 0x03f8 */ 0x18,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0400 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xde,0, 0xde,0, /* 0x0408 */ 0xde,0, 0xdc,0, 0xc0,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0410 */ 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x6c,0, 0xc6,0, 0xc6,0, 0xfe,0, /* 0x0418 */ 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0420 */ 0x00,0, 0x00,0, 0xfc,0, 0x66,0, 0x66,0, 0x66,0, 0x7c,0, 0x66,0, /* 0x0428 */ 0x66,0, 0x66,0, 0x66,0, 0xfc,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0430 */ 0x00,0, 0x00,0, 0x3c,0, 0x66,0, 0xc2,0, 0xc0,0, 0xc0,0, 0xc0,0, /* 0x0438 */ 0xc0,0, 0xc2,0, 0x66,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0440 */ 0x00,0, 0x00,0, 0xf8,0, 0x6c,0, 0x66,0, 0x66,0, 0x66,0, 0x66,0, /* 0x0448 */ 0x66,0, 0x66,0, 0x6c,0, 0xf8,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0450 */ 0x00,0, 0x00,0, 0xfe,0, 0x66,0, 0x62,0, 0x68,0, 0x78,0, 0x68,0, /* 0x0458 */ 0x60,0, 0x62,0, 0x66,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0460 */ 0x00,0, 0x00,0, 0xfe,0, 0x66,0, 0x62,0, 0x68,0, 0x78,0, 0x68,0, /* 0x0468 */ 0x60,0, 0x60,0, 0x60,0, 0xf0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0470 */ 0x00,0, 0x00,0, 0x3c,0, 0x66,0, 0xc2,0, 0xc0,0, 0xc0,0, 0xde,0, /* 0x0478 */ 0xc6,0, 0xc6,0, 0x66,0, 0x3a,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0480 */ 0x00,0, 0x00,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xfe,0, 0xc6,0, /* 0x0488 */ 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0490 */ 0x00,0, 0x00,0, 0x3c,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0498 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04a0 */ 0x00,0, 0x00,0, 0x1e,0, 0x0c,0, 0x0c,0, 0x0c,0, 0x0c,0, 0x0c,0, /* 0x04a8 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04b0 */ 0x00,0, 0x00,0, 0xe6,0, 0x66,0, 0x66,0, 0x6c,0, 0x78,0, 0x78,0, /* 0x04b8 */ 0x6c,0, 0x66,0, 0x66,0, 0xe6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04c0 */ 0x00,0, 0x00,0, 0xf0,0, 0x60,0, 0x60,0, 0x60,0, 0x60,0, 0x60,0, /* 0x04c8 */ 0x60,0, 0x62,0, 0x66,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04d0 */ 0x00,0, 0x00,0, 0xc3,0, 0xe7,0, 0xff,0, 0xff,0, 0xdb,0, 0xc3,0, /* 0x04d8 */ 0xc3,0, 0xc3,0, 0xc3,0, 0xc3,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04e0 */ 0x00,0, 0x00,0, 0xc6,0, 0xe6,0, 0xf6,0, 0xfe,0, 0xde,0, 0xce,0, /* 0x04e8 */ 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04f0 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, /* 0x04f8 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0500 */ 0x00,0, 0x00,0, 0xfc,0, 0x66,0, 0x66,0, 0x66,0, 0x7c,0, 0x60,0, /* 0x0508 */ 0x60,0, 0x60,0, 0x60,0, 0xf0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0510 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, /* 0x0518 */ 0xc6,0, 0xd6,0, 0xde,0, 0x7c,0, 0x0c,0, 0x0e,0, 0x00,0, 0x00,0, /* 0x0520 */ 0x00,0, 0x00,0, 0xfc,0, 0x66,0, 0x66,0, 0x66,0, 0x7c,0, 0x6c,0, /* 0x0528 */ 0x66,0, 0x66,0, 0x66,0, 0xe6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0530 */ 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0x60,0, 0x38,0, 0x0c,0, /* 0x0538 */ 0x06,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0540 */ 0x00,0, 0x00,0, 0xff,0, 0xdb,0, 0x99,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0548 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0550 */ 0x00,0, 0x00,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, /* 0x0558 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0560 */ 0x00,0, 0x00,0, 0xc3,0, 0xc3,0, 0xc3,0, 0xc3,0, 0xc3,0, 0xc3,0, /* 0x0568 */ 0xc3,0, 0x66,0, 0x3c,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0570 */ 0x00,0, 0x00,0, 0xc3,0, 0xc3,0, 0xc3,0, 0xc3,0, 0xc3,0, 0xdb,0, /* 0x0578 */ 0xdb,0, 0xff,0, 0x66,0, 0x66,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0580 */ 0x00,0, 0x00,0, 0xc3,0, 0xc3,0, 0x66,0, 0x3c,0, 0x18,0, 0x18,0, /* 0x0588 */ 0x3c,0, 0x66,0, 0xc3,0, 0xc3,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0590 */ 0x00,0, 0x00,0, 0xc3,0, 0xc3,0, 0xc3,0, 0x66,0, 0x3c,0, 0x18,0, /* 0x0598 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05a0 */ 0x00,0, 0x00,0, 0xff,0, 0xc3,0, 0x86,0, 0x0c,0, 0x18,0, 0x30,0, /* 0x05a8 */ 0x60,0, 0xc1,0, 0xc3,0, 0xff,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05b0 */ 0x00,0, 0x00,0, 0x3c,0, 0x30,0, 0x30,0, 0x30,0, 0x30,0, 0x30,0, /* 0x05b8 */ 0x30,0, 0x30,0, 0x30,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05c0 */ 0x00,0, 0x00,0, 0x00,0, 0x80,0, 0xc0,0, 0xe0,0, 0x70,0, 0x38,0, /* 0x05c8 */ 0x1c,0, 0x0e,0, 0x06,0, 0x02,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05d0 */ 0x00,0, 0x00,0, 0x3c,0, 0x0c,0, 0x0c,0, 0x0c,0, 0x0c,0, 0x0c,0, /* 0x05d8 */ 0x0c,0, 0x0c,0, 0x0c,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05e0 */ 0x10,0, 0x38,0, 0x6c,0, 0xc6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05e8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05f0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05f8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, 0x00,0, 0x00,0, /* 0x0600 */ 0x30,0, 0x30,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0608 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0610 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x78,0, 0x0c,0, 0x7c,0, /* 0x0618 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0620 */ 0x00,0, 0x00,0, 0xe0,0, 0x60,0, 0x60,0, 0x78,0, 0x6c,0, 0x66,0, /* 0x0628 */ 0x66,0, 0x66,0, 0x66,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0630 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc0,0, /* 0x0638 */ 0xc0,0, 0xc0,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0640 */ 0x00,0, 0x00,0, 0x1c,0, 0x0c,0, 0x0c,0, 0x3c,0, 0x6c,0, 0xcc,0, /* 0x0648 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0650 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xfe,0, /* 0x0658 */ 0xc0,0, 0xc0,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0660 */ 0x00,0, 0x00,0, 0x38,0, 0x6c,0, 0x64,0, 0x60,0, 0xf0,0, 0x60,0, /* 0x0668 */ 0x60,0, 0x60,0, 0x60,0, 0xf0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0670 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x76,0, 0xcc,0, 0xcc,0, /* 0x0678 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x7c,0, 0x0c,0, 0xcc,0, 0x78,0, 0x00,0, /* 0x0680 */ 0x00,0, 0x00,0, 0xe0,0, 0x60,0, 0x60,0, 0x6c,0, 0x76,0, 0x66,0, /* 0x0688 */ 0x66,0, 0x66,0, 0x66,0, 0xe6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0690 */ 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x38,0, 0x18,0, 0x18,0, /* 0x0698 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06a0 */ 0x00,0, 0x00,0, 0x06,0, 0x06,0, 0x00,0, 0x0e,0, 0x06,0, 0x06,0, /* 0x06a8 */ 0x06,0, 0x06,0, 0x06,0, 0x06,0, 0x66,0, 0x66,0, 0x3c,0, 0x00,0, /* 0x06b0 */ 0x00,0, 0x00,0, 0xe0,0, 0x60,0, 0x60,0, 0x66,0, 0x6c,0, 0x78,0, /* 0x06b8 */ 0x78,0, 0x6c,0, 0x66,0, 0xe6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06c0 */ 0x00,0, 0x00,0, 0x38,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x06c8 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06d0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xe6,0, 0xff,0, 0xdb,0, /* 0x06d8 */ 0xdb,0, 0xdb,0, 0xdb,0, 0xdb,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06e0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xdc,0, 0x66,0, 0x66,0, /* 0x06e8 */ 0x66,0, 0x66,0, 0x66,0, 0x66,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06f0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, /* 0x06f8 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0700 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xdc,0, 0x66,0, 0x66,0, /* 0x0708 */ 0x66,0, 0x66,0, 0x66,0, 0x7c,0, 0x60,0, 0x60,0, 0xf0,0, 0x00,0, /* 0x0710 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x76,0, 0xcc,0, 0xcc,0, /* 0x0718 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x7c,0, 0x0c,0, 0x0c,0, 0x1e,0, 0x00,0, /* 0x0720 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xdc,0, 0x76,0, 0x66,0, /* 0x0728 */ 0x60,0, 0x60,0, 0x60,0, 0xf0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0730 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0x60,0, /* 0x0738 */ 0x38,0, 0x0c,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0740 */ 0x00,0, 0x00,0, 0x10,0, 0x30,0, 0x30,0, 0xfc,0, 0x30,0, 0x30,0, /* 0x0748 */ 0x30,0, 0x30,0, 0x36,0, 0x1c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0750 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xcc,0, 0xcc,0, 0xcc,0, /* 0x0758 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0760 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xc3,0, 0xc3,0, 0xc3,0, /* 0x0768 */ 0xc3,0, 0x66,0, 0x3c,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0770 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xc3,0, 0xc3,0, 0xc3,0, /* 0x0778 */ 0xdb,0, 0xdb,0, 0xff,0, 0x66,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0780 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xc3,0, 0x66,0, 0x3c,0, /* 0x0788 */ 0x18,0, 0x3c,0, 0x66,0, 0xc3,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0790 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xc6,0, 0xc6,0, 0xc6,0, /* 0x0798 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7e,0, 0x06,0, 0x0c,0, 0xf8,0, 0x00,0, /* 0x07a0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0xcc,0, 0x18,0, /* 0x07a8 */ 0x30,0, 0x60,0, 0xc6,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07b0 */ 0x00,0, 0x00,0, 0x0e,0, 0x18,0, 0x18,0, 0x18,0, 0x70,0, 0x18,0, /* 0x07b8 */ 0x18,0, 0x18,0, 0x18,0, 0x0e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07c0 */ 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x00,0, 0x18,0, /* 0x07c8 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07d0 */ 0x00,0, 0x00,0, 0x70,0, 0x18,0, 0x18,0, 0x18,0, 0x0e,0, 0x18,0, /* 0x07d8 */ 0x18,0, 0x18,0, 0x18,0, 0x70,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07e0 */ 0x00,0, 0x00,0, 0x76,0, 0xdc,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07e8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07f0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x6c,0, 0xc6,0, /* 0x07f8 */ 0xc6,0, 0xc6,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0800 */ 0x00,0, 0x00,0, 0x3c,0, 0x66,0, 0xc2,0, 0xc0,0, 0xc0,0, 0xc0,0, /* 0x0808 */ 0xc2,0, 0x66,0, 0x3c,0, 0x0c,0, 0x06,0, 0x7c,0, 0x00,0, 0x00,0, /* 0x0810 */ 0x00,0, 0x00,0, 0xcc,0, 0x00,0, 0x00,0, 0xcc,0, 0xcc,0, 0xcc,0, /* 0x0818 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0820 */ 0x00,0, 0x0c,0, 0x18,0, 0x30,0, 0x00,0, 0x7c,0, 0xc6,0, 0xfe,0, /* 0x0828 */ 0xc0,0, 0xc0,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0830 */ 0x00,0, 0x10,0, 0x38,0, 0x6c,0, 0x00,0, 0x78,0, 0x0c,0, 0x7c,0, /* 0x0838 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0840 */ 0x00,0, 0x00,0, 0xcc,0, 0x00,0, 0x00,0, 0x78,0, 0x0c,0, 0x7c,0, /* 0x0848 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0850 */ 0x00,0, 0x60,0, 0x30,0, 0x18,0, 0x00,0, 0x78,0, 0x0c,0, 0x7c,0, /* 0x0858 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0860 */ 0x00,0, 0x38,0, 0x6c,0, 0x38,0, 0x00,0, 0x78,0, 0x0c,0, 0x7c,0, /* 0x0868 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0870 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x3c,0, 0x66,0, 0x60,0, 0x60,0, /* 0x0878 */ 0x66,0, 0x3c,0, 0x0c,0, 0x06,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0880 */ 0x00,0, 0x10,0, 0x38,0, 0x6c,0, 0x00,0, 0x7c,0, 0xc6,0, 0xfe,0, /* 0x0888 */ 0xc0,0, 0xc0,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0890 */ 0x00,0, 0x00,0, 0xc6,0, 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xfe,0, /* 0x0898 */ 0xc0,0, 0xc0,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08a0 */ 0x00,0, 0x60,0, 0x30,0, 0x18,0, 0x00,0, 0x7c,0, 0xc6,0, 0xfe,0, /* 0x08a8 */ 0xc0,0, 0xc0,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08b0 */ 0x00,0, 0x00,0, 0x66,0, 0x00,0, 0x00,0, 0x38,0, 0x18,0, 0x18,0, /* 0x08b8 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08c0 */ 0x00,0, 0x18,0, 0x3c,0, 0x66,0, 0x00,0, 0x38,0, 0x18,0, 0x18,0, /* 0x08c8 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08d0 */ 0x00,0, 0x60,0, 0x30,0, 0x18,0, 0x00,0, 0x38,0, 0x18,0, 0x18,0, /* 0x08d8 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08e0 */ 0x00,0, 0xc6,0, 0x00,0, 0x10,0, 0x38,0, 0x6c,0, 0xc6,0, 0xc6,0, /* 0x08e8 */ 0xfe,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08f0 */ 0x38,0, 0x6c,0, 0x38,0, 0x00,0, 0x38,0, 0x6c,0, 0xc6,0, 0xc6,0, /* 0x08f8 */ 0xfe,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0900 */ 0x18,0, 0x30,0, 0x60,0, 0x00,0, 0xfe,0, 0x66,0, 0x60,0, 0x7c,0, /* 0x0908 */ 0x60,0, 0x60,0, 0x66,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0910 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x6e,0, 0x3b,0, 0x1b,0, /* 0x0918 */ 0x7e,0, 0xd8,0, 0xdc,0, 0x77,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0920 */ 0x00,0, 0x00,0, 0x3e,0, 0x6c,0, 0xcc,0, 0xcc,0, 0xfe,0, 0xcc,0, /* 0x0928 */ 0xcc,0, 0xcc,0, 0xcc,0, 0xce,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0930 */ 0x00,0, 0x10,0, 0x38,0, 0x6c,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, /* 0x0938 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0940 */ 0x00,0, 0x00,0, 0xc6,0, 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, /* 0x0948 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0950 */ 0x00,0, 0x60,0, 0x30,0, 0x18,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, /* 0x0958 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0960 */ 0x00,0, 0x30,0, 0x78,0, 0xcc,0, 0x00,0, 0xcc,0, 0xcc,0, 0xcc,0, /* 0x0968 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0970 */ 0x00,0, 0x60,0, 0x30,0, 0x18,0, 0x00,0, 0xcc,0, 0xcc,0, 0xcc,0, /* 0x0978 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0980 */ 0x00,0, 0x00,0, 0xc6,0, 0x00,0, 0x00,0, 0xc6,0, 0xc6,0, 0xc6,0, /* 0x0988 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7e,0, 0x06,0, 0x0c,0, 0x78,0, 0x00,0, /* 0x0990 */ 0x00,0, 0xc6,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, /* 0x0998 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x09a0 */ 0x00,0, 0xc6,0, 0x00,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, /* 0x09a8 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x09b0 */ 0x00,0, 0x18,0, 0x18,0, 0x7e,0, 0xc3,0, 0xc0,0, 0xc0,0, 0xc0,0, /* 0x09b8 */ 0xc3,0, 0x7e,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x09c0 */ 0x00,0, 0x38,0, 0x6c,0, 0x64,0, 0x60,0, 0xf0,0, 0x60,0, 0x60,0, /* 0x09c8 */ 0x60,0, 0x60,0, 0xe6,0, 0xfc,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x09d0 */ 0x00,0, 0x00,0, 0xc3,0, 0x66,0, 0x3c,0, 0x18,0, 0xff,0, 0x18,0, /* 0x09d8 */ 0xff,0, 0x18,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x09e0 */ 0x00,0, 0xfc,0, 0x66,0, 0x66,0, 0x7c,0, 0x62,0, 0x66,0, 0x6f,0, /* 0x09e8 */ 0x66,0, 0x66,0, 0x66,0, 0xf3,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x09f0 */ 0x00,0, 0x0e,0, 0x1b,0, 0x18,0, 0x18,0, 0x18,0, 0x7e,0, 0x18,0, /* 0x09f8 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xd8,0, 0x70,0, 0x00,0, 0x00,0, /* 0x0a00 */ 0x00,0, 0x18,0, 0x30,0, 0x60,0, 0x00,0, 0x78,0, 0x0c,0, 0x7c,0, /* 0x0a08 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a10 */ 0x00,0, 0x0c,0, 0x18,0, 0x30,0, 0x00,0, 0x38,0, 0x18,0, 0x18,0, /* 0x0a18 */ 0x18,0, 0x18,0, 0x18,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a20 */ 0x00,0, 0x18,0, 0x30,0, 0x60,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, /* 0x0a28 */ 0xc6,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a30 */ 0x00,0, 0x18,0, 0x30,0, 0x60,0, 0x00,0, 0xcc,0, 0xcc,0, 0xcc,0, /* 0x0a38 */ 0xcc,0, 0xcc,0, 0xcc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a40 */ 0x00,0, 0x00,0, 0x76,0, 0xdc,0, 0x00,0, 0xdc,0, 0x66,0, 0x66,0, /* 0x0a48 */ 0x66,0, 0x66,0, 0x66,0, 0x66,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a50 */ 0x76,0, 0xdc,0, 0x00,0, 0xc6,0, 0xe6,0, 0xf6,0, 0xfe,0, 0xde,0, /* 0x0a58 */ 0xce,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a60 */ 0x00,0, 0x3c,0, 0x6c,0, 0x6c,0, 0x3e,0, 0x00,0, 0x7e,0, 0x00,0, /* 0x0a68 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a70 */ 0x00,0, 0x38,0, 0x6c,0, 0x6c,0, 0x38,0, 0x00,0, 0x7c,0, 0x00,0, /* 0x0a78 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a80 */ 0x00,0, 0x00,0, 0x30,0, 0x30,0, 0x00,0, 0x30,0, 0x30,0, 0x60,0, /* 0x0a88 */ 0xc0,0, 0xc6,0, 0xc6,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a90 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0xc0,0, /* 0x0a98 */ 0xc0,0, 0xc0,0, 0xc0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0aa0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0x06,0, /* 0x0aa8 */ 0x06,0, 0x06,0, 0x06,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ab0 */ 0x00,0, 0xc0,0, 0xc0,0, 0xc2,0, 0xc6,0, 0xcc,0, 0x18,0, 0x30,0, /* 0x0ab8 */ 0x60,0, 0xce,0, 0x9b,0, 0x06,0, 0x0c,0, 0x1f,0, 0x00,0, 0x00,0, /* 0x0ac0 */ 0x00,0, 0xc0,0, 0xc0,0, 0xc2,0, 0xc6,0, 0xcc,0, 0x18,0, 0x30,0, /* 0x0ac8 */ 0x66,0, 0xce,0, 0x96,0, 0x3e,0, 0x06,0, 0x06,0, 0x00,0, 0x00,0, /* 0x0ad0 */ 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0ad8 */ 0x3c,0, 0x3c,0, 0x3c,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ae0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x36,0, 0x6c,0, 0xd8,0, /* 0x0ae8 */ 0x6c,0, 0x36,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0af0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xd8,0, 0x6c,0, 0x36,0, /* 0x0af8 */ 0x6c,0, 0xd8,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0b00 */ 0x11,0, 0x44,0, 0x11,0, 0x44,0, 0x11,0, 0x44,0, 0x11,0, 0x44,0, /* 0x0b08 */ 0x11,0, 0x44,0, 0x11,0, 0x44,0, 0x11,0, 0x44,0, 0x11,0, 0x44,0, /* 0x0b10 */ 0x55,0, 0xaa,0, 0x55,0, 0xaa,0, 0x55,0, 0xaa,0, 0x55,0, 0xaa,0, /* 0x0b18 */ 0x55,0, 0xaa,0, 0x55,0, 0xaa,0, 0x55,0, 0xaa,0, 0x55,0, 0xaa,0, /* 0x0b20 */ 0xdd,0, 0x77,0, 0xdd,0, 0x77,0, 0xdd,0, 0x77,0, 0xdd,0, 0x77,0, /* 0x0b28 */ 0xdd,0, 0x77,0, 0xdd,0, 0x77,0, 0xdd,0, 0x77,0, 0xdd,0, 0x77,0, /* 0x0b30 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0b38 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0b40 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xf8,0, /* 0x0b48 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0b50 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xf8,0, 0x18,0, 0xf8,0, /* 0x0b58 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0b60 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0xf6,0, /* 0x0b68 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0b70 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, /* 0x0b78 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0b80 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xf8,0, 0x18,0, 0xf8,0, /* 0x0b88 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0b90 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0xf6,0, 0x06,0, 0xf6,0, /* 0x0b98 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0ba0 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0ba8 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0bb0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0x06,0, 0xf6,0, /* 0x0bb8 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0bc0 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0xf6,0, 0x06,0, 0xfe,0, /* 0x0bc8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0bd0 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0xfe,0, /* 0x0bd8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0be0 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xf8,0, 0x18,0, 0xf8,0, /* 0x0be8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0bf0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xf8,0, /* 0x0bf8 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0c00 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x1f,0, /* 0x0c08 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c10 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xff,0, /* 0x0c18 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c20 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, /* 0x0c28 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0c30 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x1f,0, /* 0x0c38 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0c40 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, /* 0x0c48 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c50 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xff,0, /* 0x0c58 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0c60 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x1f,0, 0x18,0, 0x1f,0, /* 0x0c68 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0c70 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x37,0, /* 0x0c78 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0c80 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x37,0, 0x30,0, 0x3f,0, /* 0x0c88 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c90 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x3f,0, 0x30,0, 0x37,0, /* 0x0c98 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0ca0 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0xf7,0, 0x00,0, 0xff,0, /* 0x0ca8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0cb0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, 0x00,0, 0xf7,0, /* 0x0cb8 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0cc0 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x37,0, 0x30,0, 0x37,0, /* 0x0cc8 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0cd0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, 0x00,0, 0xff,0, /* 0x0cd8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ce0 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0xf7,0, 0x00,0, 0xf7,0, /* 0x0ce8 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0cf0 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xff,0, 0x00,0, 0xff,0, /* 0x0cf8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d00 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0xff,0, /* 0x0d08 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d10 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, 0x00,0, 0xff,0, /* 0x0d18 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0d20 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, /* 0x0d28 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0d30 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x3f,0, /* 0x0d38 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d40 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x1f,0, 0x18,0, 0x1f,0, /* 0x0d48 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d50 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x1f,0, 0x18,0, 0x1f,0, /* 0x0d58 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0d60 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x3f,0, /* 0x0d68 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0d70 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0xff,0, /* 0x0d78 */ 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, 0x36,0, /* 0x0d80 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xff,0, 0x18,0, 0xff,0, /* 0x0d88 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0d90 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0xf8,0, /* 0x0d98 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0da0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x1f,0, /* 0x0da8 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0db0 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x0db8 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x0dc0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, /* 0x0dc8 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x0dd0 */ 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, /* 0x0dd8 */ 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, /* 0x0de0 */ 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, /* 0x0de8 */ 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, /* 0x0df0 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0x00,0, /* 0x0df8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e00 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x76,0, 0xdc,0, 0xd8,0, /* 0x0e08 */ 0xd8,0, 0xd8,0, 0xdc,0, 0x76,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e10 */ 0x00,0, 0x00,0, 0x78,0, 0xcc,0, 0xcc,0, 0xcc,0, 0xd8,0, 0xcc,0, /* 0x0e18 */ 0xc6,0, 0xc6,0, 0xc6,0, 0xcc,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e20 */ 0x00,0, 0x00,0, 0xfe,0, 0xc6,0, 0xc6,0, 0xc0,0, 0xc0,0, 0xc0,0, /* 0x0e28 */ 0xc0,0, 0xc0,0, 0xc0,0, 0xc0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e30 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0x6c,0, 0x6c,0, 0x6c,0, /* 0x0e38 */ 0x6c,0, 0x6c,0, 0x6c,0, 0x6c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e40 */ 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0xc6,0, 0x60,0, 0x30,0, 0x18,0, /* 0x0e48 */ 0x30,0, 0x60,0, 0xc6,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e50 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7e,0, 0xd8,0, 0xd8,0, /* 0x0e58 */ 0xd8,0, 0xd8,0, 0xd8,0, 0x70,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e60 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x66,0, 0x66,0, 0x66,0, 0x66,0, /* 0x0e68 */ 0x66,0, 0x7c,0, 0x60,0, 0x60,0, 0xc0,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e70 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x76,0, 0xdc,0, 0x18,0, 0x18,0, /* 0x0e78 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e80 */ 0x00,0, 0x00,0, 0x00,0, 0x7e,0, 0x18,0, 0x3c,0, 0x66,0, 0x66,0, /* 0x0e88 */ 0x66,0, 0x3c,0, 0x18,0, 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0e90 */ 0x00,0, 0x00,0, 0x00,0, 0x38,0, 0x6c,0, 0xc6,0, 0xc6,0, 0xfe,0, /* 0x0e98 */ 0xc6,0, 0xc6,0, 0x6c,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ea0 */ 0x00,0, 0x00,0, 0x38,0, 0x6c,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x6c,0, /* 0x0ea8 */ 0x6c,0, 0x6c,0, 0x6c,0, 0xee,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0eb0 */ 0x00,0, 0x00,0, 0x1e,0, 0x30,0, 0x18,0, 0x0c,0, 0x3e,0, 0x66,0, /* 0x0eb8 */ 0x66,0, 0x66,0, 0x66,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ec0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7e,0, 0xdb,0, 0xdb,0, /* 0x0ec8 */ 0xdb,0, 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ed0 */ 0x00,0, 0x00,0, 0x00,0, 0x03,0, 0x06,0, 0x7e,0, 0xdb,0, 0xdb,0, /* 0x0ed8 */ 0xf3,0, 0x7e,0, 0x60,0, 0xc0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ee0 */ 0x00,0, 0x00,0, 0x1c,0, 0x30,0, 0x60,0, 0x60,0, 0x7c,0, 0x60,0, /* 0x0ee8 */ 0x60,0, 0x60,0, 0x30,0, 0x1c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ef0 */ 0x00,0, 0x00,0, 0x00,0, 0x7c,0, 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, /* 0x0ef8 */ 0xc6,0, 0xc6,0, 0xc6,0, 0xc6,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f00 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0x00,0, 0x00,0, 0xfe,0, /* 0x0f08 */ 0x00,0, 0x00,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f10 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x7e,0, 0x18,0, /* 0x0f18 */ 0x18,0, 0x00,0, 0x00,0, 0xff,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f20 */ 0x00,0, 0x00,0, 0x00,0, 0x30,0, 0x18,0, 0x0c,0, 0x06,0, 0x0c,0, /* 0x0f28 */ 0x18,0, 0x30,0, 0x00,0, 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f30 */ 0x00,0, 0x00,0, 0x00,0, 0x0c,0, 0x18,0, 0x30,0, 0x60,0, 0x30,0, /* 0x0f38 */ 0x18,0, 0x0c,0, 0x00,0, 0x7e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f40 */ 0x00,0, 0x00,0, 0x0e,0, 0x1b,0, 0x1b,0, 0x1b,0, 0x18,0, 0x18,0, /* 0x0f48 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0f50 */ 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, 0x18,0, /* 0x0f58 */ 0xd8,0, 0xd8,0, 0xd8,0, 0x70,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f60 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x7e,0, /* 0x0f68 */ 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f70 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x76,0, 0xdc,0, 0x00,0, /* 0x0f78 */ 0x76,0, 0xdc,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f80 */ 0x00,0, 0x38,0, 0x6c,0, 0x6c,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f88 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0f90 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, /* 0x0f98 */ 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0fa0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0fa8 */ 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0fb0 */ 0x00,0, 0x0f,0, 0x0c,0, 0x0c,0, 0x0c,0, 0x0c,0, 0x0c,0, 0xec,0, /* 0x0fb8 */ 0x6c,0, 0x6c,0, 0x3c,0, 0x1c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0fc0 */ 0x00,0, 0xd8,0, 0x6c,0, 0x6c,0, 0x6c,0, 0x6c,0, 0x6c,0, 0x00,0, /* 0x0fc8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0fd0 */ 0x00,0, 0x70,0, 0xd8,0, 0x30,0, 0x60,0, 0xc8,0, 0xf8,0, 0x00,0, /* 0x0fd8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0fe0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7c,0, 0x7c,0, 0x7c,0, 0x7c,0, /* 0x0fe8 */ 0x7c,0, 0x7c,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ff0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ff8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, }; char* tmviewfont=font9x16; #define FONTH 16; #define FONTW 9; #define FONTS 0; tmview/fb/writefb.h0100644000175000017500000000205607250444702013665 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ void vgaopen(void); void vgagraph(void); void vgaxscroll(short); void vgayscroll(short); void vgaclose(void); unsigned char vgagetchar(int); void vgasetmouse(int, int); void vgagetmouse(int*, int*, int*, int*); int vgawaitio(fd_set * fdsetin, fd_set * fdsetout, struct timeval *timeout); void (*vgasetclip)(int, int, int, int); void (*vgaupdate)(int, int, int, int); void (*vgadrawrect)(int, int, int, int, int); void (*vgadrawrector)(int, int, int, int, int); void (*vgadrawrectbg)(int, int, int, int, int); int (*vgadimm)(int, int); void (*vgacopybitmapgs)(int, int, int, int, void*, int); void (*vgacopybitmapbw)(int, int, int, int, void*, int); void vgascreen(int); void vgadrawstatus(char, int, int); void vgaupdatestatus(void); int vgasetstatuslines(int); tmview/fb/writefb.c0100644000175000017500000007157507250444702013674 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ #include "../src/defs.h" #include #include #include #include #include #include #include #include /* framebuffer globals */ static uchar *thefb=NULL; static long thefblen; static int thefbxdim; static int thefbydim; static int thefbbyteswidth; static int thefbfd=-1; static struct fb_cmap origpalette={0,0,NULL,NULL,NULL,NULL}; static unsigned short origreds[256]; static unsigned short origgreens[256]; static unsigned short origblues[256]; static unsigned short origtrans[256]; /* terminal related stuff */ static struct termios origtermattr; static struct termios noblotermattr; static int otermvalid=0; static int thevtfd=-1; static int themousefd=-1; /* globals used by my painting stuff */ static uchar *offscreen=NULL, *ptorigin; static int ofscx1, ofscy1, ofscx2, ofscy2; static int fontw, fonth, fonts; /* Function prototypes for font-scaling */ void preparefont(void); void closefont(void); char* expandedfont=NULL; /*#define DEBUGFB */ /* if POSIX O_NONBLOCK is not available, use O_NDELAY */ #if !defined(O_NONBLOCK) && defined(O_NDELAY) #define O_NONBLOCK O_NDELAY #endif /*****************************************************************/ /* deal with framebuffer and virtual terminal */ /* */ void vgaclose(void){ /* must be very robust, called by "atexit" at any time */ /* or even by the signal catcher. issue: do each of the*/ /* below actions only once .. if cleaning itself causes*/ /* a serious error, the signal catcher will again cause*/ /* cleaning and thus again an error .. */ struct vt_mode vtmode; char* zwpt; int zwfd; pfprot("\nwritefb: restore console: "); if(otermvalid){ pfprot("a"); otermvalid=0; tcsetattr(STDIN_FILENO, TCSANOW, &origtermattr); } if(themousefd!=-1){ pfprot("i"); zwfd=themousefd; themousefd=-1; close(zwfd); } if(thefbfd!=-1) { if(origpalette.len!=0) { pfprot("c"); ioctl(thefbfd,FBIOPUTCMAP, &origpalette); origpalette.len=0; } } if(thefb!=NULL) { pfprot("m"); zwpt=thefb; thefb=NULL; munmap(zwpt,thefblen); } if(thefbfd!=-1){ pfprot("f"); zwfd=thefbfd; thefbfd=-1; close(zwfd); } if(thevtfd!=-1){ pfprot("v"); zwfd=thevtfd; thevtfd=-1; ioctl(zwfd, KDSETMODE, KD_TEXT); if(ioctl(zwfd, VT_GETMODE, &vtmode)==0){ vtmode.mode=VT_AUTO; ioctl(zwfd, VT_SETMODE, &vtmode); } signal(SIGUSR1, SIG_DFL); signal(SIGUSR2, SIG_DFL); close(zwfd); } freemem(&offscreen); closefont(); pfprot("\n"); } void vgaerror(char* mssg){ pfprot("\nfatal error: writefb: %s\n",mssg); exit(1); } /* what to do about all the signals that indicate abnormal */ /* termination? need to clean up the console at e.g. SIGSEGV */ /* solution: we install svgalib style signal catcher */ #define sizeofsig2catch (sizeof(sig2catch)/sizeof(*sig2catch)) static int sig2catch[]={ SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGIOT, SIGBUS, SIGFPE, SIGSEGV, SIGPIPE, SIGALRM, SIGTERM, SIGXCPU, SIGXFSZ, SIGVTALRM, SIGPWR}; static struct sigaction old_signal_handler[sizeofsig2catch]; static void catcher(int); /* foreward */ void installcatch(void){ struct sigaction siga; int i; for(i = 0; i < sizeofsig2catch; i++){ siga.sa_handler = catcher; siga.sa_flags = 0; sigemptyset(&(siga.sa_mask)); sigaction(sig2catch[i], &siga, old_signal_handler + i); } } static void catcher(int v){ int i; pfprot("\nwritefb: \"%s\" received\n",strsignal(v)); vgaclose(); for(i = 0; i < sizeofsig2catch; i++) if(sig2catch[i]==v){ sigaction(v, old_signal_handler + i, NULL); raise(v); break; } if(i >= sizeofsig2catch){ pfprot("writefb: cought a signal we shouldn't catch.\n"); raise(SIGSEGV); } } /* the console switching of course is another quite */ /* rather tricky issue. for the scope of dvifb there */ /* is only the routine "myupdate" actually drawing */ /* in the framebuffer ... giving me a chance */ static volatile int updateinprogress=0; static volatile int donotupdate=0; static volatile int pendingswitch=0; void setpalette(void); /* foreward */ static void vtrelease(int n){ /* switch away */ #ifdef DEBUGFB pfprot("(vtrelease)"); #endif donotupdate=1; /* indicate that drawings are no more welcome */ if(!updateinprogress) /* if we are not drawing "right now" its easy: */ ioctl(thevtfd, VT_RELDISP, 1); /* just do it! */ else /* if we are drawing "right now": */ pendingswitch=1; /* ask the drawinroutine to do it later on */ } static void vtaquire(int n) { /* come back */ #ifdef DEBUGFB pfprot("(vtaquire)"); #endif ioctl(thevtfd, VT_RELDISP, VT_ACKACQ); if(offscreen!=NULL && thefb!=NULL) { memcpy(thefb,offscreen,thefblen); setpalette(); } pendingswitch=0; /* discard a pending request ... */ donotupdate=0; /* drawwings welcome again */ } void myupdate(int x1, int y1, int x2, int y2) { int h,w; uchar *src, *dst; if(x1<0) x1=0; if(y1<0) y1=0; if(x2>truevgaxdim-1) x2=truevgaxdim-1; if(y2>truevgaydim-1) y2=truevgaydim-1; if(x20; h--, src+=thefbbyteswidth, dst+=thefbbyteswidth) memcpy(dst,src,w); updateinprogress=0; /* all drawings done so far */ if(pendingswitch){ /* aha: console switch requested while we were busy */ pendingswitch=0; ioctl(thevtfd, VT_RELDISP, 1); } #ifdef DEBUGFB pfprot(")"); #endif } void fbsetpalettecolor(int num, unsigned short r, unsigned short g, unsigned short b){ struct fb_cmap fbc; fbc.start=num; fbc.len=1; fbc.red=&r; fbc.green=&g; fbc.blue=&b; fbc.transp=NULL; if(0!=ioctl(thefbfd,FBIOPUTCMAP, &fbc)) vgaerror("\nerror: writefb: setpalette\n"); } void setpalette(void) { int i; long gl; for(i=0;ifixinfo.smem_len) pfprot("warning: writefb: mapping more than there is?\n"); pfprot("m"); thefb=mmap(NULL,thefblen, PROT_WRITE, MAP_SHARED, thefbfd, 0); /* get error here */ if(thefb==NULL || (long int)thefb ==-1){ thefb=NULL; vgaerror("memory mapping of framebuffer failed"); } seteuid(getuid()); /* give back root permissions */ #ifdef DEBUGFB pfprot("(set euid %d uid %d)",geteuid(),getuid()); #endif /* .. some basic tests, copied from below: under certain */ /* circumstances it is wise to bail out right here */ if(!isatty(STDIN_FILENO)) vgaerror("stdin not a terminal"); ttyfd=open("/dev/tty", O_RDWR); if(ttyfd < 0) vgaerror("cannot open /dev/tty"); if(ioctl(ttyfd, VT_GETSTATE, &ttystat)!=0) vgaerror("cannot get state of vt"); close(ttyfd); /* save framebuffers palette */ pfprot("c"); origpalette.start=0; origpalette.len=255; origpalette.red=origreds; origpalette.green=origgreens; origpalette.blue=origblues; origpalette.transp=origtrans; if(0!=ioctl(thefbfd,FBIOGETCMAP, &origpalette)){ origpalette.len=0; vgaerror("\nerror: writefb: readpalette\n"); } /* accocaletmviews offscreenbuffer */ allocmem(&offscreen,thefblen); /* open mouse deveice */ #ifdef HASMOUSE { uchar o; pfprot("i"); pfprot("(%s)",THEMOUSEDEV); themousefd=open(THEMOUSEDEV,O_RDONLY | O_NONBLOCK); if(themousefd==-1) vgaerror("could not open mouse device"); while(1==read(themousefd, &o, 1)); } #endif /* install signal handlers for vt-switching */ pfprot("v"); ttyfd=open("/dev/tty", O_RDWR); if(ttyfd < 0) vgaerror("cannot open /dev/tty"); if(ioctl(ttyfd, VT_GETSTATE, &ttystat)!=0) vgaerror("cannot get state of vt"); close(ttyfd); vtno=ttystat.v_active; sprintf(vtdevice,"/dev/tty%d",vtno); thevtfd=open(vtdevice, O_RDWR | O_NDELAY); if(thevtfd<0) vgaerror("cannot open vt"); if(ioctl(thevtfd, VT_GETMODE, &vtmode)!=0) vgaerror("cannot get mode of vt"); vtmode.mode =VT_PROCESS; vtmode.relsig=SIGUSR1; vtmode.acqsig=SIGUSR2; signal(SIGUSR1,vtrelease); signal(SIGUSR2,vtaquire); if(ioctl(thevtfd, VT_SETMODE, &vtmode)!=0) vgaerror("cannot install vtswitch handles"); ioctl(thevtfd, KDSETMODE, KD_GRAPHICS); /* set the terminal to noblocking/noecho */ pfprot("a"); if(!isatty(STDIN_FILENO)) vgaerror("stdin not a terminal"); tcgetattr(STDIN_FILENO, &origtermattr); otermvalid=1; tcgetattr(STDIN_FILENO, &noblotermattr); noblotermattr.c_lflag &= ~(ICANON|ECHO); noblotermattr.c_cc[VMIN] = 0; noblotermattr.c_cc[VTIME] = 0; tcsetattr(STDIN_FILENO,TCSAFLUSH, &noblotermattr); pfprot("\n"); } void vgagraph(void) { #ifdef DEBUGFB pfprot("(vgagraph ..."); #endif vgaxdim=truevgaxdim=thefbxdim; vgaydim=truevgaydim=thefbydim; ptorigin=offscreen; #define PTDELTAH (1) #define PTDELTAV (thefbbyteswidth) ofscx1=0; ofscy1=0; ofscx2=vgaxdim-1; ofscy2=vgaydim-1; setpalette(); preparefont(); vgastatushight=fonth+fonts; vgamaxstatuslines=truevgaydim/vgastatushight; vgastatuslen=(truevgaxdim-1)/fontw; #ifdef DEBUGFB pfprot("vgagraph: done)"); #endif } /**************************************************************************/ /* scrolling .. */ /* */ void vgaxscroll(short dx) { int i; uchar *src, *dst; if(abs(dx) >= vgaxdim || dx==0) return; if(dx<0) for(i=vgaydim, src=offscreen-dx, dst=offscreen; i>0; i--, src+=thefbbyteswidth, dst+=thefbbyteswidth) memmove(dst,src,vgaxdim-dx); else for(i=vgaydim, src=offscreen, dst=offscreen+dx; i>0; i--, src+=thefbbyteswidth, dst+=thefbbyteswidth) memmove(dst,src,vgaxdim-dx); } void vgayscroll(short dy) { int i; uchar *src, *dst; if(abs(dy) >= vgaydim || dy==0) return; if(dy<0) for( i=vgaydim+dy, src=offscreen+thefbbyteswidth*(-dy), dst=offscreen; i>0; i--, src+=thefbbyteswidth, dst+=thefbbyteswidth) memcpy(dst,src,vgaxdim); else /* dy>0 */ for( i=vgaydim-dy, src=offscreen+thefbbyteswidth*(vgaydim-dy-1), dst=offscreen+thefbbyteswidth*(vgaydim-1); i>0; i--, src-=thefbbyteswidth, dst-=thefbbyteswidth) memcpy(dst,src,vgaxdim); } /**************************************************************************/ /* keys (and later mice ..) */ /* */ /* mini key queue, holds at most one key */ int mode2char=-1; int vgawaitio(fd_set * fdsetin, fd_set * fdsetout, struct timeval *timeout) { fd_set myfdsetin; int res; if(mode2char>=0) return(STDIN_FILENO); if (fdsetin==NULL) { fdsetin = &myfdsetin; FD_ZERO(fdsetin); } FD_SET(STDIN_FILENO, fdsetin); #ifdef HASMOUSE FD_SET(themousefd, fdsetin); #endif res=select(FD_SETSIZE,fdsetin, fdsetout,NULL,timeout); return(res); } uchar getonechar(void){ int res; if(1==read(STDIN_FILENO, &res, 1)) return(res); return(0); } uchar vgagetchar(int mode) { /* mode==0: get next key, dont block mode==1: get next key, wait mode==2: peek next key, dont block */ uchar input,next1,next2,next3; uchar com=KEYNOP; if(mode2char>=0){ com=mode2char; if(mode!=2) mode2char=-1; return(com); } if(mode==1) /* hang until event occurs */ vgawaitio(NULL, NULL, NULL); input=getonechar(); if(input >= ' ' && input < 128) com= input; else switch(input) { case 9: com=KEYTAB; break; case 10: com=KEYRET; break; case 27: /* escape */ next1=0; next2=0; next3=0; next1= getonechar(); switch(next1) { case 91: next2=getonechar(); switch(next2) { case '6': com= KEYNEXT; break; case '5': com= KEYPREV; break; case 'A': com= KEYUP; break; case 'B': com= KEYDOWN; break; case 'D': com= KEYLEFT; break; case 'C': com= KEYRIGHT; break; case 'G': com= KEYCENTER; break; case '1': com= KEYHOME; break; case '4': com= KEYEND; break; } break; case 0: case 27: com= KEYESC; break; /* allow wild escape abuse */ default: } break; } /*if(input !=0 && input != 255) fprintf(prot,"(vgacommeand: %d %d %d %d)",input,next1,next2,next3);*/ while(input !=0 && input != 255) input=getonechar(); if(mode==2 && com!=KEYNOP) mode2char=com; return(com); } /* now the mouse. we abuse "gpm -R" as a driver, i.e. we read from */ /* the pipe "/dev/gpmdata" and expect mouse-system protocol only */ /* readbuffer for nousedevice 20 events a 5 bytes */ #define MAXMOUSEBUF 100 #define PACKLEN 5 #ifdef HASMOUSE static unsigned char mousebuf[MAXMOUSEBUF]; static int nmousebuf=0; #endif static int omx, omy; void vgasetmouse(int x, int y) { omx=MIN(2*vgaxdim,MAX(-vgaxdim,x)); omy=MIN(2*vgaydim,MAX(-vgaydim,y)); } void vgagetmouse(int *x, int *y, int *left, int* right) { int button=0,dx=0,dy=0; #ifdef HASMOUSE int p,rb; if(donotupdate==0){ /* only care about the mouse as long as the vt is active */ while(1){ /* fill mousebuf */ rb=read(themousefd, mousebuf+nmousebuf, MAXMOUSEBUF-nmousebuf); if(rb>=0) nmousebuf+=rb; if(nmousebuf=PACKLEN)) p++; if(nmousebuf-p MOUSESPEED) dx*=MOUSESPEED; if(abs(dy) > MOUSESPEED) dy*=MOUSESPEED; #endif *x=omx+dx; *y=omy+dy; vgasetmouse(*x,*y); *left= button & 0x04; *right=button & 0x01; } void vgascreen(int son) { } /**************************************************************************/ /* now the pixel copy stuff. destination is allways the offscreen context. provide debugging makros to potential segfaults. */ /* #define DEBUGPIXEL */ #ifdef DEBUGPIXEL #define CPT(apt,mess) \ if(apt=offscreen+vgaxdim*vgaydim ) \ {pfprot("(ctp %s)\n",mess); exit(1);} #define CXY(mess) \ if(x2<=x1 || y2<=y1) \ {pfprot("(cxy %s)\n",mess);} #define CXW(mess) \ if(w<0 || h<0) \ {pfprot("(cxw %s)\n",mess);}\ #else /* no debugging */ #define CPT(apt,mess) #define CXW(mess) #define CXY(mess) #endif /****************************************************************/ /* set/reset clipping */ void mysetclip(int x1, int y1, int x2, int y2) { if(x1<0) x1=0; if(y1<0) y1=0; if(x2>vgaxdim-1) x2=vgaxdim-1; if(y2>vgaydim-1) y2=vgaydim-1; if(x2>dimm); } /*****************************************************************/ /* actually draw something */ void mycopybitsbw(int tx, int ty, int sw, int sh, void* src, int c) { /* this is with self made clipping. no good ? */ /* but it will do for all kind of BMUNIT */ int j,i,supi,supj,mini,minj,sx, skip; BMUNIT *srow, *sbmu; BMUNIT premask, firstpremask; register BMUNIT data, mask; short sbmu_wide; char *ydest, *xdest; char blackc; /*fprintf(prot,"(vgacopybitmap1 : tx %d ty %d sw %d sh %d, ...\n", tx,ty,sw, sh); */ mini=minj=0; if(ty> BITS_LOG2; premask = 1 << (BITS_PER_BMUNIT-1); firstpremask = premask >> skip; srow=((BMUNIT*)src)+mini*sbmu_wide+sx; for (i = mini;i>= 1; xdest++; } srow+=sbmu_wide; sbmu=srow; ydest+=PTDELTAV; } } void mycopybitsgs(int tx, int ty, int sw, int sh, void* src, int c) { /* this is with self made clipping. no good ? */ /* but it will do for all kind of BMUNIT */ /* compatible to gl_putbox */ int j,i,supi,supj,mini,minj,sx, skip; BMUNIT *srow, *sbmu; BMUNIT premask, firstpremask; register BMUNIT data, mask; short sbmu_wide; int rs, firstrs; char *ydest, *xdest; char paintc, sourcec; mini=minj=0; if(ty>GREYSCALE_LOG2)-1); sx= minj >> (BITS_LOG2-GREYSCALE_LOG2); premask = ((1<> (skip<< GREYSCALE_LOG2); firstrs = BITS_PER_BMUNIT-GREYSCALE - skip*GREYSCALE; srow=((BMUNIT*)src)+mini*sbmu_wide+sx; for (i = mini;i>rs)); */ #ifndef LETSTRYCOLOR (*xdest) |= ((data & mask) >> rs); /* sleezy but fast .. (rs+c) */ #else if((paintc=(data & mask) >> (rs+c))){ if((sourcec=(*xdest) & (COLORS_PER_GREY-1))){ if((paintc+=sourcec)>COLORS_PER_GREY-1) paintc=COLORS_PER_GREY-1; (*xdest) &= ~(COLORS_PER_GREY-1); } (*xdest) |=paintc; } #endif mask >>= GREYSCALE; rs-=GREYSCALE; xdest++; } srow+=sbmu_wide; sbmu=srow; ydest+=PTDELTAV; } #ifdef DEBUGFB pfprot(")"); #endif } void mycopybits88(int tx, int ty, int sw, int sh, char* src) { /* this is with self made clipping. no good ? */ /* copy bytes to bytes */ /* compatible to gl_putbox */ int j,i,supi,supj,mini,minj; char *srow, *sbmu; char *ydest, *xdest; mini=minj=0; if(tyofscy2+1) h=ofscy2+1-ty; if(tx+w>ofscx2+1) w=ofscx2+1-tx; if(w <= 0 || h<= 0) { /*fprintf(prot,"clipped all away. no drawings)\n"); */ return; } CXW("rector"); ydest=ptorigin+ty*PTDELTAV+tx; /* pfprot("clipped or box: tx %d ty %d w %d h %d \n", tx,ty,w,h); */ paintc=0; for (;h>0;h--) { xdest=ydest; for (i=w;i>0;i--) { CPT(xdest,"rector") #ifndef LETSTRYCOLOR (*xdest)|=c; /* sleezy but fast */ #else if((sourcec=(*xdest) & (COLORS_PER_GREY-1))){ if((paintc =c+sourcec)>COLORS_PER_GREY-1) paintc=COLORS_PER_GREY-1; (*xdest) &= ~(COLORS_PER_GREY-1); (*xdest) |=paintc; } else { (*xdest) |=c; } #endif xdest++; } ydest+=PTDELTAV; } } void myfillboxbg(int tx, int ty, int w, int h, int c) { char *ydest; int i; register char *xdest; register char xdc; /* fprintf(prot,"(vgafillboxor : tx %d ty %d w %d h %d, ...\n", tx,ty,w,h); */ if(tyofscy2+1) h=ofscy2+1-ty; if(tx+w>ofscx2+1) w=ofscx2+1-tx; if(tx+w>vgaxdim) w=vgaxdim-tx; if(w <= 0 || h<= 0) { /*fprintf(prot,"clipped all away. no drawings)\n"); */ return; } CXW("rectbg"); ydest=ptorigin+ty*PTDELTAV+tx; /* fprintf(prot,"clipped bgbox : tx %d ty %d w %d h %d \n", tx,ty,w,h); */ for (;h>0;h--) { xdest=ydest; for (i=w;i>0;i--) { CPT(xdest,"rectbg") xdc=*xdest; if(xdc){ /*if(xdc>c) *xdest=c; */ /* transparent modus */ if(xdc>BACKCOLS && xdc!= c) *xdest=MIXEDCOL; /* mixing modus */ } else *xdest=c; xdest++; } ydest+=PTDELTAV; } } void myfillbox(int tx, int ty, int w, int h, int c) { char *ydest; int i; register char *xdest; if(tyofscy2+1) h=ofscy2+1-ty; if(tx+w>ofscx2+1) w=ofscx2+1-tx; if(tx+w>vgaxdim) w=vgaxdim-tx; if(w <= 0 || h<= 0) return; #ifdef DEBUGFB pfprot("(vgafillbox : tx %d ty %d w %d h %d", tx,ty,w,h); #endif CXW("rectbg"); ydest=ptorigin+ty*PTDELTAV+tx; for (;h>0;h--) { xdest=ydest; for (i=w;i>0;i--) { CPT(xdest,"rectbg") (*(xdest))=c; xdest++; } ydest+=PTDELTAV; } #ifdef DEBUGFB pfprot(")"); #endif } int vgasetstatuslines(int n) { #ifdef DEBUGFB pfprot("(vgasetstatuslines %d ... ",n); #endif vgastatuslines=MAX(0,MIN(vgamaxstatuslines,n)); vgaydim= truevgaydim- vgastatuslines* vgastatushight; vgaxdim= truevgaxdim; mysetclipof(); /* not clipped !! */ if(vgastatuslines!=vgamaxstatuslines) myfillbox(0,vgaydim,truevgaxdim,vgastatuslines*vgastatushight,TEXTBACKCOL); else myfillbox(0,0,truevgaxdim,truevgaydim,TEXTBACKCOL); myupdate(0,0,vgaxdim-1,truevgaydim-1); mysetclip(0,0,vgaxdim-1,vgaydim-1); #ifdef DEBUGFB pfprot("vgasetstatuslines: done)"); #endif return(vgastatuslines); } void vgaupdatestatus(void) { mysetclipof(); myupdate(0, vgaydim,truevgaxdim-1,truevgaydim-1); mysetclip(0,0,vgaxdim-1,vgaydim-1); } void vgadrawstatus(char chr, int line, int pos) { if(line>=vgastatuslines || line <0) return; if(pos>=vgastatuslen || pos <0) return; mysetclipof(); /* chr=(line&0x0f)*16 + (pos&0x0f); *//* test charset */ mycopybits88(pos*fontw+1, vgaydim+(line+1)* vgastatushight-fonth, fontw, fonth, expandedfont + (unsigned char) chr *fonth*fontw); mysetclip(0,0,vgaxdim-1,vgaydim-1); /* pfprot("(vgadrawstatus [%c] l %d p %d )",chr,line,pos); */ } void (*vgaupdate)(int, int, int, int) = myupdate; void (*vgasetclip)(int, int, int, int) = mysetclip; void (*vgadrawrect)(int x, int y, int w, int h, int c) = myfillbox; void (*vgadrawrector)(int x, int y, int w, int h, int c) = myfillboxor; void (*vgadrawrectbg)(int x, int y, int w, int h, int c) = myfillboxbg; int (*vgadimm)(int, int) = mydimm; void (*vgacopybitmapgs)(int x, int y, int w, int h, void* src, int c) = mycopybitsgs; void (*vgacopybitmapbw)(int x, int y, int w, int h, void* src, int c) = mycopybitsbw; /***************************************************************************/ /* now the font stuff ... */ /* #include "9x14thin.h" */ /* #include "gekl9x16.h" */ #include "font9x16.h" void preparefont(void) { uchar *src; uchar *dst; int i,x,y,b=0; fonth=FONTH; fontw=FONTW; fonts=FONTS; allocmem(&expandedfont,256L*fontw*fonth); src=tmviewfont; dst=expandedfont; for(i=0; i<256; i++){ for(y=0; y> (x % 8))) *(dst++) = TEXTCOL; else *(dst++) =TEXTBACKCOL; } } } } void closefont(void) { freemem(&expandedfont); } tmview/fb/defsfb.h0100644000175000017500000002512707250444702013460 0ustar tmoortmoor/* This is part of tmview, a dvi previewer. (c) 1995 Thomas Moor */ /* */ /* This program may be used without any warranty. It may be modified and */ /* distributed without any restrictions. */ /* defs for the framebuffer version of tmview */ /* will be copyed to "src/defs.h" */ /* includes "src/defsgen.h" */ /* essential for I/O primitives and signalhandling: don't use pure posix, use either BSD- or GNU-extensions. */ #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #include #include /* the framebuffer devive to use */ #define THEFBDEV "/dev/fb0" /* *************************************************************************** startup values, commandline default: here only those which tend to be deveice/platform dependant. see "src/defsgen.h" for more options *************************************************************************** */ /* set defaults for the options -t, -f, -g and -n */ #define TFMDIR "./:/usr/lib/texmf/fonts//:/usr/local/teTeX/texmf/fonts//" #define PKDIR "./:/usr/lib/texmf/fonts//:/usr/local/teTeX/texmf/fonts//" #define VFDIR "./:/usr/lib/texmf/fonts//:/usr/local/teTeX/texmf/fonts//" #define PKNAME "@N.@Mpk" /* set defaults for the option -s */ /* and fallback systemwide startupfile */ #define STARTUPFILENAME "~/.dvifb" #define SYSTEMSTARTUPFILENAME "/etc/dvifb" /* Users kept asking about using kpathsea ... so: */ /* to use kpathsea, define KPATHSEA below. to use tmviews built in */ /* font searching, don't define KPATHSEA. */ /* Since I'm not distributing KPATHSEA, you'll have to get the library*/ /* from somewhere. See CTAN. I did test with the library which comes */ /* with dviljk-2.5. Note: it makes not much sense to use a kpathsea */ /* different from the one of the rest of your TeX-installation. E.g. */ /* teTeX users best use the kpathsea from the teTeX sources. After all*/ /* configuring tmview to go with kpathsea requires some knowhow ... */ /* */ /* I've located two different kinds of initializing kpathsea, */ /* depending on which kpathsea is used (actually I've got this info */ /* from the diff-file of debian/slink) Below exactly one of */ /* KPATHSEAOLDSTYLE and KPATHSEANEWSTYLE need to be defined to set up */ /* tmview to go with your kpathsea. To figure out the right choice, */ /* visit your /usr//include/kpathsea/proginit.h: if it defines the */ /* function kpse_init_prog to have 5 arguments by "P5H", then its */ /* KPATHSEAOLDSTYLE. Probably, you will go into details and check the */ /* meaning of these arguments. See also "./tmview/src/tmview.c". */ /* However, if kpse_init_prog is defined to have 4 arguments ("P4H"),*/ /* its KPATHSEANEWSTYLE. */ /* */ /* Running MakeTeXPK by kpathsea within dvifb may be disabled below. */ /* #define KPATHSEA */ #ifdef KPATHSEA #define KPATHMODE NULL /* put f.e. "cx" here, to consist on cx fonts */ #define KPATHMAKE 1 /* put 0 here, to disable MakeTeXPK */ #define KPATHDEFF "cmr10" /* fallback font */ #define KPATHSEANEWSTYLE /* new=fine for teTeX from debian(see above)*/ /*#define KPATHSEAOLDSTYLE*//* old=fine for NTeX from Slakware */ #endif /* support for eps-figurs by calling ghostscript */ #define LETSTRYGS /* disable gs as startup-default. user may enable rendering by typing */ /* #define GSDEFOFF */ /*#define GSBIN "/usr/bin/gs" *//* absolute path of binary */ #define GSBIN "gs" /* name of binary, use $PATH to locate it */ /* extra pixel to avoid clipping .. */ #define GSEXTRAPXL 3 /* plus 3 pxl on screen */ #define GSEXTRAPT 3 /* plus 3 1/72 in epsfile */ /* greyscaling for eps-files */ /*#define GSGREY 1 *//* 1x1 pxl <> turned off */ #define GSGREY 2 /* 2x2 pxl <> cheap */ /*#define GSGREY 4 *//* 4x4 pxl <> expensive */ /* bufferlength for reading from gs */ #define GSBLOCKLEN 8192L /* arguments for calling gs */ #define GSARGLEN 40 /* max length og args */ #define GSARG0 "gs" #define GSARG1 "-sDEVICE=bit" #define GSARG2 "-sOutputFile=-" #define GSARG3 "-dNOPAUSE" #define GSARG4 "-dSAFER" #define GSARG5 "-q" #define GSARGPATH "-I%s" #define GSARGSIZE "-g%dx%d" #define GSARGRES "-r%.2fx%.2f" #define GSARGLAST "-" #define GSCODEINTRO " /SDict 200 dict def SDict begin /showpage { } def " #define GSCODESCALE " %.5f %.5f scale " #define GSCODETRANS " %.2f %.2f translate " #define GSCODEROTATE " %.2f rotate " #define GSCODEFILE " (%s) run " #define GSCODEQUIT " end showpage quit " /* dummys for resolution */ #define VGAXDIM 0 #define VGAYDIM 0 /* a little support for color specials */ #define LETSTRYCOLOR /* *************************************************************************** more internal stuff, make tmview go with the framebuffer *************************************************************************** */ /* be careful with storge types !!! */ #define BMLONG32 /* for architectures where "long int" has 32bits, e.g. i386 */ /* #define BMLONG64 *//* for architectures where "long int" has 64bits, e.g. alpha */ /* #define GREYINBMU *//* waste memory. may be a bit faster */ /* if DOSFILES is defined, a dosfilesystem is expected, */ /* incl. ugly naming conventions, like drive-letters and "\" instead ob "/". */ /* Dont use this with unix sytems */ /* #define DOSFILES */ /* yes, gnu does support the gnu-extensions to getcwd() ..*/ #define GNU_GETCWD /* waiting for IO available: dont do polling */ #define VGAHASWAITIO /* if HASMOUSE is defined, tmview offers a little mousesupport */ /* however, only the mouse-system protocol is accepted. so you */ /* may have to run "gpm -R" in order to repeat/translate your */ /* mouse-whatever protocol on /dev/gpmdata. */ #define HASMOUSE /* have a little mousesoupport */ #define THEMOUSEDEV "/dev/gpmdata" /* use "gpm -R" */ #define MOUSESPEED 3 /* speed of mousemotion */ /*#define TRACKBALL 1 */ /* scrolling by mouse only if button pressed */ /* #define HASWINDOWS *//* the framebuffer itself is no window system */ /* the following sets the way things go on the screen resp. window. tmview allways keeps the screen/windows contents in an internal buffer. You must define exactly one of the below options. To provide flickering, you may define NOTHINGONSCREEN, making tmview updating the screen from the buffer when the drawings are compleeted. On some Systems this will result in the best performance, depending on the screen driver. Set ALLONSCREEN, to make tmview drawing allways directly to the screen/window. This might result in higher performance, at the cost of some flickering. Set CURSORSNOTONSCREEEN to get a mixture of the above: when only cursormovement is to be drawn, use the buffer. If more than that is to be drawn, dont use the buffer. Set SCROLLONSCREEN to get a mixture of the above: when scrolling is to be done, use an XRequest directly. Anything else is done in the buffer. */ #define ALLONSCREEN 0 #define NOTHINGONSCREEN 1 #define CURSORSNOTONSCREEN 0 #define SCROLLONSCREEN 0 /* ************************************************************************ now there will be some colorstuff. colors are changable here. but it's the best to leave this untouched ... ************************************************************************* */ /* Bytes representing colors internaly ... will be one by one mapped to the actual color palette using a 256 pseudocolor mode */ #define COLORS_PER_GREY 16 /* should be 2^BITS_PER_GREY */ #define WHITECOL 0 #define BLACKCOL (COLORS_PER_GREY-1) #define BORDERCOL COLORS_PER_GREY #define TEXTCOL COLORS_PER_GREY+1 #define TEXTBACKCOL COLORS_PER_GREY+2 #define FRAMECOL COLORS_PER_GREY+3 #define TFMCOL COLORS_PER_GREY+4 #define RECTCOL COLORS_PER_GREY+5 #define BACKCOLS COLORS_PER_GREY+16 /* start at least transparent */ #define MARKSCOL COLORS_PER_GREY+17 #define MARKHCOL COLORS_PER_GREY+18 #define FOUNDCOL COLORS_PER_GREY+19 #define HREFCOL COLORS_PER_GREY+20 #define MARKDCOL COLORS_PER_GREY+21 #define MIXEDCOL COLORS_PER_GREY+22 /* mixed all */ #define NUMBER_OF_COLORS COLORS_PER_GREY+23 /*number of colors */ /* definition of some rgb triples, 16-bit-per-componente */ /* in fact beside of greyscales no other colors are used. */ /* to make green more blue, edit here. */ /* if you have a grey-scale-only display, set dark colors */ /* to dark grey and light colors to light grey. */ #define PALWHITE 65535,65535,65535 /* white */ #define PALLGREY 56448,56448,56448 /* light grey */ #define PALBLACK 0,0,0 /* black */ #define PALDRED 41088,10368,5248 /* dark red */ #define PALDGREEN 0,41088,10368 /* dark green */ #define PALDBLUE 3200,10368,41088 /* dark blue */ #define PALLRED 65535,51328,44118 /* light red */ #define PALLGREEN 41088,65535,51328 /* light green */ #define PALLBLUE 44118,51328,65535 /* light blue */ /* definition of colors */ /* this determines the colors on the display */ /* the following may be changed without any (?) restictions.*/ /* setting */ /* #define SETPALFRAMECOL FRAMECOL,0,63,0 */ /* results in having a bright green as framecolor */ #define SETPALTEXTCOL TEXTCOL,PALBLACK #define SETPALTEXTBACKCOL TEXTBACKCOL,PALLGREY #define SETPALFRAMECOL FRAMECOL,PALDRED #define SETPALBORDERCOL BORDERCOL,PALDGREEN #define SETPALTFMCOL TFMCOL,PALDBLUE #define SETPALRECTCOL RECTCOL,PALDBLUE #define SETPALMARKSCOL MARKSCOL,PALLBLUE #define SETPALMARKHCOL MARKHCOL,PALLGREEN #define SETPALFOUNDCOL FOUNDCOL,PALLGREEN #define SETPALHREFCOL HREFCOL,PALLBLUE #define SETPALMARKDCOL MARKDCOL,PALLRED #define SETPALMIXEDCOL MIXEDCOL,PALLGREY /* *************************************************************************** include general topics *************************************************************************** */ #include "defsgen.h" tmview/fb/9x14thin.h0100644000175000017500000011137207250444702013615 0ustar tmoortmoor/* this the font-file "8x14thin" as a c-vektor */ /* done with "hexdump -v -e '"/* 0x%.4_ax * / " 7 1 "0x%.2x,0, " "\n"' " */ char thin9x14[]={ /* 0x0000 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0007 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x000e */ 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x82,0, 0xaa,0, 0x82,0, /* 0x0015 */ 0xaa,0, 0xba,0, 0x44,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x001c */ 0x00,0, 0x00,0, 0x38,0, 0x7c,0, 0xfe,0, 0xd6,0, 0xfe,0, /* 0x0023 */ 0xba,0, 0xc6,0, 0x7c,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x002a */ 0x00,0, 0x00,0, 0x44,0, 0xee,0, 0xee,0, 0xfe,0, 0x7c,0, /* 0x0031 */ 0x7c,0, 0x38,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0038 */ 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x38,0, 0x7c,0, 0xfe,0, /* 0x003f */ 0x7c,0, 0x38,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0046 */ 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x38,0, 0x10,0, 0xfe,0, /* 0x004d */ 0xee,0, 0x54,0, 0x10,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0054 */ 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x7c,0, 0xfe,0, 0xfe,0, /* 0x005b */ 0xee,0, 0x54,0, 0x10,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0062 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x38,0, /* 0x0069 */ 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0070 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xe7,0, 0xc3,0, /* 0x0077 */ 0xc3,0, 0xe7,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x007e */ 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x24,0, 0x42,0, 0x42,0, /* 0x0085 */ 0x42,0, 0x24,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x008c */ 0xff,0, 0xff,0, 0xff,0, 0xe7,0, 0xdb,0, 0xbd,0, 0xbd,0, /* 0x0093 */ 0xbd,0, 0xdb,0, 0xe7,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x009a */ 0x00,0, 0x00,0, 0x00,0, 0x0e,0, 0x06,0, 0x0a,0, 0x70,0, /* 0x00a1 */ 0x88,0, 0x88,0, 0x88,0, 0x70,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00a8 */ 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x44,0, 0x44,0, 0x38,0, /* 0x00af */ 0x10,0, 0x10,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00b6 */ 0x00,0, 0x00,0, 0x18,0, 0x1c,0, 0x14,0, 0x14,0, 0x10,0, /* 0x00bd */ 0x10,0, 0x30,0, 0x70,0, 0x60,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00c4 */ 0x00,0, 0x00,0, 0x30,0, 0x38,0, 0x2c,0, 0x66,0, 0xe2,0, /* 0x00cb */ 0xc2,0, 0x06,0, 0x0e,0, 0x0c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00d2 */ 0x00,0, 0x00,0, 0x10,0, 0x54,0, 0x38,0, 0x44,0, 0xc6,0, /* 0x00d9 */ 0x44,0, 0x38,0, 0x54,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00e0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xc0,0, 0xf8,0, 0xfe,0, /* 0x00e7 */ 0xf8,0, 0xc0,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00ee */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x06,0, 0x3e,0, 0xfe,0, /* 0x00f5 */ 0x3e,0, 0x06,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x00fc */ 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x7c,0, 0x10,0, 0x10,0, /* 0x0103 */ 0x7c,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x010a */ 0x00,0, 0x00,0, 0x44,0, 0x44,0, 0x44,0, 0x44,0, 0x44,0, /* 0x0111 */ 0x44,0, 0x00,0, 0x00,0, 0x44,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0118 */ 0x00,0, 0x00,0, 0x7e,0, 0x8a,0, 0x8a,0, 0x8a,0, 0x7a,0, /* 0x011f */ 0x0a,0, 0x0a,0, 0x0a,0, 0x0a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0126 */ 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x40,0, 0x30,0, 0x28,0, /* 0x012d */ 0x18,0, 0x04,0, 0x44,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0134 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, /* 0x013b */ 0xfe,0, 0xfe,0, 0xfe,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0142 */ 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x7c,0, 0x10,0, 0x10,0, /* 0x0149 */ 0x7c,0, 0x38,0, 0x10,0, 0x00,0, 0xfe,0, 0x00,0, 0x00,0, /* 0x0150 */ 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x7c,0, 0x10,0, 0x10,0, /* 0x0157 */ 0x10,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x015e */ 0x00,0, 0x00,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, /* 0x0165 */ 0x7c,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x016c */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x08,0, 0x0c,0, 0xfe,0, /* 0x0173 */ 0x0c,0, 0x08,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x017a */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x20,0, 0x60,0, 0xfe,0, /* 0x0181 */ 0x60,0, 0x20,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0188 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x80,0, 0x80,0, 0x80,0, /* 0x018f */ 0x80,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0196 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x28,0, 0x6c,0, 0xfe,0, /* 0x019d */ 0x6c,0, 0x28,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01a4 */ 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x38,0, 0x38,0, 0x7c,0, /* 0x01ab */ 0x7c,0, 0xfe,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01b2 */ 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0xfe,0, 0x7c,0, 0x7c,0, /* 0x01b9 */ 0x38,0, 0x38,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01c0 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01c7 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01ce */ 0x00,0, 0x00,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, /* 0x01d5 */ 0x10,0, 0x00,0, 0x00,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01dc */ 0x00,0, 0x00,0, 0x28,0, 0x28,0, 0x28,0, 0x00,0, 0x00,0, /* 0x01e3 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01ea */ 0x00,0, 0x00,0, 0x28,0, 0x28,0, 0xfe,0, 0x28,0, 0x28,0, /* 0x01f1 */ 0x28,0, 0xfe,0, 0x28,0, 0x28,0, 0x00,0, 0x00,0, 0x00,0, /* 0x01f8 */ 0x00,0, 0x00,0, 0x10,0, 0x7c,0, 0x92,0, 0x90,0, 0x7c,0, /* 0x01ff */ 0x12,0, 0x92,0, 0x7c,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0206 */ 0x00,0, 0x00,0, 0x40,0, 0xa2,0, 0xa4,0, 0x48,0, 0x10,0, /* 0x020d */ 0x24,0, 0x4a,0, 0x8a,0, 0x04,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0214 */ 0x00,0, 0x00,0, 0x30,0, 0x48,0, 0x48,0, 0x30,0, 0x50,0, /* 0x021b */ 0x8a,0, 0x84,0, 0x84,0, 0x7a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0222 */ 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x08,0, 0x10,0, 0x00,0, /* 0x0229 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0230 */ 0x00,0, 0x00,0, 0x08,0, 0x10,0, 0x20,0, 0x20,0, 0x20,0, /* 0x0237 */ 0x20,0, 0x20,0, 0x10,0, 0x08,0, 0x00,0, 0x00,0, 0x00,0, /* 0x023e */ 0x00,0, 0x00,0, 0x20,0, 0x10,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0245 */ 0x08,0, 0x08,0, 0x10,0, 0x20,0, 0x00,0, 0x00,0, 0x00,0, /* 0x024c */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x28,0, 0x10,0, 0x7c,0, /* 0x0253 */ 0x10,0, 0x28,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x025a */ 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x10,0, 0x10,0, 0xfe,0, /* 0x0261 */ 0x10,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0268 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x026f */ 0x00,0, 0x00,0, 0x30,0, 0x30,0, 0x10,0, 0x20,0, 0x00,0, /* 0x0276 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, /* 0x027d */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0284 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x028b */ 0x00,0, 0x00,0, 0x30,0, 0x30,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0292 */ 0x00,0, 0x00,0, 0x00,0, 0x02,0, 0x04,0, 0x08,0, 0x10,0, /* 0x0299 */ 0x20,0, 0x40,0, 0x80,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02a0 */ 0x00,0, 0x00,0, 0x78,0, 0x84,0, 0x8c,0, 0x94,0, 0xa4,0, /* 0x02a7 */ 0xc4,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02ae */ 0x00,0, 0x00,0, 0x10,0, 0x30,0, 0x50,0, 0x10,0, 0x10,0, /* 0x02b5 */ 0x10,0, 0x10,0, 0x10,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02bc */ 0x00,0, 0x00,0, 0x78,0, 0x84,0, 0x04,0, 0x08,0, 0x30,0, /* 0x02c3 */ 0x40,0, 0x80,0, 0x80,0, 0xfc,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02ca */ 0x00,0, 0x00,0, 0x78,0, 0x84,0, 0x04,0, 0x04,0, 0x38,0, /* 0x02d1 */ 0x04,0, 0x04,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02d8 */ 0x00,0, 0x00,0, 0x08,0, 0x18,0, 0x28,0, 0x48,0, 0x88,0, /* 0x02df */ 0x88,0, 0xfe,0, 0x08,0, 0x08,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02e6 */ 0x00,0, 0x00,0, 0xfc,0, 0x80,0, 0x80,0, 0x80,0, 0xf8,0, /* 0x02ed */ 0x04,0, 0x04,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x02f4 */ 0x00,0, 0x00,0, 0x78,0, 0x84,0, 0x80,0, 0x80,0, 0xf8,0, /* 0x02fb */ 0x84,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0302 */ 0x00,0, 0x00,0, 0xfc,0, 0x04,0, 0x04,0, 0x08,0, 0x10,0, /* 0x0309 */ 0x20,0, 0x20,0, 0x20,0, 0x20,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0310 */ 0x00,0, 0x00,0, 0x78,0, 0x84,0, 0x84,0, 0x84,0, 0x78,0, /* 0x0317 */ 0x84,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x031e */ 0x00,0, 0x00,0, 0x78,0, 0x84,0, 0x84,0, 0x84,0, 0x7c,0, /* 0x0325 */ 0x04,0, 0x04,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x032c */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x18,0, /* 0x0333 */ 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, /* 0x033a */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, 0x18,0, /* 0x0341 */ 0x00,0, 0x00,0, 0x18,0, 0x18,0, 0x08,0, 0x10,0, 0x00,0, /* 0x0348 */ 0x00,0, 0x00,0, 0x02,0, 0x04,0, 0x08,0, 0x10,0, 0x20,0, /* 0x034f */ 0x10,0, 0x08,0, 0x04,0, 0x02,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0356 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0x00,0, /* 0x035d */ 0x00,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0364 */ 0x00,0, 0x00,0, 0x20,0, 0x10,0, 0x08,0, 0x04,0, 0x02,0, /* 0x036b */ 0x04,0, 0x08,0, 0x10,0, 0x20,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0372 */ 0x00,0, 0x00,0, 0x7c,0, 0x82,0, 0x82,0, 0x02,0, 0x0c,0, /* 0x0379 */ 0x10,0, 0x10,0, 0x00,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0380 */ 0x00,0, 0x00,0, 0x3c,0, 0x42,0, 0x9a,0, 0xa6,0, 0xa6,0, /* 0x0387 */ 0x9a,0, 0x80,0, 0x42,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x038e */ 0x00,0, 0x00,0, 0x10,0, 0x28,0, 0x44,0, 0x82,0, 0x82,0, /* 0x0395 */ 0xfe,0, 0x82,0, 0x82,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x039c */ 0x00,0, 0x00,0, 0xfc,0, 0x42,0, 0x42,0, 0x42,0, 0x7c,0, /* 0x03a3 */ 0x42,0, 0x42,0, 0x42,0, 0xfc,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03aa */ 0x00,0, 0x00,0, 0x3c,0, 0x42,0, 0x80,0, 0x80,0, 0x80,0, /* 0x03b1 */ 0x80,0, 0x80,0, 0x42,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03b8 */ 0x00,0, 0x00,0, 0xf8,0, 0x44,0, 0x42,0, 0x42,0, 0x42,0, /* 0x03bf */ 0x42,0, 0x42,0, 0x44,0, 0xf8,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03c6 */ 0x00,0, 0x00,0, 0xfe,0, 0x80,0, 0x80,0, 0x80,0, 0xf8,0, /* 0x03cd */ 0x80,0, 0x80,0, 0x80,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03d4 */ 0x00,0, 0x00,0, 0xfe,0, 0x80,0, 0x80,0, 0x80,0, 0xf8,0, /* 0x03db */ 0x80,0, 0x80,0, 0x80,0, 0x80,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03e2 */ 0x00,0, 0x00,0, 0x3c,0, 0x42,0, 0x80,0, 0x80,0, 0x8e,0, /* 0x03e9 */ 0x82,0, 0x82,0, 0x42,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03f0 */ 0x00,0, 0x00,0, 0x82,0, 0x82,0, 0x82,0, 0x82,0, 0xfe,0, /* 0x03f7 */ 0x82,0, 0x82,0, 0x82,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x03fe */ 0x00,0, 0x00,0, 0x7c,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, /* 0x0405 */ 0x10,0, 0x10,0, 0x10,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x040c */ 0x00,0, 0x00,0, 0x3e,0, 0x04,0, 0x04,0, 0x04,0, 0x04,0, /* 0x0413 */ 0x04,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x041a */ 0x00,0, 0x00,0, 0x82,0, 0x84,0, 0x88,0, 0x90,0, 0xe0,0, /* 0x0421 */ 0x90,0, 0x88,0, 0x84,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0428 */ 0x00,0, 0x00,0, 0x80,0, 0x80,0, 0x80,0, 0x80,0, 0x80,0, /* 0x042f */ 0x80,0, 0x80,0, 0x80,0, 0xfc,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0436 */ 0x00,0, 0x00,0, 0x82,0, 0xc6,0, 0xaa,0, 0x92,0, 0x92,0, /* 0x043d */ 0x82,0, 0x82,0, 0x82,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0444 */ 0x00,0, 0x00,0, 0x82,0, 0x82,0, 0xc2,0, 0xa2,0, 0x92,0, /* 0x044b */ 0x8a,0, 0x86,0, 0x82,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0452 */ 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x82,0, 0x82,0, 0x82,0, /* 0x0459 */ 0x82,0, 0x82,0, 0x44,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0460 */ 0x00,0, 0x00,0, 0xfc,0, 0x82,0, 0x82,0, 0x82,0, 0xfc,0, /* 0x0467 */ 0x80,0, 0x80,0, 0x80,0, 0x80,0, 0x00,0, 0x00,0, 0x00,0, /* 0x046e */ 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x82,0, 0x82,0, 0x82,0, /* 0x0475 */ 0x92,0, 0x8a,0, 0x44,0, 0x3a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x047c */ 0x00,0, 0x00,0, 0xfc,0, 0x82,0, 0x82,0, 0x82,0, 0xfc,0, /* 0x0483 */ 0x90,0, 0x88,0, 0x84,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x048a */ 0x00,0, 0x00,0, 0x7c,0, 0x82,0, 0x80,0, 0x80,0, 0x7c,0, /* 0x0491 */ 0x02,0, 0x02,0, 0x82,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0498 */ 0x00,0, 0x00,0, 0xfe,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, /* 0x049f */ 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04a6 */ 0x00,0, 0x00,0, 0x82,0, 0x82,0, 0x82,0, 0x82,0, 0x82,0, /* 0x04ad */ 0x82,0, 0x82,0, 0x44,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04b4 */ 0x00,0, 0x00,0, 0x82,0, 0x82,0, 0x82,0, 0x44,0, 0x44,0, /* 0x04bb */ 0x28,0, 0x28,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04c2 */ 0x00,0, 0x00,0, 0x82,0, 0x82,0, 0x82,0, 0x82,0, 0x92,0, /* 0x04c9 */ 0x92,0, 0x92,0, 0xaa,0, 0x44,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04d0 */ 0x00,0, 0x00,0, 0x82,0, 0x82,0, 0x44,0, 0x28,0, 0x10,0, /* 0x04d7 */ 0x28,0, 0x44,0, 0x82,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04de */ 0x00,0, 0x00,0, 0x82,0, 0x82,0, 0x44,0, 0x28,0, 0x10,0, /* 0x04e5 */ 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04ec */ 0x00,0, 0x00,0, 0xfe,0, 0x02,0, 0x04,0, 0x08,0, 0x10,0, /* 0x04f3 */ 0x20,0, 0x40,0, 0x80,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, /* 0x04fa */ 0x00,0, 0x00,0, 0x3c,0, 0x20,0, 0x20,0, 0x20,0, 0x20,0, /* 0x0501 */ 0x20,0, 0x20,0, 0x20,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0508 */ 0x00,0, 0x00,0, 0x00,0, 0x80,0, 0x40,0, 0x20,0, 0x10,0, /* 0x050f */ 0x08,0, 0x04,0, 0x02,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0516 */ 0x00,0, 0x00,0, 0x3c,0, 0x04,0, 0x04,0, 0x04,0, 0x04,0, /* 0x051d */ 0x04,0, 0x04,0, 0x04,0, 0x3c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0524 */ 0x00,0, 0x10,0, 0x28,0, 0x44,0, 0x00,0, 0x00,0, 0x00,0, /* 0x052b */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0532 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0539 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0x00,0, /* 0x0540 */ 0x00,0, 0x00,0, 0x08,0, 0x10,0, 0x18,0, 0x18,0, 0x00,0, /* 0x0547 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x054e */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x78,0, 0x04,0, /* 0x0555 */ 0x7c,0, 0x84,0, 0x84,0, 0x7a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x055c */ 0x00,0, 0x00,0, 0x80,0, 0x80,0, 0x80,0, 0xb8,0, 0xc4,0, /* 0x0563 */ 0x84,0, 0x84,0, 0xc4,0, 0xb8,0, 0x00,0, 0x00,0, 0x00,0, /* 0x056a */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0571 */ 0x80,0, 0x80,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0578 */ 0x00,0, 0x00,0, 0x04,0, 0x04,0, 0x04,0, 0x74,0, 0x8c,0, /* 0x057f */ 0x84,0, 0x84,0, 0x8c,0, 0x74,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0586 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x78,0, 0x84,0, /* 0x058d */ 0xfc,0, 0x80,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0594 */ 0x00,0, 0x00,0, 0x18,0, 0x24,0, 0x20,0, 0xf8,0, 0x20,0, /* 0x059b */ 0x20,0, 0x20,0, 0x20,0, 0x20,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05a2 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x74,0, 0x8c,0, /* 0x05a9 */ 0x8c,0, 0x8c,0, 0x74,0, 0x04,0, 0x84,0, 0x78,0, 0x00,0, /* 0x05b0 */ 0x00,0, 0x00,0, 0x80,0, 0x80,0, 0x80,0, 0xb8,0, 0xc4,0, /* 0x05b7 */ 0x84,0, 0x84,0, 0x84,0, 0x84,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05be */ 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x00,0, 0x30,0, 0x10,0, /* 0x05c5 */ 0x10,0, 0x10,0, 0x10,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05cc */ 0x00,0, 0x00,0, 0x00,0, 0x08,0, 0x00,0, 0x38,0, 0x08,0, /* 0x05d3 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x88,0, 0x70,0, 0x00,0, /* 0x05da */ 0x00,0, 0x00,0, 0x80,0, 0x80,0, 0x84,0, 0x88,0, 0x90,0, /* 0x05e1 */ 0xa0,0, 0xd0,0, 0x88,0, 0x84,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05e8 */ 0x00,0, 0x00,0, 0x30,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, /* 0x05ef */ 0x10,0, 0x10,0, 0x10,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x05f6 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xec,0, 0x92,0, /* 0x05fd */ 0x92,0, 0x92,0, 0x92,0, 0x92,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0604 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xb8,0, 0xc4,0, /* 0x060b */ 0x84,0, 0x84,0, 0x84,0, 0x84,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0612 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0619 */ 0x84,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0620 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xb8,0, 0xc4,0, /* 0x0627 */ 0x84,0, 0xc4,0, 0xb8,0, 0x80,0, 0x80,0, 0x80,0, 0x00,0, /* 0x062e */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x74,0, 0x8c,0, /* 0x0635 */ 0x84,0, 0x8c,0, 0x74,0, 0x04,0, 0x04,0, 0x04,0, 0x00,0, /* 0x063c */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xb8,0, 0xc4,0, /* 0x0643 */ 0x80,0, 0x80,0, 0x80,0, 0x80,0, 0x00,0, 0x00,0, 0x00,0, /* 0x064a */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0651 */ 0x60,0, 0x18,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0658 */ 0x00,0, 0x00,0, 0x00,0, 0x20,0, 0x20,0, 0xf8,0, 0x20,0, /* 0x065f */ 0x20,0, 0x20,0, 0x24,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0666 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x84,0, 0x84,0, /* 0x066d */ 0x84,0, 0x84,0, 0x8c,0, 0x74,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0674 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x82,0, 0x82,0, /* 0x067b */ 0x44,0, 0x44,0, 0x28,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0682 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x82,0, 0x82,0, /* 0x0689 */ 0x92,0, 0x92,0, 0xaa,0, 0x44,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0690 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x84,0, 0x48,0, /* 0x0697 */ 0x30,0, 0x30,0, 0x48,0, 0x84,0, 0x00,0, 0x00,0, 0x00,0, /* 0x069e */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x84,0, 0x84,0, /* 0x06a5 */ 0x84,0, 0x8c,0, 0x74,0, 0x04,0, 0x84,0, 0x78,0, 0x00,0, /* 0x06ac */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfc,0, 0x08,0, /* 0x06b3 */ 0x10,0, 0x20,0, 0x40,0, 0xfc,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06ba */ 0x00,0, 0x00,0, 0x0c,0, 0x10,0, 0x10,0, 0x10,0, 0x20,0, /* 0x06c1 */ 0x10,0, 0x10,0, 0x10,0, 0x0c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06c8 */ 0x00,0, 0x00,0, 0x10,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, /* 0x06cf */ 0x00,0, 0x10,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06d6 */ 0x00,0, 0x00,0, 0x30,0, 0x08,0, 0x08,0, 0x08,0, 0x04,0, /* 0x06dd */ 0x08,0, 0x08,0, 0x08,0, 0x30,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06e4 */ 0x00,0, 0x00,0, 0x64,0, 0x98,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06eb */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x06f2 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x28,0, /* 0x06f9 */ 0x44,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0700 */ 0x00,0, 0x00,0, 0x3c,0, 0x42,0, 0x80,0, 0x80,0, 0x80,0, /* 0x0707 */ 0x80,0, 0x80,0, 0x42,0, 0x3c,0, 0x04,0, 0x38,0, 0x00,0, /* 0x070e */ 0x00,0, 0x00,0, 0x00,0, 0x48,0, 0x00,0, 0x84,0, 0x84,0, /* 0x0715 */ 0x84,0, 0x84,0, 0x8c,0, 0x74,0, 0x00,0, 0x00,0, 0x00,0, /* 0x071c */ 0x00,0, 0x00,0, 0x0c,0, 0x10,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0723 */ 0xfc,0, 0x80,0, 0x80,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x072a */ 0x00,0, 0x10,0, 0x28,0, 0x44,0, 0x00,0, 0x78,0, 0x04,0, /* 0x0731 */ 0x7c,0, 0x84,0, 0x84,0, 0x7a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0738 */ 0x00,0, 0x00,0, 0x00,0, 0x48,0, 0x00,0, 0x78,0, 0x04,0, /* 0x073f */ 0x7c,0, 0x84,0, 0x84,0, 0x7a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0746 */ 0x00,0, 0x00,0, 0x30,0, 0x08,0, 0x00,0, 0x78,0, 0x04,0, /* 0x074d */ 0x7c,0, 0x84,0, 0x84,0, 0x7a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0754 */ 0x00,0, 0x10,0, 0x28,0, 0x10,0, 0x00,0, 0x78,0, 0x04,0, /* 0x075b */ 0x7c,0, 0x84,0, 0x84,0, 0x7a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0762 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0769 */ 0x80,0, 0x80,0, 0x84,0, 0x78,0, 0x08,0, 0x70,0, 0x00,0, /* 0x0770 */ 0x00,0, 0x30,0, 0x48,0, 0x84,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0777 */ 0xfc,0, 0x80,0, 0x80,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x077e */ 0x00,0, 0x00,0, 0x00,0, 0x48,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0785 */ 0xfc,0, 0x80,0, 0x80,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x078c */ 0x00,0, 0x00,0, 0x60,0, 0x10,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0793 */ 0xfc,0, 0x80,0, 0x80,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x079a */ 0x00,0, 0x00,0, 0x00,0, 0x48,0, 0x00,0, 0x30,0, 0x10,0, /* 0x07a1 */ 0x10,0, 0x10,0, 0x10,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07a8 */ 0x00,0, 0x10,0, 0x28,0, 0x44,0, 0x00,0, 0x30,0, 0x10,0, /* 0x07af */ 0x10,0, 0x10,0, 0x10,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07b6 */ 0x00,0, 0x00,0, 0x60,0, 0x10,0, 0x00,0, 0x30,0, 0x10,0, /* 0x07bd */ 0x10,0, 0x10,0, 0x10,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07c4 */ 0x00,0, 0x00,0, 0x44,0, 0x00,0, 0x10,0, 0x28,0, 0x44,0, /* 0x07cb */ 0x82,0, 0xfe,0, 0x82,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07d2 */ 0x10,0, 0x28,0, 0x10,0, 0x00,0, 0x10,0, 0x28,0, 0x44,0, /* 0x07d9 */ 0x82,0, 0xfe,0, 0x82,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07e0 */ 0x00,0, 0x18,0, 0x20,0, 0x00,0, 0xfc,0, 0x80,0, 0x80,0, /* 0x07e7 */ 0xf0,0, 0x80,0, 0x80,0, 0xfc,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07ee */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xec,0, 0x12,0, /* 0x07f5 */ 0x7c,0, 0x90,0, 0x90,0, 0x6e,0, 0x00,0, 0x00,0, 0x00,0, /* 0x07fc */ 0x00,0, 0x00,0, 0x1e,0, 0x30,0, 0x50,0, 0x90,0, 0x9e,0, /* 0x0803 */ 0xf0,0, 0x90,0, 0x90,0, 0x9e,0, 0x00,0, 0x00,0, 0x00,0, /* 0x080a */ 0x00,0, 0x30,0, 0x48,0, 0x84,0, 0x00,0, 0x78,0, 0x84,0, /* 0x0811 */ 0x84,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0818 */ 0x00,0, 0x00,0, 0x00,0, 0x48,0, 0x00,0, 0x78,0, 0x84,0, /* 0x081f */ 0x84,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0826 */ 0x00,0, 0x00,0, 0x60,0, 0x10,0, 0x00,0, 0x78,0, 0x84,0, /* 0x082d */ 0x84,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0834 */ 0x00,0, 0x30,0, 0x48,0, 0x84,0, 0x00,0, 0x84,0, 0x84,0, /* 0x083b */ 0x84,0, 0x84,0, 0x8c,0, 0x74,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0842 */ 0x00,0, 0x00,0, 0x60,0, 0x10,0, 0x00,0, 0x84,0, 0x84,0, /* 0x0849 */ 0x84,0, 0x84,0, 0x8c,0, 0x74,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0850 */ 0x00,0, 0x00,0, 0x00,0, 0x48,0, 0x00,0, 0x84,0, 0x84,0, /* 0x0857 */ 0x84,0, 0x8c,0, 0x74,0, 0x04,0, 0x84,0, 0x78,0, 0x00,0, /* 0x085e */ 0x00,0, 0x00,0, 0x44,0, 0x00,0, 0x38,0, 0x44,0, 0x82,0, /* 0x0865 */ 0x82,0, 0x82,0, 0x44,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x086c */ 0x00,0, 0x00,0, 0x44,0, 0x00,0, 0x82,0, 0x82,0, 0x82,0, /* 0x0873 */ 0x82,0, 0x82,0, 0x44,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x087a */ 0x00,0, 0x00,0, 0x10,0, 0x10,0, 0x78,0, 0x84,0, 0x80,0, /* 0x0881 */ 0x80,0, 0x84,0, 0x78,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, /* 0x0888 */ 0x00,0, 0x00,0, 0x78,0, 0x84,0, 0x80,0, 0x40,0, 0xf8,0, /* 0x088f */ 0x20,0, 0x20,0, 0x62,0, 0x9c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0896 */ 0x00,0, 0x00,0, 0x82,0, 0x44,0, 0x28,0, 0x10,0, 0x7c,0, /* 0x089d */ 0x10,0, 0x7c,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08a4 */ 0x00,0, 0x00,0, 0xf0,0, 0x88,0, 0x88,0, 0xf0,0, 0x88,0, /* 0x08ab */ 0x9c,0, 0x88,0, 0x88,0, 0x08,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08b2 */ 0x00,0, 0x00,0, 0x18,0, 0x24,0, 0x20,0, 0x20,0, 0x78,0, /* 0x08b9 */ 0x20,0, 0x20,0, 0x20,0, 0x20,0, 0x20,0, 0xc0,0, 0x00,0, /* 0x08c0 */ 0x00,0, 0x00,0, 0x18,0, 0x20,0, 0x00,0, 0x78,0, 0x04,0, /* 0x08c7 */ 0x7c,0, 0x84,0, 0x84,0, 0x7a,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08ce */ 0x00,0, 0x00,0, 0x18,0, 0x20,0, 0x00,0, 0x30,0, 0x10,0, /* 0x08d5 */ 0x10,0, 0x10,0, 0x10,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08dc */ 0x00,0, 0x00,0, 0x18,0, 0x20,0, 0x00,0, 0x78,0, 0x84,0, /* 0x08e3 */ 0x84,0, 0x84,0, 0x84,0, 0x78,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08ea */ 0x00,0, 0x00,0, 0x18,0, 0x20,0, 0x00,0, 0x84,0, 0x84,0, /* 0x08f1 */ 0x84,0, 0x84,0, 0x8c,0, 0x74,0, 0x00,0, 0x00,0, 0x00,0, /* 0x08f8 */ 0x00,0, 0x00,0, 0x64,0, 0x98,0, 0x00,0, 0xb8,0, 0xc4,0, /* 0x08ff */ 0x84,0, 0x84,0, 0x84,0, 0x84,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0906 */ 0x00,0, 0x00,0, 0x32,0, 0x4c,0, 0x82,0, 0xc2,0, 0xa2,0, /* 0x090d */ 0x92,0, 0x8a,0, 0x86,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0914 */ 0x00,0, 0x00,0, 0x70,0, 0x08,0, 0x38,0, 0x48,0, 0x34,0, /* 0x091b */ 0x00,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0922 */ 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x44,0, 0x44,0, 0x38,0, /* 0x0929 */ 0x00,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0930 */ 0x00,0, 0x00,0, 0x10,0, 0x00,0, 0x10,0, 0x10,0, 0x60,0, /* 0x0937 */ 0x80,0, 0x82,0, 0x82,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x093e */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0945 */ 0xfe,0, 0x80,0, 0x80,0, 0x80,0, 0x00,0, 0x00,0, 0x00,0, /* 0x094c */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0953 */ 0xfe,0, 0x02,0, 0x02,0, 0x02,0, 0x00,0, 0x00,0, 0x00,0, /* 0x095a */ 0x00,0, 0x00,0, 0x40,0, 0xc0,0, 0x48,0, 0x50,0, 0x20,0, /* 0x0961 */ 0x5c,0, 0x04,0, 0x08,0, 0x1c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0968 */ 0x00,0, 0x00,0, 0x40,0, 0xc0,0, 0x48,0, 0x50,0, 0x20,0, /* 0x096f */ 0x54,0, 0x14,0, 0x1e,0, 0x04,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0976 */ 0x00,0, 0x00,0, 0x10,0, 0x00,0, 0x00,0, 0x10,0, 0x10,0, /* 0x097d */ 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0984 */ 0x00,0, 0x00,0, 0x00,0, 0x12,0, 0x24,0, 0x48,0, 0x90,0, /* 0x098b */ 0x48,0, 0x24,0, 0x12,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0992 */ 0x00,0, 0x00,0, 0x00,0, 0x90,0, 0x48,0, 0x24,0, 0x12,0, /* 0x0999 */ 0x24,0, 0x48,0, 0x90,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x09a0 */ 0x88,0, 0x22,0, 0x88,0, 0x22,0, 0x88,0, 0x22,0, 0x88,0, /* 0x09a7 */ 0x22,0, 0x88,0, 0x22,0, 0x88,0, 0x22,0, 0x88,0, 0x22,0, /* 0x09ae */ 0xaa,0, 0x54,0, 0xaa,0, 0x54,0, 0xaa,0, 0x54,0, 0xaa,0, /* 0x09b5 */ 0x54,0, 0xaa,0, 0x54,0, 0xaa,0, 0x54,0, 0xaa,0, 0x54,0, /* 0x09bc */ 0x76,0, 0xdc,0, 0x76,0, 0xdc,0, 0x76,0, 0xdc,0, 0x76,0, /* 0x09c3 */ 0xdc,0, 0x76,0, 0xdc,0, 0x76,0, 0xdc,0, 0x76,0, 0xdc,0, /* 0x09ca */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x09d1 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x09d8 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x09df */ 0xf8,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x09e6 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0xf8,0, 0x08,0, /* 0x09ed */ 0xf8,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x09f4 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x09fb */ 0xf4,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0a02 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a09 */ 0xfc,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0a10 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xf8,0, 0x08,0, /* 0x0a17 */ 0xf8,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0a1e */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0xf4,0, 0x04,0, /* 0x0a25 */ 0xf4,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0a2c */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0a33 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0a3a */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfc,0, 0x04,0, /* 0x0a41 */ 0xf4,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0a48 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0xf4,0, 0x04,0, /* 0x0a4f */ 0xfc,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a56 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0a5d */ 0xfc,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a64 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0xf8,0, 0x08,0, /* 0x0a6b */ 0xf8,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a72 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a79 */ 0xf8,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0a80 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0a87 */ 0x0f,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a8e */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0a95 */ 0xff,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0a9c */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0aa3 */ 0xff,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0aaa */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0ab1 */ 0x0f,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0ab8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0abf */ 0xff,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ac6 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0acd */ 0xff,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0ad4 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x0f,0, 0x08,0, /* 0x0adb */ 0x0f,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0ae2 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0ae9 */ 0x17,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0af0 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x17,0, 0x10,0, /* 0x0af7 */ 0x1f,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0afe */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x1f,0, 0x10,0, /* 0x0b05 */ 0x17,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0b0c */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0xf7,0, 0x00,0, /* 0x0b13 */ 0xff,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0b1a */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, 0x00,0, /* 0x0b21 */ 0xf7,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0b28 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x17,0, 0x14,0, /* 0x0b2f */ 0x17,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0b36 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, 0x00,0, /* 0x0b3d */ 0xff,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0b44 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0xf7,0, 0x00,0, /* 0x0b4b */ 0xf7,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0b52 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0xff,0, 0x00,0, /* 0x0b59 */ 0xff,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0b60 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0b67 */ 0xff,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0b6e */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xff,0, 0x00,0, /* 0x0b75 */ 0xff,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0b7c */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0b83 */ 0xff,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0b8a */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0b91 */ 0x1f,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0b98 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x0f,0, 0x08,0, /* 0x0b9f */ 0x0f,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ba6 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x0f,0, 0x08,0, /* 0x0bad */ 0x0f,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0bb4 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0bbb */ 0x1f,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0bc2 */ 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0bc9 */ 0xff,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, 0x14,0, /* 0x0bd0 */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0xff,0, 0x08,0, /* 0x0bd7 */ 0xff,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0bde */ 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0be5 */ 0xf8,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0bec */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0bf3 */ 0x0f,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, 0x08,0, /* 0x0bfa */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x0c01 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x0c08 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c0f */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x0c16 */ 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, /* 0x0c1d */ 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, 0xf0,0, /* 0x0c24 */ 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, /* 0x0c2b */ 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, 0x0f,0, /* 0x0c32 */ 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, 0xff,0, /* 0x0c39 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c40 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x6e,0, 0x90,0, /* 0x0c47 */ 0x90,0, 0x6e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c4e */ 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x84,0, 0xb8,0, 0x88,0, /* 0x0c55 */ 0x84,0, 0x84,0, 0xa4,0, 0x98,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c5c */ 0x00,0, 0x00,0, 0xfe,0, 0x82,0, 0x82,0, 0x80,0, 0x80,0, /* 0x0c63 */ 0x80,0, 0x80,0, 0x80,0, 0x80,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c6a */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7e,0, 0xa4,0, /* 0x0c71 */ 0x24,0, 0x24,0, 0x24,0, 0x24,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c78 */ 0x00,0, 0x00,0, 0xfc,0, 0x42,0, 0x20,0, 0x10,0, 0x08,0, /* 0x0c7f */ 0x10,0, 0x20,0, 0x42,0, 0xfc,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c86 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7e,0, 0x88,0, /* 0x0c8d */ 0x88,0, 0x88,0, 0x88,0, 0x70,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0c94 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x42,0, 0x42,0, 0x42,0, /* 0x0c9b */ 0x42,0, 0x7c,0, 0x40,0, 0x40,0, 0x80,0, 0x00,0, 0x00,0, /* 0x0ca2 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x7c,0, 0xa0,0, /* 0x0ca9 */ 0x20,0, 0x20,0, 0x28,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0cb0 */ 0x00,0, 0x00,0, 0x38,0, 0x10,0, 0x7c,0, 0x92,0, 0x92,0, /* 0x0cb7 */ 0x92,0, 0x7c,0, 0x10,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0cbe */ 0x00,0, 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x82,0, 0xfe,0, /* 0x0cc5 */ 0x82,0, 0x44,0, 0x38,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ccc */ 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x82,0, 0x82,0, 0x82,0, /* 0x0cd3 */ 0x44,0, 0x28,0, 0xaa,0, 0xee,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0cda */ 0x00,0, 0x00,0, 0x38,0, 0x24,0, 0x10,0, 0x78,0, 0x88,0, /* 0x0ce1 */ 0x88,0, 0x88,0, 0x88,0, 0x70,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0ce8 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x6c,0, 0x92,0, /* 0x0cef */ 0x92,0, 0x6c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0cf6 */ 0x00,0, 0x00,0, 0x00,0, 0xb8,0, 0x44,0, 0xa2,0, 0x92,0, /* 0x0cfd */ 0x8a,0, 0x44,0, 0x3a,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d04 */ 0x00,0, 0x00,0, 0x00,0, 0x3e,0, 0x40,0, 0x80,0, 0xfe,0, /* 0x0d0b */ 0x80,0, 0x40,0, 0x3e,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d12 */ 0x00,0, 0x00,0, 0x00,0, 0x38,0, 0x44,0, 0x82,0, 0x82,0, /* 0x0d19 */ 0x82,0, 0x82,0, 0x82,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d20 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0xfe,0, 0x00,0, 0xfe,0, /* 0x0d27 */ 0x00,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d2e */ 0x00,0, 0x00,0, 0x10,0, 0x10,0, 0x10,0, 0xfe,0, 0x10,0, /* 0x0d35 */ 0x10,0, 0x10,0, 0x00,0, 0xfe,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d3c */ 0x00,0, 0x00,0, 0x20,0, 0x10,0, 0x08,0, 0x04,0, 0x08,0, /* 0x0d43 */ 0x10,0, 0x20,0, 0x00,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d4a */ 0x00,0, 0x00,0, 0x08,0, 0x10,0, 0x20,0, 0x40,0, 0x20,0, /* 0x0d51 */ 0x10,0, 0x08,0, 0x00,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d58 */ 0x00,0, 0x00,0, 0x0c,0, 0x12,0, 0x16,0, 0x10,0, 0x10,0, /* 0x0d5f */ 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, /* 0x0d66 */ 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, /* 0x0d6d */ 0x10,0, 0xd0,0, 0x90,0, 0x60,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d74 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x10,0, 0x00,0, 0xfe,0, /* 0x0d7b */ 0x00,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d82 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x64,0, 0x98,0, 0x00,0, /* 0x0d89 */ 0x64,0, 0x98,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d90 */ 0x00,0, 0x00,0, 0x30,0, 0x48,0, 0x48,0, 0x30,0, 0x00,0, /* 0x0d97 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0d9e */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x18,0, /* 0x0da5 */ 0x3c,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0dac */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0db3 */ 0x18,0, 0x18,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0dba */ 0x00,0, 0x1e,0, 0x10,0, 0x10,0, 0x10,0, 0x10,0, 0x90,0, /* 0x0dc1 */ 0x50,0, 0x30,0, 0x10,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0dc8 */ 0x00,0, 0x58,0, 0x24,0, 0x24,0, 0x24,0, 0x24,0, 0x00,0, /* 0x0dcf */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0dd6 */ 0x00,0, 0x18,0, 0x24,0, 0x08,0, 0x10,0, 0x3c,0, 0x00,0, /* 0x0ddd */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0de4 */ 0x00,0, 0x00,0, 0x7c,0, 0x7c,0, 0x7c,0, 0x7c,0, 0x7c,0, /* 0x0deb */ 0x7c,0, 0x7c,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0df2 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, /* 0x0df9 */ 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, 0x00,0, }; char* tmviewfont=thin9x14; #define FONTH 14 #define FONTW 9 #define FONTS 0 tmview/MakeFb0100644000175000017500000000441707250444702012536 0ustar tmoortmoor# Compiling everything: # fb/linux section SRC=./src/ SSRC=./fb/ OBJ=./src/fb. LIBS= -lm #LIBS= -lkpathsea -lm # when kpathsea is to be used LL=gcc -L /usr/lib CC=gcc -c -O2 -g -Wall -I$(SRC) -I$(SSRC) OBJDEPEND=$(SSRC)defsfb.h $(SRC)defsgen.h $(SRC)subs.c default: cp $(SSRC)defsfb.h $(SRC)defs.h cp $(SSRC)writefb.h $(SRC)writedis.h make -f MakeFb tmview rm $(SRC)defs.h rm $(SRC)writedis.h rm -f ./dvifb.linux mv $(OBJ)tmview ./dvifb.linux strip ./dvifb.linux tmview: $(OBJ)tmview.o $(OBJ)readdvi.o $(OBJ)globals.o $(OBJ)readpk.o $(OBJ)readvf.o\ $(OBJ)subs.o $(OBJ)readtfm.o $(OBJ)drawit.o $(OBJ)halfhyp.o\ $(OBJ)writefb.o $(OBJ)bookmks.o $(OBJ)rwconf.o $(OBJ)epsfile.o $(OBJ)colors.o $(LL) $(OBJ)tmview.o $(OBJ)globals.o $(OBJ)subs.o $(OBJ)readpk.o $(OBJ)readvf.o\ $(OBJ)readtfm.o $(OBJ)readdvi.o $(OBJ)drawit.o $(OBJ)halfhyp.o \ $(OBJ)writefb.o $(OBJ)bookmks.o $(OBJ)rwconf.o $(OBJ)epsfile.o $(OBJ)colors.o \ -o $(OBJ)tmview $(LIBS) chmod 4755 $(OBJ)tmview $(OBJ)tmview.o: $(SRC)tmview.c $(SRC)help.h $(OBJDEPEND) $(CC) $(SRC)tmview.c -o $(OBJ)tmview.o $(OBJ)readdvi.o: $(SRC)readdvi.c $(OBJDEPEND) $(CC) $(SRC)readdvi.c -o $(OBJ)readdvi.o $(OBJ)readpk.o: $(SRC)readpk.c $(OBJDEPEND) $(CC) $(SRC)readpk.c -o $(OBJ)readpk.o $(OBJ)readvf.o: $(SRC)readvf.c $(OBJDEPEND) $(CC) $(SRC)readvf.c -o $(OBJ)readvf.o $(OBJ)readtfm.o: $(SRC)readtfm.c $(OBJDEPEND) $(CC) $(SRC)readtfm.c -o $(OBJ)readtfm.o $(OBJ)drawit.o: $(SRC)drawit.c $(OBJDEPEND) $(CC) $(SRC)drawit.c -o $(OBJ)drawit.o $(OBJ)halfhyp.o: $(SRC)halfhyp.c $(OBJDEPEND) $(CC) $(SRC)halfhyp.c -o $(OBJ)halfhyp.o $(OBJ)epsfile.o: $(SRC)epsfile.c $(OBJDEPEND) $(CC) $(SRC)epsfile.c -o $(OBJ)epsfile.o $(OBJ)colors.o: $(SRC)colors.c $(OBJDEPEND) $(CC) $(SRC)colors.c -o $(OBJ)colors.o $(OBJ)writefb.o: $(SSRC)writefb.c $(OBJDEPEND) $(CC) $(SSRC)writefb.c -o $(OBJ)writefb.o $(OBJ)subs.o: $(SRC)subs.c $(OBJDEPEND) $(CC) $(SRC)subs.c -o $(OBJ)subs.o $(OBJ)bookmks.o: $(SRC)bookmks.c $(OBJDEPEND) $(CC) $(SRC)bookmks.c -o $(OBJ)bookmks.o $(OBJ)rwconf.o: $(SRC)rwconf.c $(OBJDEPEND) $(CC) $(SRC)rwconf.c -o $(OBJ)rwconf.o $(OBJ)globals.o: $(SRC)globals.c $(OBJDEPEND) $(CC) $(SRC)globals.c -o $(OBJ)globals.o clean: rm -f $(OBJ)*.o tmview/VER01030100644000175000017500000000000007250444702012331 0ustar tmoortmoor