home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume34 / starhp / part01 < prev    next >
Encoding:
Text File  |  1992-12-07  |  53.7 KB  |  1,545 lines

  1. Newsgroups: comp.sources.misc
  2. From: kirk@sdd.hp.com (Kirk Norton)
  3. Subject:  v34i018:  starhp - HP-GL/2 StarChart driver, Part01/02
  4. Message-ID: <csm-v34i018=starhp.194428@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: f681e6aa2cb8206db1d358d56dac1766
  6. Date: Tue, 8 Dec 1992 01:45:09 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: kirk@sdd.hp.com (Kirk Norton)
  10. Posting-number: Volume 34, Issue 18
  11. Archive-name: starhp/part01
  12. Environment: HP-GL/2, Starchart
  13.  
  14. This shar file contains the C source, makefile, man page, and README file 
  15. for an HP-GL/2 driver for the StarChart software.  It allows StarChart to 
  16. produce Postscript quality output on HP Laserjets, compatibles, and other 
  17. HP-GL/2 or PCL5 printers and plotters.  The set of StarChart codes may be 
  18. found on several Internet hosts:
  19.  
  20.      gatekeeper.dec.com         ftp.uu.net
  21.      wuarchive.wustl.edu         ames.arc.nasa.gov
  22.      uxc.cso.uiuc.edu             irisa.irisa.fr
  23.      nic.funet.fi
  24.  
  25. to name but a few.  Other sites may be found using Archie and searching
  26. for "starchart".
  27.  
  28. I have only compiled and tested this driver under HP-UX on an HP series 300.
  29. However, running on other systems should not be a problem, since this driver
  30. is "environmentally identical" to the existing Postscript driver.  But if
  31. you do find problems, please let me know.
  32.  
  33. Thanks!
  34.  
  35. -Kirk
  36. kirk@sdd.hp.com
  37. ---------------
  38. #! /bin/sh
  39. # This is a shell archive.  Remove anything before this line, then feed it
  40. # into a shell via "sh file" or similar.  To overwrite existing files,
  41. # type "sh file -c".
  42. # Contents:  README Makefile starhp.c.B
  43. # Wrapped by kent@sparky on Mon Dec  7 19:27:02 1992
  44. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  45. echo If this archive is complete, you will see the following message:
  46. echo '          "shar: End of archive 1 (of 2)."'
  47. if test -f 'README' -a "${1}" != "-c" ; then 
  48.   echo shar: Will not clobber existing file \"'README'\"
  49. else
  50.   echo shar: Extracting \"'README'\" \(2829 characters\)
  51.   sed "s/^X//" >'README' <<'END_OF_FILE'
  52. XSTARHP.C is to be used with the StarChart software suite.  It is used to 
  53. Xtranslate StarChart output into Hewlett-Packard's Graphics Language 2
  54. X(HP-GL/2).  The set of StarChart codes may be found on several Internet hosts:
  55. X
  56. X     gatekeeper.dec.com
  57. X     ftp.uu.net
  58. X     wuarchive.wustl.edu
  59. X     ames.arc.nasa.gov
  60. X     uxc.cso.uiuc.edu
  61. X     irisa.irisa.fr
  62. X     nic.funet.fi
  63. X
  64. Xto name but a few.  Other sites may be found using Archie and searching
  65. Xfor "starchart".
  66. X
  67. XThe makefile should be okay for most systems.  It should only be necessary to
  68. Xmodify the file to compile the desired drivers in the set.  However, the 
  69. XFILEROOT variable will need to be set to the desired directory (i.e. the top 
  70. XStarChart directory) before compiling.  
  71. X
  72. XI have only compiled and tested this driver under HP-UX on an HP series 300.
  73. XHowever, running on other systems should not be a problem, since this driver
  74. Xis "environmentally identical" to the existing Postscript driver.  But if
  75. Xyou do find problems, please let me know.
  76. X
  77. XSend remarks to Kirk Norton (kirk@sdd.hp.com).
  78. X
  79. X
  80. XThe remaining text in this file is taken directly from the comments at 
  81. Xthe beginning of the C source code "starhp.c": 
  82. X
  83. XThis driver should support all HP Laserjet IIP's, III's (or higher), and any 
  84. Xother HP-GL/2 (or PCL-5) printers and plotters (pen, electrostatic, etc.).  
  85. XHP-GL devices (usually the older ones) may have some problems, but
  86. XI've tried to keep the driver as general as possible.
  87. X
  88. XThis driver WILL NOT support DeskJet, PaintJet (without the HP-GL/2 option),
  89. X or early LaserJets (those before IIP's), since these are PCL-only devices
  90. X -- so don't try it (because you will get many, many pages of garbage).
  91. X
  92. XSome HP-GL/2 LaserJets and compatibles will not be able to print high density
  93. Xcharts (ones with lots of stars) due to insufficient memory, and the page
  94. Xmay be only partially printed.  To avoid this, either reduce the scale
  95. Xparameter on the starhp command line or reduce the magnitude limits, thereby
  96. Xreducing the number of objects appearing on the page.
  97. X
  98. XHP-GL/2 plotters shouldn't have these problems since they print "on the fly".
  99. XOf course, "haloing" of objects is not supported on pen plotters, and the 
  100. Xnice looking fonts will probably not be available on most large format 
  101. Xdevices or on some HP-GL/2 ink jet printers.
  102. X
  103. X
  104. XProduced by Kirk Norton (kirk@sdd.hp.com) July, 1991 for StarChart 3.2
  105. Xby Alan Paeth and Craig Counterman.  Leveraged (heavily) from starpost.c.
  106. X
  107. XSupports the following enhancements:
  108. X  1> "bigmaster" chart layout now added
  109. X  2> extensive rework and subclassing of non-stellar objects, e.g.
  110. X     galaxies, now have both spiral and irregular variants.
  111. X  3> star sizes now extended to magnitude 10
  112. X  4> supports large format devices (up to 44x34 inches) 
  113. X
  114. XDefault size changed from 8x11 to 8x10 inches to accomodate Laserjets
  115. X
  116. END_OF_FILE
  117.   if test 2829 -ne `wc -c <'README'`; then
  118.     echo shar: \"'README'\" unpacked with wrong size!
  119.   fi
  120.   # end of 'README'
  121. fi
  122. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  123.   echo shar: Will not clobber existing file \"'Makefile'\"
  124. else
  125.   echo shar: Extracting \"'Makefile'\" \(10346 characters\)
  126.   sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  127. X#    Makefile for starchart programs
  128. X#
  129. X#    $Header: Makefile,v 2.19 90/04/03 01:54:15 ccount Exp $
  130. X#
  131. X# Read the makefile before making.  There are many things you may wish
  132. X# to customize.
  133. X#
  134. X#
  135. X# StarChart Version 3.2.1 copyright (c) March 1990 by Craig Counterman 
  136. X# original StarChart Software Suite copyright (c) 1987 by Alan Paeth
  137. X#
  138. X# All rights reserved. Redistribution granted for non-commercial
  139. X# non-profit use only. Disclaimer: users of this work understand that
  140. X# (a) the authors' cannot undertake to support this software (b) users
  141. X# agree to acknowledge the use of the software in any published work
  142. X# arising from its application and (c) any subsequent redistribution of
  143. X# this work retains this warranty placard. 
  144. X#
  145. X#
  146. X# No representation is made about the suitability of this
  147. X# software for any purpose.  It is provided "as is" without express or
  148. X# implied warranty, to the extent permitted by applicable law.
  149. X#
  150. X# DISCLAIMER OF WARRANTY
  151. X# ----------------------
  152. X# The authors  disclaim all warranties  with regard to  this software to
  153. X# the   extent  permitted  by applicable   law,  including all   implied
  154. X# warranties  of merchantability  and  fitness. In  no event shall   the
  155. X# author be liable for any special, indirect or consequential damages or
  156. X# any  damages whatsoever resulting from  loss of use, data or  profits,
  157. X# whether in an action of contract, negligence or other tortious action,
  158. X# arising  out of  or in connection with the  use or performance of this
  159. X# software.
  160. X#
  161. X#
  162. X#list ONLY the programs you want to use at your site
  163. XTARGS= \
  164. X        starX11 \
  165. X        starhp
  166. X
  167. X#    starX11 \
  168. X#    starpost
  169. X#       starXaw \
  170. X#    stardsp \
  171. X#    startek \
  172. X#    staruplot \
  173. X#    starsunv \
  174. X#    starlaser 
  175. X#    starX10 
  176. X
  177. X# startool must be made specially, see below.
  178. X# Also consider "postconv.awk"
  179. X
  180. X#SITE DEPENDENCIES
  181. X#
  182. X# Uncomment out the version appropriate for your site.
  183. X# At present dependencies for sysV UNIX
  184. X#
  185. XLOCAL=-DSYSV -Dindex=strchr
  186. X
  187. X
  188. X# FOR ALL
  189. X# define OLD_GREEK if you have the v2.1 yale.star file, with a
  190. X#                slightly different greek encoding
  191. X# To produce programs which allow keyboard user interaction with the -u flag, 
  192. X#    see COBJ and starmain.o below.
  193. X# If you don't want to use the Guide Star Catalog, you can produce
  194. X#    slightly smaller executable by defining NO_GSC
  195. X# Define NO_BUF_READSTAR to avoid the buffering file read function,
  196. X#    to reduce runtime memory usage.
  197. X# Define USE_ENV_RC to use a STARRC environment variable for the file name
  198. X#    if the STARRC file named below is not found.
  199. X# 
  200. X# FOR X11
  201. X# define USE_X_DASHES if your server can draw dashed lines
  202. X# define RELEASE3_FONTS if you want to use the X11R3 font names
  203. X# define X11R4 if you are using Release 4  (for the athena widgets).
  204. X#
  205. X# FOR POSTSCRIPT
  206. X# define USE_FINE_MACROS if you want to use finer macros than usual:
  207. X#     star size varies with 1/10th magnitude increments
  208. X#        Needs printer with lots of available memory, but produces
  209. X#        smaller postscript files than using the "-a m" option to
  210. X#        postscript.
  211. X#
  212. X#DEFINES= -DRELEASE3_FONTS -DUSE_X_DASHES -DUSE_FINE_MACROS
  213. XDEFINES= -DRELEASE3_FONTS -DUSE_X_DASHES -DUSE_ENV_RC -DX11R4
  214. X
  215. X#destination for 'make install', otherwise not important
  216. XBINDIR = "/usr/local"
  217. X
  218. X#XINCLUDES is for DECwindows UWS 2.0
  219. XXINCLUDES = -I/usr/include/mit -I/usr/include/X11R4
  220. X#XINCLUDES =
  221. X
  222. X#list ALL header files
  223. XHDRS=icon.h parse_input.h star3.h starXaw.h starXawDlog.h patchlevel.h
  224. X#list ALL source files, whether or not you use them
  225. XSRCS= interact.c parse_input.c readfile.c starX10.c starX11.c starXaw.c \
  226. X    starXawDlog.c starXawHelp.c starXawMwin.c starcust.c \
  227. X    stardsp.c starimages.c starhp.c starlaser.c starm2.c starmain.c \
  228. X    starpost.c starsample.c starsunv.c starsupp.c startek.c staruplot.c
  229. X
  230. X#list ALL object files which could be produced
  231. XOBJS= interact.o parse_input.o readfile.o starX10.o \
  232. X    starX11.o starX11_aw.o starXaw.o starXawDlog.o \
  233. X    starXawHelp.o starXawMwin.o starcust.o stardsp.o \
  234. X    starimages.o starimages_a.o starlaser.o starm2.o starm2_i.o \
  235. X    starmain.o starmain_i.o starpost.o starsunv.o starsupp.o \
  236. X    startek.o staruplot.o starhp.o
  237. X
  238. XSTARTOOL=startool.tt startool.icon startool.sh
  239. XSUPP=postconv.awk
  240. XVMSFILES=decwxtk.opt descrip.mms starchart_init.com vaxcrtl.opt
  241. XIBMFILES=pcstar.h Starchar.MSC staribm.c staribmv.c svgagraf.asm
  242. XATARIFILES=README.st makefile.st starst.c vqgdos.txt vqgdos.s
  243. XMACFILES=README.mac
  244. XFILES=Makefile README ${SRCS} ${HDRS} ${STARTOOL} ${SUPP} ${VMSFILES} \
  245. X    ${IBMFILES} ${ATARIFILES} ${MACFILES}
  246. X
  247. XDISTDIR=../../dist/starchart
  248. X
  249. X#The following may be defined here to set default data file locations
  250. X# filename    filetype    description
  251. X# STARFILE    STARFTYPE    bright star data (yale)
  252. X# INDEXFILE    INDEXFTYPE    index to fainter stars (SAO)
  253. X# NEBFILE    NEBFTYPE    nebulae
  254. X# BOUNDFILE    BOUNDFTYPE    constellation boundaries
  255. X# PATTERNFILE    PATTFTYPE    constellation patterns
  256. X# CNAMEFILE    CNAMEFTYPE    constellation names
  257. X# PLANETFILE    PLANETFTYPE    planet positions
  258. X
  259. X# other files
  260. X# CONSTFILE    constellation locations
  261. X# RCFILE    resource file
  262. X
  263. X# Define as needed only
  264. X# Remember, there are defaults in the code
  265. X
  266. X# Example
  267. XFILEROOT=/local/astro/starchart3.2.1/data
  268. XSTAR="${FILEROOT}/yale.star"
  269. XSTART=LINEREAD
  270. XINDEX="${FILEROOT}/index.indx"
  271. XINDEXT=INDEXTYPE
  272. X# only currently valid index file type
  273. XNEB="${FILEROOT}/neb.star"
  274. XNEBT=LINEREAD
  275. XBOUND="${FILEROOT}/boundaries.star"
  276. XBOUNDT=LINEREAD
  277. XPATT="${FILEROOT}/pattern.star"
  278. XPATTTY=LINEREAD
  279. XCNAME="${FILEROOT}/cnames.star"
  280. XCNAMET=LINEREAD
  281. XPLANET="./planet.star"
  282. X# Planets move, so make it local
  283. XPLANETTY=LINEREAD
  284. XCONS="${FILEROOT}/con.locs"
  285. XRC="./.starrc"
  286. X
  287. XFILEFLAGS= \
  288. X        -DSTARFILE='$(STAR)' \
  289. X        -DSTARFTYPE='$(START)' \
  290. X        -DINDEXFILE='$(INDEX)' \
  291. X        -DINDEXFTYPE='$(INDEXT)' \
  292. X        -DNEBFILE='$(NEB)' \
  293. X        -DNEBFTYPE='$(NEBT)' \
  294. X        -DBOUNDFILE='$(BOUND)' \
  295. X        -DBOUNDFTYPE='$(BOUNDT)' \
  296. X        -DPATTERNFILE='$(PATT)' \
  297. X        -DPATTFTYPE='$(PATTTY)' \
  298. X        -DCNAMEFILE='$(CNAME)' \
  299. X        -DCNAMEFTYPE='$(CNAMET)' \
  300. X        -DPLANETFILE='$(PLANET)' \
  301. X        -DPLANETFTYPE='$(PLANETTY)' \
  302. X        -DCONSTFILE='$(CONS)' \
  303. X        -DRCFILE='$(RC)'
  304. X
  305. X
  306. Xall: ${TARGS}
  307. X
  308. XCFLAGS= ${FILEFLAGS} ${LOCAL} ${DEFINES} -g
  309. XLDFLAGS = -g
  310. X
  311. X
  312. X#Include interact.o in COBJ to support keyboard user interaction
  313. X#COBJ=starmain.o starm2.o starsupp.o readfile.o parse_input.o
  314. XCOBJ=starmain.o starm2.o starsupp.o readfile.o parse_input.o interact.o 
  315. XCOBJIM=${COBJ} starimages.o
  316. XCOBJIMA=${COBJ} starimages_a.o
  317. X
  318. Xstardsp: ${COBJ} stardsp.o starcust.o
  319. X    $(CC) $(LDFLAGS) ${COBJ} stardsp.o starcust.o -lm -o $@
  320. X
  321. Xstarlaser: ${COBJIMA} starlaser.o starcust.o
  322. X    $(CC) $(LDFLAGS) ${COBJIMA} starlaser.o starcust.o -lm -o $@
  323. X
  324. Xstarpost: $(COBJ) starpost.o starcust.o
  325. X    $(CC) $(LDFLAGS) $(COBJ) starpost.o starcust.o -lm -o $@
  326. X
  327. Xstarhp: $(COBJ) starhp.o starcust.o
  328. X    $(CC) $(LDFLAGS) $(COBJ) starhp.o starcust.o -lm -o $@
  329. X
  330. Xstartek:  ${COBJIMA} startek.o starcust.o
  331. X    $(CC) $(LDFLAGS) ${COBJIMA} startek.o starcust.o -lm -o $@
  332. X
  333. Xstaruplot: ${COBJIMA} staruplot.o starcust.o
  334. X    $(CC) $(LDFLAGS) ${COBJIMA} staruplot.o starcust.o -lm -lplot -o $@
  335. X
  336. XstarX10: ${COBJIMA} starX10.o starcust.o
  337. X    $(CC) $(LDFLAGS) ${COBJIMA} starX10.o starcust.o -lm -lX -o $@
  338. X
  339. XstarX11: ${COBJIM} starX11.o starcust.o
  340. X    $(CC) $(LDFLAGS) ${COBJIM} starX11.o starcust.o -lm -lX11 -L/usr/lib/X11R4 -o $@
  341. X
  342. XstarXaw: starmain_i.o starm2_i.o starsupp.o readfile.o starX11_aw.o \
  343. X        starXaw.o starXawDlog.o starXawHelp.o starXawMwin.o\
  344. X        starcust.o starimages.o parse_input.o
  345. X    $(CC) $(LDFLAGS) starmain_i.o starm2_i.o starsupp.o readfile.o \
  346. X        starXaw.o starXawDlog.o starXawHelp.o starXawMwin.o \
  347. X         starX11_aw.o starcust.o starimages.o parse_input.o\
  348. X        -lm -lXaw -lXmu -lXt -lX11 -L/usr/lib/X11R4 -o $@
  349. X
  350. Xstarsunv: starmain_i.o starm2_i.o starsupp.o readfile.o starsunv.o \
  351. X        starcust.o starimages.o parse_input.o interact.o
  352. X    $(CC) $(LDFLAGS) starmain_i.o starm2_i.o starsupp.o readfile.o \
  353. X        starsunv.o starcust.o starimages.o parse_input.o interact.o \
  354. X            -lm -lsuntool -lsunwindow -lpixrect -o $@
  355. X
  356. Xstartool: starsunv
  357. X    echo "You must edit startool, startool.tt and startool.sh,"
  358. X    echo "    and install them"
  359. X    echo "You must have the program tooltool,"
  360. X    echo "    which is available from sun PD archives"
  361. X    echo "tooltool -f startool.tt" > startool
  362. X
  363. X# use -DINTERACTIVE_CONTROL in starmain.o and starm2.o
  364. X#     to allow keyboard user interaction
  365. Xstarmain.o: starmain.c Makefile star3.h parse_input.h
  366. X    $(CC) $(CFLAGS) -DINTERACTIVE_CONTROL -c starmain.c
  367. X
  368. Xstarm2.o: starm2.c Makefile star3.h
  369. X    $(CC) $(CFLAGS) -DINTERACTIVE_CONTROL -c starm2.c
  370. X
  371. X
  372. X
  373. Xstarmain_i.o: starmain.c Makefile star3.h parse_input.h
  374. X    -mv starmain.o starmain_n.o
  375. X    $(CC) $(CFLAGS) -DINTERACTIVE_CONTROL -c starmain.c
  376. X    mv starmain.o starmain_i.o
  377. X    -mv starmain_n.o starmain.o
  378. X
  379. Xstarm2_i.o: starm2.c Makefile star3.h
  380. X    -mv starm2.o starm2_n.o
  381. X    $(CC) $(CFLAGS) -DINTERACTIVE_CONTROL -c starm2.c
  382. X    mv starm2.o starm2_i.o
  383. X    -mv starm2_n.o starm2.o
  384. X
  385. Xreadfile.o: readfile.c star3.h
  386. X
  387. Xstarimages.o: starimages.c star3.h
  388. X    $(CC) $(CFLAGS) -c starimages.c
  389. X
  390. X#starimages_a.o defines area operations for drivers which otherwise don't
  391. X#  support them
  392. Xstarimages_a.o: Makefile starimages.c star3.h
  393. X    -mv starimages.o starimages_n.o
  394. X    $(CC) $(CFLAGS) -DAREAS -c starimages.c
  395. X    mv starimages.o starimages_a.o
  396. X    -mv starimages_n.o starimages.o
  397. X
  398. XstarX11.o: starX11.c Makefile icon.h star3.h
  399. X    $(CC) $(CFLAGS) $(XINCLUDES) -DSTARX11 -c starX11.c
  400. X
  401. XstarX11_aw.o: starX11.c Makefile icon.h star3.h
  402. X    -mv starX11.o starX11_n.o
  403. X    $(CC) $(CFLAGS) $(XINCLUDES) -DSTARXAW -c starX11.c
  404. X    mv starX11.o starX11_aw.o
  405. X    -mv starX11_n.o starX11.o
  406. X
  407. XstarXaw.o: starXaw.c star3.h starXaw.h icon.h
  408. X    $(CC) $(CFLAGS) $(XINCLUDES) -c starXaw.c
  409. X
  410. XstarXawDlog.o: starXawDlog.c star3.h starXaw.h starXawDlog.h
  411. X    $(CC) $(CFLAGS) $(XINCLUDES) -c starXawDlog.c
  412. X
  413. XstarXawHelp.o: starXawHelp.c star3.h starXaw.h
  414. X    $(CC) $(CFLAGS) $(XINCLUDES) -c starXawHelp.c
  415. X
  416. XstarXawMwin.o: starXawMwin.c star3.h starXaw.h
  417. X    $(CC) $(CFLAGS) $(XINCLUDES) -c starXawMwin.c
  418. X
  419. Xstarsunv.o: star3.h
  420. Xinteract.o: star3.h parse_input.h patchlevel.h
  421. Xparse_input.o: star3.h parse_input.h
  422. Xstarcust.o: star3.h 
  423. Xstardsp.o: star3.h 
  424. Xstarlaser.o: star3.h 
  425. Xstarpost.o: star3.h 
  426. Xstarhp.o : star3.h
  427. Xstarsample.o: star3.h 
  428. Xstarsupp.o: star3.h 
  429. Xstartek.o: star3.h 
  430. Xstaruplot.o: star3.h 
  431. X
  432. Xinstall: all
  433. X    strip $(TARGS)
  434. X    mv $(TARGS) $(BINDIR)
  435. X
  436. Xdist:
  437. X    cp ${FILES} ${DISTDIR}
  438. X
  439. Xclean:
  440. X    rm -f ${OBJS} ${TARGS} a.out core
  441. END_OF_FILE
  442.   if test 10346 -ne `wc -c <'Makefile'`; then
  443.     echo shar: \"'Makefile'\" unpacked with wrong size!
  444.   fi
  445.   # end of 'Makefile'
  446. fi
  447. if test -f 'starhp.c.B' -a "${1}" != "-c" ; then 
  448.   echo shar: Will not clobber existing file \"'starhp.c.B'\"
  449. else
  450.   echo shar: Extracting \"'starhp.c.B'\" \(36790 characters\)
  451.   sed "s/^X//" >'starhp.c.B' <<'END_OF_FILE'
  452. X     class = 0;
  453. X     while (table[class] && (table[class] != color_str[0])) class++;
  454. X     subclass = isdigit(color_str[1]) ? color_str[1] - '0' : 0;
  455. X     colr = table[class] ? 10 + super_spectra[class][subclass] : WHITE;
  456. X
  457. X     if( colr != cur_colr )
  458. X          {
  459. X          fprintf( outf, "SP%d", colr );
  460. X          pen_up = UNKNOWN;
  461. X          cur_colr = colr;
  462. X         }
  463. X     }
  464. X
  465. X
  466. X/* Set the font and font size to be used for text. */
  467. X/* Note order of args */
  468. XD_fontsize(fsize, font)
  469. X     int fsize;    /* Size of font */
  470. X     int font;    /* e.g. TIMES, HELV, TIMES+ITALIC */
  471. X{
  472. X
  473. X  /* override some requests */
  474. X  switch(cur_function) {
  475. X  case CHRTOUTLN:
  476. X    break;
  477. X  case CHRTHTICK:
  478. X  case CHRTVTICK:
  479. X    font = TIMESBOLD;
  480. X    break;
  481. X  case GRID_RA:
  482. X  case GRID_DEC:
  483. X  case ECLIPT:
  484. X    break;
  485. X  case CONSTBOUND:
  486. X  case CONSTPATTRN:
  487. X    break;
  488. X  case CONSTNAME:
  489. X    font = HELVITAL;
  490. X    break;
  491. X  case CHARTFILE:
  492. X    break;
  493. X  }
  494. X                        /* Set font attribute variables */
  495. X  switch(font) {
  496. X  default:
  497. X  case TIMESROMAN:
  498. X    f_posture = FP_UPRIGHT;
  499. X    f_sweight = SW_MEDIUM;
  500. X    f_typeface = TF_TMSRMN;
  501. X    break;
  502. X  case TIMESBOLD:
  503. X    f_posture = FP_UPRIGHT;
  504. X    f_sweight = SW_BOLD;
  505. X    f_typeface = TF_TMSRMN;
  506. X    break;
  507. X  case TIMESITAL:
  508. X    f_posture = FP_ITALIC;
  509. X    f_sweight = SW_MEDIUM;
  510. X    f_typeface = TF_TMSRMN;
  511. X    break;
  512. X  case TIMESBOLDITAL:
  513. X    f_posture = FP_ITALIC;
  514. X    f_sweight = SW_BOLD;
  515. X    f_typeface = TF_TMSRMN;
  516. X    break;
  517. X  case HELV:
  518. X    f_posture = FP_UPRIGHT;
  519. X    f_sweight = SW_MEDIUM;
  520. X    f_typeface = TF_UNIVERS;
  521. X    break;
  522. X  case HELVBOLD:
  523. X    f_posture = FP_UPRIGHT;
  524. X    f_sweight = SW_BOLD;
  525. X    f_typeface = TF_UNIVERS;
  526. X    break;
  527. X  case HELVITAL:
  528. X    f_posture = FP_ITALIC;
  529. X    f_sweight = SW_MEDIUM;
  530. X    f_typeface = TF_UNIVERS;
  531. X    break;
  532. X  case HELVBOLDITAL:
  533. X    f_posture = FP_ITALIC;
  534. X    f_sweight = SW_BOLD;
  535. X    f_typeface = TF_UNIVERS;
  536. X    break;
  537. X  case COURIER:
  538. X    f_posture = FP_UPRIGHT;
  539. X    f_sweight = SW_MEDIUM;
  540. X    f_typeface = TF_COURIER;
  541. X    break;
  542. X  case COURBOLD:
  543. X    f_posture = FP_UPRIGHT;
  544. X    f_sweight = SW_BOLD;
  545. X    f_typeface = TF_COURIER;
  546. X    break;
  547. X  case COURITAL:
  548. X    f_posture = FP_ITALIC;
  549. X    f_sweight = SW_MEDIUM;
  550. X    f_typeface = TF_COURIER;
  551. X    break;
  552. X  case COURITALBOLD:
  553. X    f_posture = FP_ITALIC;
  554. X    f_sweight = SW_BOLD;
  555. X    f_typeface = TF_COURIER;
  556. X    break; 
  557. X  };
  558. X  f_size = fsize;
  559. X
  560. X}
  561. X/* This routine is encouraged to look at the extern cur_funtion
  562. X   and change the font used as desired */
  563. X
  564. X
  565. X/* Display text string str at x,y, in current font and font size.
  566. X   if star_lbl is TRUE, string is a star label, use
  567. X     greek characters (if possible) */
  568. XD_text(x, y, str, star_lbl)
  569. X     int x, y;
  570. X     char *str;
  571. X     int star_lbl;
  572. X     {
  573. X     int changed = FALSE;
  574. X
  575. X     if (star_lbl)  /* Specify math character set for Greek letters */
  576. X          {
  577. X          while (*str == ' ') str++;    /* remove leading spaces */
  578. X          f_typeface = CS_MATH8;
  579. X          }
  580. X     else
  581. X          f_typeface = CS_STANDARD;
  582. X
  583. X         /* Specify only as much about the font that has changed */
  584. X
  585. X     if( c_f_charset != f_charset )    /* Set character set */
  586. X          {
  587. X          fprintf( outf, "SD1,%d", f_charset );
  588. X          c_f_charset = f_charset;
  589. X          changed = TRUE;
  590. X          }
  591. X     if( c_f_size != f_size )          /* Set point size */
  592. X          {
  593. X          if( changed == TRUE )
  594. X               fprintf( outf, ",4,%d", f_size );
  595. X          else
  596. X               {
  597. X               fprintf( outf, "SD4,%d", f_size );
  598. X               changed = TRUE;
  599. X               }
  600. X          c_f_size = f_size;
  601. X          }
  602. X     if( c_f_posture != f_posture )    /* Set posture */
  603. X          {
  604. X          if( changed == TRUE )
  605. X               fprintf( outf, ",5,%d", f_posture );
  606. X          else
  607. X               {
  608. X               fprintf( outf, "SD5,%d", f_posture );
  609. X               changed = TRUE;
  610. X               }
  611. X          c_f_posture = f_posture;
  612. X          }
  613. X     if( c_f_sweight != f_sweight )    /* Set stroke weight */
  614. X          {
  615. X          if( changed == TRUE )
  616. X               fprintf( outf, ",6,%d", f_sweight );
  617. X          else
  618. X               {
  619. X               fprintf( outf, "SD6,%d", f_sweight );
  620. X               changed = TRUE;
  621. X               }
  622. X          c_f_posture = f_posture;
  623. X          }
  624. X     if( c_f_typeface != f_typeface )  /* Set typeface */
  625. X          {
  626. X          if( changed == TRUE )
  627. X               fprintf( outf, ",7,%d", f_typeface );
  628. X          else
  629. X               {
  630. X               fprintf( outf, "SD7,%d", f_typeface );
  631. X               changed = TRUE;
  632. X               }
  633. X          c_f_typeface = f_typeface;
  634. X          }
  635. X     out( ";" );
  636. X
  637. X     D_move( x, y );
  638. X     fprintf( outf, "SD6,%dSP1LB%s@", f_sweight, str );
  639. X     lost = TRUE;
  640. X     cur_colr = UNKNOWN;
  641. X     }
  642. X
  643. X
  644. X/* Return input coordinate in device coords where there are pointing devices */
  645. XD_inxy(x, y)
  646. X     int *x, *y;
  647. X{
  648. X}
  649. X
  650. X
  651. X/* Put non-displayed comment in output file */
  652. XD_comment(str)
  653. X     char *str;
  654. X{
  655. X  int i = 0;
  656. X
  657. X  out( ";\n\nCO \"" );
  658. X  while( str[i] != '\0' )  /* Any double quotes in a comment must be doubled */
  659. X    {
  660. X    if( str[i] == '\"' )
  661. X      fprintf( outf, "\"%c", str[ i++ ] );
  662. X    else
  663. X      fprintf( outf, "%c", str[ i++ ] );
  664. X    }
  665. X  out( "\";\n\n" );
  666. X}
  667. X
  668. X
  669. X/**
  670. XHigher level functions
  671. X**/
  672. X
  673. X/* Point sizes for font calls */
  674. X#define TITLESIZE 16
  675. X#define SUBTLSIZE 12
  676. X#define NAMESIZE 10
  677. X#define LBLSIZE 8
  678. X#define MAGSIZE 8
  679. X
  680. X/* Fonts for font calls */
  681. X#define NAMEFNT TIMESROMAN
  682. X#define LBLFNT HELV
  683. X#define MAGFNT COURIER
  684. X#define TITLEFNT TIMESBOLD
  685. X#define SUBTLFNT TIMESROMAN
  686. X
  687. X
  688. X/* Interface Function */
  689. X/* Draw object at x, y.  properties set by other parameters */
  690. Xdrawobj(x, y, mag, type, color_str, label_field, con_str, obj_name,
  691. X    comment_str, file_line,
  692. X    draw_glyph, draw_text, use_lbl, use_name, use_mag)
  693. X
  694. X     int x, y;
  695. X     double mag;    /* Magnitude of object */
  696. X     char *type;    /* 2 chars, object code and subcode */
  697. X     char *color_str;    /* 2 chars, spectral type for stars, 
  698. X               color code otherwise */
  699. X     char *label_field;    /* 2 chars, Bayer or flamsteed for stars,
  700. X               size in seconds for nebulae and
  701. X               planets */
  702. X     char *con_str;    /* 3 chars, the constellation the object is in */
  703. X     char *obj_name;    /* Name of object */
  704. X     char *comment_str;    /* Comment field */
  705. X     char *file_line;    /* The full line from the file,
  706. X               containing the above if it is in
  707. X               standard format */
  708. X     int draw_glyph;    /* Draw object symbol */
  709. X     int draw_text;    /* Draw text */
  710. X     int use_lbl;    /* Label object with the label_field string */
  711. X     int use_name;    /* Label object with the obj_name string */
  712. X     int use_mag;    /* Label object with a 2 or 3 character string
  713. X               containing the magnitude * 10 without
  714. X               decimal point */
  715. X     {
  716. X     char magstr[10];
  717. X
  718. X     if (draw_glyph) switch(type[0])
  719. X          {
  720. X          case 'S':    drawStar(x,y,mag,type[1],color_str);
  721. X               break;
  722. X          case 'P':    drawPlan(x,y,mag,type[1],color_str, size_obj(label_field), comment_str);
  723. X               break;
  724. X          case 'N':    drawNebu(x,y,mag,type[1],color_str, size_obj(label_field));
  725. X               break;
  726. X          case 'G':    drawGalx(x,y,mag,type[1],color_str, size_obj(label_field));
  727. X               break;
  728. X          case 'C':    drawClus(x,y,mag,type[1],color_str, size_obj(label_field));
  729. X               break;
  730. X          case 'U':     drawUnknown(x,y,mag,type[1],color_str, size_obj(label_field));
  731. X               break;
  732. X          case 'O':     drawOther(x,y,mag,type[1],color_str, size_obj(label_field));
  733. X               break;
  734. X          case 'V':
  735. X          default:
  736. X               break;
  737. X          }
  738. X/*
  739. X * use name or label
  740. X */
  741. X     if (draw_text) {
  742. X          if (use_name && obj_name[0])   
  743. X                {
  744. X                D_fontsize(NAMESIZE, NAMEFNT);
  745. X                D_text(x+x_nameoffset, y+y_nameoffset, obj_name, FALSE);
  746. X                } 
  747. X          else if (use_lbl && ((label_field[0] != ' ') || (label_field[1] != ' ')))
  748. X                {
  749. X                D_fontsize(LBLSIZE, LBLFNT);
  750. X                D_text(x+x_lbloffset, y+y_lbloffset, label_field, TRUE);
  751. X                }
  752. X/* If you want to magnitude label other objects, change this */
  753. X          if (use_mag && (type[0] == 'S')) 
  754. X               {
  755. X               sprintf(magstr, "%02d", (int)(mag*10.0+0.5));
  756. X               D_fontsize(MAGSIZE, MAGFNT);
  757. X               D_text(x+x_magoffset, y+y_magoffset, magstr, FALSE);
  758. X               }
  759. X          }
  760. X     }
  761. X
  762. X
  763. Xint findrad( mag )
  764. Xdouble mag;
  765. X     {
  766. X     int rad, hirad, lorad, delrad, whole;
  767. X     double remainder;
  768. X
  769. X     if( cur_map_type == THUMBNAIL )
  770. X          mag += thumbshift;    /* Reduce radius for thumbnail map stars */
  771. X     else 
  772. X          {
  773. X          if (mag < brightest_used) brightest_used = mag;
  774. X          if (mag > faintest_used) faintest_used = mag;
  775. X          }
  776. X     if (mag<MAG_BRIGHT) mag = MAG_BRIGHT;
  777. X     if (mag>MAG_DIM) mag = MAG_DIM;
  778. X
  779. X     whole = (int) (mag + 1.0);
  780. X     remainder = 1.0 + mag - (double) whole;
  781. X     hirad = magsizes[ whole ];
  782. X     lorad = magsizes[ whole + 1 ];
  783. X     delrad = hirad - lorad;
  784. X     if( use_fine_mag == TRUE )
  785. X          rad = lorad + (int) ( (1.0 - remainder) * (double) delrad );
  786. X     else if( remainder < 0.5 )
  787. X          rad = hirad;
  788. X     else
  789. X          rad = lorad;
  790. X     return( rad );
  791. X     }
  792. X
  793. X
  794. XdrawStar(x, y, mag, type, color)
  795. Xint x, y;
  796. Xdouble mag;
  797. Xchar type, *color;
  798. X     {
  799. X     int starrad;
  800. X
  801. X                   /* Note: this ends current line */
  802. X     D_move(x,y);
  803. X     if( A_SIZE <= plot_size && plot_size <= E_SIZE )
  804. X          starrad = (int) ( (double) findrad( mag ) * scaling_factor);
  805. X     else
  806. X          starrad = findrad( mag );
  807. X
  808. X     switch( type )
  809. X          {
  810. X          default:
  811. X          case 'S':                   /* Draw solid color star with halo */
  812. X               cur_colr = BLACK;
  813. X               set_line_type( SOLID );
  814. X               fprintf( outf, "PW.35PM0CI%d,%dPM2SP0EP", starrad, curve_val );
  815. X               D_color(color);
  816. X               out( "PW.13FP" );
  817. X               break;
  818. X          case 'D':                   /* Draw solid star with bar (both haloed) */
  819. X               out( "SP0PW.35" );
  820. X               cur_colr = BLACK;  
  821. X               D_draw( x - (int) (1.6 * (double) starrad+ResPT/2), y, SOLID );
  822. X               D_draw( x + (int) (1.6 * (double) starrad+ResPT/2), y, SOLID );
  823. X               D_draw( x, y, SOLID );
  824. X               fprintf( outf, "PM0CI%d,%dPM2EP", starrad, curve_val );
  825. X               D_color(color);
  826. X               out( "FPPW.13" );
  827. X               D_draw( x - (int) (1.6 * (double) starrad), y, SOLID );
  828. X               D_draw( x + (int) (1.6 * (double) starrad), y, SOLID );
  829. X               break;
  830. X          case 'V':                   /* Draw hollow colored star with halo */
  831. X               cur_colr = BLACK;
  832. X               set_line_type( SOLID );
  833. X               fprintf( outf, "SP0PW0.35PM0CI%d,%dPM2EPFP", starrad, curve_val );
  834. X               D_color(color);
  835. X               out( "PW.13EP" );
  836. X               break;
  837. X          }
  838. X     pen_up = UNKNOWN;
  839. X     cur_colr = UNKNOWN;
  840. X     }
  841. X
  842. XdrawPlan(x, y, mag, type, color, plansize, comment_str)
  843. Xint x,y;
  844. Xdouble mag;
  845. Xchar type, *color;
  846. Xlong plansize;        /* -1 should give default size */
  847. Xchar *comment_str;
  848. X     {
  849. X     int rad, s, xm, ym, xp, yp;
  850. X     int n;
  851. X     double phase, chi;
  852. X
  853. X     rad = (int) (plansize/(3600.*xf_c_scale)+.5)/2;
  854. X     if (rad < 6*ResPT)
  855. X          rad = 6*ResPT;
  856. X     if( A_SIZE <= plot_size && plot_size <= E_SIZE )
  857. X          rad = (int) ((double) rad * scaling_factor);
  858. X     s = rad/2;
  859. X
  860. X     D_color(color);
  861. X     D_move(x,y);
  862. X
  863. X  switch(type)
  864. X    {
  865. X    case 'A':                                        /* Draw symbol for an asteroid */ 
  866. X         fprintf(outf, "PM0CI%d,%dPM2FP", (int) (s*0.35), curve_val );
  867. X         fprintf(outf, "PR%d,%dPD%d,%dPU0,%dPD%d,%dPU", (int) s, (int) s, (int) (-s*2),
  868. X                                         (int) (-s*2), (int) (s*2), (int) (s*2), (int) (-s*2) );
  869. X         lost = TRUE;
  870. X         break;
  871. X    case 'C':                                        /* Draw symbol for a comet */
  872. X         phase = 135.0;
  873. X         n = sscanf(comment_str, "%lf", &phase);
  874. X         if (cur_win->invert) phase = 180 - phase;
  875. X         fprintf( outf, "SP0PW0.35PM0CI%d,%dPM2PREP", s/2, curve_val );
  876. X         draw_rot( 0, -2*s, phase, PEN_DOWN );
  877. X         draw_rot( 0, 2*s, phase, PEN_DOWN );
  878. X         draw_rot( -s/2, 0, phase, PEN_UP );
  879. X         draw_rot( -s/2, -(3*s)/2, phase, PEN_DOWN );
  880. X         draw_rot( s/2, (3*s)/2, phase, PEN_DOWN );
  881. X         draw_rot( s, 0, phase, PEN_UP );
  882. X         draw_rot( s/2, -(3*s)/2, phase, PEN_DOWN );
  883. X         draw_rot( -s/2, (3*s)/2, phase, PEN_DOWN );
  884. X         draw_rot( -s/2, 0, phase, PEN_UP );
  885. X         cur_colr = UNKNOWN;
  886. X         D_color(color);
  887. X         out( "PW0.13" );
  888. X         draw_rot( 0, -2*s, phase, PEN_DOWN );
  889. X         draw_rot( 0, 2*s, phase, PEN_DOWN );
  890. X         draw_rot( -s/2, 0, phase, PEN_UP );
  891. X         draw_rot( -s/2, -(3*s)/2, phase, PEN_DOWN );
  892. X         draw_rot( s/2, (3*s/2), phase, PEN_DOWN );
  893. X         draw_rot( s, 0, phase, PEN_UP );
  894. X         draw_rot( s/2, -(3*s/2), phase, PEN_DOWN );
  895. X         draw_rot( -s/2, (3*s/2), phase, PEN_DOWN );
  896. X         draw_rot( -s/2, 0, phase, PEN_UP );
  897. X         out( "SP0FPPU" );
  898. X         lost = TRUE;
  899. X         cur_colr = UNKNOWN;
  900. X         D_color(color);
  901. X         out( "EP" );
  902. X         break;
  903. X    case 'S':                                        /* Draw symbol for the sun */
  904. X         fprintf(outf, "PW.35CI%d,%dPW.13", rad, curve_val/2); 
  905. X         fprintf(outf, "PM0CI%d,%dPM2FP", (int) (s*0.4), curve_val ); 
  906. X         lost = TRUE;
  907. X         break;
  908. X    case 'L':                                        /* Draw symbol for the moon */
  909. X         phase = 0.0;
  910. X         chi = 90.0;
  911. X         n = sscanf(comment_str, "%lf %lf", &phase, &chi);
  912. X         if (cur_win->invert) chi = 180 - chi;
  913. X         set_line_type( VECDOT );
  914. X         fprintf(outf, "CI%d,%d", rad, curve_val/2);
  915. X         xm = rad;  
  916. X         ym = 0;
  917. X         rotate( &xm, &ym, chi ); 
  918. X         xp = 0;    
  919. X         yp = -(int) (cos(phase*0.0174532925199) * (double) rad); 
  920. X         rotate( &xp, &yp, chi ); 
  921. X         fprintf( outf, "PU%d,%dPM0PDRT%d,%d,%d,%d,%d", -xm, -ym, ym+xm, -xm+ym,
  922. X                                                          2*xm, 2*ym, curve_val/2 ); 
  923. X         fprintf( outf, "RT%d,%d,%d,%d,%dPM2PUFP", xp-xm, yp-ym, -2*xm, -2*ym, curve_val/2  ); 
  924. X         set_line_type( SOLID ); 
  925. X         lost = TRUE;
  926. X         break;
  927. X    case 'M':                                        /* Draw symbol for Mercury */ 
  928. X         fprintf(outf, "CI%d,%d", rad, curve_val/2); 
  929. X         fprintf(outf, "PR%d,%dPDAR%d,0,180,10", (int) (-s*0.4), (int) s, (int) (s*0.4) );
  930. X         fprintf(outf, "PU%d,%dPDAR%d,0,360,10", (int) (s*0.1), (int) (-s*0.9), (int) (-s*0.5) );
  931. X         fprintf(outf, "PU%d,%dPD0,%d", (int) (-s*0.5), (int) (-s*0.5), (int) (-s*0.6) );
  932. X         fprintf(outf, "PU%d,%dPD%d,0PU", (int) (-s*0.3), (int) (s*0.3), (int) (s*0.6) );
  933. X         lost = TRUE;
  934. X         break;
  935. X    case 'V':                                        /* Draw symbol for Venus */
  936. X         fprintf(outf, "CI%d,%d", rad, curve_val/2);
  937. X         fprintf(outf, "PR%d,%dPDAR%d,0,360,10", (int) (s*0.5), (int) (s*0.4), (int) (-s*0.5) );
  938. X         fprintf(outf, "PU%d,%dPD0,%d", (int) (-s*0.5), (int) (-s*0.3), (int) -s );
  939. X         fprintf(outf, "PU%d,%dPD%d,0PU", (int) (-s*0.4), (int) (s*0.35), (int) (s*0.8) );
  940. X         lost = TRUE;
  941. X         break;
  942. X    case 'm':                                        /* Draw symbol for Mars */
  943. X         fprintf(outf, "CI%d,%d", rad, curve_val/2);
  944. X         fprintf(outf, "PR%d,%dPDAR%d,%d,360,10", (int) (s*0.224), (int) (s*0.224), 
  945. X                                                           (int) (-s*0.424), (int) (-s*0.424) );
  946. X         fprintf(outf, "PD%d,%dPU0,%d", (int) (s*0.476), (int) (s*0.476), (int) (-s*0.5) );
  947. X         fprintf(outf, "PD0,%d,%d,0PU", (int) (s*0.5), (int) (-s*0.5) );
  948. X         lost = TRUE;
  949. X         break;
  950. X    case 'J':                                        /* Draw symbol for Jupiter */
  951. X         fprintf(outf, "CI%d,%d", rad, curve_val/2); 
  952. X         fprintf(outf, "PR%d,%dPD0,%dPU%d,%dPD%d,0", (int) (s*0.5), (int) (-s*0.9),
  953. X                                 (int) (s*1.8), (int) (s*0.4), (int) (-s*1.4), (int) (-s*1.6) );
  954. X         fprintf(outf, "AR0,%d,90,5", (int) (s*0.9));
  955. X         fprintf(outf, "AR%d,0,200,10PU", (int) (-s*0.3));
  956. X         lost = TRUE;
  957. X         break;
  958. X    case 's':                                        /* Draw symbol for Saturn */
  959. X         fprintf(outf, "CI%d,%d", rad, curve_val/2); 
  960. X         fprintf(outf, "PR%d,%dPD0,%dPU%d,0PD%d,0PU%d,%d", (int) (-s*0.5), (int) (-s*0.7),
  961. X                       (int) (s*1.7), (int) (-s*0.3), (int) (s*0.6), (int) (-s*0.3), (int) -s );
  962. X         fprintf(outf, "PDRT%d,%d,%d,%d,10", (int) (s*0.209), (int) (s*.219), 
  963. X                                                                 (int) (s*0.5), (int) (s*0.3) );
  964. X         fprintf(outf, "AR0,%d,-90,10PD%d,%d", (int) (-s*0.4), (int) (-s*0.1), (int) (-s*0.5) );
  965. X         fprintf(outf, "RT%d,%d,%d,%d,10PU", (int) (s*0.1), (int) (-s*0.24), 
  966. X                                                                (int) (s*0.4), (int) (-s*0.2) );
  967. X         lost = TRUE;
  968. X         break;
  969. X    case 'U':                                        /* Draw symbol for Uranus */
  970. X         fprintf(outf, "CI%d,%d", rad, curve_val/2);
  971. X         fprintf(outf, "PR%d,%dPD0,%dPU%d,%d,PD0,%d", (int) -s, (int) s, 
  972. X                                          (int) (-s*2),(int) (s*2), (int) (s*2), (int) (-s*2) );
  973. X         fprintf(outf, "PU%d,%dPD%d,0", (int) (-s*2), (int) s, (int) (s*2) );
  974. X         fprintf(outf, "PU%d,%dPD0,%d", (int) -s, (int) s, (int) (-s*2) );
  975. X         fprintf(outf, "AR0,%d,360,10PU", (int) (-s*0.3) );
  976. X         lost = TRUE;
  977. X         break;
  978. X    case 'N':                                        /* Draw symbol for Neptune */
  979. X         fprintf(outf, "CI%d,%d", rad, curve_val/2);
  980. X         fprintf(outf, "PR0,%dPD0,%dPU%d,0", (int) (-s*0.9), (int) (s*1.7), (int) (-s*0.8) );
  981. X         fprintf(outf, "PD%d,%d,0,%d,%d,0,0,%d,%d,%d", (int) (s*0.1), (int) (-s*0.3), 
  982. X                   (int) (-s*0.5), (int) (s*1.4), (int) (s*0.5), (int) (s*0.1), (int) (s*0.3) );
  983. X         fprintf(outf, "PU%d,%dPD%d,0PU", (int) (-s*1.3), (int) (-s*1.3), (int) s );
  984. X         lost = TRUE;
  985. X         break;
  986. X    case 'P':                                        /* Draw symbol for Pluto */
  987. X         fprintf(outf, "CI%d,%d", rad, curve_val/2);
  988. X         fprintf(outf, "PR%d,%dPD0,%d,%d,0", (int) -s, (int) s, (int) (-s*2), (int) (s*1.5) );
  989. X         fprintf(outf, "PU%d,%dPD%d,0PU%d,%dPD%d,0", (int) (-s*1.5), (int) (s*2),
  990. X                                                         (int) s, (int) -s, (int) -s, (int) s );
  991. X         fprintf(outf, "AR0,%d,180,10PU", (int) (s*0.5) );
  992. X         lost = TRUE;
  993. X         break;
  994. X    default:                                         /* Draw symbol for other */
  995. X         fprintf(outf, "CI%d,%d", (int) (rad*0.8), curve_val/2);
  996. X         fprintf(outf, "PR%d,0PD%d,0,%d,0", (int) (-s*2), (int) (s*4), (int) (-s*2) );
  997. X         fprintf(outf, "PD0,%d,0,%dPU", (int) (-s*2), (int) (s*4) );
  998. X         lost = TRUE;
  999. X         break;
  1000. X    }
  1001. X}
  1002. X
  1003. XdrawGalx(x, y, mag, type, color, nebsize)
  1004. X     int x, y;
  1005. X     double mag;
  1006. X     char type, *color;
  1007. X     long nebsize;        /* -1 should give default size */
  1008. X{
  1009. X  int rad, s;
  1010. X
  1011. X  rad = (int) (nebsize/(3600.*xf_c_scale)+.5)/2;
  1012. X  if (rad < 6*ResPT) /* size of object in device coords */
  1013. X    rad = 6*ResPT;
  1014. X  if( A_SIZE <= plot_size && plot_size <= E_SIZE )
  1015. X    rad = (int) ((double) rad * scaling_factor);
  1016. X  s = rad/2;
  1017. X
  1018. X  D_move( x, y );
  1019. X
  1020. X  switch(type)
  1021. X     {
  1022. X     case 'a':
  1023. X     case 'b':
  1024. X     case 'c':
  1025. X     case 'd':
  1026. X     case 'B':
  1027. X     case 'S':             /* Draw Spiral Galaxy */
  1028. X     case 'O':    
  1029. X          fprintf( outf, "SP0PW0.35PR%d,%dPDPM0", (int) (-s*0.9), (int) (s*0.5));
  1030. X          fprintf( outf, "RT%d,%d,%d,%d,%d", (int) (s*0.1), 
  1031. X                       (int) (s*0.3), (int) (s*0.4), (int) (s*0.4), curve_val );
  1032. X          fprintf( outf, "RT%d,%d,%d,%d,%d", (int) (s*0.9), 
  1033. X                     (int) (-s*0.5), (int) (s*1.4), (int) (-s*1.4), curve_val );
  1034. X          fprintf( outf, "RT%d,%d,%d,%d,%d", (int) (-s*0.1), 
  1035. X                    (int) (-s*0.3), (int) (-s*0.4), (int) (-s*0.4), curve_val );
  1036. X          fprintf( outf, "RT%d,%d,%d,%d,%d", (int) (-s*0.9), (int) (s*0.5), 
  1037. X                                     (int) (-s*1.4), (int) (s*1.4), curve_val );
  1038. X          out( "PM2EP" );
  1039. X          fprintf( outf, "PU%d,%d", (int) (s*0.9), (int) (-s*0.5));
  1040. X          fprintf( outf, "PU%d,%dPD%d,%dPU%d,%d", (int) (-s*0.8), (int) (s*0.8),
  1041. X                 (int) (-s*0.5), (int) (-s*0.4), (int) (s*2.1), (int) (-s*1.2) );
  1042. X          fprintf( outf, "PD%d,%dPU%d,%d", (int) (s*0.5), (int) (s*0.4),
  1043. X                                               (int) (-s*1.3), (int) (s*0.4) );
  1044. X          cur_colr = BLACK;
  1045. X          D_color( color );
  1046. X          out( "PW0.13FP" );
  1047. X          fprintf( outf, "PU%d,%dPD%d,%dPU%d,%d", (int) (-s*0.8), (int) (s*0.8),
  1048. X                 (int) (-s*0.5), (int) (-s*0.4), (int) (s*2.1), (int) (-s*1.2) );
  1049. X          fprintf( outf, "PD%d,%dPU%d,%d", (int) (s*0.5), (int) (s*0.4),
  1050. X                                               (int) (-s*1.3), (int) (s*0.4) );
  1051. X          break;
  1052. X     case 'Q':            /* Draw Quasar */
  1053. X
  1054. X          fprintf( outf, "SP0PW0.35PR%d,%dPDPM0", (int) (-s*0.9), (int) (s*0.5));
  1055. X          fprintf( outf, "RT%d,%d,%d,%d,%d", (int) (s*0.1), 
  1056. X                       (int) (s*0.3), (int) (s*0.4), (int) (s*0.4), curve_val );
  1057. X          fprintf( outf, "RT%d,%d,%d,%d,%d", (int) (s*0.9), 
  1058. X                     (int) (-s*0.5), (int) (s*1.4), (int) (-s*1.4), curve_val );
  1059. X          fprintf( outf, "RT%d,%d,%d,%d,%d", (int) (-s*0.1), 
  1060. X                    (int) (-s*0.3), (int) (-s*0.4), (int) (-s*0.4), curve_val );
  1061. X          fprintf( outf, "RT%d,%d,%d,%d,%d", (int) (-s*0.9), (int) (s*0.5), 
  1062. X                                     (int) (-s*1.4), (int) (s*1.4), curve_val );
  1063. X          out( "PM2EP" );
  1064. X          fprintf( outf, "PU%d,%d", (int) (s*0.9), (int) (-s*0.5));
  1065. X          fprintf( outf, "PD%d,0,%d,0,%d,0", (int) (-s*1.2), (int) (s*2.4), (int) (-s*1.2) );
  1066. X          fprintf( outf, "PD0,%d,0,%d,0,%dPW0.13", (int) (-s*1.2), (int) (s*2.4), (int) (-s*1.2) );
  1067. X          cur_colr = BLACK;
  1068. X          D_color( color );
  1069. X          fprintf( outf, "FPPD%d,0,%d,0,%d,0", (int) (-s*1.2), (int) (s*2.4), (int) (-s*1.2) );
  1070. X          fprintf( outf, "PD0,%d,0,%d,0,%d", (int) (-s*1.2), (int) (s*2.4), (int) (-s*1.2) );
  1071. X          break;
  1072. X     case 'E':
  1073. X     case 'I':            /* Draw Elliptical Galaxy */
  1074. X     case 'G':
  1075. X     default:
  1076. X          fprintf( outf, "SP0PW0.35PR%d,%dPDPM0", (int) (-s*0.9), (int) (s*0.5));
  1077. X          fprintf( outf, "RT%d,%d,%d,%d,%d", (int) (s*0.1), 
  1078. X                       (int) (s*0.3), (int) (s*0.4), (int) (s*0.4), curve_val );
  1079. X          fprintf( outf, "RT%d,%d,%d,%d,%d", (int) (s*0.9), 
  1080. X                     (int) (-s*0.5), (int) (s*1.4), (int) (-s*1.4), curve_val );
  1081. X          fprintf( outf, "RT%d,%d,%d,%d,%d", (int) (-s*0.1), 
  1082. X                    (int) (-s*0.3), (int) (-s*0.4), (int) (-s*0.4), curve_val );
  1083. X          fprintf( outf, "RT%d,%d,%d,%d,%d", (int) (-s*0.9), (int) (s*0.5), 
  1084. X                                     (int) (-s*1.4), (int) (s*1.4), curve_val );
  1085. X          out( "PM2EPPW0.13" );
  1086. X          cur_colr = BLACK;
  1087. X          D_color( color );
  1088. X          out( "FP" );
  1089. X          break;
  1090. X     }
  1091. X
  1092. X  out( "PU" );
  1093. X  pen_up = UNKNOWN;
  1094. X  lost = TRUE;
  1095. X}
  1096. X
  1097. X
  1098. XdrawClus(x, y, mag, type, color, nebsize)
  1099. X     int x, y;
  1100. X     double mag;
  1101. X     char type, *color;
  1102. X     long nebsize;        /* -1 should give default size */
  1103. X{
  1104. X  int rad, s;
  1105. X
  1106. X  rad = (int) (nebsize/(3600.*xf_c_scale)+.5)/2;
  1107. X  if (rad < 6*ResPT) /* size of object in device coords */
  1108. X    rad = 6*ResPT;
  1109. X  if( A_SIZE <= plot_size && plot_size <= E_SIZE )
  1110. X    rad = (int) ((double) rad * scaling_factor);
  1111. X  s = rad/2;
  1112. X
  1113. X  D_move( x, y );
  1114. X
  1115. X  switch(type)
  1116. X    {
  1117. X    case 'G': 
  1118. X         fprintf( outf, "SP0PW0.35PM0CI%d,%dPM2FPEPPW0.13", s, curve_val/2 );
  1119. X         cur_colr = BLACK;
  1120. X         D_color( color );
  1121. X         out( "LT1,1.08,1EP" );    
  1122. X         cur_sty = UNKNOWN;
  1123. X         set_line_type( SOLID );
  1124. X         fprintf( outf, "PM0CI%d,%dPM2FPPU", s/4, curve_val );
  1125. X         break;
  1126. X    case 'O': 
  1127. X    default:
  1128. X         fprintf( outf, "SP0PW0.35PM0CI%d,%dPM2FPEPPW0.13", s, curve_val/2 );
  1129. X         cur_colr = BLACK;
  1130. X         D_color( color );
  1131. X         out( "LT1,1.08,1EP" );    
  1132. X         cur_sty = UNKNOWN;
  1133. X         set_line_type( SOLID );
  1134. X         out( "PU" );
  1135. X    }
  1136. X  pen_up = UNKNOWN;
  1137. X  lost = TRUE;
  1138. X}
  1139. X
  1140. XdrawNebu(x, y, mag, type, color, nebsize)
  1141. X     int x, y;
  1142. X     double mag;
  1143. X     char type, *color;
  1144. X     long nebsize;        /* -1 should give default size */
  1145. X{
  1146. X  int rad, s;
  1147. X
  1148. X  rad = (int) (nebsize/(3600.*xf_c_scale)+.5)/2;
  1149. X  if (rad < 6*ResPT) /* size of object in device coords */
  1150. X    rad = 6*ResPT;
  1151. X  if( A_SIZE <= plot_size && plot_size <= E_SIZE )
  1152. X    rad = (int) ((double) rad * scaling_factor);
  1153. X  s = rad/2;
  1154. X
  1155. X  D_move( x, y );
  1156. X
  1157. X  switch(type)
  1158. X    {
  1159. X    case 'P':
  1160. X         fprintf( outf, "SP0PW0.35PRPD%d,0,%d,0,%d,0,0,%d,0,%d,0,%d", -s, s*2, -s, -s, s*2, -s );
  1161. X         fprintf( outf, "PM0CI%d,%dPM2EP", s/2, curve_val );
  1162. X         cur_colr = UNKNOWN;
  1163. X         D_color( color );
  1164. X         fprintf( outf, "PW0.13PD%d,0,%d,0,%d,0,0,%d,0,%d,0,%d", -s, s*2, -s, -s, s*2, -s );
  1165. X         out( "SP0FP" );
  1166. X         cur_colr = BLACK;
  1167. X         D_color( color );
  1168. X         out( "EPPU" );
  1169. X         break;
  1170. X    case 'D': 
  1171. X    default:
  1172. X         fprintf( outf, "SP0PW0.35PR0,%d", s );
  1173. X         fprintf( outf, "PM0PD%d,%d,%d,%d,%d,%d,%d,%d", -s, -s, s, -s, s, s, -s, s );
  1174. X         out( "PM2FPEPPW0.13" );
  1175. X         fprintf( outf, "PU0,%d", -s );
  1176. X         cur_colr = BLACK;
  1177. X         D_color( color );
  1178. X         fprintf( outf, "EPPU0,%d", -s );
  1179. X         out( "PU" );
  1180. X    }
  1181. X  lost = TRUE;
  1182. X  pen_up = UNKNOWN;
  1183. X}
  1184. X
  1185. XdrawUnknown(x, y, mag, type, color, nebsize)
  1186. Xint x, y;
  1187. Xdouble mag;
  1188. Xchar type, *color;
  1189. Xlong nebsize;        /* -1 should give default size */
  1190. X     {
  1191. X     int rad, s;
  1192. X
  1193. X     rad = (int) (nebsize/(3600.*xf_c_scale)+.5)/2;
  1194. X     if (rad < 6*ResPT) /* size of object in device coords */
  1195. X          rad = 6*ResPT;
  1196. X     if( A_SIZE <= plot_size && plot_size <= E_SIZE )
  1197. X          rad = (int) ((double) rad * scaling_factor);
  1198. X     s = rad/2;
  1199. X
  1200. X     D_move( x, y );
  1201. X
  1202. X     fprintf( outf, "SP0PW0.35PDRT%d,%d,%d,%d,%d", s/2, s/2, -s/2, s/2, curve_val );
  1203. X     fprintf( outf, "PU%d, %dPD0,%dPU0,%d", s/2, -s/2, -s, s );
  1204. X     cur_colr = BLACK;
  1205. X     D_color( color );
  1206. X     fprintf( outf, "PW0.13PDRT%d,%d,%d,%d,%d", s/2, s/2, -s/2, s/2, curve_val );
  1207. X     fprintf( outf, "PU%d, %dPD0,%dPU0,%d", s/2, -s/2, -s, s );
  1208. X     }
  1209. X
  1210. XdrawOther(x, y, mag, type, color, nebsize)
  1211. Xint x, y;
  1212. Xdouble mag;
  1213. Xchar type, *color;
  1214. Xlong nebsize;        /* -1 should give default size */
  1215. X     {
  1216. X     int rad, s;
  1217. X
  1218. X     rad = (int) (nebsize/(3600.*xf_c_scale)+.5)/2;
  1219. X     if (rad < 6*ResPT) /* size of object in device coords */
  1220. X          rad = 6*ResPT;
  1221. X     if( A_SIZE <= plot_size && plot_size <= E_SIZE )
  1222. X          rad = (int) ((double) rad * scaling_factor);
  1223. X     s = rad/2;
  1224. X
  1225. X     D_move( x, y );
  1226. X
  1227. X     fprintf( outf, "SP0PW0.35PR0,%d", s );
  1228. X     fprintf( outf, "PM0PD%d,%d,%d,%d,%d,%d,%d,%d", -s, -s, s, -s, s, s, -s, s );
  1229. X     out( "PM2FPEP" );
  1230. X     fprintf( outf, "PU0,%d", -s );
  1231. X     fprintf(outf, "PD%d,%dPD%d,%dPU0,%dPD%d,%d,%d,%d", s, s, -s*2, -s*2, s*2, s*2, -s*2, -s, s );
  1232. X     cur_colr = BLACK;
  1233. X     D_color( color );
  1234. X     out( "PW0.13EP" );
  1235. X     fprintf(outf, "PD%d,%dPD%d,%dPU0,%dPD%d,%d,%d,%d", s, s, -s*2, -s*2, s*2, s*2, -s*2, -s, s );
  1236. X     out( "PU" );
  1237. X     lost = TRUE;
  1238. X     }
  1239. X
  1240. X
  1241. X/* Want three legend columns, in 10 rows, with a title and subtitle above:
  1242. Xtitle
  1243. Xsubtitle (ra, dec, lim)
  1244. X
  1245. X    -1                0                1
  1246. X     2                3                4
  1247. X     5                6                7
  1248. X     8                9               10
  1249. X     double           variable
  1250. X     planet           asteroid        comet
  1251. X     cluster          globular        open
  1252. X     nebula           planetary       diffuse
  1253. X     galaxy           elliptical      spiral
  1254. X     unknown          other           quasar
  1255. X
  1256. Xstar columns x coordinates are at star_x_col[];
  1257. Xstar row y coordinates are star_y_row[];
  1258. Xother at oth_x_col[] and oth_y_row[];
  1259. X
  1260. Xtitle and subtitle coordinates are defined by L_TIL_{X,Y} and L_STIL_{X,Y}
  1261. XLabels are placed as in drawobj().
  1262. X
  1263. Xfor fullpage map, only the title and subtitle are displayed, on one line. */
  1264. X
  1265. Xstatic int star_x_col[] = {
  1266. X  36*ResPT,
  1267. X  108*ResPT,
  1268. X  180*ResPT,
  1269. X  36*ResPT,
  1270. X  108*ResPT,
  1271. X  180*ResPT,
  1272. X  36*ResPT,
  1273. X  108*ResPT,
  1274. X  180*ResPT,
  1275. X  36*ResPT,
  1276. X  108*ResPT,
  1277. X  180*ResPT,
  1278. X  36*ResPT,
  1279. X  108*ResPT,
  1280. X  180*ResPT};
  1281. X
  1282. Xstatic int oth_x_col[] = {
  1283. X  36*ResPT,
  1284. X  108*ResPT,
  1285. X  180*ResPT,
  1286. X  36*ResPT,
  1287. X  108*ResPT,
  1288. X  180*ResPT,
  1289. X  36*ResPT,
  1290. X  108*ResPT,
  1291. X  180*ResPT,
  1292. X  36*ResPT,
  1293. X  108*ResPT,
  1294. X  180*ResPT,
  1295. X  36*ResPT,
  1296. X  108*ResPT,
  1297. X  180*ResPT};
  1298. X
  1299. X
  1300. X#define L_TIL_X   ((int) (0.5*InchPT))
  1301. X#define L_TIL_Y   ((int) (2.25*InchPT))
  1302. X#define L_STIL_X  ((int) (0.5*InchPT))
  1303. X#define L_STIL_Y  (L_TIL_Y - (int) (0.25*InchPT))
  1304. X
  1305. Xstatic int star_y_row[] = {
  1306. X  126*ResPT,
  1307. X  126*ResPT,
  1308. X  126*ResPT,
  1309. X  114*ResPT,
  1310. X  114*ResPT,
  1311. X  114*ResPT,
  1312. X  102*ResPT,
  1313. X  102*ResPT,
  1314. X  102*ResPT,
  1315. X  90*ResPT,
  1316. X  90*ResPT,
  1317. X  90*ResPT,
  1318. X  78*ResPT,
  1319. X  78*ResPT,
  1320. X  78*ResPT
  1321. X};
  1322. X
  1323. Xstatic int oth_y_row[] = {
  1324. X  66*ResPT,
  1325. X  66*ResPT,
  1326. X  66*ResPT,
  1327. X  54*ResPT,
  1328. X  54*ResPT,
  1329. X  54*ResPT,
  1330. X  42*ResPT,
  1331. X  42*ResPT,
  1332. X  42*ResPT,
  1333. X  30*ResPT,
  1334. X  30*ResPT,
  1335. X  30*ResPT,
  1336. X  18*ResPT,
  1337. X  18*ResPT,
  1338. X  18*ResPT};
  1339. X
  1340. Xstatic int starmags[12];
  1341. Xstatic int magbright, magfaint;
  1342. X#define L_X_FULLPAGE_CAPT 18*ResPT
  1343. X#define L_Y_FULLPAGE_CAPT 12*ResPT
  1344. X
  1345. X
  1346. Xchartlegend(win)
  1347. Xmapwindow *win;
  1348. X     {
  1349. X     char ras[20], dls[20], outstr[40], magstr[20];
  1350. X     int i, nummags;
  1351. X     legend_window.width = win->width;        /* Remember these for notebook mode */
  1352. X     legend_window.height = win->height;
  1353. X     legend_window.x_offset = win->x_offset;
  1354. X     legend_window.y_offset = win->y_offset;
  1355. X     legend_window.c_scale = win->c_scale;
  1356. X
  1357. X     if (!title[0]) title = "LEGEND";
  1358. X     rastr(ras, win->racen);
  1359. X     declstr(dls, win->dlcen);
  1360. X
  1361. X     if (win->map_type != FULLPAGEMAP) {
  1362. X          sprintf(outstr, "(%s,%s lim: %2.1f)", ras, dls, win->maglim);
  1363. X          D_fontsize(TITLESIZE, TITLEFNT); D_text(L_TIL_X, L_TIL_Y, title, FALSE);
  1364. X          D_fontsize(SUBTLSIZE, SUBTLFNT); D_text(L_STIL_X, L_STIL_Y, outstr, FALSE);
  1365. X
  1366. X          D_fontsize(10, NAMEFNT);
  1367. X     
  1368. X     /* set magnitudes in legend */
  1369. X
  1370. X          if (brightest_used > faintest_used) {
  1371. X               brightest_used = 0.0;
  1372. X               faintest_used = 10.0;
  1373. X               }
  1374. X
  1375. X          magbright = brightest_used - 0.5;
  1376. X          magfaint = faintest_used + 0.5;
  1377. X          if (magfaint > MAG_DIM) magfaint = MAG_DIM;
  1378. X          if (magbright < MAG_BRIGHT) magbright = MAG_BRIGHT;
  1379. X          if (magbright < (magfaint - 11)) magbright = (magfaint - 11);
  1380. X          nummags = magfaint - magbright + 1;
  1381. X          for (i = magbright; i <= magfaint; i++) {
  1382. X               starmags[i-magbright] = i;
  1383. X               }
  1384. X
  1385. X          for (i = 0; i < nummags; i++) {
  1386. X               drawStar(star_x_col[i], star_y_row[i], (double) starmags[i], 'S', "  ");
  1387. X               sprintf(magstr, " %d", starmags[i]);
  1388. X               D_text(star_x_col[i]+x_nameoffset, star_y_row[i]+y_nameoffset, magstr, FALSE);
  1389. X               }
  1390. X          drawStar(star_x_col[13], star_y_row[13], ((magbright+magfaint)/2.0), 'D', "  ");
  1391. X          D_text(star_x_col[13]+x_nameoffset, star_y_row[13]+y_nameoffset, "double", FALSE);
  1392. X
  1393. X          drawStar(star_x_col[14], star_y_row[14], ((magbright+magfaint)/2.0), 'V', "  ");
  1394. X          D_text(star_x_col[14]+x_nameoffset, star_y_row[14]+y_nameoffset, "variable", FALSE);
  1395. X
  1396. X          i = 0;
  1397. X          drawPlan(oth_x_col[i], oth_y_row[i], 1.0, 'u', "  ", (long) -1, "");
  1398. X          D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset, "Planet", FALSE);
  1399. X          i++;
  1400. X
  1401. X          drawPlan(oth_x_col[i], oth_y_row[i], 1.0, 'A', "  ", (long) -1, "");
  1402. X          D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset, "Asteroid", FALSE);
  1403. X          i++;
  1404. X
  1405. X          drawPlan(oth_x_col[i], oth_y_row[i], 1.0, 'C', "  ", (long) -1, "");
  1406. X          D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset, "Comet", FALSE);
  1407. X          i++;
  1408. X
  1409. X          drawClus(oth_x_col[i], oth_y_row[i], 1.0, 'u', "  ", (long) -1);
  1410. X          D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset, "Cluster", FALSE);
  1411. X          i++;
  1412. X
  1413. X          drawClus(oth_x_col[i], oth_y_row[i], 1.0, 'G', "  ", (long) -1);
  1414. X          D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset, "Globular", FALSE);
  1415. X          i++;
  1416. X
  1417. X          drawClus(oth_x_col[i], oth_y_row[i], 1.0, 'O', "  ", (long) -1);
  1418. X          D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset, "Open", FALSE);
  1419. X          i++;
  1420. X
  1421. X          drawNebu(oth_x_col[i], oth_y_row[i], 1.0, 'u', "  ", (long) -1);
  1422. X          D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset, "Nebula", FALSE);
  1423. X          i++;
  1424. X
  1425. X          drawNebu(oth_x_col[i], oth_y_row[i], 1.0, 'P', "  ", (long) -1);
  1426. X          D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset, "Planetary", FALSE);
  1427. X          i++;
  1428. X
  1429. X          drawNebu(oth_x_col[i], oth_y_row[i], 1.0, 'D', "  ", (long) -1);
  1430. X          D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset, "Diffuse", FALSE);
  1431. X          i++;
  1432. X
  1433. X          drawGalx(oth_x_col[i], oth_y_row[i], 1.0, 'u', "  ", (long) -1);
  1434. X          D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset, "Galaxy", FALSE);
  1435. X          i++;
  1436. X
  1437. X          drawGalx(oth_x_col[i], oth_y_row[i], 1.0, 'E', "  ", (long) -1);
  1438. X          D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset, "Elliptical", FALSE);
  1439. X          i++;
  1440. X
  1441. X          drawGalx(oth_x_col[i], oth_y_row[i], 1.0, 'S', "  ", (long) -1);
  1442. X          D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset, "Spiral", FALSE);
  1443. X          i++;
  1444. X
  1445. X          drawUnknown(oth_x_col[i], oth_y_row[i], 1.0, 'u', "  ", (long) -1);
  1446. X          D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset, "Unknown", FALSE);
  1447. X          i++;
  1448. X
  1449. X          drawOther(oth_x_col[i], oth_y_row[i], 1.0, 'o', "  ", (long) -1);
  1450. X          D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset, "Other", FALSE);
  1451. X          i++;
  1452. X
  1453. X          drawGalx(oth_x_col[i], oth_y_row[i], 1.0, 'Q', "  ", (long) -1);
  1454. X          D_text(oth_x_col[i]+x_nameoffset, oth_y_row[i]+y_nameoffset, "Quasar", FALSE);
  1455. X          i++;
  1456. X          }
  1457. X     }
  1458. X                             /* Notebook mode */
  1459. X#define NOTE_LEFT_COL ((int) (4.5*InchPT))
  1460. X#define NOTE_RIGHT_COL ((int) (7.0*InchPT))
  1461. X#define NOTE_TOP_ROW ((int) (2.00*InchPT))
  1462. X#define NOTE_ROW_SPACE ((int) (0.219*InchPT))
  1463. Xint add_notes()
  1464. X     {
  1465. X     int j, xcen, ycen, i = 0; 
  1466. X
  1467. X                      /* Erase Thumbnail Map */
  1468. X     D_move( (int) (3.375*InchPT), 0 );
  1469. X     fprintf( outf, "SP0RA%d,%d;", (int) (9*InchPT), (int) (2.5*InchPT) );
  1470. X     lost = TRUE;
  1471. X     cur_colr = UNKNOWN;
  1472. X     D_color( "BLACK" );
  1473. X
  1474. X                      /* Draw viewing circles */
  1475. X     xcen = legend_window.width/2 + legend_window.x_offset;
  1476. X     ycen = legend_window.height/2 + legend_window.y_offset;
  1477. X     D_move( xcen, ycen );
  1478. X     for (j = 0; j< numviews; j++) 
  1479. X          fprintf(outf, "CI%d,%d", (int) (viewrad[j]/legend_window.c_scale), (int) (curve_val/4));
  1480. X
  1481. X     out( "LO7" );     /* Right-justify text */
  1482. X     lost = TRUE;
  1483. X     D_fontsize( 12, HELV );
  1484. X     D_text( NOTE_LEFT_COL, NOTE_TOP_ROW, "Date:", FALSE );
  1485. X     D_text( NOTE_RIGHT_COL, NOTE_TOP_ROW, "Time:", FALSE );
  1486. X     i++;
  1487. X     D_text( NOTE_LEFT_COL, NOTE_TOP_ROW-i*NOTE_ROW_SPACE, "Object Altitude:", FALSE );
  1488. X     D_text( NOTE_RIGHT_COL, NOTE_TOP_ROW-i*NOTE_ROW_SPACE, "", FALSE );
  1489. X     i++;
  1490. X     D_text( NOTE_LEFT_COL, NOTE_TOP_ROW-i*NOTE_ROW_SPACE, "Instrument:", FALSE );
  1491. X     D_text( NOTE_RIGHT_COL, NOTE_TOP_ROW-i*NOTE_ROW_SPACE, "", FALSE );
  1492. X     i++;
  1493. X     D_text( NOTE_LEFT_COL, NOTE_TOP_ROW-i*NOTE_ROW_SPACE, "Eyepiece:", FALSE );
  1494. X     D_text( NOTE_RIGHT_COL, NOTE_TOP_ROW-i*NOTE_ROW_SPACE, "Filter:", FALSE );
  1495. X     i++;
  1496. X     D_text( NOTE_LEFT_COL, NOTE_TOP_ROW-i*NOTE_ROW_SPACE, "Site:", FALSE );
  1497. X     D_text( NOTE_RIGHT_COL, NOTE_TOP_ROW-i*NOTE_ROW_SPACE, "", FALSE );
  1498. X     i++;
  1499. X     D_text( NOTE_LEFT_COL, NOTE_TOP_ROW-i*NOTE_ROW_SPACE, "Seeing:", FALSE );
  1500. X     D_text( NOTE_RIGHT_COL, NOTE_TOP_ROW-i*NOTE_ROW_SPACE, "Transparency:", FALSE );
  1501. X     i++;
  1502. X     D_text( NOTE_LEFT_COL, NOTE_TOP_ROW-i*NOTE_ROW_SPACE, "Darkness:", FALSE );
  1503. X     D_text( NOTE_RIGHT_COL, NOTE_TOP_ROW-i*NOTE_ROW_SPACE, "Magnitude Limit:", FALSE );
  1504. X     i++;
  1505. X     D_text( NOTE_LEFT_COL, NOTE_TOP_ROW-i*NOTE_ROW_SPACE, "Wind:", FALSE );
  1506. X     D_text( NOTE_RIGHT_COL, NOTE_TOP_ROW-i*NOTE_ROW_SPACE, "", FALSE );
  1507. X     i++;
  1508. X     D_text( NOTE_LEFT_COL, NOTE_TOP_ROW-i*NOTE_ROW_SPACE, "Temperature:", FALSE );
  1509. X     D_text( NOTE_RIGHT_COL, NOTE_TOP_ROW-i*NOTE_ROW_SPACE, "Dew:", FALSE );
  1510. X     }
  1511. X
  1512. END_OF_FILE
  1513.   if test 36790 -ne `wc -c <'starhp.c.B'`; then
  1514.     echo shar: \"'starhp.c.B'\" unpacked with wrong size!
  1515.   elif test -f 'starhp.c.A'; then
  1516.     echo shar: Combining  \"'starhp.c'\" \(67818 characters\)
  1517.     cat 'starhp.c.A' 'starhp.c.B' > 'starhp.c'
  1518.     if test 67818 -ne `wc -c <'starhp.c'`; then
  1519.       echo shar: \"'starhp.c'\" combined with wrong size!
  1520.     else
  1521.       rm starhp.c.A starhp.c.B
  1522.     fi
  1523.   fi
  1524.   # end of 'starhp.c.B'
  1525. fi
  1526. echo shar: End of archive 1 \(of 2\).
  1527. cp /dev/null ark1isdone
  1528. MISSING=""
  1529. for I in 1 2 ; do
  1530.     if test ! -f ark${I}isdone ; then
  1531.     MISSING="${MISSING} ${I}"
  1532.     fi
  1533. done
  1534. if test "${MISSING}" = "" ; then
  1535.     echo You have unpacked both archives.
  1536.     rm -f ark[1-9]isdone
  1537. else
  1538.     echo You still must unpack the following archives:
  1539.     echo "        " ${MISSING}
  1540. fi
  1541. exit 0
  1542. exit 0 # Just in case...
  1543.